/[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.6 by adcroft, Wed Jun 6 12:24:19 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
45   endsw   endsw
46  end  end
47    
48    # Need to make sure we don't meet non-model problems ...
49    unlimit
50    
51  foreach dr ([a-zA-Z01-9]*)  foreach dr ([a-zA-Z01-9]*)
52   if (! -d $dr/input ) continue   if (! -d $dr/input ) continue
53     foreach skip ($SKIP)
54      if ( `echo $dr | sed s/$skip.'*'//` == '' ) continue;continue
55     end
56   set config=-   set config=-
57   set makedepend=-   set makedepend=-
58   set compile=-   set compile=-
59   set execute=-   set execute=-
60   set exactmatch=-   set exactmatch=-
61   set accuracy=-   set accuracy=-
62     set pass=FAIL
63   echo ==============================================================================   echo ==============================================================================
64   echo Entering $dr   echo Entering $dr
65   cd $dr   cd $dr
# Line 54  foreach dr ([a-zA-Z01-9]*) Line 70  foreach dr ([a-zA-Z01-9]*)
70    set untested=($untested $dr)    set untested=($untested $dr)
71   else   else
72    set config=NO    set config=NO
   set makedepend=NO  
   set compile=NO  
   set execute=NO  
   set exactmatch=NO  
   set accuracy=-  
73    cd input    cd input
74    echo -n "  generating Makefile ..."    echo -n "  generating Makefile ..."
75    ../../../tools/genmake -mods=../code >&! make.log    ../../../tools/genmake -mods=../code >&! make.log
76    if ($status == 0) set config=Yes    if ($status == 0) set config=Yes
77      set makedepend=NO
78    echo " done."    echo " done."
79    echo -n "  make depend ..."    echo -n "  make depend ..."
80    make cleanlinks depend >>& make.log    make cleanlinks depend >>& make.log
# Line 73  foreach dr ([a-zA-Z01-9]*) Line 85  foreach dr ([a-zA-Z01-9]*)
85    if ($status) then    if ($status) then
86     echo "               ***** An error occurred during make *****"     echo "               ***** An error occurred during make *****"
87     cat make.log     cat make.log
88     exit 1     echo The error during compilation occured in \"$dr\"
89       set compile=NO
90       if ($?on_error_die) exit 1
91    else    else
92     set compile=Yes     set compile=Yes
93       set execute=NO
94    endif    endif
95    echo " done."    echo " done."
96    echo -n "  running model ..."    echo -n "  running model ..."
97    ./mitgcmuv | & grep "D iters" > output.txt    if ($compile == 'Yes') then
98    # ./mitgcmuv | & grep "D iters" > output.txt
99      ./mitgcmuv > & output.txt
100    if ($status == 0) then    if ($status == 0) then
101      set execute=Yes      set execute=Yes
102        set exactmatch=NO
103        set accuracy=-
104      echo " done."      echo " done."
105      sed 's/.*D iters, err =//' output.txt \      grep "D iters" output.txt | sed 's/.*D iters, err =//' \
106      | grep "   0    " \      | grep "   0    " \
107      > high.txt      > high.txt
108      grep "D iters" ../results/output.txt \      grep "D iters" ../results/output.txt \
# Line 115  foreach dr ([a-zA-Z01-9]*) Line 134  foreach dr ([a-zA-Z01-9]*)
134        if ($?fail ) then        if ($?fail ) then
135          if (! $?fails) set fails          if (! $?fails) set fails
136          set fails=($fails $dr)          set fails=($fails $dr)
137            set pass=FAIL
138          echo "                        ***** FAIL *****"          echo "                        ***** FAIL *****"
139        else        else
140          if (! $?passes) set passes          if (! $?passes) set passes
141          set passes=($passes $dr)          set passes=($passes $dr)
142            set pass=Pass
143          echo ""          echo ""
144          echo "                   ***** PASS (grade $lvl) *****"          echo "                   ***** PASS (grade $lvl) *****"
145        endif        endif
146        set accuracy=$lvl        set accuracy=$lvl
147      else      else
148        set exactmatch=Yes        set exactmatch=Yes
149          set pass=Pass
150        echo ""        echo ""
151        echo Model passed at highest accuracy.        echo Model passed at highest accuracy.
152        echo ""        echo ""
# Line 134  foreach dr ([a-zA-Z01-9]*) Line 156  foreach dr ([a-zA-Z01-9]*)
156      endif      endif
157    else    else
158      echo " error"      echo " error"
159      echo "               ***** An error occured running the mode *****"      echo "               ***** An error occured running the model *****"
160      tail output.txt      tail output.txt
161      exit 1      echo The runtime error occured in \"$dr\"
162        if ($?on_error_die) exit 1
163        set pass=-
164      endif
165      rm -f high.txt oldhigh.txt low.txt oldlow.txt output.txt make.log
166    endif    endif
167    cd ..    cd ..
168   endif   endif
169   echo ""   echo ""
170   cd ..   cd ..
171  # Pretty summary  # Pretty summary
172   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:
173     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
174  end  end
175  echo ==============================================================================  echo ==============================================================================
176  echo ""  echo ""

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

  ViewVC Help
Powered by ViewVC 1.1.22