/[MITgcm]/MITgcm/verification/testreport
ViewVC logotype

Diff of /MITgcm/verification/testreport

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.99 by jmc, Sat Sep 15 20:30:05 2007 UTC revision 1.105 by jmc, Fri Oct 12 21:39:37 2007 UTC
# Line 108  testoutput_var() Line 108  testoutput_var()
108      if [ -r $1/$4/$OUTPUTFILE ]; then      if [ -r $1/$4/$OUTPUTFILE ]; then
109          grep "$2" $1/$4/$OUTPUTFILE | sed 's/.*=//' | cat -n > tmp1.txt          grep "$2" $1/$4/$OUTPUTFILE | sed 's/.*=//' | cat -n > tmp1.txt
110          lncntA=`wc -l tmp1.txt | awk '{print $1}' `          lncntA=`wc -l tmp1.txt | awk '{print $1}' `
111          if [ $lncntA -lt 3 ]; then          if [ $lncntA -lt 2 ]; then
112              if [ $verbose -gt 0 ]; then              if [ $verbose -gt 0 ]; then
113                  echo Not enough lines of output when searching for "$2" 1>&2                  echo Not enough lines of output when searching for "$2" 1>&2
114              fi              fi
# Line 123  testoutput_var() Line 123  testoutput_var()
123      fi      fi
124      grep "$2" $1/results/$5 | sed 's/.*=//' | cat -n > tmp2.txt      grep "$2" $1/results/$5 | sed 's/.*=//' | cat -n > tmp2.txt
125      lncntB=`wc -l tmp2.txt | awk '{print $1}' `      lncntB=`wc -l tmp2.txt | awk '{print $1}' `
126      if [ $lncntB -lt 3 ]; then      if [ $lncntB -lt 2 ]; then
127          if [ $verbose -gt 0 ]; then          if [ $verbose -gt 0 ]; then
128              echo Not enough lines of output when searching for "$2" 1>&2              echo Not enough lines of output when searching for "$2" 1>&2
129          fi          fi
# Line 189  dashnum() Line 189  dashnum()
189      done      done
190  }  }
191    
 testoutput_ad()  
 {  
     grep $3 $1/results_ad/output_adm.txt | awk '{print NR " " $5}' > t05.txt  
     grep $3 $1/$2/$OUTPUTFILE | awk '{print NR " " $5}' > t15.txt  
     grep $3 $1/results_ad/output_adm.txt | awk '{print NR " " $6}' > t06.txt  
     grep $3 $1/$2/$OUTPUTFILE | awk '{print NR " " $6}' > t16.txt  
     join t05.txt t15.txt > t5.txt  
     join t06.txt t16.txt > t6.txt  
     echo "-1" >> t5.txt  
     echo "-1" >> t6.txt  
     digits_5=`./tr_cmpnum < t5.txt`  
     digits_6=`./tr_cmpnum < t6.txt`  
     dashnum $digits_5 $digits_6  
     rm -f t[01][56].txt t[56].txt  
 }  
   
