/[MITgcm]/MITgcm/verification/testscript
ViewVC logotype

Diff of /MITgcm/verification/testscript

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

revision 1.1 by adcroft, Fri Mar 9 17:56:37 2001 UTC revision 1.5 by adcroft, Tue Jun 5 14:35:46 2001 UTC
# Line 1  Line 1 
1  #!/bin/csh  #!/bin/csh -f
2    
3  # Run this script from the verification directory  # Run this script from the verification directory
4  # It will automatically configure, compile, run and verify all experiments  # It will automatically configure, compile, run and verify all experiments
# Line 8  Line 8 
8  # This is the number of least-significant digits allows to be  # This is the number of least-significant digits allows to be
9  # in error before the test is classified as a "fail".  # in error before the test is classified as a "fail".
10    
11    set on_error_die
12  set passaccuracy=7  set passaccuracy=7
13  printf '%s\t%s\t%s\t%s\t%s\t%s\t%s\n' " " Make " " " " Exact "# of" " " > summary.txt  set SKIP=( )
14  printf '%s\t%s\t%s\t%s\t%s\t%s\t%s\n' Config Depend Compile Execute Match Digits experiment >> summary.txt  printf '%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n' " " Make " " " " Exact "# of" " " " " > summary.txt
15    printf '%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n' Config Depend Compile Execute Match Digits Status Experiment >> summary.txt
16    
17  # Pass any arguments  # Pass any arguments
18  foreach arg ($argv)  foreach arg ($argv)
# Line 30  foreach arg ($argv) Line 32  foreach arg ($argv)
32     end     end
33     rm -f summary.txt     rm -f summary.txt
34     exit 0     exit 0
35       breaksw
36      case -nodie:
37       unset on_error_die
38       breaksw
39      case -skip=*:
40       set SKIP = ( $SKIP `echo $arg | sed 's/-skip=//' | sed 's/,/ /g' `)
41       breaksw
42    default:    default:
43     echo Unknown argument given to $0     echo Unknown argument given to $0
44     exit 1     exit 1
# Line 38  end Line 47  end
47    
48  foreach dr ([a-zA-Z01-9]*)  foreach dr ([a-zA-Z01-9]*)
49   if (! -d $dr/input ) continue   if (! -d $dr/input ) continue
50     foreach skip ($SKIP)
51      if ( `echo $dr | sed s/$skip.'*'//` == '' ) continue;continue
52     end
53   set config=-   set config=-
54   set makedepend=-   set makedepend=-
55   set compile=-   set compile=-
56   set execute=-   set execute=-
57   set exactmatch=-   set exactmatch=-
58   set accuracy=-   set accuracy=-
59     set pass=FAIL
60   echo ==============================================================================   echo ==============================================================================
61   echo Entering $dr   echo Entering $dr
62   cd $dr   cd $dr
# Line 54  foreach dr ([a-zA-Z01-9]*) Line 67  foreach dr ([a-zA-Z01-9]*)
67    set untested=($untested $dr)    set untested=($untested $dr)
68   else   else
69    set config=NO    set config=NO
   set makedepend=NO  
   set compile=NO  
   set execute=NO  
   set exactmatch=NO  
   set accuracy=-  
70    cd input    cd input
71    echo -n "  generating Makefile ..."    echo -n "  generating Makefile ..."
72    ../../../tools/genmake -mods=../code >&! make.log    ../../../tools/genmake -mods=../code >&! make.log
73    if ($status == 0) set config=Yes    if ($status == 0) set config=Yes
74      set makedepend=NO
75    echo " done."    echo " done."
76    echo -n "  make depend ..."    echo -n "  make depend ..."
77    make cleanlinks depend >>& make.log    make cleanlinks depend >>& make.log
# Line 73  foreach dr ([a-zA-Z01-9]*) Line 82  foreach dr ([a-zA-Z01-9]*)
82    if ($status) then    if ($status) then
83     echo "               ***** An error occurred during make *****"     echo "               ***** An error occurred during make *****"
84     cat make.log     cat make.log
85     exit 1     echo The error during compilation occured in \"$dr\"
86       set compile=NO
87       if ($?on_error_die) exit 1
88    else    else
89     set compile=Yes     set compile=Yes
90       set execute=NO
91    endif    endif
92    echo " done."    echo " done."
93    echo -n "  running model ..."    echo -n "  running model ..."
94    ./mitgcmuv | & grep "D iters" > output.txt    if ($compile == 'Yes') then
95    # ./mitgcmuv | & grep "D iters" > output.txt
96      ./mitgcmuv > & output.txt
97    if ($status == 0) then    if ($status == 0) then
98      set execute=Yes      set execute=Yes
99        set exactmatch=NO
100        set accuracy=-
101      echo " done."      echo " done."
102      sed 's/.*D iters, err =//' output.txt \      grep "D iters" output.txt | sed 's/.*D iters, err =//' \
103      | grep "   0    " \      | grep "   0    " \
104      > high.txt      > high.txt
105      grep "D iters" ../results/output.txt \      grep "D iters" ../results/output.txt \
# Line 115  foreach dr ([a-zA-Z01-9]*) Line 131  foreach dr ([a-zA-Z01-9]*)
131        if ($?fail ) then        if ($?fail ) then
132          if (! $?fails) set fails          if (! $?fails) set fails
133          set fails=($fails $dr)          set fails=($fails $dr)
134            set pass=FAIL
135          echo "                        ***** FAIL *****"          echo "                        ***** FAIL *****"
136        else        else
137          if (! $?passes) set passes          if (! $?passes) set passes
138          set passes=($passes $dr)          set passes=($passes $dr)
139            set pass=Pass
140          echo ""          echo ""
141          echo "                   ***** PASS (grade $lvl) *****"          echo "                   ***** PASS (grade $lvl) *****"
142        endif        endif
143        set accuracy=$lvl        set accuracy=$lvl
144      else      else
145        set exactmatch=Yes        set exactmatch=Yes
146          set pass=Pass
147        echo ""        echo ""
148        echo Model passed at highest accuracy.        echo Model passed at highest accuracy.
149        echo ""        echo ""
# Line 134  foreach dr ([a-zA-Z01-9]*) Line 153  foreach dr ([a-zA-Z01-9]*)
153      endif      endif
154    else    else
155      echo " error"      echo " error"
156      echo "               ***** An error occured running the mode *****"      echo "               ***** An error occured running the model *****"
157      tail output.txt      tail output.txt
158      exit 1      echo The runtime error occured in \"$dr\"
159        if ($?on_error_die) exit 1
160        set pass=-
161      endif
162      rm -f high.txt oldhigh.txt low.txt oldlow.txt output.txt make.log
163    endif    endif
164    cd ..    cd ..
165   endif   endif
166   echo ""   echo ""
167   cd ..   cd ..
168  # Pretty summary  # Pretty summary
169   printf '  %s\t  %s\t  %s\t  %s\t  %s\t  %s\t%s\n' $config $makedepend $compile $execute $exactmatch $accuracy $dr >> summary.txt   printresults:
170     printf '  %s\t  %s\t  %s\t  %s\t  %s\t %s\t %s\t%s\n' $config $makedepend $compile $execute $exactmatch $accuracy $pass $dr >> summary.txt
171  end  end
172  echo ==============================================================================  echo ==============================================================================
173  echo ""  echo ""

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.5

  ViewVC Help
Powered by ViewVC 1.1.22