/[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.20 by edhill, Wed Nov 26 15:04:42 2003 UTC revision 1.22 by edhill, Sat Nov 29 00:58:43 2003 UTC
# Line 120  testoutput_for_prop() Line 120  testoutput_for_prop()
120      if [ $debug -gt 0 ]; then      if [ $debug -gt 0 ]; then
121          echo testoutput_for_prop: compare_lines 1>&2          echo testoutput_for_prop: compare_lines 1>&2
122      fi      fi
123      compare_lines      if [ $verbose -gt 1 ]; then
124      digits_of_similarity=$?          cat tmp3.txt 1>&2
125        fi
126        echo "-1" >> tmp3.txt
127        digits_of_similarity=`./tmp_cmpnum < tmp3.txt`
128      if [ $digits_of_similarity -eq 99 ]; then      if [ $digits_of_similarity -eq 99 ]; then
129          if [ $verbose -gt 0 ]; then          if [ $verbose -gt 0 ]; then
130              echo testoutput_for_prop: No comparison was available for \"$2\" 1>&2              echo testoutput_for_prop: No comparison was available for \"$2\" 1>&2
# Line 198  genmakemodel() Line 201  genmakemodel()
201              command="$GENMAKE2  -ds -m $MAKE --mods=../code"              command="$GENMAKE2  -ds -m $MAKE --mods=../code"
202              if test "x$OPTFILE" != xNONE ; then              if test "x$OPTFILE" != xNONE ; then
203                  command="$command --optfile=$OPTFILE"                  command="$command --optfile=$OPTFILE"
                 # echo "  command=\"$command\""  
204              fi              fi
205              if test "x$IEEE" != x ; then              if test "x$IEEE" != x ; then
206                  command="$command -ieee"                  command="$command -ieee"
207              fi              fi
             # echo "command: \"$command\""  
208              printf 'genmake ... ' 1>&2              printf 'genmake ... ' 1>&2
209              $command > make.log 2>&1              $command > make.log 2>&1
210              RETVAL=$?              RETVAL=$?
211              for i in genmake_state genmake_optfile genmake_local Makefile ; do              cp Makefile $CDIR
                 if test -r $i ; then  
                     cp $i $CDIR  
                 fi  
             done  
212              if test "x$RETVAL" != x0 ; then              if test "x$RETVAL" != x0 ; then
213                  tail make.log                  tail make.log
214                  echo "genmakemodel: genmake failed" 1>&2                  echo "genmakemodel: genmake failed" 1>&2
215                  cp make.log $CDIR                  cp genmake_* make.log $CDIR
216                  return 1                  return 1
217              else              else
218                  echo "successful" 1>&2                  echo "successful" 1>&2
# Line 344  createcodelet() Line 341  createcodelet()
341      # create codelet for comparing model output      # create codelet for comparing model output
342    
343      echo -n "creating the comparison code...  "      echo -n "creating the comparison code...  "
344      cat > tmp_cmpnum.f <<EOFA      cat > tmp_cmpnum.c <<EOF
345        program cmpnum  #include <stdio.h>
346        implicit none  #include <math.h>
347        real*8 a,b,diff  int main( int argc, char** argv )  {
348        integer linnum,best    int linnum,best;
349        best=-16    double a,b,diff;
350    99  read(*,*,end=70,err=60) linnum,a,b    best = -16;
351        diff=0.5*(abs(a)+abs(b))    while( 1 )  {
352  c     print *,a,b,diff,abs(a-b)/diff      scanf("%d", &linnum);
353        if (diff.gt.1.e-12) then      if (linnum == -1)  break;
354          diff=abs(a-b)/diff      scanf("%lf", &a);  scanf("%lf", &b);
355          if (diff.gt.0.) then      diff = 0.5*(fabs(a)+fabs(b));
356  c         print *,int(log10(diff)),diff      if (diff > 1.e-12) {
357            linnum=int(log10(diff))        diff=fabs(a-b)/diff;
358            best=max(best,linnum)        if (diff > 0.0) {
359          endif          linnum = (int)log10(diff);
360        else          best = (best > linnum) ? best : linnum;
361          if (best.eq.-16.and.diff.ne.0.) best=-22        }
362        endif        else {
363        goto 99          if (best == -16 && diff != 0)  best = -22;
364    60  stop 'cmpnum: An error occured reading a,b'        }
365    70  print *,-best      }
366        end    }
367  EOFA    printf("%d\n", -best);
368      return 0;
369    }
370    EOF
371        cc -o tmp_cmpnum tmp_cmpnum.c -lm
372    
373      f77 tmp_cmpnum.f      if [ -x ./tmp_cmpnum ]; then
     if [ -x ./a.out ]; then  
374          echo "OK"          echo "OK"
375          return 0          return 0
376      else      else
377          echo          echo
378          echo "createcodelet: failed to compile codelet"          echo "ERROR: failed to compile comparison code"
379          exit 1          exit 1
380      fi      fi
381  }  }
# Line 435  scandirs() Line 435  scandirs()
435    
436    
437  ###############################################################################  ###############################################################################
 ###############################################################################  
 ###############################################################################  