192  check_for_add_mon_output()  check_for_add_mon_output()
193  {  {
194      # Check for additional types of monitor output      # Check for additional types of monitor output
# Line 235  testoutput_run() Line 219  testoutput_run()
219      # testoutput_run directory subdir reference_output      # testoutput_run directory subdir reference_output
220      #      #
221      #  test output from 1 run in "directory"      #  test output from 1 run in "directory"
222      if test "x$ADM" = x ; then  # --> same processing for adjoint & forward test
223          # default list of output variables to be checked:          # default list of output variables to be checked:
224          #  1rst : main variable used to decide if it pass or FAIL          #  1rst : main variable used to decide if it pass or FAIL
225          #  others : number of matching digits to be printed in summary.txt          #  others : number of matching digits to be printed in summary.txt
# Line 270  testoutput_run() Line 254  testoutput_run()
254                    then echo testoutput_run: testoutput_var $1 cg2d_init_res 1>&2 ; fi                    then echo testoutput_run: testoutput_var $1 cg2d_init_res 1>&2 ; fi
255                    testoutput_var $1 "cg2d_init_res" "Press. Solver (cg2d)" $2 $3; yy=$?                    testoutput_var $1 "cg2d_init_res" "Press. Solver (cg2d)" $2 $3; yy=$?
256                    if [ $debug -gt 0 ] ; then echo testoutput_run: cg2dres=$yy 1>&2 ; fi ;;                    if [ $debug -gt 0 ] ; then echo testoutput_run: cg2dres=$yy 1>&2 ; fi ;;
257             'Cost') testoutput_var $1 "ADM  precision_derivative_cost" "ADM Cost" $2 $3; yy=$? ;;            'Cost') testoutput_var $1 "ADM  precision_derivative_cost" "ADM Cost" $2 $3; yy=$? ;;
258             'Grad') testoutput_var $1 "ADM  precision_derivative_grad" "ADM Grad" $2 $3; yy=$? ;;            'Grad') testoutput_var $1 "ADM  precision_derivative_grad" "ADM Grad" $2 $3; yy=$? ;;
259             'Tmn') testoutput_var $1 "dynstat_theta_min"  "Theta minimum"  $2 $3; yy=$? ;;             'Tmn') testoutput_var $1 "dynstat_theta_min"  "Theta minimum"  $2 $3; yy=$? ;;
260             'Tmx') testoutput_var $1 "dynstat_theta_max"  "Theta maximum"  $2 $3; yy=$? ;;             'Tmx') testoutput_var $1 "dynstat_theta_max"  "Theta maximum"  $2 $3; yy=$? ;;
261             'Tav') testoutput_var $1 "dynstat_theta_mean" "Theta mean"     $2 $3; yy=$? ;;             'Tav') testoutput_var $1 "dynstat_theta_mean" "Theta mean"     $2 $3; yy=$? ;;
# Line 296  testoutput_run() Line 280  testoutput_run()
280             testoutput_var $1 "trcstat_ptracer0"$ii"_mean" "p0"$ii"_mean" $2 $3; yy=$? ;;             testoutput_var $1 "trcstat_ptracer0"$ii"_mean" "p0"$ii"_mean" $2 $3; yy=$? ;;
281          'pt1sd'|'pt2sd'|'pt3sd'|'pt4sd'|'pt5sd') ii=`echo $xx | sed 's/pt//' | sed 's/..$//'`          'pt1sd'|'pt2sd'|'pt3sd'|'pt4sd'|'pt5sd') ii=`echo $xx | sed 's/pt//' | sed 's/..$//'`
282             testoutput_var $1 "trcstat_ptracer0"$ii"_sd"   "p0"$ii"_StDv"  $2 $3; yy=$? ;;             testoutput_var $1 "trcstat_ptracer0"$ii"_sd"   "p0"$ii"_StDv"  $2 $3; yy=$? ;;
283             'Qntmn') testoutput_var $1 "extforcing_qnet_min" "Qnet minimum"  $2 $3; yy=$? ;;
284             'Qntmx') testoutput_var $1 "extforcing_qnet_max" "Qnet maximum"  $2 $3; yy=$? ;;
285             'Qntav') testoutput_var $1 "extforcing_qnet_mean" "Qnet mean"    $2 $3; yy=$? ;;
286             'Qntsd') testoutput_var $1 "extforcing_qnet_sd"  "Qnet Std.Dev"  $2 $3; yy=$? ;;
287             'aSImn') testoutput_var $1 "seaice_area_min"   "SIce Area min"   $2 $3; yy=$? ;;
288             'aSImx') testoutput_var $1 "seaice_area_max"   "SIce Area max"   $2 $3; yy=$? ;;
289             'aSIav') testoutput_var $1 "seaice_area_mean"  "SIce Area mean"  $2 $3; yy=$? ;;
290             'aSIsd') testoutput_var $1 "seaice_area_sd"    "SIce Area StDv"  $2 $3; yy=$? ;;
291             'hSImn') testoutput_var $1 "seaice_heff_min"   "SIce Heff min"   $2 $3; yy=$? ;;
292             'hSImx') testoutput_var $1 "seaice_heff_max"   "SIce Hell max"   $2 $3; yy=$? ;;
293             'hSIav') testoutput_var $1 "seaice_heff_mean"  "SIce Hell mean"  $2 $3; yy=$? ;;
294             'hSIsd') testoutput_var $1 "seaice_heff_sd"    "SIce Hell StDv"  $2 $3; yy=$? ;;
295            'AthSiG') testoutput_var $1 "thSI_Ice_Area_G" "thSIc Area Global" $2 $3; yy=$? ;;
296            'AthSiS') testoutput_var $1 "thSI_Ice_Area_S" "thSIc Area South"  $2 $3; yy=$? ;;
297            'AthSiN') testoutput_var $1 "thSI_Ice_Area_N" "thSIc Area North"  $2 $3; yy=$? ;;
298            'HthSiG') testoutput_var $1 "thSI_IceH_ave_G" "thSIc H Global"    $2 $3; yy=$? ;;
299            'HthSiS') testoutput_var $1 "thSI_IceH_ave_S" "thSIc H South"     $2 $3; yy=$? ;;
300            'HthSiN') testoutput_var $1 "thSI_IceH_ave_N" "thSIc H North"     $2 $3; yy=$? ;;
301                *) yy=99; echo "WARNING: asking for var=$xx : not recognized !" 1>&2 ;;                *) yy=99; echo "WARNING: asking for var=$xx : not recognized !" 1>&2 ;;
302            esac            esac
303            if test $xx = $sVar            if test $xx = $sVar
# Line 312  testoutput_run() Line 314  testoutput_run()
314          else          else
315            echo $allargs            echo $allargs
316          fi          fi
317    # <-- same processing for adjoint & forward test
     else  
         testoutput_ad $1 $2 "precision_grdchk_result"  
     fi  
