/[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.23 by edhill, Sat Nov 29 01:45:25 2003 UTC revision 1.24 by edhill, Sun Nov 30 01:28:51 2003 UTC
# Line 22  usage() Line 22  usage()
22      echo "  (-b|-bash) STRING        preferred location of a \"bash\" or"      echo "  (-b|-bash) STRING        preferred location of a \"bash\" or"
23      echo "                             Bourne-compatible \"sh\" shell"      echo "                             Bourne-compatible \"sh\" shell"
24      echo "                             (DEF=\"\" for \"bash\")"      echo "                             (DEF=\"\" for \"bash\")"
25        echo "  (-adm|-ad)               perform an adjoint run"
26      echo "  (-command) STRING        command to run"      echo "  (-command) STRING        command to run"
27      echo "                             (DEF=\"make output.txt\")"      echo "                             (DEF=\"make output.txt\")"
28      echo "  (-m|-make) STRING        command to use for \"make\""      echo "  (-m|-make) STRING        command to use for \"make\""
# Line 148  dashnum() Line 149  dashnum()
149      done      done
150  }  }
151    
152    testoutput_ad()
153    {
154        grep $3 $1/results_ad/output.txt_adm | awk '{print NR " " $5}' > t05.txt
155        grep $3 $1/$2/output.txt_adm | awk '{print NR " " $5}' > t15.txt
156        grep $3 $1/results_ad/output.txt_adm | awk '{print NR " " $6}' > t06.txt
157        grep $3 $1/$2/output.txt_adm | awk '{print NR " " $6}' > t16.txt
158        join t05.txt t15.txt > t5.txt
159        join t06.txt t16.txt > t6.txt
160        echo "-1" >> t5.txt
161        echo "-1" >> t6.txt
162        digits_5=`./tmp_cmpnum < t5.txt`
163        digits_6=`./tmp_cmpnum < t6.txt`
164        dashnum $digits_5 $digits_6
165        rm -f t[01][56].txt t[56].txt
166    }
167    
168  testoutput()  testoutput()
169  {  {
170      # testoutput diretory subdir      # testoutput directory subdir
171      #      #
172      #  test output in "directory"      #  test output in "directory"
173        if test "x$ADM" = x ; then
174      if [ $debug -gt 0 ]; then          if [ $debug -gt 0 ]; then
175          echo testoutput: testoutput_for_prop $1 cg2d_init_res 1>&2              echo testoutput: testoutput_for_prop $1 cg2d_init_res 1>&2
176      fi          fi
177      testoutput_for_prop $1 "cg2d_init_res" "cg2d init. residual" $2; cg2dres=$?          testoutput_for_prop $1 "cg2d_init_res" "cg2d init. residual" $2; cg2dres=$?
178      if [ $debug -gt 0 ]; then          if [ $debug -gt 0 ]; then
179          echo testoutput: cg2dres=$cg2dres 1>&2              echo testoutput: cg2dres=$cg2dres 1>&2
180            fi
181            testoutput_for_prop $1 "dynstat_theta_min" "theta minimum" $2; tmin=$?
182            testoutput_for_prop $1 "dynstat_theta_max" "theta maximum" $2; tmax=$?
183            testoutput_for_prop $1 "dynstat_theta_mean" "theta mean" $2; tmean=$?
184            testoutput_for_prop $1 "dynstat_theta_sd" "theta s.d." $2; tsd=$?
185            testoutput_for_prop $1 "dynstat_salt_min" "salt minimum" $2; smin=$?
186            testoutput_for_prop $1 "dynstat_salt_max" "salt maximum" $2; smax=$?
187            testoutput_for_prop $1 "dynstat_salt_mean" "salt mean" $2; smean=$?
188            testoutput_for_prop $1 "dynstat_salt_sd" "salt s.d." $2; ssd=$?
189            testoutput_for_prop $1 "dynstat_uvel_min" "U minimum" $2; umin=$?
190            testoutput_for_prop $1 "dynstat_uvel_max" "U maximum" $2; umax=$?
191            testoutput_for_prop $1 "dynstat_uvel_mean" "U mean" $2; umean=$?
192            testoutput_for_prop $1 "dynstat_uvel_sd" "U s.d." $2; usd=$?
193            testoutput_for_prop $1 "dynstat_vvel_min" "V minimum" $2; vmin=$?
194            testoutput_for_prop $1 "dynstat_vvel_max" "V maximum" $2; vmax=$?
195            testoutput_for_prop $1 "dynstat_vvel_mean" "V mean" $2; vmean=$?
196            testoutput_for_prop $1 "dynstat_vvel_sd" "V s.d." $2; vsd=$?
197            dashnum $cg2dres $tmin $tmax $tmean $tsd $smin $smax $smean $ssd \
198                $umin $umax $umean $usd $vmin $vmax $vmean $vsd
199        else
200            testoutput_ad $1 $2 "precision_grdchk_result"
201      fi      fi
     testoutput_for_prop $1 "dynstat_theta_min" "theta minimum" $2; tmin=$?  
     testoutput_for_prop $1 "dynstat_theta_max" "theta maximum" $2; tmax=$?  
     testoutput_for_prop $1 "dynstat_theta_mean" "theta mean" $2; tmean=$?  
     testoutput_for_prop $1 "dynstat_theta_sd" "theta s.d." $2; tsd=$?  
     testoutput_for_prop $1 "dynstat_salt_min" "salt minimum" $2; smin=$?  
     testoutput_for_prop $1 "dynstat_salt_max" "salt maximum" $2; smax=$?  
     testoutput_for_prop $1 "dynstat_salt_mean" "salt mean" $2; smean=$?  
     testoutput_for_prop $1 "dynstat_salt_sd" "salt s.d." $2; ssd=$?  
     testoutput_for_prop $1 "dynstat_uvel_min" "U minimum" $2; umin=$?  
     testoutput_for_prop $1 "dynstat_uvel_max" "U maximum" $2; umax=$?  
     testoutput_for_prop $1 "dynstat_uvel_mean" "U mean" $2; umean=$?  
     testoutput_for_prop $1 "dynstat_uvel_sd" "U s.d." $2; usd=$?  
     testoutput_for_prop $1 "dynstat_vvel_min" "V minimum" $2; vmin=$?  
     testoutput_for_prop $1 "dynstat_vvel_max" "V maximum" $2; vmax=$?  
     testoutput_for_prop $1 "dynstat_vvel_mean" "V mean" $2; vmean=$?  
     testoutput_for_prop $1 "dynstat_vvel_sd" "V s.d." $2; vsd=$?  
       
     dashnum $cg2dres $tmin $tmax $tmean $tsd $smin $smax $smean $ssd \  
         $umin $umax $umean $usd $vmin $vmax $vmean $vsd  
202  }  }
203    
204  genmakemodel()  genmakemodel()
# Line 191  genmakemodel() Line 210  genmakemodel()
210          GENMAKE2="$BASH ../../../tools/genmake2"          GENMAKE2="$BASH ../../../tools/genmake2"
211          (          (
212              cd $1;              cd $1;
213              command="$GENMAKE2  -ds -m $MAKE --mods=../code"              command="$GENMAKE2  -ds -m $MAKE"
214                if test "x$ADM" = x ; then
215                    command="$command --mods=../code"
216                else
217                    command="$command --mods=../code_ad"
218                    command="$command -adof=../../../tools/adjoint_options/adjoint_staf"
219                fi
220              if test "x$OPTFILE" != xNONE ; then              if test "x$OPTFILE" != xNONE ; then
221                  command="$command --optfile=$OPTFILE"                  command="$command --optfile=$OPTFILE"
222              fi              fi
# Line 272  makemodel() Line 297  makemodel()
297          cd $1;          cd $1;
298          if test -r Makefile ; then          if test -r Makefile ; then
299              printf 'make ... ' 1>&2              printf 'make ... ' 1>&2
300              $MAKE >> make.log 2>&1              if test "x$ADM" = x ; then
301                    $MAKE >> make.log 2>&1
302                else
303                    $MAKE adall >> make.log 2>&1
304                fi
305              RETVAL=$?              RETVAL=$?
306              if test "x$RETVAL" != x0 ; then              if test "x$RETVAL" != x0 ; then
307                  tail make.log                  tail make.log
# Line 294  linkdata() Line 323  linkdata()
323      if test "x$1" = x1 ; then      if test "x$1" = x1 ; then
324          (          (
325              cd $2              cd $2
326              files=`( cd ../input ; ls -1 | grep -v CVS )`              if test "x$ADM" = x ; then
327              for i in $files ; do                  files=`( cd ../input ; ls -1 | grep -v CVS )`
328                  if test ! -d "../input/"$i ; then                  for i in $files ; do
329                      ln -sf "../input/"$i $i                      if test ! -d "../input/"$i ; then
330                  fi                          ln -sf "../input/"$i $i
331              done                      fi
332                    done
333                else
334                    files=`( cd ../input ; ls -1 *.bin | grep -v CVS )`
335                    for i in $files ; do
336                        if test ! -d "../input/"$i ; then
337                            ln -sf "../input/"$i $i
338                        fi
339                    done
340                    files=`( cd ../input_ad ; ls -1 | grep -v CVS )`
341                    for i in $files ; do
342                        if test ! -d "../input_ad/"$i ; then
343                            ln -sf "../input_ad/"$i $i
344                        fi
345                    done
346                fi
347          )          )
348      fi      fi
349  }  }
# Line 308  runmodel() Line 352  runmodel()
352  {  {
353      # runmodel directory      # runmodel directory
354      #      #
355      #  runs "$COMMAND" in "directory"      #  runs "$COMMAND in "directory"
356      #  (where "$COMMAND" is relative to "directory")      #  (where "$COMMAND" is relative to "directory")
357      (      (
358          cd $1          cd $1
# Line 318  runmodel() Line 362  runmodel()
362          RETVAL=$?          RETVAL=$?
363          if test "x$RETVAL" = x0 ; then          if test "x$RETVAL" = x0 ; then
364              echo successful 1>&2              echo successful 1>&2
365              cp output.txt $CDIR"/output.txt"              if test "x$ADM" = x ; then
366                    cp output.txt $CDIR"/output.txt"
367                else
368                    cp output.txt_adm $CDIR"/output.txt_adm"
369                fi
370              return 0              return 0
371          else          else
372              tail run.log              tail run.log
# Line 456  TESTDIRS= Line 504  TESTDIRS=
504  MPACKDIR="../tools/mpack-1.6"  MPACKDIR="../tools/mpack-1.6"
505  HAVE_MPACK=  HAVE_MPACK=
506  MPACK="$MPACKDIR/mpack"  MPACK="$MPACKDIR/mpack"
507  COMMAND="make output.txt"  COMMAND=
508  MAKE=make  MAKE=make
509  MPI=f  MPI=f
510    
511    ADM=
512    
513  echo -n "parsing options...  "  echo -n "parsing options...  "
514    
515  ac_prev=  ac_prev=
# Line 523  for ac_option ; do Line 573  for ac_option ; do
573    
574          -mpi) MPI=t ;;          -mpi) MPI=t ;;
575    
576            -adm | -ad) ADM=t ;;
577    
578          -ieee) IEEE=true ;;          -ieee) IEEE=true ;;
579          -noieee) IEEE= ;;          -noieee) IEEE= ;;
580    
# Line 558  if test "x$OPTFILE" = xNONE -a "x$MITGCM Line 610  if test "x$OPTFILE" = xNONE -a "x$MITGCM
610      OPTFILE=$MITGCM_OF      OPTFILE=$MITGCM_OF
611  fi  fi
612    
613    if test "x$ADM" = xt -a "x$COMMAND" = x ; then
614        COMMAND="./mitgcmuv_ad > output.txt_adm 2>&1"
615    fi
616    
617    if test "x$COMMAND" = x ; then
618        COMMAND="make output.txt"
619    fi
620    
621  echo "OK"  echo "OK"
622    
623  #  create the FORTRAN comparison code  #  create the FORTRAN comparison code
# Line 615  else Line 675  else
675  fi  fi
676  echo  echo
677  echo >> $SUMMARY  echo >> $SUMMARY
678  cat << EOF | tee -a $SUMMARY  if test "x$ADM" = x ; then
679        cat << EOF | tee -a $SUMMARY
680                  T           S           U           V                  T           S           U           V
681  G D M    c        m  s        m  s        m  s        m  s  G D M    c        m  s        m  s        m  s        m  s
682  E p a R  g  m  m  e  .  m  m  e  .  m  m  e  .  m  m  e  .  E p a R  g  m  m  e  .  m  m  e  .  m  m  e  .  m  m  e  .
# Line 623  N n k u  2  i  a  a  d  i  a  a  d  i  a Line 684  N n k u  2  i  a  a  d  i  a  a  d  i  a
684  2 d e n  d  n  x  n  .  n  x  n  .  n  x  n  .  n  x  n  .  2 d e n  d  n  x  n  .  n  x  n  .  n  x  n  .  n  x  n  .
685    
686  EOF  EOF
687    else
688        echo "ADJOINT=true" >> $SUMMARY
689        echo >> $SUMMARY
690        cat << EOF | tee -a $SUMMARY
691    G D M    C  G
692    E p a R  o  r
693    N n k u  s  a
694    2 d e n  t  d
695    
696    EOF
697    fi
698    
699  #  ...and each test directory...  #  ...and each test directory...
700  for dir in $TESTDIRS ; do  for dir in $TESTDIRS ; do
# Line 640  for dir in $TESTDIRS ; do Line 712  for dir in $TESTDIRS ; do
712    
713      #  Verify that the testdir exists and contains previous      #  Verify that the testdir exists and contains previous
714      #  results in the correct location--or skip this directory!      #  results in the correct location--or skip this directory!
715      if test ! -r $dir"/results/output.txt" ; then      fout=
716          echo "can't read \"$dir/results/output.txt\" -- skipping $dir"      if test "x$ADM" = x ; then
717            fout=$dir"/results/output.txt"
718        else
719            fout=$dir"/results_ad/output.txt_adm"
720        fi
721        if test ! -r $fout ; then
722            echo "can't read \"$fout\" -- skipping $dir"
723          continue          continue
724      fi      fi
725    
# Line 662  for dir in $TESTDIRS ; do Line 740  for dir in $TESTDIRS ; do
740          linkdata $use_seperate_build $dir/$rundir          linkdata $use_seperate_build $dir/$rundir
741      fi      fi
742            
743      CODE_DIR=$dir/code      if test "x$ADM" = x ; then
744            CODE_DIR=$dir/code
745        else
746            CODE_DIR=$dir/code_ad
747        fi
748      BUILD_DIR=$dir/$builddir      BUILD_DIR=$dir/$builddir
749      MPI_FILES="CPP_EEOPTIONS.h_mpi SIZE.h_mpi"      MPI_FILES="CPP_EEOPTIONS.h_mpi SIZE.h_mpi"
750      NOMPI_FILES="CPP_EEOPTIONS.h_nompi SIZE.h_nompi"      NOMPI_FILES="CPP_EEOPTIONS.h_nompi SIZE.h_nompi"
# Line 720  for dir in $TESTDIRS ; do Line 802  for dir in $TESTDIRS ; do
802      fi      fi
803            
804      echo      echo
805      fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results`      if test "x$ADM" = x ; then
806            fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results`
807        else
808            fres=`printf '%s %s %s %s' ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N}`
809            fres=$fres"$results   $dir"
810        fi
811      echo      echo
812      echo "$fres" >> $SUMMARY      echo "$fres" >> $SUMMARY
813      echo "fresults='$fres'" > $CDIR"/summary.txt"      echo "fresults='$fres'" > $CDIR"/summary.txt"

Legend:
Removed from v.1.23  
changed lines
  Added in v.1.24

  ViewVC Help
Powered by ViewVC 1.1.22