Revamped the fortran demos, adding in tests of the output

This commit is contained in:
Harry Moffat 2009-03-17 01:02:07 +00:00
parent 389e96035f
commit 2c3c88d3cc
6 changed files with 432 additions and 1 deletions

View file

@ -1,2 +1,11 @@
isentropic.dsp
f77demos.mak
Makefile
ct2ctml.log
ctlib
diff_out_0.txt
diff_out_1.txt
gri30.xml
isentropic
output_0.txt
output_1.txt

View file

@ -0,0 +1,107 @@
#!/bin/sh
# the object files to be linked together.
OBJS = demo_ftnlib.o isentropic.o ctlib.o
# additional flags to be passed to the linker. If your program
# requires other external libraries, put them here
LINK_OPTIONS =
# the Fortran compiler
FORT = @F77@
# Fortran compile flags
FORT_FLAGS = @FFLAGS@
# Fortran libraries
FORT_LIBS = @FLIBS@
# the C++ compiler
CXX = @CXX@
# C++ compile flags
CXX_FLAGS = @CXXFLAGS@
# external libraries
EXT_LIBS = @LOCAL_LIBS@ -lctcxx
# the directory where the Cantera libraries are located
CANTERA_LIBDIR=@buildlib@
# the directory where Cantera include files may be found.
CANTERA_INCDIR=@ctroot@/build/include
# flags passed to the C++ compiler/linker for the linking step
LCXX_FLAGS = -L$(CANTERA_LIBDIR) @LOCAL_LIB_DIRS@ @CXXFLAGS@
# how to compile C++ source files to object files
.@CXX_EXT@.@OBJ_EXT@:
$(CXX) -c $< -I$(CANTERA_INCDIR) $(CXX_FLAGS)
# how to create a dependency file
.@CXX_EXT@.d:
@CXX_DEPENDS@ -I$(CANTERA_INCDIR) $(CXX_FLAGS) $(LOCAL_DEFNS) $*.cpp > $*.d
# how to compile Fortran source files to object files
.@F77_EXT@.@OBJ_EXT@:
$(FORT) -c $< $(FORT_FLAGS)
PROGRAM = $(PROG_NAME)$(EXE_EXT)
DEPENDS = $(OBJS:.o=.d)
all: isentropic ctlib
demo_ftnlib.o: @ctroot@/tools/templates/f77/demo_ftnlib.cpp
$(CXX) -c $< -I$(CANTERA_INCDIR) $(CXX_FLAGS)
demo_ftnlib.d: @ctroot@/tools/templates/f77/demo_ftnlib.cpp
@CXX_DEPENDS@ -I$(CANTERA_INCDIR) $(CXX_FLAGS) $< > $*.d
isentropic: isentropic.o demo_ftnlib.o
$(CXX) -o isentropic isentropic.o demo_ftnlib.o $(LCXX_FLAGS) $(CANTERA_LIBS) \
$(LINK_OPTIONS) $(EXT_LIBS) @LIBS@ $(FORT_LIBS)
ctlib: ctlib.o demo_ftnlib.o
$(CXX) -o ctlib ctlib.o demo_ftnlib.o $(LCXX_FLAGS) $(CANTERA_LIBS) \
$(LINK_OPTIONS) $(EXT_LIBS) @LIBS@ $(FORT_LIBS)
test:
@MAKE@
./runtest
INSTALL_DIR=@ct_demodir@/f77
install:
@INSTALL@ -d $(INSTALL_DIR)
@INSTALL@ -c -m ug+rw,o+r f77demos.mak $(INSTALL_DIR)/Makefile
@INSTALL@ -c -m ug+rw,o+r @ctroot@/tools/templates/f77/demo_ftnlib.cpp $(INSTALL_DIR)
@(for ihhh in *.f *blessed* README.txt ; do \
@INSTALL@ $${ihhh} -m ug+rw,o+r $(INSTALL_DIR) ; \
echo "@INSTALL@ $${ihhh} -m ug+rw,o+r $(INSTALL_DIR)" ; \
done )
@INSTALL@ runtest $(INSTALL_DIR) ;
clean:
$(RM) $(OBJS) isentropic ctlib
depends:
$(MAKE) .depends
.depends: $(DEPENDS)
cat *.d > .depends
TAGS:
etags *.h *.cpp
ifeq ($(wildcard .depends), .depends)
include .depends
endif

View file

