/[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.33 by adcroft, Thu Dec 18 15:12:34 2003 UTC revision 1.34 by edhill, Fri Mar 12 02:44:34 2004 UTC
# Line 44  usage() Line 44  usage()
44  #  build the mpack utility  #  build the mpack utility
45  build_mpack()  build_mpack()
46  {  {
47      echo -n "building the mpack utility...  "      printf "building the mpack utility...  "
48      if test ! -x "$MPACKDIR/mpack" ; then      if test ! -x "$MPACKDIR/mpack" ; then
49          if test ! -d $MPACKDIR ; then          if test ! -d $MPACKDIR ; then
50              echo              echo
# Line 54  build_mpack() Line 54  build_mpack()
54              echo              echo
55              HAVE_MPACK=f              HAVE_MPACK=f
56          fi          fi
57          echo -n "building mpack...  "          printf "building mpack...  "
58          if test "x$CC" = x ; then          if test "x$CC" = x ; then
59              export CC=cc              export CC=cc
60          fi          fi
# Line 77  build_mpack() Line 77  build_mpack()
77    
78  testoutput_for_prop()  testoutput_for_prop()
79  {  {
80      # testoutput_for_prop dir s1 label subdir      # testoutput_for_prop dir s1 label subdir extension
81      #      #
82      #  compares files in $dir/$subdir/output.txt and $dir/results/output.txt      #  compares files in $dir/$subdir/output.txt and $dir/results/output.txt
83      #  using search strings s1 and text label      #  using search strings s1 and text label
# Line 99  testoutput_for_prop() Line 99  testoutput_for_prop()
99          return 99          return 99
100      fi      fi
101      if [ $debug -gt 0 ]; then      if [ $debug -gt 0 ]; then
102          echo testoutput_for_prop: grep "$2" $1/results/output.txt 1>&2          echo testoutput_for_prop: grep "$2" $1/results/output.txt$5 1>&2
103      fi      fi
104      grep "$2" $1/results/output.txt | sed 's/.*=//' | cat -n > tmp2.txt      grep "$2" $1/results/output.txt$5 | sed 's/.*=//' | cat -n > tmp2.txt
105      lncnt=`wc -l tmp2.txt | awk '{print $1}' `      lncnt=`wc -l tmp2.txt | awk '{print $1}' `
106      if [ $lncnt -lt 3 ]; then      if [ $lncnt -lt 3 ]; then
107          if [ $verbose -gt 0 ]; then          if [ $verbose -gt 0 ]; then
# Line 171  testoutput_ad() Line 171  testoutput_ad()
171    
172  testoutput()  testoutput()
173  {  {
174      # testoutput directory subdir      # testoutput directory subdir extension
175      #      #
176      #  test output in "directory"      #  test output in "directory"
177      if test "x$ADM" = x ; then      if test "x$ADM" = x ; then
178          if [ $debug -gt 0 ]; then          if [ $debug -gt 0 ]; then
179              echo testoutput: testoutput_for_prop $1 cg2d_init_res 1>&2              echo testoutput: testoutput_for_prop $1 cg2d_init_res 1>&2
180          fi          fi
181          testoutput_for_prop $1 "cg2d_init_res" "cg2d init. residual" $2; cg2dres=$?          testoutput_for_prop $1 "cg2d_init_res" "cg2d init. residual" $2 $3; cg2dres=$?
182          if [ $debug -gt 0 ]; then          if [ $debug -gt 0 ]; then
183              echo testoutput: cg2dres=$cg2dres 1>&2              echo testoutput: cg2dres=$cg2dres 1>&2
184          fi          fi
185          testoutput_for_prop $1 "dynstat_theta_min" "theta minimum" $2; tmin=$?          testoutput_for_prop $1 "dynstat_theta_min" "theta minimum" $2 $3; tmin=$?
186          testoutput_for_prop $1 "dynstat_theta_max" "theta maximum" $2; tmax=$?          testoutput_for_prop $1 "dynstat_theta_max" "theta maximum" $2 $3; tmax=$?
187          testoutput_for_prop $1 "dynstat_theta_mean" "theta mean" $2; tmean=$?          testoutput_for_prop $1 "dynstat_theta_mean" "theta mean" $2 $3; tmean=$?
188          testoutput_for_prop $1 "dynstat_theta_sd" "theta s.d." $2; tsd=$?          testoutput_for_prop $1 "dynstat_theta_sd" "theta s.d." $2 $3; tsd=$?
189          testoutput_for_prop $1 "dynstat_salt_min" "salt minimum" $2; smin=$?          testoutput_for_prop $1 "dynstat_salt_min" "salt minimum" $2 $3; smin=$?
190          testoutput_for_prop $1 "dynstat_salt_max" "salt maximum" $2; smax=$?          testoutput_for_prop $1 "dynstat_salt_max" "salt maximum" $2 $3; smax=$?
191          testoutput_for_prop $1 "dynstat_salt_mean" "salt mean" $2; smean=$?          testoutput_for_prop $1 "dynstat_salt_mean" "salt mean" $2 $3; smean=$?
192          testoutput_for_prop $1 "dynstat_salt_sd" "salt s.d." $2; ssd=$?          testoutput_for_prop $1 "dynstat_salt_sd" "salt s.d." $2 $3; ssd=$?
193          testoutput_for_prop $1 "dynstat_uvel_min" "U minimum" $2; umin=$?          testoutput_for_prop $1 "dynstat_uvel_min" "U minimum" $2 $3; umin=$?
194          testoutput_for_prop $1 "dynstat_uvel_max" "U maximum" $2; umax=$?          testoutput_for_prop $1 "dynstat_uvel_max" "U maximum" $2 $3; umax=$?
195          testoutput_for_prop $1 "dynstat_uvel_mean" "U mean" $2; umean=$?          testoutput_for_prop $1 "dynstat_uvel_mean" "U mean" $2 $3; umean=$?
196          testoutput_for_prop $1 "dynstat_uvel_sd" "U s.d." $2; usd=$?          testoutput_for_prop $1 "dynstat_uvel_sd" "U s.d." $2 $3; usd=$?
197          testoutput_for_prop $1 "dynstat_vvel_min" "V minimum" $2; vmin=$?          testoutput_for_prop $1 "dynstat_vvel_min" "V minimum" $2 $3; vmin=$?
198          testoutput_for_prop $1 "dynstat_vvel_max" "V maximum" $2; vmax=$?          testoutput_for_prop $1 "dynstat_vvel_max" "V maximum" $2 $3; vmax=$?
199          testoutput_for_prop $1 "dynstat_vvel_mean" "V mean" $2; vmean=$?          testoutput_for_prop $1 "dynstat_vvel_mean" "V mean" $2 $3; vmean=$?
200          testoutput_for_prop $1 "dynstat_vvel_sd" "V s.d." $2; vsd=$?          testoutput_for_prop $1 "dynstat_vvel_sd" "V s.d." $2 $3; vsd=$?
201          dashnum $cg2dres $tmin $tmax $tmean $tsd $smin $smax $smean $ssd \          dashnum $cg2dres $tmin $tmax $tmean $tsd $smin $smax $smean $ssd \
202              $umin $umax $umean $usd $vmin $vmax $vmean $vsd              $umin $umax $umean $usd $vmin $vmax $vmean $vsd
203      else      else
# Line 211  genmakemodel() Line 211  genmakemodel()
211      if test "x$NOGENMAKE" = xt ; then      if test "x$NOGENMAKE" = xt ; then
212          echo "genmake skipped!"          echo "genmake skipped!"
213      else      else
214          GENMAKE2="$BASH ../../../tools/genmake2"          if test "x$BASH" = x ; then
215                GENMAKE2="../../../tools/genmake2"
216            else
217                GENMAKE2="$BASH ../../../tools/genmake2 -bash $BASH"
218            fi
219          (          (
220              cd $1;              cd $1;
221              command="$GENMAKE2  -ds -m $MAKE"              command="$GENMAKE2  -ds -m $MAKE"
# Line 432  createcodelet() Line 436  createcodelet()
436  {  {
437      # create codelet for comparing model output      # create codelet for comparing model output
438    
439      echo -n "creating the comparison code...  "      printf "creating the comparison code...  "
440      cat > tmp_cmpnum.c <<EOF      cat > tmp_cmpnum.c <<EOF
441  #include <stdio.h>  #include <stdio.h>
442  #include <math.h>  #include <math.h>
# Line 563  MPI=f Line 567  MPI=f
567    
568  ADM=  ADM=
569    
570  echo -n "parsing options...  "  printf "parsing options...  "
571    
572  ac_prev=  ac_prev=
573  for ac_option ; do  for ac_option ; do
# Line 701  if test "x$RETVAL" != x0 ; then Line 705  if test "x$RETVAL" != x0 ; then
705      exit 1      exit 1
706  fi  fi
707  SUMMARY="$DRESULTS/summary.txt"  SUMMARY="$DRESULTS/summary.txt"
708  echo -n "Start time:  " >> $SUMMARY  printf "Start time:  " >> $SUMMARY
709  start_date=`date`  start_date=`date`
710  echo $start_date > $SUMMARY  echo $start_date > $SUMMARY
711    
# Line 790  for dir in $TESTDIRS ; do Line 794  for dir in $TESTDIRS ; do
794          linkdata $use_seperate_build $dir/$rundir          linkdata $use_seperate_build $dir/$rundir
795      fi      fi
796            
797        #  Check whether there are "extra runs" for this testdir
798        extra_runs=
799        if test "x$ADM" = x -a "x$use_seperate_build" = x1 ; then
800            ex_run_dirs=`( cd $dir ; echo input.* )`
801            echo "ex_run_dirs='$ex_run_dirs'"
802            for exd in $ex_run_dirs ; do
803                name=`echo $exd | sed -e 's/input.//g'`
804                outf="$dir/results/output.txt.$name"
805                if test -f $outf -a -r $outf ; then
806                    extra_runs="$extra_runs $name"
807                fi
808            done
809        fi
810    
811      if test "x$ADM" = x ; then      if test "x$ADM" = x ; then
812          code_dir=code          code_dir=code
813          CODE_DIR=$dir/code          CODE_DIR=$dir/code
# Line 832  for dir in $TESTDIRS ; do Line 850  for dir in $TESTDIRS ; do
850      echo      echo
851      if test "x$ADM" = x ; then      if test "x$ADM" = x ; then
852          fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results`          fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results`
853            echo
854            echo "$fres" >> $SUMMARY
855            echo "fresults='$fres'" > $CDIR"/summary.txt"
856            echo "MACH='$MACH'" >> $CDIR"/summary.txt"
857            echo "UNAMEA='$UNAMEA'" >> $CDIR"/summary.txt"
858            echo "DATE='$DATE'" >> $CDIR"/summary.txt"
859            echo "tdir='$dir'" >> $CDIR"/summary.txt"
860    
861            for ex in $extra_runs ; do
862                test -e "$dir/tr_run" && rm -rf "$dir/tr_run"
863                mkdir "$dir/tr_run"
864                ( cd "$dir/input" ; links=`ls -1 | grep -v CVS` )
865                (
866                    cd "$dir/tr_run"
867                    for i in $links; do
868                        ln -s ../input/$i $i
869                    done
870                )
871                ( cd "$dir/input.$ex" ; links=`ls -1 | grep -v CVS` )
872                (
873                    cd "$dir/tr_run"
874                    for i in $links; do
875                        test -e $i  &&  rm -f $i
876                        ln -s ../input.$ex/$i $i
877                    done
878                    ln -s ../$builddir/Makefile Makefile
879                    ln -s ../$builddir/mitgcmuv mitgcmuv
880                )
881                runmodel $dir/tr_run && run=Y \
882                    && results=`testoutput $dir $rundir "."$ex`
883                fres=`printf '%s %s %s %s' ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N}`
884                fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results`
885                fres="$fres.$ex"
886                echo
887                echo "$fres" >> $SUMMARY
888                echo "fresults='$fres'" > $CDIR"/summary.txt"
889                echo "MACH='$MACH'" >> $CDIR"/summary.txt"
890                echo "UNAMEA='$UNAMEA'" >> $CDIR"/summary.txt"
891                echo "DATE='$DATE'" >> $CDIR"/summary.txt"
892                echo "tdir='$dir'" >> $CDIR"/summary.txt"
893            done
894      else      else
895          fres=`printf '%s %s %s %s' ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N}`          fres=`printf '%s %s %s %s' ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N}`
896          fres=$fres"$results   $dir"          fres=$fres"$results   $dir"
897            echo
898            echo "$fres" >> $SUMMARY
899            echo "fresults='$fres'" > $CDIR"/summary.txt"
900            echo "MACH='$MACH'" >> $CDIR"/summary.txt"
901            echo "UNAMEA='$UNAMEA'" >> $CDIR"/summary.txt"
902            echo "DATE='$DATE'" >> $CDIR"/summary.txt"
903            echo "tdir='$dir'" >> $CDIR"/summary.txt"
904      fi      fi
     echo  
     echo "$fres" >> $SUMMARY  
     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"  
905            
906      echo "-------------------------------------------------------------------------------"      echo "-------------------------------------------------------------------------------"
907            
908  done  done
909    
910  echo -n "Start time:  " >> $SUMMARY  printf "Start time:  " >> $SUMMARY
911  echo $start_date >> $SUMMARY  echo $start_date >> $SUMMARY
912  echo -n "End time:    " >> $SUMMARY  printf "End time:    " >> $SUMMARY
913  date >> $SUMMARY  date >> $SUMMARY
914    
915  #  If addresses were supplied and mpack built successfully, then try  #  If addresses were supplied and mpack built successfully, then try

Legend:
Removed from v.1.33  
changed lines
  Added in v.1.34

  ViewVC Help
Powered by ViewVC 1.1.22