318  }  }
319    
320  genmakemodel()  genmakemodel()
# Line 911  else Line 910  else
910  fi  fi
911    
912  if test "x$TESTDIRS" = x ; then  if test "x$TESTDIRS" = x ; then
913      if test "x$ADM" = xt ; then      LIST=`scandirs results/$ref_outp`
         LIST=`scandirs results_ad/$ref_outp`  
     else  
         LIST=`scandirs results/$ref_outp`  
     fi  
914  else  else
915      #- expand group of experiments:      #- expand group of experiments:
916      LIST=" "      LIST=" "
# Line 967  if test "x$MPI" = xt ; then Line 962  if test "x$MPI" = xt ; then
962      OUTPUTFILE="STDOUT.0000"      OUTPUTFILE="STDOUT.0000"
963  fi  fi
964    
 #echo "OK"  
965  echo "OK (COMMAND= $COMMAND )"  echo "OK (COMMAND= $COMMAND )"
966    
967  # set the Default List of output variables to be checked:  # set the Default List of output variables to be checked:
# Line 981  if test "x$ADM" = x ; then Line 975  if test "x$ADM" = x ; then
975      ii=`echo $EMPTY_RESULTS | awk '{print NF}'`      ii=`echo $EMPTY_RESULTS | awk '{print NF}'`
976      EMPTY_RESULTS=$EMPTY_RESULTS`expr $LEN_CHECK_LIST - $ii | awk 'BEGIN{FS=":"}{for(i=1;i<=$1;i++){printf "  ."}}'`      EMPTY_RESULTS=$EMPTY_RESULTS`expr $LEN_CHECK_LIST - $ii | awk 'BEGIN{FS=":"}{for(i=1;i<=$1;i++){printf "  ."}}'`
977  else  else
978      DEF_CHECK_LIST='Cost Cost Grad'      DEF_CHECK_LIST='Grad Cost Grad'
979      EMPTY_RESULTS='.. ..'      EMPTY_RESULTS='.. ..'
980      LEN_CHECK_LIST=`echo $DEF_CHECK_LIST | sed 's/ [a-zA-Z0-9]*+/&mn &mx &av &sd/g' | awk '{print NF-1}'`      LEN_CHECK_LIST=`echo $DEF_CHECK_LIST | sed 's/ [a-zA-Z0-9]*+/&mn &mx &av &sd/g' | awk '{print NF-1}'`
981  fi  fi
# Line 1077  if test "x$ADM" = x ; then Line 1071  if test "x$ADM" = x ; then
1071  else  else
1072      echo "ADJOINT=true" >> $SUMMARY      echo "ADJOINT=true" >> $SUMMARY
1073      echo >> $SUMMARY      echo >> $SUMMARY
1074        if [ $MATCH_CRIT -lt 10 ] ;
1075        then line_0="default     "$MATCH_CRIT ;
1076        else line_0="default    "$MATCH_CRIT ; fi
1077        echo "$line_0" | tee -a $SUMMARY
1078      cat << EOF | tee -a $SUMMARY      cat << EOF | tee -a $SUMMARY
1079  G D M    C  G  G D M    C  G
1080  E p a R  o  r  E p a R  o  r
# Line 1108  for dir in $TESTDIRS ; do Line 1106  for dir in $TESTDIRS ; do
1106    
1107      #  Verify that the testdir exists and contains previous      #  Verify that the testdir exists and contains previous
1108      #  results in the correct location--or skip this directory!      #  results in the correct location--or skip this directory!
1109      fout=      fout=$dir"/results/"$ref_outp
     if test "x$ADM" = x ; then  
         fout=$dir"/results/"$ref_outp  
     else  
         fout=$dir"/results_ad/"$ref_outp  
     fi  