438    
439    
440  #  Default properties  #  Default properties
# Line 596  SUMMARY="$DRESULTS/summary.txt" Line 594  SUMMARY="$DRESULTS/summary.txt"
594  echo -n "Start time:  " >> $SUMMARY  echo -n "Start time:  " >> $SUMMARY
595  start_date=`date`  start_date=`date`
596  echo $start_date > $SUMMARY  echo $start_date > $SUMMARY
 cat << EOF | tee -a $SUMMARY  
                 T           S           U           V  
 G D M    c        m  s        m  s        m  s        m  s  
 E p a R  g  m  m  e  .  m  m  e  .  m  m  e  .  m  m  e  .  
 N n k u  2  i  a  a  d  i  a  a  d  i  a  a  d  i  a  a  d  
 2 d e n  d  n  x  n  .  n  x  n  .  n  x  n  .  n  x  n  .  
   
 EOF  
   
 NDIR=0  
597    
598  of_path=  of_path=
599  if test "x$OPTFILE" != xNONE ; then  if test "x$OPTFILE" != xNONE ; then
# Line 619  if test "x$OPTFILE" != xNONE ; then Line 607  if test "x$OPTFILE" != xNONE ; then
607          fi          fi
608          file=${OPTFILE##*/}          file=${OPTFILE##*/}
609          OPTFILE=$of_path/$file          OPTFILE=$of_path/$file
610            cp $OPTFILE $DRESULTS
611            echo >> $SUMMARY
612            echo "  OPTFILE=$OPTFILE" >> $SUMMARY
613      else      else
614          echo          echo | tee $SUMMARY
615          echo "WARNING: can't read OPTFILE=\"$OPTFILE\" but will try to use it..."          echo "ERROR: can't read OPTFILE=\"$OPTFILE\"" | tee $SUMMARY
616            exit 1
617      fi      fi
618    else
619        echo >> $SUMMARY
620        echo "No \"OPTFILE\" was explicitly specified by testreport," >> $SUMMARY
621        echo "   so the genmake default will be used." >> $SUMMARY
622  fi  fi
623  echo  echo
 echo "OPTFILE=$OPTFILE" >> $SUMMARY  
624  echo >> $SUMMARY  echo >> $SUMMARY
625    cat << EOF | tee -a $SUMMARY
626                    T           S           U           V
627    G D M    c        m  s        m  s        m  s        m  s
628    E p a R  g  m  m  e  .  m  m  e  .  m  m  e  .  m  m  e  .
629    N n k u  2  i  a  a  d  i  a  a  d  i  a  a  d  i  a  a  d
630    2 d e n  d  n  x  n  .  n  x  n  .  n  x  n  .  n  x  n  .
631    
632    EOF
633    
634  #  ...and each test directory...  #  ...and each test directory...
635  for dir in $TESTDIRS ; do  for dir in $TESTDIRS ; do
# Line 724  for dir in $TESTDIRS ; do Line 727  for dir in $TESTDIRS ; do
727      fi      fi
728            
729      echo      echo
730      formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} \      fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results`
         ${run:-N} $results  
731      echo      echo
732      formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} \      echo "$fres" >> $SUMMARY
733          ${run:-N} $results >> $SUMMARY      echo "fresults='$fres'" > $CDIR"/summary.txt"
     echo "fresults='" > $CDIR"/summary.txt"  
     formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} \  
         ${run:-N} $results >> $CDIR"/summary.txt"  
     echo "'" >> $CDIR"/summary.txt"  
734      echo "MACH='$MACH'" >> $CDIR"/summary.txt"      echo "MACH='$MACH'" >> $CDIR"/summary.txt"
735      echo "UNAMEA='$UNAMEA'" >> $CDIR"/summary.txt"      echo "UNAMEA='$UNAMEA'" >> $CDIR"/summary.txt"
736      echo "DATE='$DATE'" >> $CDIR"/summary.txt"      echo "DATE='$DATE'" >> $CDIR"/summary.txt"
# Line 740  for dir in $TESTDIRS ; do Line 738  for dir in $TESTDIRS ; do
738            
739      echo "-------------------------------------------------------------------------------"      echo "-------------------------------------------------------------------------------"
740            
     NDIR=$(( $NDIR + 1 ))  
       
741  done  done
742    
743  echo -n "Start time:  " >> $SUMMARY  echo -n "Start time:  " >> $SUMMARY
# Line 776  else Line 772  else
772      fi      fi
773  fi  fi
774    
775  rm tmp_cmpnum.f a.out  # rm -f tmp_cmpnum.f a.out
776    rm -f tmp_cmpnum.c tmp_cmpnum
777    
778  if test "x$CLEANUP" != xt ; then  if test "x$CLEANUP" != xt ; then
779      cat $SUMMARY      cat $SUMMARY

Legend:
Removed from v.1.20  
changed lines
  Added in v.1.22

  ViewVC Help
Powered by ViewVC 1.1.22