1 |
#!/bin/sh |
#!/bin/sh |
2 |
|
|
|
similar() |
|
|
{ |
|
|
# similar digits a b |
|
|
# |
|
|
# compare the floating point number a and b and successively reduced |
|
|
# truncation until a match is found |
|
|
for digits in 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 |
|
|
do |
|
|
a=`printf '%22.'$digits'e\n' $1` |
|
|
b=`printf '%22.'$digits'e\n' $2` |
|
|
if [ $a = $b ]; then |
|
|
if [ $verbose -gt 1 ]; then |
|
|
echo $1 $2 $a 1>&2 |
|
|
fi |
|
|
break |
|
|
fi |
|
|
done |
|
|
return $digits |
|
|
} |
|
|
|
|
3 |
compare_lines() |
compare_lines() |
4 |
{ |
{ |
|
# compare_lines digits < file |
|
|
# |
|
|
# read each line of file and test the 2nd and 3rd column values for |
|
|
# similarity based on the function similar() |
|
|
worst_so_far=$1 |
|
|
while read linenum a b |
|
|
do |
|
|
if [ $debug -gt 0 ]; then |
|
|
echo compare_lines: similar a=$a b=$b 1>&2 |
|
|
fi |
|
|
similar $a $b |
|
|
digits=$? |
|
|
if [ $digits -lt $worst_so_far ]; then |
|
|
worst_so_far=$digits |
|
|
fi |
|
|
done |
|
|
if [ $debug -gt 0 ]; then |
|
|
echo compare_lines: worst_so_far=$worst_so_far 1>&2 |
|
|
fi |
|
|
return $worst_so_far |
|
|
} |
|
|
|
|
|
compare_lines2() |
|
|
{ |
|
5 |
# use codelet to compare lines |
# use codelet to compare lines |
6 |
|
if [ $verbose -gt 1 ]; then |
7 |
|
cat tmp3.txt 1>&2 |
8 |
|
fi |
9 |
return `./a.out < tmp3.txt` |
return `./a.out < tmp3.txt` |
10 |
} |
} |
11 |
|
|
12 |
testoutput_for_prop() |
testoutput_for_prop() |
13 |
{ |
{ |
14 |
# testoutput_for_prop dir s1 label |
# testoutput_for_prop dir s1 label subdir |
15 |
# |
# |
16 |
# compares files in $dir/input/output.txt and $dir/results.output.txt |
# compares files in $dir/$subdir/output.txt and $dir/results/output.txt |
17 |
# using search strings s1 and text label |
# using search strings s1 and text label |
18 |
|
|
19 |
if [ $debug -gt 0 ]; then |
if [ $debug -gt 0 ]; then |
20 |
echo testoutput_for_prop: grep "$2" $1/input/output.txt 1>&2 |
echo testoutput_for_prop: grep "$2" $1/$4/output.txt 1>&2 |
21 |
fi |
fi |
22 |
if [ -r $1/input/output.txt ]; then |
if [ -r $1/$4/output.txt ]; then |
23 |
grep "$2" $1/input/output.txt | sed 's/.*=//' | nl > tmp1.txt |
grep "$2" $1/$4/output.txt | sed 's/.*=//' | nl > tmp1.txt |
24 |
|
lncnt=`wc -l tmp1.txt | awk '{print $1}' ` |
25 |
|
if [ $lncnt -lt 3 ]; then |
26 |
|
if [ $verbose -gt 0 ]; then |
27 |
|
echo Not enough lines of output when searching for "$2" 1>&2 |
28 |
|
fi |
29 |
|
return 99 |
30 |
|
fi |
31 |
else |
else |
32 |
echo testoutput_for_prop: output.txt from model run was not readable 1>&2 |
echo testoutput_for_prop: output.txt from model run was not readable 1>&2 |
33 |
return 99 |
return 99 |
36 |
echo testoutput_for_prop: grep "$2" $1/results/output.txt 1>&2 |
echo testoutput_for_prop: grep "$2" $1/results/output.txt 1>&2 |
37 |
fi |
fi |
38 |
grep "$2" $1/results/output.txt | sed 's/.*=//' | nl > tmp2.txt |
grep "$2" $1/results/output.txt | sed 's/.*=//' | nl > tmp2.txt |
39 |
|
lncnt=`wc -l tmp2.txt | awk '{print $1}' ` |
40 |
|
if [ $lncnt -lt 3 ]; then |
41 |
|
if [ $verbose -gt 0 ]; then |
42 |
|
echo Not enough lines of output when searching for "$2" 1>&2 |
43 |
|
fi |
44 |
|
return 99 |
45 |
|
fi |
46 |
if [ $debug -gt 0 ]; then |
if [ $debug -gt 0 ]; then |
47 |
echo testoutput_for_prop: join tmp1.txt tmp2.txt 1>&2 |
echo testoutput_for_prop: join tmp1.txt tmp2.txt 1>&2 |
48 |
fi |
fi |
50 |
if [ $debug -gt 0 ]; then |
if [ $debug -gt 0 ]; then |
51 |
echo testoutput_for_prop: compare_lines 1>&2 |
echo testoutput_for_prop: compare_lines 1>&2 |
52 |
fi |
fi |
53 |
#compare_lines 99 < tmp3.txt |
compare_lines |
|
compare_lines2 |
|
54 |
digits_of_similarity=$? |
digits_of_similarity=$? |
55 |
if [ $digits_of_similarity -eq 99 ]; then |
if [ $digits_of_similarity -eq 99 ]; then |
56 |
if [ $verbose -gt 0 ]; then |
if [ $verbose -gt 0 ]; then |
84 |
|
|
85 |
testoutput() |
testoutput() |
86 |
{ |
{ |
87 |
# testoutput diretory |
# testoutput diretory subdir |
88 |
# |
# |
89 |
# test output in "directory" |
# test output in "directory" |
90 |
|
|
91 |
if [ $debug -gt 0 ]; then |
if [ $debug -gt 0 ]; then |
92 |
echo testoutput: testoutput_for_prop $1 cg2d_init_res 1>&2 |
echo testoutput: testoutput_for_prop $1 cg2d_init_res 1>&2 |
93 |
fi |
fi |
94 |
testoutput_for_prop $1 "cg2d_init_res" "cg2d init. residual"; cg2dres=$? |
testoutput_for_prop $1 "cg2d_init_res" "cg2d init. residual" $2; cg2dres=$? |
95 |
if [ $debug -gt 0 ]; then |
if [ $debug -gt 0 ]; then |
96 |
echo testoutput: cg2dres=$cg2dres 1>&2 |
echo testoutput: cg2dres=$cg2dres 1>&2 |
97 |
fi |
fi |
98 |
|
|
99 |
if [ $testmore -gt 0 ]; then |
if [ $longtest -gt 0 ]; then |
100 |
testoutput_for_prop $1 "dynstat_theta_min" "theta minimum"; tmin=$? |
testoutput_for_prop $1 "dynstat_theta_min" "theta minimum" $2; tmin=$? |
101 |
testoutput_for_prop $1 "dynstat_theta_max" "theta maximum"; tmax=$? |
testoutput_for_prop $1 "dynstat_theta_max" "theta maximum" $2; tmax=$? |
102 |
testoutput_for_prop $1 "dynstat_theta_mean" "theta mean"; tmean=$? |
testoutput_for_prop $1 "dynstat_theta_mean" "theta mean" $2; tmean=$? |
103 |
testoutput_for_prop $1 "dynstat_theta_sd" "theta s.d."; tsd=$? |
testoutput_for_prop $1 "dynstat_theta_sd" "theta s.d." $2; tsd=$? |
104 |
testoutput_for_prop $1 "dynstat_salt_min" "salt minimum"; smin=$? |
testoutput_for_prop $1 "dynstat_salt_min" "salt minimum" $2; smin=$? |
105 |
testoutput_for_prop $1 "dynstat_salt_max" "salt maximum"; smax=$? |
testoutput_for_prop $1 "dynstat_salt_max" "salt maximum" $2; smax=$? |
106 |
testoutput_for_prop $1 "dynstat_salt_mean" "salt mean"; smean=$? |
testoutput_for_prop $1 "dynstat_salt_mean" "salt mean" $2; smean=$? |
107 |
testoutput_for_prop $1 "dynstat_salt_sd" "salt s.d."; ssd=$? |
testoutput_for_prop $1 "dynstat_salt_sd" "salt s.d." $2; ssd=$? |
108 |
testoutput_for_prop $1 "dynstat_uvel_min" "U minimum"; umin=$? |
testoutput_for_prop $1 "dynstat_uvel_min" "U minimum" $2; umin=$? |
109 |
testoutput_for_prop $1 "dynstat_uvel_max" "U maximum"; umax=$? |
testoutput_for_prop $1 "dynstat_uvel_max" "U maximum" $2; umax=$? |
110 |
testoutput_for_prop $1 "dynstat_uvel_mean" "U mean"; umean=$? |
testoutput_for_prop $1 "dynstat_uvel_mean" "U mean" $2; umean=$? |
111 |
testoutput_for_prop $1 "dynstat_uvel_sd" "U s.d."; usd=$? |
testoutput_for_prop $1 "dynstat_uvel_sd" "U s.d." $2; usd=$? |
112 |
testoutput_for_prop $1 "dynstat_vvel_min" "V minimum"; vmin=$? |
testoutput_for_prop $1 "dynstat_vvel_min" "V minimum" $2; vmin=$? |
113 |
testoutput_for_prop $1 "dynstat_vvel_max" "V maximum"; vmax=$? |
testoutput_for_prop $1 "dynstat_vvel_max" "V maximum" $2; vmax=$? |
114 |
testoutput_for_prop $1 "dynstat_vvel_mean" "V mean"; vmean=$? |
testoutput_for_prop $1 "dynstat_vvel_mean" "V mean" $2; vmean=$? |
115 |
testoutput_for_prop $1 "dynstat_vvel_sd" "V s.d."; vsd=$? |
testoutput_for_prop $1 "dynstat_vvel_sd" "V s.d." $2; vsd=$? |
116 |
else |
else |
117 |
testoutput_for_prop $1 "dynstat_theta_min" "theta minimum"; tmin=$? |
testoutput_for_prop $1 "dynstat_theta_min" "theta minimum" $2; tmin=$? |
118 |
testoutput_for_prop $1 "dynstat_theta_max" "theta maximum"; tmax=$? |
testoutput_for_prop $1 "dynstat_theta_max" "theta maximum" $2; tmax=$? |
119 |
testoutput_for_prop $1 "dynstat_salt_min" "salt minimum"; smin=$? |
testoutput_for_prop $1 "dynstat_salt_min" "salt minimum" $2; smin=$? |
120 |
testoutput_for_prop $1 "dynstat_salt_max" "salt maximum"; smax=$? |
testoutput_for_prop $1 "dynstat_salt_max" "salt maximum" $2; smax=$? |
121 |
testoutput_for_prop $1 "dynstat_uvel_min" "U minimum"; umin=$? |
testoutput_for_prop $1 "dynstat_uvel_min" "U minimum" $2; umin=$? |
122 |
testoutput_for_prop $1 "dynstat_uvel_max" "U maximum"; umax=$? |
testoutput_for_prop $1 "dynstat_uvel_max" "U maximum" $2; umax=$? |
123 |
testoutput_for_prop $1 "dynstat_vvel_min" "V minimum"; vmin=$? |
testoutput_for_prop $1 "dynstat_vvel_min" "V minimum" $2; vmin=$? |
124 |
testoutput_for_prop $1 "dynstat_vvel_max" "V maximum"; vmax=$? |
testoutput_for_prop $1 "dynstat_vvel_max" "V maximum" $2; vmax=$? |
125 |
fi |
fi |
126 |
|
|
127 |
dashnum $cg2dres $tmin $tmax $tmean $tsd $smin $smax $smean $ssd \ |
dashnum $cg2dres $tmin $tmax $tmean $tsd $smin $smax $smean $ssd \ |
136 |
( cd $1; |
( cd $1; |
137 |
if [ $quick -eq 0 -o ! -r Makefile ]; then |
if [ $quick -eq 0 -o ! -r Makefile ]; then |
138 |
printf 'genmake ... ' 1>&2 |
printf 'genmake ... ' 1>&2 |
139 |
../../../tools/genmake -mods=../code > make.log 2>&1 |
if [ $ieee -eq 0 ]; then |
140 |
|
../../../tools/genmake2 -mods=../code > make.log 2>&1 |
141 |
|
else |
142 |
|
../../../tools/genmake2 -ieee -mods=../code > make.log 2>&1 |
143 |
|
fi |
144 |
if [ $? -ne 0 ]; then |
if [ $? -ne 0 ]; then |
145 |
tail make.log |
tail make.log |
146 |
echo makemodel: genmake failed 1>&2 |
echo genmakemodel: $genmake failed 1>&2 |
147 |
return 1 |
return 1 |
148 |
else |
else |
149 |
echo succesful 1>&2 |
echo succesful 1>&2 |
152 |
) |
) |
153 |
} |
} |
154 |
|
|
155 |
|
makecleancompile() |
156 |
|
{ |
157 |
|
# makecleancompile directory |
158 |
|
( cd $1; |
159 |
|
if [ $force -gt 0 ]; then |
160 |
|
rm -f output.txt |
161 |
|
printf 'make clean ... ' 2>&1 |
162 |
|
make CLEAN >> make.log 2>&1 |
163 |
|
if [ $? -ne 0 ]; then |
164 |
|
tail make.log |
165 |
|
echo makecleancompile: make clean failed 1>&2 |
166 |
|
return 1 |
167 |
|
else |
168 |
|
echo succesful 1>&2 |
169 |
|
fi |
170 |
|
fi |
171 |
|
) |
172 |
|
} |
173 |
|
|
174 |
|
makecleanupafter() |
175 |
|
{ |
176 |
|
# makeupafter directory |
177 |
|
( cd $1; |
178 |
|
if [ $clean -gt 0 ]; then |
179 |
|
rm -f output.txt |
180 |
|
printf 'make clean ... ' 2>&1 |
181 |
|
make CLEAN >> make.log 2>&1 |
182 |
|
if [ $? -ne 0 ]; then |
183 |
|
tail make.log |
184 |
|
echo makeupafter: make clean failed 1>&2 |
185 |
|
return 1 |
186 |
|
else |
187 |
|
echo succesful 1>&2 |
188 |
|
fi |
189 |
|
fi |
190 |
|
) |
191 |
|
} |
192 |
|
|
193 |
makedependmodel() |
makedependmodel() |
194 |
{ |
{ |
195 |
# makedependmodel directory |
# makedependmodel directory |
227 |
) |
) |
228 |
} |
} |
229 |
|
|
230 |
|
linkdata() |
231 |
|
{ |
232 |
|
# linkdata flag |
233 |
|
# |
234 |
|
# symbolically link data files to run directory |
235 |
|
if test "x$1" = x1 ; then |
236 |
|
( |
237 |
|
cd $2 |
238 |
|
if test "x$ADM" = x ; then |
239 |
|
files=`( cd ../input ; ls -1 | grep -v CVS )` |
240 |
|
for i in $files ; do |
241 |
|
if test ! -d "../input/"$i ; then |
242 |
|
ln -sf "../input/"$i $i |
243 |
|
fi |
244 |
|
done |
245 |
|
else |
246 |
|
files=`( cd ../input ; ls -1 *.bin | grep -v CVS )` |
247 |
|
for i in $files ; do |
248 |
|
if test ! -d "../input/"$i ; then |
249 |
|
ln -sf "../input/"$i $i |
250 |
|
fi |
251 |
|
done |
252 |
|
files=`( cd ../input_ad ; ls -1 | grep -v CVS )` |
253 |
|
for i in $files ; do |
254 |
|
if test ! -d "../input_ad/"$i ; then |
255 |
|
ln -sf "../input_ad/"$i $i |
256 |
|
fi |
257 |
|
done |
258 |
|
fi |
259 |
|
) |
260 |
|
fi |
261 |
|
} |
262 |
|
|
263 |
runmodel() |
runmodel() |
264 |
{ |
{ |
265 |
# runmodel directory exe |
# runmodel directory exe |
268 |
|
|
269 |
( cd $1 |
( cd $1 |
270 |
if [ -x $2 ]; then |
if [ -x $2 ]; then |
271 |
if [ ! -r output.txt -o $quick -eq 0 ]; then |
if [ $quick -eq 0 ]; then |
272 |
echo runmodel: running... 1>&2 |
rm -f output.txt |
273 |
( ./$2 > output.txt 2>&1 ) && return 0 |
fi |
274 |
|
if [ $debug -gt 0 ]; then |
275 |
|
echo -n runmodel: pwd= 1>&2 |
276 |
|
pwd 1>&2 |
277 |
|
fi |
278 |
|
printf 'runmodel: ' 1>&2 |
279 |
|
make output.txt && return 0 |
280 |
return 1 |
return 1 |
281 |
else |
fi |
282 |
echo runmodel: output.txt is newer than executable 1>&2 |
) |
283 |
|
} |
284 |
|
|
285 |
|
copynewresults() |
286 |
|
{ |
287 |
|
# copynewresults directory |
288 |
|
# |
289 |
|
# runs the model "exe" in "directory" (exe is relative to directory) |
290 |
|
|
291 |
|
( cd $1 |
292 |
|
if [ $newresults -eq 1 ]; then |
293 |
|
if [ -r output.txt ]; then |
294 |
|
cp -f output.txt ../results/ |
295 |
return 0 |
return 0 |
296 |
fi |
fi |
|
else |
|
|
echo runmodel: executable \"$1/$2\" is missing 1>&2 |
|
|
return 1 |
|
297 |
fi |
fi |
298 |
) |
) |
299 |
} |
} |
309 |
best=-16 |
best=-16 |
310 |
99 read(*,*,end=70,err=60) linnum,a,b |
99 read(*,*,end=70,err=60) linnum,a,b |
311 |
diff=0.5*(abs(a)+abs(b)) |
diff=0.5*(abs(a)+abs(b)) |
312 |
if (diff.gt.0.) then |
c print *,a,b,diff,abs(a-b)/diff |
313 |
|
if (diff.gt.1.e-12) then |
314 |
diff=abs(a-b)/diff |
diff=abs(a-b)/diff |
315 |
if (diff.gt.0.) then |
if (diff.gt.0.) then |
316 |
c print *,int(log10(diff)),diff |
c print *,int(log10(diff)),diff |
317 |
linnum=int(log10(diff)) |
linnum=int(log10(diff)) |
318 |
best=max(best,linnum) |
best=max(best,linnum) |
|
c else |
|
|
c print *,-16 |
|
319 |
endif |
endif |
320 |
c else |
else |
321 |
c diff=0. |
if (best.eq.-16.and.diff.ne.0.) best=-22 |
|
c print *,-16 |
|
322 |
endif |
endif |
323 |
goto 99 |
goto 99 |
324 |
60 stop 'cmpnum: An error occured reading a,b' |
60 stop 'cmpnum: An error occured reading a,b' |
363 |
$0 [-help] [-quick] [-verbose] dir1 [dir2] [...] |
$0 [-help] [-quick] [-verbose] dir1 [dir2] [...] |
364 |
-help Show this help message |
-help Show this help message |
365 |
-quick Skip "genmake" and "make depend" if the Makefile exists |
-quick Skip "genmake" and "make depend" if the Makefile exists |
366 |
|
-newresults Copy the output.txt into results/ |
367 |
-quiet Reduce the amount of output |
-quiet Reduce the amount of output |
368 |
-verbose Produce copious amounts of output |
-verbose Produce copious amounts of output |
369 |
|
-debug Produce even more output which will mean nothing to most |
370 |
|
-force Do "make CLEAN" before compiling. This forces a complete rebuild. |
371 |
|
-clean Do "make CLEAN" after compiling and testing. |
372 |
|
-shorttest Don't compare numeric output for mean and s.d. of variables. |
373 |
|
-noieee By default, $0 uses the -ieee option for genmake. This turns it off. |
374 |
|
-cleanup Aggresively removes all model output, executables and object files |
375 |
|
and then exits. Use with care. |
376 |
|
|
377 |
Normal usage: |
Normal usage: |
378 |
$0 * Configure, compile, run and analyze in all experiment directories |
$0 * Configure, compile, run and analyze in all experiment directories |
379 |
EOF |
EOF |
380 |
} |
} |
381 |
|
|
382 |
|
scandirs() |
383 |
|
{ |
384 |
|
if [ $# -eq 0 ]; then |
385 |
|
for arg in * |
386 |
|
do |
387 |
|
test -d $arg/input && echo $arg |
388 |
|
done |
389 |
|
else |
390 |
|
echo $* |
391 |
|
fi |
392 |
|
} |
393 |
|
|
394 |
|
clean_up() |
395 |
|
{ |
396 |
|
# Find all executables, object files, CPP'd source and model output |
397 |
|
# and DELETE it. |
398 |
|
for opt in '-name "mitgcmuv*"' '-name "*.o"' '-name "*.f"' '-name "*.c"' '-name "fort.*"' '-name "make.log"' '-path *results -prune -o -name "*.meta"' '-path *results -prune -o -name "*.data"' '-type l' |
399 |
|
do |
400 |
|
echo Cleaning: find . $opt -exec rm {} \; |
401 |
|
find . $opt -exec rm {} \; |
402 |
|
done |
403 |
|
} |
404 |
|
|
405 |
|
############################################################################### |
406 |
|
############################################################################### |
407 |
############################################################################### |
############################################################################### |
408 |
|
|
409 |
# Main function |
# Main function |
412 |
debug=0 |
debug=0 |
413 |
verbose=1 |
verbose=1 |
414 |
quick=0 |
quick=0 |
415 |
testmore=0 |
newresults=0 |
416 |
|
force=0 |
417 |
|
clean=0 |
418 |
|
ieee=1 |
419 |
|
longtest=1 |
420 |
expts='' |
expts='' |
421 |
|
genmake=genmake |
422 |
|
|
423 |
# Process arguments |
# Process arguments |
424 |
for arg in $@ |
for arg in $@ |
425 |
do |
do |
426 |
case $arg in |
case $arg in |
427 |
|
-cleanup) clean_up; exit 0;; |
428 |
-quick) quick=1;; |
-quick) quick=1;; |
429 |
|
-newresults) newresults=1;; |
430 |
-verbose) verbose=2;; |
-verbose) verbose=2;; |
431 |
-debug) debug=1;; |
-debug) debug=1;; |
432 |
-testmore) testmore=1;; |
-force) force=1;; |
433 |
|
-clean) clean=1;; |
434 |
|
-noieee) ieee=0;; |
435 |
|
-shorttest) longtest=0;; |
436 |
-quiet) verbose=0;; |
-quiet) verbose=0;; |
437 |
-help) show_help; exit 0;; |
-help) show_help; exit 0;; |
438 |
|
-*) echo Unrecognized option:$arg; exit 9;; |
439 |
*) test -d $arg && expts=`echo $expts $arg`;; |
*) test -d $arg && expts=`echo $expts $arg`;; |
440 |
esac |
esac |
441 |
done |
done |
442 |
|
|
443 |
if [ ${#expts} -eq 0 ]; then |
if [ $force -gt 0 -a $quick -gt 0 ]; then |
444 |
echo Scanning all directories |
echo You specified -quick and -force together which conflict. |
445 |
for arg in * |
echo Please specify either -quick or -force or neither but not both. |
446 |
do |
exit 1 |
|
test -d $arg && expts=`echo $expts $arg` |
|
|
done |
|
447 |
fi |
fi |
448 |
|
|
449 |
|
#if [ ${#expts} -eq 0 ]; then |
450 |
|
# echo Scanning all directories |
451 |
|
# for arg in * |
452 |
|
# do |
453 |
|
# test -d $arg && expts=`echo $expts $arg` |
454 |
|
# done |
455 |
|
#fi |
456 |
|
expts=`scandirs $expts` |
457 |
|
|
458 |
createcodelet |
createcodelet |
459 |
|
|
460 |
if [ $testmore -eq 0 ]; then |
date > summary.txt |
461 |
cat << EOF > summary.txt |
if [ $longtest -gt 0 ]; then |
462 |
|
cat << EOF >> summary.txt |
463 |
T S U V |
T S U V |
464 |
C D M c m s m s m s m s |
C D M c m s m s m s m s |
465 |
n p a R g m m e . m m e . m m e . m m e . |
n p a R g m m e . m m e . m m e . m m e . |
468 |
|
|
469 |
EOF |
EOF |
470 |
else |
else |
471 |
cat << EOF > summary.txt |
cat << EOF >> summary.txt |
472 |
T S U V |
T S U V |
473 |
C D M c |
C D M c |
474 |
n p a R g m m m m m m m m |
n p a R g m m m m m m m m |
486 |
echo |
echo |
487 |
echo Experiment: $dir |
echo Experiment: $dir |
488 |
echo |
echo |
489 |
unset genmake makedepend make run |
unset genmakepass makedepend make run |
490 |
results='-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --' |
if [ $longtest -gt 0 ]; then |
491 |
results='-- -- -- -- -- -- -- -- --' |
results='-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --' |
492 |
genmakemodel $dir/input && genmake=Y \ |
else |
493 |
&& makedependmodel $dir/input && makedepend=Y \ |
results='-- -- -- -- -- -- -- -- --' |
494 |
&& makemodel $dir/input && make=Y \ |
fi |
495 |
&& runmodel $dir/input mitgcmuv && run=Y \ |
if [ -r $dir/build ]; then |
496 |
&& results=`testoutput $dir` |
seperatebuilddir=1 |
497 |
|
builddir=build |
498 |
|
rundir=build |
499 |
|
(cd $dir/input; rm -f *.{o,f,c,F,h} work* output.txt Make* make.log; ) |
500 |
|
else |
501 |
|
seperatebuilddir=0 |
502 |
|
builddir=input |
503 |
|
rundir=input |
504 |
|
fi |
505 |
|
genmakemodel $dir/$builddir && genmakepass=Y \ |
506 |
|
&& makecleancompile $dir/$builddir \ |
507 |
|
&& makedependmodel $dir/$builddir && makedepend=Y \ |
508 |
|
&& makemodel $dir/$builddir && make=Y \ |
509 |
|
&& linkdata $seperatebuilddir $dir/$rundir \ |
510 |
|
&& runmodel $dir/$builddir mitgcmuv && run=Y \ |
511 |
|
&& results=`testoutput $dir $rundir` \ |
512 |
|
&& copynewresults $dir/$rundir \ |
513 |
|
&& makecleanupafter $dir/$builddir |
514 |
echo |
echo |
515 |
formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results |
formatresults $dir ${genmakepass:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results |
516 |
echo |
echo |
517 |
formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results >> summary.txt |
formatresults $dir ${genmakepass:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results >> summary.txt |
518 |
fi |
fi |
519 |
done |
done |
520 |
|
|
522 |
|
|
523 |
echo ------------------------------------------------------------------------------- |
echo ------------------------------------------------------------------------------- |
524 |
echo |
echo |
525 |
|
date >> summary.txt |
526 |
cat summary.txt |
cat summary.txt |