@ -40,7 +40,7 @@ CANTERA_LIBDIR=@ct_libdir@
CANTERA_INCDIR=@ct_incroot@
# flags passed to the C++ compiler/linker for the linking step
LCXX_FLAGS = -L$(CANTERA_LIBDIR) @CXXFLAGS@
LCXX_FLAGS = -L$(CANTERA_LIBDIR) @LOCAL_LIB_DIRS@ @CXXFLAGS@
# how to compile C++ source files to object files
.@CXX_EXT@.@OBJ_EXT@:

View file

@ -0,0 +1,200 @@
.13047E+02 .41846E+01 .27020E+03 .49751E-02
.82256E+01 .36786E+01 .32994E+03 .99502E-02
.63008E+01 .33959E+01 .37041E+03 .14925E-01
.52263E+01 .32002E+01 .40197E+03 .19900E-01
.45279E+01 .30507E+01 .42824E+03 .24876E-01
.40320E+01 .29300E+01 .45096E+03 .29851E-01
.36588E+01 .28288E+01 .47111E+03 .34826E-01
.33662E+01 .27417E+01 .48928E+03 .39801E-01
.31297E+01 .26653E+01 .50589E+03 .44776E-01
.29340E+01 .25973E+01 .52123E+03 .49751E-01
.27689E+01 .25359E+01 .53551E+03 .54726E-01
.26275E+01 .24801E+01 .54889E+03 .59701E-01
.25048E+01 .24289E+01 .56149E+03 .64677E-01
.23971E+01 .23816E+01 .57341E+03 .69652E-01
.23019E+01 .23376E+01 .58474E+03 .74627E-01
.22169E+01 .22965E+01 .59554E+03 .79602E-01
.21405E+01 .22579E+01 .60586E+03 .84577E-01
.20714E+01 .22216E+01 .61576E+03 .89552E-01
.20087E+01 .21872E+01 .62526E+03 .94527E-01
.19513E+01 .21547E+01 .63441E+03 .99502E-01
.18987E+01 .21237E+01 .64324E+03 .10448E+00
.18503E+01 .20941E+01 .65177E+03 .10945E+00
.18055E+01 .20659E+01 .66002E+03 .11443E+00
.17639E+01 .20388E+01 .66801E+03 .11940E+00
.17253E+01 .20129E+01 .67576E+03 .12438E+00
.16893E+01 .19879E+01 .68329E+03 .12935E+00
.16556E+01 .19639E+01 .69062E+03 .13433E+00
.16240E+01 .19407E+01 .69774E+03 .13930E+00
.15944E+01 .19183E+01 .70469E+03 .14428E+00
.15665E+01 .18966E+01 .71146E+03 .14925E+00
.15402E+01 .18756E+01 .71806E+03 .15423E+00
.15153E+01 .18553E+01 .72451E+03 .15920E+00
.14919E+01 .18355E+01 .73081E+03 .16418E+00
.14696E+01 .18163E+01 .73698E+03 .16915E+00
.14485E+01 .17976E+01 .74301E+03 .17413E+00
.14285E+01 .17795E+01 .74891E+03 .17910E+00
.14095E+01 .17617E+01 .75470E+03 .18408E+00
.13913E+01 .17444E+01 .76037E+03 .18905E+00
.13741E+01 .17276E+01 .76593E+03 .19403E+00
.13576E+01 .17111E+01 .77138E+03 .19900E+00
.13419E+01 .16950E+01 .77673E+03 .20398E+00
.13269E+01 .16792E+01 .78199E+03 .20896E+00
.13125E+01 .16638E+01 .78716E+03 .21393E+00
.12988E+01 .16486E+01 .79223E+03 .21891E+00
.12856E+01 .16338E+01 .79722E+03 .22388E+00
.12730E+01 .16193E+01 .80213E+03 .22886E+00
.12609E+01 .16050E+01 .80696E+03 .23383E+00
.12493E+01 .15910E+01 .81171E+03 .23881E+00
.12382E+01 .15773E+01 .81639E+03 .24378E+00
.12275E+01 .15637E+01 .82100E+03 .24876E+00
.12172E+01 .15504E+01 .82553E+03 .25373E+00
.12074E+01 .15374E+01 .83001E+03 .25871E+00
.11979E+01 .15245E+01 .83441E+03 .26368E+00
.11888E+01 .15118E+01 .83876E+03 .26866E+00
.11800E+01 .14994E+01 .84304E+03 .27363E+00
.11716E+01 .14871E+01 .84727E+03 .27861E+00
.11634E+01 .14750E+01 .85144E+03 .28358E+00
.11556E+01 .14630E+01 .85556E+03 .28856E+00
.11481E+01 .14512E+01 .85962E+03 .29353E+00
.11408E+01 .14396E+01 .86363E+03 .29851E+00
.11339E+01 .14281E+01 .86759E+03 .30348E+00
.11271E+01 .14168E+01 .87150E+03 .30846E+00
.11207E+01 .14056E+01 .87537E+03 .31343E+00
.11144E+01 .13946E+01 .87919E+03 .31841E+00
.11084E+01 .13836E+01 .88296E+03 .32338E+00
.11026E+01 .13728E+01 .88669E+03 .32836E+00
.10971E+01 .13622E+01 .89038E+03 .33333E+00
.10917E+01 .13516E+01 .89403E+03 .33831E+00
.10865E+01 .13412E+01 .89763E+03 .34328E+00
.10816E+01 .13308E+01 .90120E+03 .34826E+00
.10768E+01 .13206E+01 .90473E+03 .35323E+00
.10722E+01 .13104E+01 .90822E+03 .35821E+00
.10678E+01 .13004E+01 .91167E+03 .36318E+00
.10635E+01 .12905E+01 .91509E+03 .36816E+00
.10594E+01 .12806E+01 .91848E+03 .37313E+00
.10555E+01 .12708E+01 .92183E+03 .37811E+00
.10518E+01 .12612E+01 .92515E+03 .38308E+00
.10482E+01 .12516E+01 .92843E+03 .38806E+00
.10447E+01 .12421E+01 .93169E+03 .39303E+00
.10414E+01 .12326E+01 .93491E+03 .39801E+00
.10383E+01 .12233E+01 .93811E+03 .40299E+00
.10353E+01 .12140E+01 .94127E+03 .40796E+00
.10324E+01 .12047E+01 .94441E+03 .41294E+00
.10296E+01 .11956E+01 .94751E+03 .41791E+00
.10270E+01 .11865E+01 .95059E+03 .42289E+00
.10246E+01 .11775E+01 .95365E+03 .42786E+00
.10222E+01 .11685E+01 .95667E+03 .43284E+00
.10200E+01 .11596E+01 .95967E+03 .43781E+00
.10179E+01 .11508E+01 .96265E+03 .44279E+00
.10159E+01 .11420E+01 .96560E+03 .44776E+00
.10141E+01 .11332E+01 .96853E+03 .45274E+00
.10123E+01 .11246E+01 .97143E+03 .45771E+00
.10107E+01 .11159E+01 .97431E+03 .46269E+00
.10092E+01 .11073E+01 .97717E+03 .46766E+00
.10078E+01 .10988E+01 .98000E+03 .47264E+00
.10066E+01 .10903E+01 .98281E+03 .47761E+00
.10054E+01 .10819E+01 .98560E+03 .48259E+00
.10044E+01 .10735E+01 .98837E+03 .48756E+00
.10035E+01 .10651E+01 .99112E+03 .49254E+00
.10026E+01 .10568E+01 .99385E+03 .49751E+00
.10019E+01 .10485E+01 .99656E+03 .50249E+00
.10013E+01 .10402E+01 .99925E+03 .50746E+00
.10009E+01 .10321E+01 .10019E+04 .51244E+00
.10005E+01 .10239E+01 .10046E+04 .51741E+00
.10002E+01 .10159E+01 .10072E+04 .52239E+00
.10001E+01 .10078E+01 .10098E+04 .52736E+00
.10000E+01 .99978E+00 .10124E+04 .53234E+00
.10001E+01 .99180E+00 .10150E+04 .53731E+00
.10002E+01 .98383E+00 .10175E+04 .54229E+00
.10005E+01 .97590E+00 .10201E+04 .54726E+00
.10009E+01 .96799E+00 .10226E+04 .55224E+00
.10014E+01 .96011E+00 .10251E+04 .55721E+00
.10020E+01 .95225E+00 .10276E+04 .56219E+00
.10027E+01 .94441E+00 .10301E+04 .56716E+00
.10035E+01 .93659E+00 .10325E+04 .57214E+00
.10045E+01 .92880E+00 .10349E+04 .57711E+00
.10055E+01 .92102E+00 .10374E+04 .58209E+00
.10067E+01 .91326E+00 .10398E+04 .58706E+00
.10080E+01 .90552E+00 .10422E+04 .59204E+00
.10094E+01 .89779E+00 .10445E+04 .59701E+00
.10110E+01 .89007E+00 .10469E+04 .60199E+00
.10126E+01 .88237E+00 .10492E+04 .60697E+00
.10144E+01 .87468E+00 .10516E+04 .61194E+00
.10163E+01 .86700E+00 .10539E+04 .61692E+00
.10184E+01 .85933E+00 .10562E+04 .62189E+00
.10205E+01 .85167E+00 .10585E+04 .62687E+00
.10228E+01 .84402E+00 .10607E+04 .63184E+00
.10253E+01 .83637E+00 .10630E+04 .63682E+00
.10278E+01 .82873E+00 .10652E+04 .64179E+00
.10306E+01 .82108E+00 .10675E+04 .64677E+00
.10334E+01 .81345E+00 .10697E+04 .65174E+00
.10364E+01 .80581E+00 .10719E+04 .65672E+00
.10396E+01 .79817E+00 .10741E+04 .66169E+00
.10429E+01 .79053E+00 .10763E+04 .66667E+00
.10464E+01 .78289E+00 .10784E+04 .67164E+00
.10501E+01 .77525E+00 .10806E+04 .67662E+00
.10539E+01 .76760E+00 .10827E+04 .68159E+00
.10579E+01 .75994E+00 .10849E+04 .68657E+00
.10621E+01 .75227E+00 .10870E+04 .69154E+00
.10665E+01 .74460E+00 .10891E+04 .69652E+00
.10710E+01 .73691E+00 .10912E+04 .70149E+00
.10758E+01 .72922E+00 .10933E+04 .70647E+00
.10808E+01 .72150E+00 .10953E+04 .71144E+00
.10860E+01 .71378E+00 .10974E+04 .71642E+00
.10914E+01 .70603E+00 .10995E+04 .72139E+00
.10970E+01 .69827E+00 .11015E+04 .72637E+00
.11029E+01 .69049E+00 .11035E+04 .73134E+00
.11091E+01 .68268E+00 .11055E+04 .73632E+00
.11155E+01 .67485E+00 .11076E+04 .74129E+00
.11221E+01 .66700E+00 .11096E+04 .74627E+00
.11291E+01 .65912E+00 .11115E+04 .75124E+00
.11364E+01 .65121E+00 .11135E+04 .75622E+00
.11440E+01 .64326E+00 .11155E+04 .76119E+00
.11519E+01 .63529E+00 .11174E+04 .76617E+00
.11601E+01 .62727E+00 .11194E+04 .77114E+00
.11687E+01 .61922E+00 .11213E+04 .77612E+00
.11777E+01 .61113E+00 .11233E+04 .78109E+00
.11871E+01 .60300E+00 .11252E+04 .78607E+00
.11970E+01 .59481E+00 .11271E+04 .79104E+00
.12073E+01 .58658E+00 .11290E+04 .79602E+00
.12180E+01 .57830E+00 .11309E+04 .80100E+00
.12293E+01 .56996E+00 .11328E+04 .80597E+00
.12411E+01 .56156E+00 .11346E+04 .81095E+00
.12535E+01 .55310E+00 .11365E+04 .81592E+00
.12665E+01 .54458E+00 .11384E+04 .82090E+00
.12802E+01 .53598E+00 .11402E+04 .82587E+00
.12945E+01 .52731E+00 .11420E+04 .83085E+00
.13096E+01 .51856E+00 .11439E+04 .83582E+00
.13256E+01 .50973E+00 .11457E+04 .84080E+00
.13424E+01 .50080E+00 .11475E+04 .84577E+00
.13601E+01 .49179E+00 .11493E+04 .85075E+00
.13789E+01 .48267E+00 .11511E+04 .85572E+00
.13988E+01 .47344E+00 .11529E+04 .86070E+00
.14199E+01 .46409E+00 .11547E+04 .86567E+00
.14424E+01 .45463E+00 .11564E+04 .87065E+00
.14663E+01 .44503E+00 .11582E+04 .87562E+00
.14918E+01 .43528E+00 .11600E+04 .88060E+00
.15192E+01 .42539E+00 .11617E+04 .88557E+00
.15485E+01 .41533E+00 .11635E+04 .89055E+00
.15801E+01 .40509E+00 .11652E+04 .89552E+00
.16141E+01 .39466E+00 .11669E+04 .90050E+00
.16510E+01 .38402E+00 .11686E+04 .90547E+00
.16911E+01 .37315E+00 .11704E+04 .91045E+00
.17349E+01 .36204E+00 .11721E+04 .91542E+00
.17830E+01 .35065E+00 .11738E+04 .92040E+00
.18360E+01 .33895E+00 .11754E+04 .92537E+00
.18948E+01 .32692E+00 .11771E+04 .93035E+00
.19605E+01 .31452E+00 .11788E+04 .93532E+00
.20346E+01 .30169E+00 .11805E+04 .94030E+00
.21189E+01 .28838E+00 .11821E+04 .94527E+00
.22159E+01 .27451E+00 .11838E+04 .95025E+00
.23290E+01 .26001E+00 .11854E+04 .95522E+00
.24632E+01 .24475E+00 .11871E+04 .96020E+00
.26258E+01 .22858E+00 .11887E+04 .96517E+00
.28282E+01 .21129E+00 .11904E+04 .97015E+00
.30894E+01 .19257E+00 .11920E+04 .97512E+00
.34444E+01 .17197E+00 .11936E+04 .98010E+00
.39661E+01 .14870E+00 .11952E+04 .98507E+00
.48440E+01 .12123E+00 .11968E+04 .99005E+00
.68316E+01 .85587E-01 .11984E+04 .99502E+00

