1 |
#!/bin/bash |
#!/bin/bash |
2 |
# |
# |
3 |
# $Header$ |
# $Header$ |
4 |
|
# $Name$ |
5 |
# |
# |
6 |
|
|
7 |
usage() |
usage() |
12 |
echo "where possible OPTIONS are:" |
echo "where possible OPTIONS are:" |
13 |
echo " (-help|-h) print usage" |
echo " (-help|-h) print usage" |
14 |
echo " (-mpi) use MPI input files" |
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" |
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 " (DEF=\"edhill@mitgcm.org\")" |
echo " (DEF=\"edhill@mitgcm.org\")" |
20 |
echo " (DEF=\"\" which builds all)" |
echo " (DEF=\"\" which builds all)" |
21 |
echo " (-b|-bash)STRING location of \"bash\" executable" |
echo " (-b|-bash)STRING location of \"bash\" executable" |
22 |
echo " (DEF=\"\" for \"/bin/bash\")" |
echo " (DEF=\"\" for \"/bin/bash\")" |
23 |
echo " (-c|-command)STRING command to run" |
echo " (-command)STRING command to run" |
24 |
echo " (DEF=\"make output.txt\")" |
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 |
echo |
33 |
echo "and where STRING follows a whitespace-delimited format" |
echo "and where STRING follows a whitespace-delimited format" |
34 |
echo "such as:" |
echo "such as:" |
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 |
181 |
genmakemodel() |
genmakemodel() |
182 |
{ |
{ |
183 |
# genmakemodel directory |
# genmakemodel directory |
184 |
GENMAKE2="$BASH ../../../tools/genmake2" |
if test "x$NOGENMAKE" = xt ; then |
185 |
( |
echo "genmake skipped!" |
186 |
cd $1; |
else |
187 |
printf 'genmake ... ' 1>&2 |
GENMAKE2="$BASH ../../../tools/genmake2" |
188 |
# ../../../tools/genmake -ieee -mods=../code > make.log 2>&1 |
( |
189 |
$GENMAKE2 -ds --mods=../code "--optfile="$OPTFILE > make.log 2>&1 |
cd $1; |
190 |
RETVAL=$? |
command="$GENMAKE2 -ds -m $MAKE --mods=../code" |
191 |
for i in gm_state gm_optfile gm_local Makefile ; do |
if test "x$OPTFILE" != xNONE ; then |
192 |
if test -r $i ; then |
command="$command --optfile=$OPTFILE" |
193 |
cp $i $CDIR |
# echo " command=\"$command\"" |
194 |
fi |
fi |
195 |
done |
if test "x$IEEE" != x ; then |
196 |
if test "x$RETVAL" != x0 ; then |
command="$command -ieee" |
197 |
tail make.log |
fi |
198 |
echo "genmakemodel: genmake failed" 1>&2 |
# echo "command: \"$command\"" |
199 |
cp make.log $CDIR |
printf 'genmake ... ' 1>&2 |
200 |
return 1 |
$command > make.log 2>&1 |
201 |
else |
RETVAL=$? |
202 |
echo "succesful" 1>&2 |
for i in genmake_state genmake_optfile genmake_local Makefile ; do |
203 |
fi |
if test -r $i ; then |
204 |
) |
cp $i $CDIR |
205 |
|
fi |
206 |
|
done |
207 |
|
if test "x$RETVAL" != x0 ; then |
208 |
|
tail make.log |
209 |
|
echo "genmakemodel: genmake failed" 1>&2 |
210 |
|
cp make.log $CDIR |
211 |
|
return 1 |
212 |
|
else |
213 |
|
echo "succesful" 1>&2 |
214 |
|
fi |
215 |
|
) |
216 |
|
fi |
217 |
} |
} |
218 |
|
|
219 |
makeclean() |
makeclean() |
220 |
{ |
{ |
221 |
# makeclean directory |
# makeclean directory |
222 |
( |
if test "x$NOCLEAN" = xt ; then |
223 |
cd $1; |
echo "make CLEAN skipped!" |
224 |
if test -e output.txt ; then |
else |
225 |
rm -f output.txt |
( |
226 |
fi |
cd $1; |
227 |
printf 'make CLEAN ... ' 2>&1 |
if test -e output.txt ; then |
228 |
if test -r Makefile ; then |
rm -f output.txt |
|
make CLEAN >> make.log 2>&1 |
|
|
RETVAL=$? |
|
|
if test "x$RETVAL" != x0 ; then |
|
|
tail make.log |
|
|
echo "makeclean: \"make CLEAN\" failed" 1>&2 |
|
|
cp make.log $CDIR"/make.log" |
|
|
return 1 |
|
229 |
fi |
fi |
230 |
fi |
printf 'make CLEAN ... ' 2>&1 |
231 |
echo succesful 1>&2 |
if test -r Makefile ; then |
232 |
exit 0 |
$MAKE CLEAN >> make.log 2>&1 |
233 |
) |
RETVAL=$? |
234 |
|
if test "x$RETVAL" != x0 ; then |
235 |
|
tail make.log |
236 |
|
echo "makeclean: \"make CLEAN\" failed" 1>&2 |
237 |
|
cp make.log $CDIR"/make.log" |
238 |
|
return 1 |
239 |
|
fi |
240 |
|
fi |
241 |
|
echo succesful 1>&2 |
242 |
|
exit 0 |
243 |
|
) |
244 |
|
fi |
245 |
} |
} |
246 |
|
|
247 |
makedependmodel() |
makedependmodel() |
248 |
{ |
{ |
249 |
# makedependmodel directory |
# makedependmodel directory |
250 |
( |
if test "x$NODEPEND" = xt ; then |
251 |
cd $1; |
echo "make depend skipped!" |
252 |
printf 'make depend ... ' 1>&2 |
else |
253 |
make depend >> make.log 2>&1 |
( |
254 |
RETVAL=$? |
cd $1; |
255 |
if test "x$RETVAL" != x0 ; then |
printf 'make depend ... ' 1>&2 |
256 |
tail make.log |
$MAKE depend >> make.log 2>&1 |
257 |
echo "makedependmodel: make depend failed" 1>&2 |
RETVAL=$? |
258 |
cp make.log $CDIR"/make.log" |
if test "x$RETVAL" != x0 ; then |
259 |
return 1 |
tail make.log |
260 |
else |
echo "makedependmodel: make depend failed" 1>&2 |
261 |
echo succesful 1>&2 |
cp make.log $CDIR"/make.log" |
262 |
fi |
return 1 |
263 |
) |
else |
264 |
|
echo succesful 1>&2 |
265 |
|
fi |
266 |
|
) |
267 |
|
fi |
268 |
} |
} |
269 |
|
|
270 |
makemodel() |
makemodel() |
274 |
cd $1; |
cd $1; |
275 |
if test -r Makefile ; then |
if test -r Makefile ; then |
276 |
printf 'make ... ' 1>&2 |
printf 'make ... ' 1>&2 |
277 |
make >> make.log 2>&1 |
$MAKE >> make.log 2>&1 |
278 |
RETVAL=$? |
RETVAL=$? |
279 |
if test "x$RETVAL" != x0 ; then |
if test "x$RETVAL" != x0 ; then |
280 |
tail make.log |
tail make.log |
387 |
{ |
{ |
388 |
cat - << EOF |
cat - << EOF |
389 |
$0 [-help] [-quick] [-verbose] dir1 [dir2] [...] |
$0 [-help] [-quick] [-verbose] dir1 [dir2] [...] |
390 |
-help Show this help message |
|
391 |
-quick Skip "genmake" and "make depend" if the Makefile exists |
-help|-h Show this help message |
392 |
-quiet Reduce the amount of output |
-quiet Reduce the amount of output |
393 |
-verbose Produce copious amounts of output |
-verbose Produce copious amounts of output |
394 |
-debug Produce even more output which will mean nothing to most |
-debug Produce even more output which will mean nothing to most |
395 |
-force Do "make CLEAN" before compiling. This forces a complete rebuild. |
-force Do "make CLEAN" before compiling. This forces a complete rebuild. |
396 |
-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. |
|
397 |
-cleanup Aggresively removes all model output, executables and object files |
-cleanup Aggresively removes all model output, executables and object files |
398 |
and then exits. Use with care. |
and then exits. Use with care. |
399 |
|
|
425 |
clean=0 |
clean=0 |
426 |
expts='' |
expts='' |
427 |
# ieee=1 |
# ieee=1 |
428 |
# quick=0 |
|
429 |
|
IEEE= |
430 |
|
if test "x$MITGCM_IEEE" != x ; then |
431 |
|
IEEE=$MITGCM_IEEE |
432 |
|
fi |
433 |
|
|
434 |
|
|
435 |
|
CLEANUP=f |
436 |
|
QUICK=f |
437 |
|
NOGENMAKE=f |
438 |
|
NOCLEAN=f |
439 |
|
NODEPEND=f |
440 |
|
|
441 |
BASH= |
BASH= |
442 |
OPTFILES= |
OPTFILE=NONE |
443 |
ADDRESSES=edhill@mitgcm.org |
ADDRESSES= |
444 |
TESTDIRS= |
TESTDIRS= |
445 |
MPACKDIR="../tools/mpack-1.6" |
MPACKDIR="../tools/mpack-1.6" |
446 |
MPACK="$MPACKDIR/mpack" |
MPACK="$MPACKDIR/mpack" |
447 |
COMMAND="make output.txt" |
COMMAND="make output.txt" |
448 |
|
MAKE=make |
449 |
MPI=f |
MPI=f |
450 |
|
|
451 |
echo -n "parsing options... " |
echo -n "parsing options... " |
468 |
usage ;; |
usage ;; |
469 |
|
|
470 |
-optfile | --optfile | -of | --of) |
-optfile | --optfile | -of | --of) |
471 |
ac_prev=OPTFILES ;; |
ac_prev=OPTFILE ;; |
472 |
-optfile=* | --optfile=* | -of=* | --of=*) |
-optfile=* | --optfile=* | -of=* | --of=*) |
473 |
OPTFILES=$ac_optarg ;; |
OPTFILE=$ac_optarg ;; |
474 |
|
|
475 |
-addr | --addr | -a | --a) |
-addr | --addr | -a | --a) |
476 |
ac_prev=ADDRESSES ;; |
ac_prev=ADDRESSES ;; |
492 |
-command=* | --command=*) |
-command=* | --command=*) |
493 |
COMMAND=$ac_optarg ;; |
COMMAND=$ac_optarg ;; |
494 |
|
|
495 |
-mpi) MPI=t ;; |
-make | --make | -m | --m) |
496 |
|
ac_prev=MAKE ;; |
497 |
|
-make=* | --make=*) |
498 |
|
MAKE=$ac_optarg ;; |
499 |
|
|
500 |
|
-clean | --clean) |
501 |
|
CLEANUP=t ;; |
502 |
|
|
503 |
|
-quick | --quick | -q | --q) |
504 |
|
QUICK=t ;; |
505 |
|
-nogenmake | --nogenmake | -ng | --ng) |
506 |
|
NOGENMAKE=t ;; |
507 |
|
-noclean | --noclean | -nc | --nc) |
508 |
|
NOCLEAN=t ;; |
509 |
|
-nodepend | --nodepend | -nd | --nd) |
510 |
|
NODEPEND=t ;; |
511 |
|
|
512 |
|
-mpi) MPI=true ;; |
513 |
|
|
514 |
|
-ieee) IEEE=true ;; |
515 |
|
-noieee) IEEE= ;; |
516 |
|
|
517 |
-verbose) verbose=2 ;; |
-verbose) verbose=2 ;; |
518 |
-debug) debug=1 ;; |
-debug) debug=1 ;; |
|
-clean) clean=1 ;; |
|
519 |
-quiet) verbose=0 ;; |
-quiet) verbose=0 ;; |
520 |
|
|
521 |
-*) |
-*) |
532 |
|
|
533 |
done |
done |
534 |
|
|
535 |
|
if test "x$QUICK" = xt ; then |
536 |
|
NOGENMAKE=t |
537 |
|
NOCLEAN=t |
538 |
|
NODEPEND=t |
539 |
|
fi |
540 |
|
|
541 |
if test "x$TESTDIRS" = x ; then |
if test "x$TESTDIRS" = x ; then |
542 |
TESTDIRS=`scandirs` |
TESTDIRS=`scandirs` |
543 |
fi |
fi |
544 |
|
|
545 |
|
if test "x$OPTFILE" = xNONE -a "x$MITGCM_OF" != x ; then |
546 |
|
OPTFILE=$MITGCM_OF |
547 |
|
fi |
548 |
|
|
549 |
echo "OK" |
echo "OK" |
550 |
|
|
551 |
# create the FORTRAN comparison code |
# create the FORTRAN comparison code |
584 |
|
|
585 |
NDIR=0 |
NDIR=0 |
586 |
|
|
587 |
# For each optfile... |
of_path= |
588 |
for OPTFILE in $OPTFILES ; do |
if test "x$OPTFILE" != xNONE ; then |
589 |
|
if test -r $OPTFILE ; then |
590 |
OPTFILE=`pwd`"/$OPTFILE" |
# get the path |
591 |
if test ! -r $OPTFILE ; then |
path=${OPTFILE%/*} |
592 |
echo "Error: can't read optfile \"$OPTFILE\"" |
if test "x$path" = x ; then |
593 |
exit 1 |
of_path=`pwd` |
594 |
|
else |
595 |
|
of_path=`( cd $path > /dev/null 2>&1 ; pwd )` |
596 |
|
fi |
597 |
|
file=${OPTFILE##*/} |
598 |
|
OPTFILE=$of_path/$file |
599 |
|
else |
600 |
|
echo |
601 |
|
echo "WARNING: can't read OPTFILE=\"$OPTFILE\" but will try to use it..." |
602 |
fi |
fi |
603 |
echo |
fi |
604 |
echo "OPTFILE=$OPTFILE" >> $SUMMARY |
echo |
605 |
echo >> $SUMMARY |
echo "OPTFILE=$OPTFILE" >> $SUMMARY |
606 |
|
echo >> $SUMMARY |
|
# ...and each test directory... |
|
|
for dir in $TESTDIRS ; do |
|
607 |
|
|
608 |
# Verify that the testdir exists and contains previous |
# ...and each test directory... |
609 |
# results in the correct location--or skip this directory! |
for dir in $TESTDIRS ; do |
610 |
if test ! -r $dir"/results/output.txt" ; then |
|
611 |
echo | tee -a $SUMMARY |
# Cleanup only! |
612 |
echo "can't read \"$dir/results/output.txt\" -- skipping $dir" \ |
if test "x$CLEANUP" = xt ; then |
613 |
| tee -a $SUMMARY |
if test -r $dir/build/Makefile ; then |
614 |
continue |
( cd $dir/build ; make CLEAN ) |
615 |
fi |
fi |
616 |
|
if test -r $dir/input/Makefile ; then |
617 |
# Is this an MPI run? |
( cd $dir/input ; make CLEAN ) |
|
if test "x$MPI" = xt ; then |
|
|
if test ! -r $dir"/code/CPP_EEOPTIONS.h_mpi" -o ! -r $dir"/code/SIZE.h_mpi" ; then |
|
|
echo | tee -a $SUMMARY |
|
|
echo "can't read \"$dir/code/CPP_EEOPTIONS.h_mpi\" or \"$dir/code/SIZE.h_mpi\"" \ |
|
|
| tee -a $SUMMARY |
|
|
continue |
|
|
else |
|
|
cp $dir"/code/CPP_EEOPTIONS.h_mpi" $dir"/code/CPP_EEOPTIONS.h" |
|
|
cp $dir"/code/SIZE.h_mpi" $dir"/code/SIZE.h" |
|
|
fi |
|
|
else |
|
|
if test -r $dir"/code/CPP_EEOPTIONS.h_nompi" ; then |
|
|
cp $dir"/code/CPP_EEOPTIONS.h_nompi" $dir"/code/CPP_EEOPTIONS.h" |
|
|
fi |
|
|
if test -r $dir"/code/SIZE.h_nompi" ; then |
|
|
cp $dir"/code/SIZE.h_nompi" $dir"/code/SIZE.h" |
|
|
fi |
|
618 |
fi |
fi |
619 |
|
continue |
620 |
|
fi |
621 |
|
|
622 |
# Create an output dir for each OPTFILE/tdir combination |
# Verify that the testdir exists and contains previous |
623 |
CDIR=$DRESULTS"/"$DRESULTS"_"$NDIR |
# results in the correct location--or skip this directory! |
624 |
mkdir $CDIR |
if test ! -r $dir"/results/output.txt" ; then |
625 |
CDIR=`pwd`"/$CDIR" |
echo "can't read \"$dir/results/output.txt\" -- skipping $dir" |
626 |
|
continue |
627 |
|
fi |
628 |
|
|
629 |
# ...configue, make, run, and compare the output. |
echo "-------------------------------------------------------------------------------" |
630 |
echo "-------------------------------------------------------------------------------" |
echo |
631 |
echo |
echo "Experiment: $dir" |
632 |
echo "Experiment: $dir" |
echo |
633 |
echo |
unset genmake makedepend make run |
634 |
unset genmake makedepend make run |
results='-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --' |
|
results='-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --' |
|
|
( cd $dir/input; rm -f *.{o,f,c,F} *.[f,F]90 work* output.txt Make* make.log; ) |
|
|
if [ -r $dir/build ]; then |
|
|
seperatebuilddir=1 |
|
|
builddir=build |
|
|
rundir=build |
|
|
( cd $dir/build; ln -sf ../input/* . ) |
|
|
else |
|
|
seperatebuilddir=0 |
|
|
builddir=input |
|
|
rundir=input |
|
|
fi |
|
635 |
|
|
636 |
|
if [ -r $dir/build ]; then |
637 |
|
seperatebuilddir=1 |
638 |
|
builddir=build |
639 |
|
rundir=build |
640 |
|
( cd $dir/build; ln -sf ../input/* . ) |
641 |
|
else |
642 |
|
seperatebuilddir=0 |
643 |
|
builddir=input |
644 |
|
rundir=input |
645 |
|
fi |
646 |
|
|
647 |
|
CODE_DIR=$dir/code |
648 |
|
BUILD_DIR=$dir/$builddir |
649 |
|
MPI_FILES="CPP_EEOPTIONS.h_mpi SIZE.h_mpi" |
650 |
|
NOMPI_FILES="CPP_EEOPTIONS.h_nompi SIZE.h_nompi" |
651 |
|
|
652 |
|
# Is this an MPI run? |
653 |
|
if test "x$MPI" = xt ; then |
654 |
|
FILES=$MPI_FILES |
655 |
|
endings="_mpi" |
656 |
|
else |
657 |
|
FILES=$NOMPI_FILES |
658 |
|
endings="_nompi" |
659 |
|
fi |
660 |
|
|
661 |
|
# Check to see that we have the files |
662 |
|
have_files=t |
663 |
|
for i in $FILES ; do |
664 |
|
if test ! -r $CODE_DIR/$i ; then |
665 |
|
echo "Warning: can't read file $CODE_DIR/$i" |
666 |
|
have_files=f |
667 |
|
fi |
668 |
|
done |
669 |
|
if test "x$have_files" != xt -a "x$MPI" = xt ; then |
670 |
|
echo "Skipping $dir due to lack of input files (see above warning)" |
671 |
|
continue |
672 |
|
fi |
673 |
|
|
674 |
|
# If we have the $FILES and they differ, copy the $FILES to $BUILD_DIR |
675 |
|
if test "x$have_files" = xt ; then |
676 |
|
for i in $FILES ; do |
677 |
|
sstr="s|$endings||" |
678 |
|
name=`echo $i | sed -e $sstr ` |
679 |
|
cmp $CODE_DIR/$i $BUILD_DIR/$name > /dev/null 2>&1 |
680 |
|
RETVAL=$? |
681 |
|
if test "x$RETVAL" != x0 ; then |
682 |
|
cp $CODE_DIR/$i $BUILD_DIR/$name |
683 |
|
fi |
684 |
|
done |
685 |
|
fi |
686 |
|
|
687 |
|
# Create an output dir for each OPTFILE/tdir combination |
688 |
|
CDIR=$DRESULTS"/"$DRESULTS"_"$NDIR |
689 |
|
mkdir $CDIR |
690 |
|
CDIR=`pwd`"/$CDIR" |
691 |
|
|
692 |
|
if test "x$CLEANUP" = xt ; then |
693 |
|
makeclean $dir/$builddir |
694 |
|
else |
695 |
genmakemodel $dir/$builddir && genmake=Y \ |
genmakemodel $dir/$builddir && genmake=Y \ |
696 |
&& makeclean $dir/$builddir \ |
&& makeclean $dir/$builddir \ |
697 |
&& makedependmodel $dir/$builddir && makedepend=Y \ |
&& makedependmodel $dir/$builddir && makedepend=Y \ |
699 |
&& linkdata $seperatebuilddir $dir/$rundir \ |
&& linkdata $seperatebuilddir $dir/$rundir \ |
700 |
&& runmodel $dir/$builddir && run=Y \ |
&& runmodel $dir/$builddir && run=Y \ |
701 |
&& results=`testoutput $dir $rundir` |
&& results=`testoutput $dir $rundir` |
702 |
echo |
fi |
703 |
formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} \ |
|
704 |
${run:-N} $results |
echo |
705 |
echo |
formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} \ |
706 |
formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} \ |
${run:-N} $results |
707 |
${run:-N} $results >> $SUMMARY |
echo |
708 |
echo "fresults='" > $CDIR"/summary.txt" |
formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} \ |
709 |
formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} \ |
${run:-N} $results >> $SUMMARY |
710 |
${run:-N} $results >> $CDIR"/summary.txt" |
echo "fresults='" > $CDIR"/summary.txt" |
711 |
echo "'" >> $CDIR"/summary.txt" |
formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} \ |
712 |
echo "MACH='$MACH'" >> $CDIR"/summary.txt" |
${run:-N} $results >> $CDIR"/summary.txt" |
713 |
echo "UNAMEA='$UNAMEA'" >> $CDIR"/summary.txt" |
echo "'" >> $CDIR"/summary.txt" |
714 |
echo "DATE='$DATE'" >> $CDIR"/summary.txt" |
echo "MACH='$MACH'" >> $CDIR"/summary.txt" |
715 |
echo "tdir='$dir'" >> $CDIR"/summary.txt" |
echo "UNAMEA='$UNAMEA'" >> $CDIR"/summary.txt" |
716 |
|
echo "DATE='$DATE'" >> $CDIR"/summary.txt" |
717 |
( |
echo "tdir='$dir'" >> $CDIR"/summary.txt" |
718 |
cd $DRESULTS |
|
719 |
tar -cf $NDIR".tar" $DRESULTS"_"$NDIR > /dev/null 2>&1 |
( |
720 |
gzip $NDIR".tar" |
cd $DRESULTS |
721 |
) |
tar -cf $NDIR".tar" $DRESULTS"_"$NDIR > /dev/null 2>&1 |
722 |
|
gzip $NDIR".tar" |
723 |
|
) |
724 |
|
|
725 |
|
if test "x$ADDRESSES" = xNONE -o "x$ADDRESSES" = x ; then |
726 |
|
echo "No mail sent" |
727 |
|
else |
728 |
$MPACK -s MITgcm-test -m 1000000 $DRESULTS"/"$NDIR".tar.gz" $ADDRESSES |
$MPACK -s MITgcm-test -m 1000000 $DRESULTS"/"$NDIR".tar.gz" $ADDRESSES |
729 |
RETVAL=$? |
RETVAL=$? |
730 |
if test "x$RETVAL" != x0 ; then |
if test "x$RETVAL" != x0 ; then |
732 |
else |
else |
733 |
rm -f $DRESULTS"/"$NDIR".tar*" |
rm -f $DRESULTS"/"$NDIR".tar*" |
734 |
fi |
fi |
735 |
|
fi |
736 |
|
|
737 |
NDIR=$(( $NDIR + 1 )) |
echo "-------------------------------------------------------------------------------" |
738 |
|
|
739 |
done |
NDIR=$(( $NDIR + 1 )) |
740 |
|
|
741 |
done |
done |
742 |
|
|
743 |
rm tmp_cmpnum.f a.out |
rm tmp_cmpnum.f a.out |