1 |
#!/bin/bash |
#!/bin/bash |
2 |
# |
# |
3 |
# $Header$ |
# $Header$ |
4 |
|
# $Name$ |
5 |
# |
# |
6 |
|
|
7 |
usage() |
usage() |
11 |
echo |
echo |
12 |
echo "where possible OPTIONS are:" |
echo "where possible OPTIONS are:" |
13 |
echo " (-help|-h) print usage" |
echo " (-help|-h) print usage" |
14 |
echo " (-optfile=|-of=)STRING list of genmake2 \"optfiles\"" |
echo " (-mpi) use MPI input files" |
15 |
|
echo " (-ieee|-noieee) if possible, use IEEE compiler flags" |
16 |
|
echo " (-optfile=|-of=)STRING list of optfiles to use" |
17 |
echo " (-a|-addr)STRING list of email recipients" |
echo " (-a|-addr)STRING list of email recipients" |
18 |
echo " (-t|-tdir)STRING list of \"test\" dirs" |
echo " (DEF=\"edhill@mitgcm.org\")" |
19 |
|
echo " (-t|-tdir)STRING list of test dirs to use" |
20 |
|
echo " (DEF=\"\" which builds all)" |
21 |
|
echo " (-b|-bash)STRING location of \"bash\" executable" |
22 |
|
echo " (DEF=\"\" for \"/bin/bash\")" |
23 |
|
echo " (-command)STRING command to run" |
24 |
|
echo " (DEF=\"make output.txt\")" |
25 |
|
echo " (-m|-make)STRING command to use for \"make\"" |
26 |
|
echo " (DEF=\"make\")" |
27 |
|
echo " (-clean) *ONLY* run \"make CLEAN\"" |
28 |
|
echo " (-quick|-q) same as \"-nogenmake -noclean -nodepend\"" |
29 |
|
echo " (-nogenmake|-ng) skip the genmake stage" |
30 |
|
echo " (-noclean|-nc) skip the \"make clean\" stage" |
31 |
|
echo " (-nodepend|-nd) skip the \"make depend\" stage" |
32 |
|
echo |
33 |
|
echo "and where STRING follows a whitespace-delimited format" |
34 |
|
echo "such as:" |
35 |
|
echo " -t 'exp0 exp2 exp3' " |
36 |
|
echo " -addr='abc@123.com testing@home.org'" |
37 |
echo |
echo |
38 |
exit 1 |
exit 1 |
39 |
} |
} |
50 |
exit 1 |
exit 1 |
51 |
fi |
fi |
52 |
echo -n "building mpack... " |
echo -n "building mpack... " |
53 |
( cd $MPACKDIR && ./configure && make ) > build_mpack.out 2>&1 |
( cd $MPACKDIR && ./configure && $MAKE ) > build_mpack.out 2>&1 |
54 |
RETVAL=$? |
RETVAL=$? |
55 |
if test "x$RETVAL" != x0 ; then |
if test "x$RETVAL" != x0 ; then |
56 |
echo |
echo |
156 |
if [ $debug -gt 0 ]; then |
if [ $debug -gt 0 ]; then |
157 |
echo testoutput: cg2dres=$cg2dres 1>&2 |
echo testoutput: cg2dres=$cg2dres 1>&2 |
158 |
fi |
fi |
|
|
|
159 |
testoutput_for_prop $1 "dynstat_theta_min" "theta minimum" $2; tmin=$? |
testoutput_for_prop $1 "dynstat_theta_min" "theta minimum" $2; tmin=$? |
160 |
testoutput_for_prop $1 "dynstat_theta_max" "theta maximum" $2; tmax=$? |
testoutput_for_prop $1 "dynstat_theta_max" "theta maximum" $2; tmax=$? |
161 |
testoutput_for_prop $1 "dynstat_theta_mean" "theta mean" $2; tmean=$? |
testoutput_for_prop $1 "dynstat_theta_mean" "theta mean" $2; tmean=$? |
180 |
genmakemodel() |
genmakemodel() |
181 |
{ |
{ |
182 |
# genmakemodel directory |
# genmakemodel directory |
183 |
GENMAKE2="../../../tools/genmake2" |
if test "x$NOGENMAKE" = xt ; then |
184 |
( |
echo "genmake skipped!" |
185 |
cd $1; |
else |
186 |
printf 'genmake ... ' 1>&2 |
GENMAKE2="$BASH ../../../tools/genmake2" |
187 |
# ../../../tools/genmake -ieee -mods=../code > make.log 2>&1 |
( |
188 |
$GENMAKE2 -ds --mods=../code "--optfile="$OPTFILE > make.log 2>&1 |
cd $1; |
189 |
RETVAL=$? |
command="$GENMAKE2 -ds -m $MAKE --mods=../code" |
190 |
for i in gm_state gm_optfile gm_local Makefile ; do |
if test "x$OPTFILE" != xNONE ; then |
191 |
if test -r $i ; then |
command="$command --optfile=$OPTFILE" |
192 |
cp $i $CDIR |
# echo " command=\"$command\"" |
193 |
fi |
fi |
194 |
done |
if test "x$IEEE" != x ; then |
195 |
if test "x$RETVAL" != x0 ; then |
command="$command -ieee" |
196 |
tail make.log |
fi |
197 |
echo "genmakemodel: genmake failed" 1>&2 |
# echo "command: \"$command\"" |
198 |
cp make.log $CDIR |
printf 'genmake ... ' 1>&2 |
199 |
return 1 |
$command > make.log 2>&1 |
200 |
else |
RETVAL=$? |
201 |
echo "succesful" 1>&2 |
for i in genmake_state genmake_optfile genmake_local Makefile ; do |
202 |
fi |
if test -r $i ; then |
203 |
) |
cp $i $CDIR |
204 |
|
fi |
205 |
|
done |
206 |
|
if test "x$RETVAL" != x0 ; then |
207 |
|
tail make.log |
208 |
|
echo "genmakemodel: genmake failed" 1>&2 |
209 |
|
cp make.log $CDIR |
210 |
|
return 1 |
211 |
|
else |
212 |
|
echo "succesful" 1>&2 |
213 |
|
fi |
214 |
|
) |
215 |
|
fi |
216 |
} |
} |
217 |
|
|
218 |
makeclean() |
makeclean() |
219 |
{ |
{ |
220 |
# makeclean directory |
# makeclean directory |
221 |
( |
if test "x$NOCLEAN" = xt ; then |
222 |
cd $1; |
echo "make CLEAN skipped!" |
223 |
rm -f output.txt |
else |
224 |
printf 'make CLEAN ... ' 2>&1 |
( |
225 |
if test -r Makefile ; then |
cd $1; |
226 |
make CLEAN >> make.log 2>&1 |
if test -e output.txt ; then |
227 |
RETVAL=$? |
rm -f output.txt |
|
if test "x$RETVAL" != x0 ; then |
|
|
tail make.log |
|
|
echo "makeclean: \"make CLEAN\" failed" 1>&2 |
|
|
cp make.log $CDIR"/make.log" |
|
|
return 1 |
|
228 |
fi |
fi |
229 |
fi |
printf 'make CLEAN ... ' 2>&1 |
230 |
echo succesful 1>&2 |
if test -r Makefile ; then |
231 |
exit 0 |
$MAKE CLEAN >> make.log 2>&1 |
232 |
) |
RETVAL=$? |
233 |
|
if test "x$RETVAL" != x0 ; then |
234 |
|
tail make.log |
235 |
|
echo "makeclean: \"make CLEAN\" failed" 1>&2 |
236 |
|
cp make.log $CDIR"/make.log" |
237 |
|
return 1 |
238 |
|
fi |
239 |
|
fi |
240 |
|
echo succesful 1>&2 |
241 |
|
exit 0 |
242 |
|
) |
243 |
|
fi |
244 |
} |
} |
245 |
|
|
246 |
makedependmodel() |
makedependmodel() |
247 |
{ |
{ |
248 |
# makedependmodel directory |
# makedependmodel directory |
249 |
( |
if test "x$NODEPEND" = xt ; then |
250 |
cd $1; |
echo "make depend skipped!" |
251 |
printf 'make depend ... ' 1>&2 |
else |
252 |
make depend >> make.log 2>&1 |
( |
253 |
RETVAL=$? |
cd $1; |
254 |
if test "x$RETVAL" != x0 ; then |
printf 'make depend ... ' 1>&2 |
255 |
tail make.log |
$MAKE depend >> make.log 2>&1 |
256 |
echo "makedependmodel: make depend failed" 1>&2 |
RETVAL=$? |
257 |
cp make.log $CDIR"/make.log" |
if test "x$RETVAL" != x0 ; then |
258 |
return 1 |
tail make.log |
259 |
else |
echo "makedependmodel: make depend failed" 1>&2 |
260 |
echo succesful 1>&2 |
cp make.log $CDIR"/make.log" |
261 |
fi |
return 1 |
262 |
) |
else |
263 |
|
echo succesful 1>&2 |
264 |
|
fi |
265 |
|
) |
266 |
|
fi |
267 |
} |
} |
268 |
|
|
269 |
makemodel() |
makemodel() |
273 |
cd $1; |
cd $1; |
274 |
if test -r Makefile ; then |
if test -r Makefile ; then |
275 |
printf 'make ... ' 1>&2 |
printf 'make ... ' 1>&2 |
276 |
make >> make.log 2>&1 |
$MAKE >> make.log 2>&1 |
277 |
RETVAL=$? |
RETVAL=$? |
278 |
if test "x$RETVAL" != x0 ; then |
if test "x$RETVAL" != x0 ; then |
279 |
tail make.log |
tail make.log |
292 |
# linkdata flag |
# linkdata flag |
293 |
# |
# |
294 |
# symbolically link data files to run directory |
# symbolically link data files to run directory |
295 |
if [ $1 -ne 0 ]; then |
if test "x$1" = x1 ; then |
296 |
( cd $2 ; ln -sf ../input/* . ) |
( |
297 |
|
cd $2 |
298 |
|
files=`( cd ../input ; ls -1 | grep -v CVS )` |
299 |
|
for i in $files ; do |
300 |
|
if test ! -d "../input/"$i ; then |
301 |
|
ln -sf "../input/"$i $i |
302 |
|
fi |
303 |
|
done |
304 |
|
) |
305 |
fi |
fi |
306 |
} |
} |
307 |
|
|
308 |
runmodel() |
runmodel() |
309 |
{ |
{ |
310 |
# runmodel directory exe |
# runmodel directory |
311 |
# |
# |
312 |
# runs the model "exe" in "directory" (exe is relative to directory) |
# runs "$COMMAND" in "directory" |
313 |
|
# (where "$COMMAND" is relative to "directory") |
314 |
( |
( |
315 |
cd $1 |
cd $1 |
316 |
if [ -x $2 ]; then |
printf 'runmodel: ' 1>&2 |
317 |
if [ $quick -eq 0 ]; then |
# make output.txt |
318 |
rm -f output.txt |
$COMMAND |
319 |
fi |
RETVAL=$? |
320 |
printf 'runmodel: ' 1>&2 |
if test "x$RETVAL" = x0 ; then |
321 |
make output.txt |
cp output.txt $CDIR"/output.txt" |
322 |
RETVAL=$? |
return 0 |
323 |
if test "x$RETVAL" = x0 ; then |
else |
324 |
cp output.txt $CDIR"/output.txt" |
return 1 |
|
return 0 |
|
|
else |
|
|
return 1 |
|
|
fi |
|
325 |
fi |
fi |
326 |
) |
) |
327 |
} |
} |
362 |
return 0 |
return 0 |
363 |
else |
else |
364 |
echo |
echo |
365 |
echo "createcodelet: failed to compile codelet" | tee |
echo "createcodelet: failed to compile codelet" |
366 |
exit 1 |
exit 1 |
367 |
fi |
fi |
368 |
} |
} |
394 |
{ |
{ |
395 |
cat - << EOF |
cat - << EOF |
396 |
$0 [-help] [-quick] [-verbose] dir1 [dir2] [...] |
$0 [-help] [-quick] [-verbose] dir1 [dir2] [...] |
397 |
-help Show this help message |
|
398 |
-quick Skip "genmake" and "make depend" if the Makefile exists |
-help|-h Show this help message |
399 |
-quiet Reduce the amount of output |
-quiet Reduce the amount of output |
400 |
-verbose Produce copious amounts of output |
-verbose Produce copious amounts of output |
401 |
-debug Produce even more output which will mean nothing to most |
-debug Produce even more output which will mean nothing to most |
402 |
-force Do "make CLEAN" before compiling. This forces a complete rebuild. |
-force Do "make CLEAN" before compiling. This forces a complete rebuild. |
403 |
-clean Do "make CLEAN" after compiling and testing. |
-clean Do "make CLEAN" after compiling and testing. |
|
-noieee By default, $0 uses the -ieee option for genmake. This turns it off. |
|
404 |
-cleanup Aggresively removes all model output, executables and object files |
-cleanup Aggresively removes all model output, executables and object files |
405 |
and then exits. Use with care. |
and then exits. Use with care. |
406 |
|
|
429 |
# Default properties |
# Default properties |
430 |
debug=0 |
debug=0 |
431 |
verbose=1 |
verbose=1 |
|
quick=0 |
|
432 |
clean=0 |
clean=0 |
|
ieee=1 |
|
433 |
expts='' |
expts='' |
434 |
|
# ieee=1 |
435 |
|
|
436 |
OPTFILES= |
IEEE= |
437 |
ADDRESSES=edhill@mitgcm.org |
if test "x$MITGCM_IEEE" != x ; then |
438 |
|
IEEE=$MITGCM_IEEE |
439 |
|
fi |
440 |
|
|
441 |
|
|
442 |
|
CLEANUP=f |
443 |
|
QUICK=f |
444 |
|
NOGENMAKE=f |
445 |
|
NOCLEAN=f |
446 |
|
NODEPEND=f |
447 |
|
|
448 |
|
BASH= |
449 |
|
OPTFILE=NONE |
450 |
|
ADDRESSES= |
451 |
TESTDIRS= |
TESTDIRS= |
452 |
MPACKDIR="../tools/mpack-1.6" |
MPACKDIR="../tools/mpack-1.6" |
453 |
MPACK="$MPACKDIR/mpack" |
MPACK="$MPACKDIR/mpack" |
454 |
|
COMMAND="make output.txt" |
455 |
|
MAKE=make |
456 |
|
MPI=f |
457 |
|
|
458 |
echo -n "parsing options... " |
echo -n "parsing options... " |
459 |
|
|
474 |
-help | --help | -h | --h) |
-help | --help | -h | --h) |
475 |
usage ;; |
usage ;; |
476 |
|
|
477 |
-optfile | --optfile | -f | --f) |
-optfile | --optfile | -of | --of) |
478 |
ac_prev=OPTFILES ;; |
ac_prev=OPTFILE ;; |
479 |
-optfile=* | --optfile=*) |
-optfile=* | --optfile=* | -of=* | --of=*) |
480 |
OPTFILES=$ac_optarg ;; |
OPTFILE=$ac_optarg ;; |
481 |
|
|
482 |
-addr | --addr | -a | --a) |
-addr | --addr | -a | --a) |
483 |
ac_prev=ADDRESSES ;; |
ac_prev=ADDRESSES ;; |
489 |
-tdir=* | --tdir=*) |
-tdir=* | --tdir=*) |
490 |
TESTDIRS=$ac_optarg ;; |
TESTDIRS=$ac_optarg ;; |
491 |
|
|
492 |
-quick) quick=1 ;; |
-bash | --bash | -b | --b) |
493 |
|
ac_prev=BASH ;; |
494 |
|
-bash=* | --bash=*) |
495 |
|
BASH=$ac_optarg ;; |
496 |
|
|
497 |
|
-command | --command | -c | --c) |
498 |
|
ac_prev=COMMAND ;; |
499 |
|
-command=* | --command=*) |
500 |
|
COMMAND=$ac_optarg ;; |
501 |
|
|
502 |
|
-make | --make | -m | --m) |
503 |
|
ac_prev=MAKE ;; |
504 |
|
-make=* | --make=*) |
505 |
|
MAKE=$ac_optarg ;; |
506 |
|
|
507 |
|
-clean | --clean) |
508 |
|
CLEANUP=t ;; |
509 |
|
|
510 |
|
-quick | --quick | -q | --q) |
511 |
|
QUICK=t ;; |
512 |
|
-nogenmake | --nogenmake | -ng | --ng) |
513 |
|
NOGENMAKE=t ;; |
514 |
|
-noclean | --noclean | -nc | --nc) |
515 |
|
NOCLEAN=t ;; |
516 |
|
-nodepend | --nodepend | -nd | --nd) |
517 |
|
NODEPEND=t ;; |
518 |
|
|
519 |
|
-mpi) MPI=true ;; |
520 |
|
|
521 |
|
-ieee) IEEE=true ;; |
522 |
|
-noieee) IEEE= ;; |
523 |
|
|
524 |
-verbose) verbose=2 ;; |
-verbose) verbose=2 ;; |
525 |
-debug) debug=1 ;; |
-debug) debug=1 ;; |
|
-clean) clean=1 ;; |
|
|
-noieee) ieee=0 ;; |
|
526 |
-quiet) verbose=0 ;; |
-quiet) verbose=0 ;; |
527 |
|
|
528 |
-*) |
-*) |
539 |
|
|
540 |
done |
done |
541 |
|
|
542 |
|
if test "x$QUICK" = xt ; then |
543 |
|
NOGENMAKE=t |
544 |
|
NOCLEAN=t |
545 |
|
NODEPEND=t |
546 |
|
fi |
547 |
|
|
548 |
if test "x$TESTDIRS" = x ; then |
if test "x$TESTDIRS" = x ; then |
549 |
TESTDIRS=`scandirs` |
TESTDIRS=`scandirs` |
550 |
fi |
fi |
551 |
|
|
552 |
|
if test "x$OPTFILE" = xNONE -a "x$MITGCM_OF" != x ; then |
553 |
|
OPTFILE=$MITGCM_OF |
554 |
|
fi |
555 |
|
|
556 |
echo "OK" |
echo "OK" |
557 |
|
|
558 |
# create the FORTRAN comparison code |
# create the FORTRAN comparison code |
563 |
|
|
564 |
# Create a uniquely named directory to store results |
# Create a uniquely named directory to store results |
565 |
MACH=`hostname` |
MACH=`hostname` |
566 |
|
UNAMEA=`uname -a` |
567 |
DATE=`date +%Y%m%d` |
DATE=`date +%Y%m%d` |
568 |
BASE=$MACH"_"$DATE"_" |
BASE=$MACH"_"$DATE"_" |
569 |
DNUM=0 |
DNUM=0 |
591 |
|
|
592 |
NDIR=0 |
NDIR=0 |
593 |
|
|
594 |
# For each optfile... |
of_path= |
595 |
for OPTFILE in $OPTFILES ; do |
if test "x$OPTFILE" != xNONE ; then |
596 |
|
if test -r $OPTFILE ; then |
597 |
|
# get the path |
598 |
|
path=${OPTFILE%/*} |
599 |
|
if test "x$path" = x ; then |
600 |
|
of_path=`pwd` |
601 |
|
else |
602 |
|
of_path=`( cd $path > /dev/null 2>&1 ; pwd )` |
603 |
|
fi |
604 |
|
file=${OPTFILE##*/} |
605 |
|
OPTFILE=$of_path/$file |
606 |
|
else |
607 |
|
echo |
608 |
|
echo "WARNING: can't read OPTFILE=\"$OPTFILE\" but will try to use it..." |
609 |
|
fi |
610 |
|
fi |
611 |
|
echo |
612 |
|
echo "OPTFILE=$OPTFILE" >> $SUMMARY |
613 |
|
echo >> $SUMMARY |
614 |
|
|
615 |
OPTFILE=`pwd`"/$OPTFILE" |
# ...and each test directory... |
616 |
if test ! -r $OPTFILE ; then |
for dir in $TESTDIRS ; do |
617 |
echo "Error: can't read optfile \"$OPTFILE\"" |
|
618 |
exit 1 |
# Cleanup only! |
619 |
|
if test "x$CLEANUP" = xt ; then |
620 |
|
if test -r $dir/build/Makefile ; then |
621 |
|
( cd $dir/build ; make CLEAN ) |
622 |
|
fi |
623 |
|
if test -r $dir/input/Makefile ; then |
624 |
|
( cd $dir/input ; make CLEAN ) |
625 |
|
fi |
626 |
|
continue |
627 |
fi |
fi |
628 |
|
|
629 |
|
# Verify that the testdir exists and contains previous |
630 |
|
# results in the correct location--or skip this directory! |
631 |
|
if test ! -r $dir"/results/output.txt" ; then |
632 |
|
echo "can't read \"$dir/results/output.txt\" -- skipping $dir" |
633 |
|
continue |
634 |
|
fi |
635 |
|
|
636 |
|
echo "-------------------------------------------------------------------------------" |
637 |
echo |
echo |
638 |
echo "OPTFILE=$OPTFILE" >> $SUMMARY |
echo "Experiment: $dir" |
639 |
echo >> $SUMMARY |
echo |
640 |
|
unset genmake makedepend make run |
641 |
# ...and each test directory... |
results='-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --' |
|
for dir in $TESTDIRS ; do |
|
|
|
|
|
# Create an output dir for each OPTFILE/tdir combination |
|
|
CDIR=$DRESULTS"/"$NDIR |
|
|
mkdir $CDIR |
|
|
CDIR=`pwd`"/$CDIR" |
|
642 |
|
|
643 |
# ...configue, make, run, and compare the output. |
builddir="input" |
644 |
echo "-------------------------------------------------------------------------------" |
rundir="input" |
645 |
echo |
use_seperate_build=0 |
646 |
echo "Experiment: $dir" |
if test -d $dir/build -a -r $dir/build ; then |
647 |
echo |
builddir="build" |
648 |
unset genmake makedepend make run |
rundir="build" |
649 |
results='-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --' |
use_seperate_build=1 |
650 |
( cd $dir/input; rm -f *.{o,f,c,F} *.[f,F]90 work* output.txt Make* make.log; ) |
linkdata $use_seperate_build $dir/$rundir |
651 |
if [ -r $dir/build ]; then |
fi |
652 |
seperatebuilddir=1 |
|
653 |
builddir=build |
CODE_DIR=$dir/code |
654 |
rundir=build |
BUILD_DIR=$dir/$builddir |
655 |
( cd $dir/build; ln -sf ../input/* . ) |
MPI_FILES="CPP_EEOPTIONS.h_mpi SIZE.h_mpi" |
656 |
else |
NOMPI_FILES="CPP_EEOPTIONS.h_nompi SIZE.h_nompi" |
657 |
seperatebuilddir=0 |
|
658 |
builddir=input |
# Is this an MPI run? |
659 |
rundir=input |
if test "x$MPI" = xt ; then |
660 |
|
FILES=$MPI_FILES |
661 |
|
endings="_mpi" |
662 |
|
else |
663 |
|
FILES=$NOMPI_FILES |
664 |
|
endings="_nompi" |
665 |
|
fi |
666 |
|
|
667 |
|
# Check to see that we have the files |
668 |
|
have_files=t |
669 |
|
for i in $FILES ; do |
670 |
|
if test ! -r $CODE_DIR/$i ; then |
671 |
|
echo "Warning: can't read file $CODE_DIR/$i" |
672 |
|
have_files=f |
673 |
fi |
fi |
674 |
|
done |
675 |
|
if test "x$have_files" != xt -a "x$MPI" = xt ; then |
676 |
|
echo "Skipping $dir due to lack of input files (see above warning)" |
677 |
|
continue |
678 |
|
fi |
679 |
|
|
680 |
|
# If we have the $FILES and they differ, copy the $FILES to $BUILD_DIR |
681 |
|
if test "x$have_files" = xt ; then |
682 |
|
for i in $FILES ; do |
683 |
|
sstr="s|$endings||" |
684 |
|
name=`echo $i | sed -e $sstr ` |
685 |
|
cmp $CODE_DIR/$i $BUILD_DIR/$name > /dev/null 2>&1 |
686 |
|
RETVAL=$? |
687 |
|
if test "x$RETVAL" != x0 ; then |
688 |
|
cp $CODE_DIR/$i $BUILD_DIR/$name |
689 |
|
fi |
690 |
|
done |
691 |
|
fi |
692 |
|
|
693 |
|
# Create an output dir for each OPTFILE/tdir combination |
694 |
|
CDIR=$DRESULTS"/"$DRESULTS"_"$NDIR |
695 |
|
mkdir $CDIR |
696 |
|
CDIR=`pwd`"/$CDIR" |
697 |
|
|
698 |
|
if test "x$CLEANUP" = xt ; then |
699 |
|
makeclean $dir/$builddir |
700 |
|
else |
701 |
genmakemodel $dir/$builddir && genmake=Y \ |
genmakemodel $dir/$builddir && genmake=Y \ |
702 |
&& makeclean $dir/$builddir \ |
&& makeclean $dir/$builddir \ |
703 |
&& makedependmodel $dir/$builddir && makedepend=Y \ |
&& makedependmodel $dir/$builddir && makedepend=Y \ |
704 |
&& makemodel $dir/$builddir && make=Y \ |
&& makemodel $dir/$builddir && make=Y \ |
705 |
&& linkdata $seperatebuilddir $dir/$rundir \ |
&& linkdata $use_seperate_build $dir/$rundir \ |
706 |
&& runmodel $dir/$builddir mitgcmuv && run=Y \ |
&& runmodel $dir/$rundir && run=Y \ |
707 |
&& results=`testoutput $dir $rundir` |
&& results=`testoutput $dir $rundir` |
708 |
echo |
fi |
709 |
formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results |
|
710 |
echo |
echo |
711 |
formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results >> $SUMMARY |
formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} \ |
712 |
|
${run:-N} $results |
713 |
( cd $DRESULTS"/"$NDIR ; gzip * ) |
echo |
714 |
|
formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} \ |
715 |
tar -cf $DRESULTS"/"$NDIR".tar" $DRESULTS"/"$NDIR |
${run:-N} $results >> $SUMMARY |
716 |
$MPACK -s MITgcm-test -m 1000000 $DRESULTS"/"$NDIR".tar" $ADDRESSES |
echo "fresults='" > $CDIR"/summary.txt" |
717 |
|
formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} \ |
718 |
|
${run:-N} $results >> $CDIR"/summary.txt" |
719 |
|
echo "'" >> $CDIR"/summary.txt" |
720 |
|
echo "MACH='$MACH'" >> $CDIR"/summary.txt" |
721 |
|
echo "UNAMEA='$UNAMEA'" >> $CDIR"/summary.txt" |
722 |
|
echo "DATE='$DATE'" >> $CDIR"/summary.txt" |
723 |
|
echo "tdir='$dir'" >> $CDIR"/summary.txt" |
724 |
|
|
725 |
|
( |
726 |
|
cd $DRESULTS |
727 |
|
tar -cf $NDIR".tar" $DRESULTS"_"$NDIR > /dev/null 2>&1 |
728 |
|
gzip $NDIR".tar" |
729 |
|
) |
730 |
|
|
731 |
|
if test "x$ADDRESSES" = xNONE -o "x$ADDRESSES" = x ; then |
732 |
|
echo "No mail sent" |
733 |
|
else |
734 |
|
$MPACK -s MITgcm-test -m 1000000 $DRESULTS"/"$NDIR".tar.gz" $ADDRESSES |
735 |
|
RETVAL=$? |
736 |
|
if test "x$RETVAL" != x0 ; then |
737 |
|
echo "Warning: \"$MPACK\" failed -- please contact <edhill@mitgcm.org>" |
738 |
|
else |
739 |
|
rm -f $DRESULTS"/"$NDIR".tar*" |
740 |
|
fi |
741 |
|
fi |
742 |
|
|
743 |
NDIR=$(( $NDIR + 1 )) |
echo "-------------------------------------------------------------------------------" |
744 |
|
|
745 |
done |
NDIR=$(( $NDIR + 1 )) |
746 |
|
|
747 |
done |
done |
748 |
|
|
749 |
# rm tmp_cmpnum.f a.out |
rm tmp_cmpnum.f a.out |
750 |
|
|
751 |
echo ------------------------------------------------------------------------------- |
if test "x$CLEANUP" != xt ; then |
752 |
echo |
cat $SUMMARY |
753 |
echo >> $SUMMARY |
fi |
|
date >> $SUMMARY |
|
|
cat $SUMMARY |
|
|
|
|
|
# tar -cf $DRESULTS".tar" $DRESULTS |
|
|
# |
|
|
# $MPACK -s MITgcm-test -m 1000000 $DRESULTS".tar" $ADDRESSES |
|
754 |
|
|