| 1 |
#! /usr/bin/env bash |
| 2 |
|
| 3 |
# $Header: /u/u3/gcmpack/MITgcm_contrib/test_scripts/faulks/test_lcs,v 1.1 2003/11/28 17:37:57 edhill Exp $ |
| 4 |
|
| 5 |
# Ed Hill |
| 6 |
|
| 7 |
# Testing script designed to be run on halem. Note that halem |
| 8 |
# doesn't seem to have a working cron system for ordinary users -- I |
| 9 |
# got multiple errors. |
| 10 |
|
| 11 |
usage() |
| 12 |
{ |
| 13 |
cat << EOF |
| 14 |
|
| 15 |
Usage: $0 [OPTIONS] |
| 16 |
|
| 17 |
where possible OPTIONS are: |
| 18 |
(-help|-h) print usage |
| 19 |
(-of | -optfile)FILE specify an OPTFILE |
| 20 |
(default=$OPTFILE) |
| 21 |
(-[no]ieee) IEEE math flag |
| 22 |
(default=-ieee) |
| 23 |
|
| 24 |
EOF |
| 25 |
exit 1 |
| 26 |
} |
| 27 |
|
| 28 |
. /u1/edhill/bin/bash_env |
| 29 |
|
| 30 |
# defaults |
| 31 |
OPTFILE="../tools/build_options/osf1_alpha_f77" |
| 32 |
IEEE="-ieee" |
| 33 |
|
| 34 |
# Parse options |
| 35 |
ac_prev= |
| 36 |
for ac_option ; do |
| 37 |
|
| 38 |
# If the previous option needs an argument, assign it. |
| 39 |
if test -n "$ac_prev"; then |
| 40 |
eval "$ac_prev=\$ac_option" |
| 41 |
ac_prev= |
| 42 |
continue |
| 43 |
fi |
| 44 |
|
| 45 |
ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` |
| 46 |
|
| 47 |
case $ac_option in |
| 48 |
|
| 49 |
-help | --help | -h | --h) |
| 50 |
usage ;; |
| 51 |
|
| 52 |
-of | --of | -optfile | --optfile) |
| 53 |
ac_prev=OPTFILE ;; |
| 54 |
--of=* | -of=* | --optfile=* | -optfile=*) |
| 55 |
OPTFILE=$ac_optarg ;; |
| 56 |
|
| 57 |
-ieee) |
| 58 |
IEEE="-ieee" ;; |
| 59 |
-noieee) |
| 60 |
IEEE= ;; |
| 61 |
|
| 62 |
*) |
| 63 |
echo "Error: don't understand argument \"$ac_option\"" |
| 64 |
usage |
| 65 |
;; |
| 66 |
|
| 67 |
esac |
| 68 |
|
| 69 |
done |
| 70 |
|
| 71 |
echo -n "Creating a temp directory ..." |
| 72 |
cd /scr/edhill |
| 73 |
mach=`hostname` |
| 74 |
file=${OPTFILE##*/} |
| 75 |
tdir=$mach"_"$file |
| 76 |
test -e $tdir && rm -rf $tdir |
| 77 |
mkdir $tdir |
| 78 |
cd $tdir |
| 79 |
echo " done" |
| 80 |
|
| 81 |
echo -n "Getting the previously-uploaded tarball ..." |
| 82 |
tball=/u1/edhill/MITgcm.tar.gz |
| 83 |
if test -r $tball ; then |
| 84 |
gunzip $tball |
| 85 |
tar -xf ${tball/.gz/} |
| 86 |
else |
| 87 |
echo |
| 88 |
echo "ERROR: can't read \"$tball\"" |
| 89 |
exit 1 |
| 90 |
fi |
| 91 |
echo " done" |
| 92 |
|
| 93 |
echo "Running testreport using:" |
| 94 |
cd MITgcm/verification |
| 95 |
comm="./testreport $IEEE -a edhill@mitgcm.org" |
| 96 |
if test "x$OPTFILE" != x ; then |
| 97 |
comm="$comm -of=$OPTFILE" |
| 98 |
fi |
| 99 |
echo " \"$comm\"" |
| 100 |
echo "======================" |
| 101 |
echo |
| 102 |
$comm |
| 103 |
|
| 104 |
cd /u1/edhill/ |
| 105 |
rm -rf /u1/edhill/MITgcm.tar |
| 106 |
rm -rf /scr/edhill/$tdir |