View file

@ -0,0 +1,53 @@
1 .0188679245 107580366.
2 .0188679245 -127618291.
3 .0188679245 -5841908.88
4 .0188679245 1882753.34
5 .0188679245 16309604.3
6 .0188679245 21394370.6
7 .0188679245 9140216.83
8 .0188679245 -18211215.7
9 .0188679245 21655576.1
10 .0188679245 -3714229.1
11 .0188679245 -18186216.1
12 .0188679245 -1682741.15
13 .0188679245 37470914.2
14 .0188679245 -3392197.3
15 .0188679245 18026079.2
16 .0188679245 463875.16
17 .0188679245 2806651.72
18 .0188679245 -1667694.07
19 .0188679245 1880341.11
20 .0188679245 -8475520.7
21 .0188679245 -6400829.08
22 .0188679245 -1406778.08
23 .0188679245 13553453.2
24 .0188679245 773619.115
25 .0188679245 -1655967.27
26 .0188679245 -1169297.41
27 .0188679245 -5423477.63
28 .0188679245 -4477211.79
29 .0188679245 1678733.83
30 .0188679245 -7621432.25
31 .0188679245 2920967.69
32 .0188679245 1587088.17
33 .0188679245 -1115927.73
34 .0188679245 -1114219.33
35 .0188679245 -25381839.7
36 .0188679245 19122996.
37 .0188679245 -5098275.67
38 .0188679245 -437067.673
39 .0188679245 -14456797.9
40 .0188679245 -2054184.47
41 .0188679245 5671681.7
42 .0188679245 -877757.851
43 .0188679245 -5388358.94
44 .0188679245 -314214.889
45 .0188679245 -6148952.17
46 .0188679245 3674701.43
47 .0188679245 -2633132.34
48 .0188679245 31625280.
49 .0188679245 1.7069679E-12
50 .0188679245 2079585.71
51 .0188679245 -6636328.08
52 .0188679245 -2233998.81
53 .0188679245 -539425.581