1110      if test ! -r $fout ; then      if test ! -r $fout ; then
1111          echo "can't read \"$fout\" -- skipping $dir"          echo "can't read \"$fout\" -- skipping $dir"
1112          continue          continue
# Line 1196  for dir in $TESTDIRS ; do Line 1189  for dir in $TESTDIRS ; do
1189      fi      fi
1190            
1191      echo      echo
1192      if test "x$ADM" = x ; then  # --> same processing for adjoint & forward test
1193          fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results`          fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results`
1194          echo          echo
1195          echo "$fres" | sed 's/ 99/ --/g' | sed 's/  > />/' | sed 's/  < /</' >> $SUMMARY          echo "$fres" | sed 's/ 99/ --/g' | sed 's/  > />/' | sed 's/  < /</' >> $SUMMARY
1196          touch $CDIR"/summary.txt"          touch $CDIR"/summary.txt"
1197          echo "fresults='$fres'" | sed 's/ 99/ --/g' >> $CDIR"/summary.txt"          echo "fresults='$fres'" | sed 's/ 99/ --/g' >> $CDIR"/summary.txt"
1198          echo "MACH='$MACH'" >> $CDIR"/summary.txt"          echo "MACH='$MACH'" >> $CDIR"/summary.txt"
1199          echo "UNAMEA='$UNAMEA'" >> $CDIR"/summary.txt"          echo "UNAMEA='$UNAMEA'" >> $CDIR"/summary.txt"
# Line 1222  for dir in $TESTDIRS ; do Line 1215  for dir in $TESTDIRS ; do
1215              fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results`              fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results`
1216              fres="$fres.$ex"              fres="$fres.$ex"
1217              echo              echo
1218              echo "$fres" | sed 's/ 99/ --/g' | sed 's/  > />/' | sed 's/  < /</' >> $SUMMARY              echo "$fres" | sed 's/ 99/ --/g' | sed 's/  > />/' | sed 's/  < /</' >> $SUMMARY
1219              touch $CDIR"/summary.txt"              touch $CDIR"/summary.txt"
1220              echo "fresults='$fres'" | sed 's/ 99/ --/g' >> $CDIR"/summary.txt"              echo "fresults='$fres'" | sed 's/ 99/ --/g' >> $CDIR"/summary.txt"
1221              echo "MACH='$MACH'" >> $CDIR"/summary.txt"              echo "MACH='$MACH'" >> $CDIR"/summary.txt"
1222              echo "UNAMEA='$UNAMEA'" >> $CDIR"/summary.txt"              echo "UNAMEA='$UNAMEA'" >> $CDIR"/summary.txt"
1223              echo "DATE='$DATE'" >> $CDIR"/summary.txt"              echo "DATE='$DATE'" >> $CDIR"/summary.txt"
1224              echo "tdir='$dir.$ex'" >> $CDIR"/summary.txt"              echo "tdir='$dir.$ex'" >> $CDIR"/summary.txt"
1225              if test "x$POSTCLEAN" = xt ; then              if test "x$POSTCLEAN" = xt ; then
1226                  run_clean $dir/tr_run.$ex                  run_clean $dir/tr_run.$ex
1227              fi              fi
1228          done          done
1229      else  # <-- same processing for adjoint & forward test
         fres=`printf '%s %s %s %s' ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N}`  
         fres=$fres"$results   $dir"  
         echo  
         echo "$fres" >> $SUMMARY  
         touch $CDIR"/summary.txt"  
         echo "fresults='$fres'" >> $CDIR"/summary.txt"  
         echo "MACH='$MACH'" >> $CDIR"/summary.txt"  
         echo "UNAMEA='$UNAMEA'" >> $CDIR"/summary.txt"  
         echo "DATE='$DATE'" >> $CDIR"/summary.txt"  
         echo "tdir='$dir'" >> $CDIR"/summary.txt"  
     fi  
