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 |
10 |
|
|
11 |
set on_error_die |
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) |
36 |
case -nodie: |
case -nodie: |
37 |
unset on_error_die |
unset on_error_die |
38 |
breaksw |
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 |
95 |
echo " done." |
echo " done." |
96 |
echo -n " running model ..." |
echo -n " running model ..." |
97 |
if ($compile == 'Yes') then |
if ($compile == 'Yes') then |
98 |
./mitgcmuv | & grep "D iters" > output.txt |
# ./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 |
set exactmatch=NO |
103 |
set accuracy=- |
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 \ |
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 "" |
160 |
tail output.txt |
tail output.txt |
161 |
echo The runtime error occured in \"$dr\" |
echo The runtime error occured in \"$dr\" |
162 |
if ($?on_error_die) exit 1 |
if ($?on_error_die) exit 1 |
163 |
|
set pass=- |
164 |
endif |
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 |
170 |
cd .. |
cd .. |
171 |
# Pretty summary |
# Pretty summary |
172 |
printresults: |
printresults: |
173 |
printf ' %s\t %s\t %s\t %s\t %s\t %s\t%s\n' $config $makedepend $compile $execute $exactmatch $accuracy $dr >> summary.txt |
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 "" |