View file

@ -0,0 +1,62 @@
#!/bin/sh
#
#
temp_success="1"
/bin/rm -f output_0.txt diff_csv.txt diff_out_0.txt
##########################################################################
prog=isentropic
if test ! -x $prog ; then
echo $prog ' does not exist'
exit -1
fi
#################################################################
#
CANTERA_DATA=${CANTERA_DATA:=../../../data/inputs}; export CANTERA_DATA
CANTERA_BIN=${CANTERA_BIN:=../../../bin}
#################################################################
$prog > output_0.txt
retnStat=$?
if [ $retnStat != "0" ]
then
temp_success="0"
echo "$prog returned with bad status, $retnStat, check output"
fi
diff -w output_0_blessed.txt output_0.txt > diff_out_0.txt
retnStat_0=$?
############################################################
ctlib > output_1.txt
retnStat=$?
if [ $retnStat != "0" ]
then
temp_success="0"
echo "$prog returned with bad status, $retnStat, check output"
fi
diff -w output_1_blessed.txt output_1.txt > diff_out_1.txt
retnStat_1=$?
retnTotal=1
if test $retnStat_0 = "0" -a $retnStat_1 = "0"
then
retnTotal=0
fi
if test $retnTotal = "0"
then
echo "Successful test comparison on "`pwd`
else
echo "Unsuccessful test comparison on "`pwd` " test"
echo " txt files are different - see diff_test*.txt"
fi