1230      if test "x$ADM" = xt ; then      if test "x$ADM" = xt ; then
1231          grep -A3 'Seconds in section "ALL' $dir/$rundir/$OUTPUTFILE \          head -1 $dir/$builddir/taf_ad.log >> $CDIR"/summary.txt"
1232            grep -A3 'Seconds in section "ALL' $dir/$rundir/$OUTPUTFILE \
1233                             >> $CDIR"/summary.txt"                             >> $CDIR"/summary.txt"
1234      fi      fi
1235    
# Line 1295  fi Line 1278  fi
1278  rm -f tr_cmpnum.c tr_cmpnum  rm -f tr_cmpnum.c tr_cmpnum
1279    
1280  if test "x$CLEANUP" != xt ; then  if test "x$CLEANUP" != xt ; then
1281      cat $SUMMARY | sed 's/  \.  \.  \.  \.  \.  \.  \.  \.  \.  \.  \.  \.//'      cat $SUMMARY | sed 's/ \.  \.  \.  \.  \.  \.  \.  \.  \.  \.  \.  \. //'
1282      if test -e tr_out.txt ; then      if test -e tr_out.txt ; then
1283          mv tr_out.txt tr_out.txt.old          mv tr_out.txt tr_out.txt.old
1284      fi      fi
1285      cat $SUMMARY | sed '/^[YN] [YN] [YN] [YN]/ s/  \.//g' > tr_out.txt      cat $SUMMARY | sed '/^[YN] [YN] [YN] [YN]/ s/ \. //g' > tr_out.txt
1286  fi  fi
1287    
1288  if test "x$DELDIR" = xt ; then  if test "x$DELDIR" = xt ; then

Legend:
Removed from v.1.99  
changed lines
  Added in v.1.105

  ViewVC Help
Powered by ViewVC 1.1.22