--- MITgcm/verification/testreport 2012/09/04 19:27:52 1.180 +++ MITgcm/verification/testreport 2013/07/19 18:49:33 1.188 @@ -1,6 +1,6 @@ #! /usr/bin/env bash # -# $Header: /home/ubuntu/mnt/e9_copy/MITgcm/verification/testreport,v 1.180 2012/09/04 19:27:52 jmc Exp $ +# $Header: /home/ubuntu/mnt/e9_copy/MITgcm/verification/testreport,v 1.188 2013/07/19 18:49:33 jmc Exp $ # $Name: $ # @@ -322,9 +322,12 @@ 'AthSiG') testoutput_var $1 "thSI_Ice_Area_G" "thSIc Area Global" $2 $refoutp ; yy=$? ;; 'AthSiS') testoutput_var $1 "thSI_Ice_Area_S" "thSIc Area South" $2 $refoutp ; yy=$? ;; 'AthSiN') testoutput_var $1 "thSI_Ice_Area_N" "thSIc Area North" $2 $refoutp ; yy=$? ;; - 'HthSiG') testoutput_var $1 "thSI_IceH_ave_G" "thSIc H Global" $2 $refoutp ; yy=$? ;; - 'HthSiS') testoutput_var $1 "thSI_IceH_ave_S" "thSIc H South" $2 $refoutp ; yy=$? ;; - 'HthSiN') testoutput_var $1 "thSI_IceH_ave_N" "thSIc H North" $2 $refoutp ; yy=$? ;; + 'HthSiG') testoutput_var $1 "thSI_IceH_ave_G" "thSIc H Glob-ave" $2 $refoutp ; yy=$? ;; + 'HthSiS') testoutput_var $1 "thSI_IceH_ave_S" "thSIc H South-av" $2 $refoutp ; yy=$? ;; + 'HthSiN') testoutput_var $1 "thSI_IceH_ave_N" "thSIc H North-av" $2 $refoutp ; yy=$? ;; + 'HthMxS') testoutput_var $1 "thSI_IceH_max_S" "thSIc H South-max" $2 $refoutp ; yy=$? ;; + 'HthMxN') testoutput_var $1 "thSI_IceH_max_N" "thSIc H North-max" $2 $refoutp ; yy=$? ;; + 'StrmIc') testoutput_var $1 "STREAMICE_FP_ERR" "StreamIce Solver" $2 $refoutp ; yy=$? ;; *) yy=99; echo "WARNING: asking for var=$xx : not recognized !" 1>&2 ;; esac if test $xx = $sVar @@ -467,6 +470,7 @@ rm -f $RUNLOG *.txt STD* w2_tile_topology.????.log *diagnostics.log datetime rm -rf mnc_test_* rm -f *_MIT_CE_000.opt0000 costfunction*0000 + rm -f oad_cp.000.[0-9][0-9][0-9][0-9][0-9] echo successful exit 0 ) @@ -535,13 +539,17 @@ fi fi if test $KIND = 1 -a -f taf_ftl.log ; then - head -1 taf_ftl.log >> $CDIR"/summary.txt" + head -1 taf_ftl.log >> $CDIR"/summary.txt" fi if test $KIND = 2 -a -f taf_ad.log ; then - head -1 taf_ad.log >> $CDIR"/summary.txt" - nerr=`grep -c 'TAF *.* ERROR ' taf_ad.log` - nwar=`grep -c 'TAF RECOMPUTATION *.* WARNING ' taf_ad.log` - echo " TAF reports $nerr Errors and $nwar Recomputation Warnings" \ + head -1 taf_ad.log >> $CDIR"/summary.txt" + nerr=`grep -c 'TAF *.* ERROR ' taf_ad.log` + nwar=`grep -c 'TAF RECOMPUTATION *.* WARNING ' taf_ad.log` + if test -f taf_output ; then + n2er=`grep -c 'TAF *.* ERROR ' taf_output` + nerr=`expr $nerr + $n2er` + fi + echo " TAF reports $nerr Errors and $nwar Recomputation Warnings" \ >> $CDIR"/summary.txt" fi if test $mk_fail != 0 ; then return $mk_fail ; fi @@ -788,6 +796,23 @@ # output do not exist or is older than executable: rm -f $OUTPUTFILE $RUNLOG ; touch $RUNLOG if test -f run.log_tmp ; then cat run.log_tmp >> $RUNLOG ; fi + #- Divided Adjoint Run: + # get the number of additional runs (add_DIVA_runs) from file "run_ADM_DIVA" + if test $KIND = 2 -a -f run_ADM_DIVA ; then + adm_diva_nb=`sed -n '/^ *add_DIVA_runs\>.*=/p' run_ADM_DIVA | sed 's/ //g'` + echo " Divided Adjoint Run: $adm_diva_nb" >> $RUNLOG + eval "let $adm_diva_nb" + if [ $add_DIVA_runs -ge 1 ] ; then + rm -f costf* divided.ctrl snapshot* + echo -n "(add_DIVA_runs=$add_DIVA_runs) ... " + for ii in `seq 1 $add_DIVA_runs` ; do + ( eval $COMMAND ) >> $RUNLOG 2>&1 + echo " additional DIVA run # $ii : done" >> $RUNLOG + mv -f $OUTPUTFILE ${OUTPUTFILE}.diva_${ii} + done + fi + fi + #- special DIVA processing ends here ( eval $COMMAND ) >> $RUNLOG 2>&1 RETVAL=$? ENDVAL=`tail $OUTPUTFILE | grep -c 'PROGRAM MAIN: Execution ended Normally'` @@ -912,6 +937,13 @@ fi fi printf ' %s' $nm + if test $KIND = 2 ; then + #-- apppend taf repport summary: + tafrep=`grep -c '^ TAF reports ' $CDIR/summary.txt` + if test $tafrep = 1 ; then + grep '^ TAF reports ' $CDIR/summary.txt | awk '{printf " (e=%i, w=%i)",$3,$6}' + fi + fi printf '\n' } @@ -1376,11 +1408,20 @@ else line_0=`printf '%s %2i' 'default ' $MATCH_CRIT` if test $KIND = 1 ; then - echo "TANGLIN=true" >> $SUMMARY + #echo "TANGLIN=true" >> $SUMMARY + echo "TangLin generated by TAF" >> $SUMMARY + elif test $KIND = 3 ; then + echo "TangLin generated by OpenAD" >> $SUMMARY + elif test $KIND = 2 ; then + #echo "ADJOINT=true" >> $SUMMARY + echo "Adjoint generated by TAF" >> $SUMMARY + else + echo "Adjoint generated by OpenAD" >> $SUMMARY + fi + if test $KIND = 1 -o $KIND = 3 ; then line_1="G D M C T F" line_2="e p a R o L D" else - echo "ADJOINT=true" >> $SUMMARY line_1="G D M C A F" line_2="e p a R o d D" fi @@ -1504,14 +1545,13 @@ # Check whether there are "extra runs" for this testdir extra_runs= if test "x$NORUN" = xf ; then - ex_run_dirs=`( cd $dir ; echo $inputdir.* )` + ex_run_dirs=`( cd $dir ; ls -d $inputdir.* 2> /dev/null )` fi #echo "ex_run_dirs='$ex_run_dirs'" for exd in $ex_run_dirs ; do name=`echo $exd | sed -e "s/$inputdir\.//"` refExOut=`echo $ref_outp | sed "s/\./.${name}./"` outf="$dir/results/$refExOut" - #if test -f $outf -a -r $outf ; then if test -r $outf -o -r ${outf}.gz ; then if test "x$MULTI_THREAD" = "xt" ; then if test -r $dir"/"$exd"/eedata.mth" ; then @@ -1595,8 +1635,7 @@ linkdata $dir/$pfxdir.$ex $inputdir.$ex $inputdir runmodel $dir/$pfxdir.$ex && run=Y \ && results=`testoutput_run $dir $pfxdir.$ex $refExOut` - fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results` - fres="$fres.$ex" + fres=`formatresults $dir.$ex ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results` echo 1>&2 echo "$fres" | sed 's/ 99/ --/g' | sed 's/ > />/' | sed 's/ < /> $SUMMARY echo "fresults='$fres'" | sed 's/ 99/ --/g' >> $locDIR"/summary.txt"