diff --git a/Source/Fortran/calc_etadot.f90 b/Source/Fortran/calc_etadot.f90 index 542997d20f47c0e4b7dec9968d30dacf70fd72f7..741eba91eab049df23a560219d0f2656a6cc9881 100644 --- a/Source/Fortran/calc_etadot.f90 +++ b/Source/Fortran/calc_etadot.f90 @@ -485,24 +485,25 @@ PROGRAM calc_etadot END IF ! MGAUSS -!! CREATE FILE VERTICAL.EC NEEDED BY POP MODEL - - OPEN(21,FILE='VERTICAL.EC') - WRITE(21,'(A)') - WRITE(21,'(A)') 'VERTICAL DISCRETIZATION OF POP MODEL' - WRITE(21,'(A)') - write(21,'(i3,a)') MLEVEL,' number of layers' - WRITE(21,'(A)') - WRITE(21,'(A)') '* A(NLEV+1)' - WRITE(21,'(A)') - DO 205 I=1,MLEVEL+1 -205 WRITE(21,'(F18.12)') AK(I) - WRITE(21,'(A)') - WRITE(21,'(A)') '* B(NLEV+1)' - WRITE(21,'(A)') - DO 210 I=1,MLEVEL+1 -210 WRITE(21,'(F18.12)') BK(I) - CLOSE(21) +! CREATE FILE VERTICAL.EC NEEDED BY POP MODEL +! 2020-06-25 Commented out by PS - not needed anymore + +! OPEN(21,FILE='VERTICAL.EC') +! WRITE(21,'(A)') +! WRITE(21,'(A)') 'VERTICAL DISCRETIZATION OF POP MODEL' +! WRITE(21,'(A)') +! write(21,'(i3,a)') MLEVEL,' number of layers' +! WRITE(21,'(A)') +! WRITE(21,'(A)') '* A(NLEV+1)' +! WRITE(21,'(A)') +! DO 205 I=1,MLEVEL+1 +!205 WRITE(21,'(F18.12)') AK(I) +! WRITE(21,'(A)') +! WRITE(21,'(A)') '* B(NLEV+1)' +! WRITE(21,'(A)') +! DO 210 I=1,MLEVEL+1 +!210 WRITE(21,'(F18.12)') BK(I) +! CLOSE(21) !------------------------------------------------------------------ ! READING OF OMEGA diff --git a/Source/Fortran/makefile_debug b/Source/Fortran/makefile_debug index 538a3b3e00edba49892c0e1b8047444b06a5e195..93d4a09032e1fd05a1805eec40ad69f32230b6a8 100644 --- a/Source/Fortran/makefile_debug +++ b/Source/Fortran/makefile_debug @@ -14,7 +14,7 @@ EXE = calc_etadot_debug.out -ECCODES_LIB= -Bstatic -leccodes_f90 -leccodes -Bdynamic -lm -ljasper +ECCODES_LIB= -Bstatic -leccodes_f90 -leccodes -Bdynamic -lm EMOSLIB=-lemosR64 LIB = $(ECCODES_LIB) $(EMOSLIB) diff --git a/Source/Fortran/makefile_fast b/Source/Fortran/makefile_fast index 2e12c9c4746491a9dc5d4f2f347bc9534505b8c1..7b0a21519ccaab8b5736b4e256d1bf472c5667f7 100644 --- a/Source/Fortran/makefile_fast +++ b/Source/Fortran/makefile_fast @@ -14,16 +14,17 @@ EXE = calc_etadot_fast.out -ECCODES_LIB = -Bstatic -leccodes_f90 -leccodes -Bdynamic -lm -ljasper +ECCODES_LIB = -Bstatic -leccodes_f90 -leccodes -Bdynamic -lm EMOSLIB=-lemosR64 LIB = $(ECCODES_LIB) $(EMOSLIB) -ECCODES_INCLUDE_DIR=/usr/local/include/ -#/usr/lib/x86_64-linux-gnu/fortran/gfortran-mod-15 +ECCODES_INCLUDE_DIR=/usr/lib/x86_64-linux-gnu/fortran/gfortran-mod-15 +#/usr/local/include/ #oldstable + INC = -I. -I$(ECCODES_INCLUDE_DIR) FC = gfortran -OPT = -O3 -march=native +OPT = -O3 # -O3 -march=native FFLAGS = $(OPT) $(LIB) $(INC) -fdefault-real-8 -fopenmp -fconvert=big-endian LDFLAGS = $(OPT) $(LIB) -fopenmp SRC = ./rwgrib2.f90 ./calc_etadot.f90 ./ftrafo.f90 ./grphreal.f90 ./posnam.f90 ./phgrreal.f90 diff --git a/Testing/Regression/FortranEtadot/run_ref.sh b/Testing/Regression/FortranEtadot/run_ref.sh index eb064de9e34d9ceba90ee9569fa1ec3bec638bb0..065a2919a6b4e68434d94dfb7a25bc18e626dd19 100755 --- a/Testing/Regression/FortranEtadot/run_ref.sh +++ b/Testing/Regression/FortranEtadot/run_ref.sh @@ -13,11 +13,13 @@ path=../${path1} exedebug=calc_etadot_debug.out exefast=calc_etadot_fast.out hash=$(git log --abbrev-commit --pretty=oneline -n 1 --pretty=format:'%h') +csvfile='runtimes_'${HOST}'.csv' exitonfail=true rm -f log.run_ref failed # loop over all reference runs rm -f log.run_ref +rm -f Work/* if [ "$1" = omithigh ]; then # for fast testing, not for production # requires > 16 GB @@ -50,7 +52,7 @@ for ref in $inputs; do echo $ref $exe 'FAILED' >> ${testhome}/failed if [ "${exitonfail}" = true ]; then exit; fi fi - for outfile in 'fort.15' 'VERTICAL.EC'; do + for outfile in 'fort.15' ; do if [ -e $outfile ]; then mv ${outfile} ../${outdir} else @@ -67,11 +69,11 @@ for ref in $inputs; do # compare debug and fast # omega case also produces fort.25 - need to add this - for outfile in 'fort.15' 'VERTICAL.EC'; do + for outfile in 'fort.15' ; do outdebug='Outputs/Output_ref_'${ref}'_debug/'$outfile outfast='Outputs/Output_ref_'${ref}'_fast/'$outfile - test=$(cmp $outdebug $outfast) - if $test; then + test=$() + if cmp -s $outdebug $outfast >/dev/null; then echo $outfile ' equal for debug and fast' >> log.run_ref else echo 'WARNING:' $outfile ' not equal for debug and fast, test failed' @@ -87,7 +89,7 @@ for ref in $inputs; do real=$(echo $times | grep real | awk '{print $2}') user=$(echo $times | grep user | awk '{print $4}') sys=$( echo $times | grep sys | awk '{print $6}') - echo $hash, "'"reference"'", "'"${ref}'_'${exe}"'", ${real}, ${user}, ${sys} >> runtimes.csv + echo $hash, "'"reference"'", "'"${ref}'_'${exe}"'", ${real}, ${user}, ${sys} >> ${csvfile} tail -1 runtimes.csv >> log.run_ref done diff --git a/Testing/Regression/FortranEtadot/run_regrtest.sh b/Testing/Regression/FortranEtadot/run_regrtest.sh index e00a47e26bc0f6541e6347eafef17af49a30b6f7..1284adae7ac30f873f543e060e03ff6eb078b45c 100755 --- a/Testing/Regression/FortranEtadot/run_regrtest.sh +++ b/Testing/Regression/FortranEtadot/run_regrtest.sh @@ -16,6 +16,7 @@ path=../${path1} exedebug=calc_etadot_debug.out exefast=calc_etadot_fast.out hash=$(git log --abbrev-commit --pretty=oneline -n 1 --pretty=format:'%h') +csvfile='runtimes_'${HOST}'.csv' exitonfail=true numtest=0 numpassed=0 @@ -31,7 +32,7 @@ else fi for ref in $inputs; do - echo 'Working on test case =' $ref + echo 'Working on test case =' $ref | tee -a ../log.run_regr # loop over debug and fast runs for exe in 'debug' 'fast'; do @@ -61,8 +62,7 @@ for ref in $inputs; do # compare reference and current version # omega case also produces fort.25 - need to add this outref='../Outputs/Output_ref_'${ref}'_'${exe}'/'$outfile - test=$(cmp $outfile $outref) - if $test; then + if cmp -s $outfile $outref >/dev/null; then echo ' '$outfile ' test passed' | tee -a ../log.run_regr else echo 'WARNING:' $outfile ' test failed' | tee -a ../log.run_regr @@ -84,11 +84,11 @@ for ref in $inputs; do real=$(echo $times | grep real | awk '{print $2}') user=$(echo $times | grep user | awk '{print $4}') sys=$( echo $times | grep sys | awk '{print $6}') - echo $hash, "'"reference"'", "'"${ref}'_'${exe}"'", ${real}, ${user}, ${sys} >> ../runtimes.csv - tail -1 ../runtimes.csv >> log.run_regr + echo $hash, "'"reference"'", "'"${ref}'_'${exe}"'", ${real}, ${user}, ${sys} >> ../${csvfile} + tail -1 ../${csvfile} >> log.run_regr cd .. - rm Work/* # this is for being more safe + rm -f Work/* # this is for being more safe done # end of exe loop @@ -99,7 +99,7 @@ echo echo ' Regression test: ' $numpassed 'out of' $numtest 'tests passed'. \ | tee -a ../log.run_regr echo ' More information may be found in log.run_regr' -echo ' Runtimes were added to runtimes.csv under '$hash | tee -a ../log.run_regr +echo ' Runtimes were added to '${csvfile}' under '$hash | tee -a ../log.run_regr # the following code is executed only if exitonfail is not set to 'true'. if [ -e failed ]; then diff --git a/Testing/Regression/FortranEtadot/runtimes.imp7 b/Testing/Regression/FortranEtadot/runtimes_imp7.csv similarity index 50% rename from Testing/Regression/FortranEtadot/runtimes.imp7 rename to Testing/Regression/FortranEtadot/runtimes_imp7.csv index c709fb5868139ce18593dd33f9d589be2691397e..2bf6fd25be83396e05dfe4d985127a0124d2dfab 100644 --- a/Testing/Regression/FortranEtadot/runtimes.imp7 +++ b/Testing/Regression/FortranEtadot/runtimes_imp7.csv @@ -14,3 +14,19 @@ 949379e, 'reference', 'latlon_fast', 0m0.673s, 0m7.032s, 0m0.152s 949379e, 'reference', 'latlonall_debug', 0m0.777s, 0m6.772s, 0m0.620s 949379e, 'reference', 'latlonall_fast', 0m0.687s, 0m7.064s, 0m0.196s +d90a529, 'reference', 'etadot_debug', 0m0.504s, 0m0.431s, 0m0.016s +d90a529, 'reference', 'etadot_fast', 0m0.442s, 0m0.529s, 0m0.017s +d90a529, 'reference', 'etadotall_debug', 0m0.576s, 0m0.603s, 0m0.048s +d90a529, 'reference', 'etadotall_fast', 0m0.604s, 0m0.673s, 0m0.028s +d90a529, 'reference', 'etadothigh_debug', 17m14.011s, 16m31.983s, 0m18.441s +d90a529, 'reference', 'etadothigh_fast', 17m23.426s, 16m31.624s, 0m21.645s +d90a529, 'reference', 'gauss_debug', 0m3.348s, 0m7.130s, 0m0.208s +d90a529, 'reference', 'gauss_fast', 0m2.403s, 0m5.028s, 0m0.156s +d90a529, 'reference', 'gaussall_debug', 0m12.126s, 0m28.251s, 0m0.648s +d90a529, 'reference', 'gaussall_fast', 0m9.868s, 0m23.323s, 0m0.880s +d90a529, 'reference', 'gausshigh_debug', 5m4.089s, 14m23.018s, 0m12.998s +d90a529, 'reference', 'gausshigh_fast', 4m48.049s, 13m11.227s, 0m16.318s +d90a529, 'reference', 'latlon_debug', 0m0.657s, 0m0.681s, 0m0.016s +d90a529, 'reference', 'latlon_fast', 0m0.485s, 0m0.563s, 0m0.004s +d90a529, 'reference', 'latlonall_debug', 0m0.544s, 0m0.613s, 0m0.012s +d90a529, 'reference', 'latlonall_fast', 0m0.534s, 0m0.620s, 0m0.020s