35 |
# =1 : update code (if no existing code -> swith to 2) |
# =1 : update code (if no existing code -> swith to 2) |
36 |
# =0 : use existing code (if no existing code -> swith to 2) |
# =0 : use existing code (if no existing code -> swith to 2) |
37 |
dInWeek=`date +%a` |
dInWeek=`date +%a` |
38 |
outDir=`hostname -s` |
|
39 |
TESTDIR="/scratch/jmc/test_${outDir}" |
dNam=`hostname -s | tr '[:upper:]' '[:lower:]'` |
40 |
outDir="${outDir}-${tst_grp}" |
TESTDIR="/scratch/jmc/test_${dNam}" |
41 |
|
outDir="${dNam}-${tst_grp}" |
42 |
|
#outDir=`hostname -s` |
43 |
MC=13 |
MC=13 |
44 |
sepDir=1 |
sepDir=1 |
45 |
option= |
option= |
46 |
|
|
47 |
#tst_list='g7a adm mpa g77 gfo+rs mth mp2+rs mpi ifc' |
#tst_list='g7a adm mpa g77 gfo+rs mth mp2+rs mpi ifc' |
48 |
#if test "x$dInWeek" = xSun ; then tst_list="$tst_list tlm oad" ; fi |
#if test "x$dInWeek" = xSun ; then tst_list="$tst_list tlm oad" ; fi |
49 |
if test $tst_grp = 'a' ; then |
if test $tst_grp = 'a' ; then |
61 |
|
|
62 |
TODAY=`date +%d` |
TODAY=`date +%d` |
63 |
tdir=$TESTDIR |
tdir=$TESTDIR |
64 |
|
updFile='updated_code' ; today=`date +%Y%m%d` |
65 |
if test $checkOut != 2 ; then |
if test $checkOut != 2 ; then |
66 |
if test -e $tdir/MITgcm/CVS ; then |
if test -e $tdir/MITgcm/CVS ; then |
67 |
echo $tdir/MITgcm/CVS 'exist' |
echo $tdir/MITgcm/CVS 'exist' |
68 |
if test $sepDir = 0 -a $checkOut = 1 ; then |
if test $sepDir = 0 -a $checkOut = 1 ; then |
69 |
|
#- remove date/lock-file: |
70 |
|
if test -f $tdir/$updFile ; then rm -f $tdir/$updFile ; sleep 2 ; fi |
71 |
echo -n "Update the MITgcm code using: $cmdCVS ..." |
echo -n "Update the MITgcm code using: $cmdCVS ..." |
72 |
cd $tdir/MITgcm |
cd $tdir/MITgcm |
73 |
$cmdCVS update -P -d |
$cmdCVS update -P -d |
74 |
echo " done" |
echo " done" |
75 |
|
#- update date/lock-file: |
76 |
|
( cd $tdir ; echo $today > $updFile |
77 |
|
sleep 2 ; ls -l $updFile ) |
78 |
fi |
fi |
79 |
else |
else |
80 |
echo -n $tdir/MITgcm 'missing ; ' |
echo -n $tdir/MITgcm 'missing ; ' |
90 |
mkdir $tdir |
mkdir $tdir |
91 |
fi |
fi |
92 |
echo " done" |
echo " done" |
|
echo -n "Downloading the MITgcm code using: $cmdCVS ..." |
|
93 |
cd $tdir |
cd $tdir |
94 |
|
#- remove date/lock-file: |
95 |
|
if test -f $updFile ; then rm -f $updFile ; sleep 2 ; fi |
96 |
|
echo -n "Downloading the MITgcm code using: $cmdCVS ..." |
97 |
$cmdCVS co -P MITgcm > /dev/null |
$cmdCVS co -P MITgcm > /dev/null |
98 |
echo " done" |
echo " done" |
99 |
if test -d other_input ; then |
if test -d other_input ; then |
106 |
done |
done |
107 |
echo " <-- update of 'other_input' dirs done" |
echo " <-- update of 'other_input' dirs done" |
108 |
fi |
fi |
109 |
|
#- update date/lock-file: |
110 |
|
echo $today > $updFile ; sleep 2 ; ls -l $updFile |
111 |
else |
else |
112 |
cd $tdir |
cd $tdir |
113 |
fi |
fi |
154 |
new_dir="MITgcm_$typ" |
new_dir="MITgcm_$typ" |
155 |
reUse=1 ; if [ $checkOut -ge 2 ] ; then reUse=0 ; fi |
reUse=1 ; if [ $checkOut -ge 2 ] ; then reUse=0 ; fi |
156 |
if test -d $new_dir/CVS -a $reUse = 1 ; then |
if test -d $new_dir/CVS -a $reUse = 1 ; then |
157 |
pushd $new_dir |
cd $tdir/$new_dir |
158 |
if test $tt != $typ ; then |
if test $tt != $typ ; then |
159 |
( cd verification ; ../tools/do_tst_2+2 -clean ) |
( cd verification ; ../tools/do_tst_2+2 -clean ) |
160 |
fi |
fi |
167 |
if test -d prev ; then |
if test -d prev ; then |
168 |
#-- save previous summary: |
#-- save previous summary: |
169 |
oldS=`ls -t ${new_dir}/verification/tr_${outDir}_*/summary.txt 2> /dev/null | head -1` |
oldS=`ls -t ${new_dir}/verification/tr_${outDir}_*/summary.txt 2> /dev/null | head -1` |
170 |
if test "x$oldS" != x ; then cp -p -f $oldS prev/tr_out.$typ ; fi |
if test "x$oldS" != x ; then |
171 |
|
cat $oldS | sed '/^[YN] [YN] [YN] [YN]/ s/ \. //g' > prev/tr_out.$typ |
172 |
|
touch -r $oldS prev/tr_out.$typ |
173 |
|
fi |
174 |
if test $tt != $typ ; then |
if test $tt != $typ ; then |
175 |
oldS=`ls -t ${new_dir}/verification/rs_${outDir}_*/summary.txt 2> /dev/null | head -1` |
oldS=`ls -t ${new_dir}/verification/rs_${outDir}_*/summary.txt 2> /dev/null | head -1` |
176 |
if test "x$oldS" != x ; then cp -p -f $oldS prev/rs_out.$typ ; fi |
if test "x$oldS" != x ; then cp -p -f $oldS prev/rs_out.$typ ; fi |
178 |
fi |
fi |
179 |
test -e $new_dir && rm -rf $new_dir |
test -e $new_dir && rm -rf $new_dir |
180 |
mkdir $new_dir |
mkdir $new_dir |
181 |
pushd $new_dir |
#- before making a copy, check that code has been updated |
182 |
cp -ra ../MITgcm/* . |
nCount=0; today=`date +%Y%m%d` |
183 |
|
updDate=0 ; test -f $updFile && updDate=`cat $updFile` |
184 |
|
while [ $today -gt $updDate ] ; do |
185 |
|
nCount=`expr $nCount + 1` |
186 |
|
if [ $nCount -gt 40 ] ; then |
187 |
|
echo " waiting too long (nCount=$nCount) for updated code" |
188 |
|
echo " today=$today , updDate=$updDate " |
189 |
|
ls -l $updFile |
190 |
|
exit |
191 |
|
fi |
192 |
|
sleep 60 |
193 |
|
updDate=0 ; test -f $updFile && updDate=`cat $updFile` |
194 |
|
done |
195 |
|
ls -l $updFile | tee -a $tdir/output_$tt |
196 |
|
echo " waited nCount=$nCount for updated code ($updDate) to copy" | tee -a $tdir/output_$tt |
197 |
|
#----------------------------- |
198 |
|
if test -d MITgcm -a -d $new_dir ; then |
199 |
|
echo " copy main code from MITgcm to $new_dir" | tee -a $tdir/output_$tt |
200 |
|
cp -ra MITgcm/* $new_dir 2>&1 | tee -a $tdir/output_$tt |
201 |
|
else |
202 |
|
if test -d MITgcm ; then |
203 |
|
echo " missing dir $new_dir --> end test $tt" | tee -a $tdir/output_$tt |
204 |
|
else |
205 |
|
echo " missing dir MITgcm --> end test $tt" | tee -a $tdir/output_$tt |
206 |
|
fi |
207 |
|
continue |
208 |
|
fi |
209 |
|
echo -n " cd $tdir/$new_dir " | tee -a $tdir/output_$tt |
210 |
|
cd $tdir/$new_dir |
211 |
|
retVal=$? |
212 |
|
( echo "(retVal= $retVal )" ; pwd ) | tee -a $tdir/output_$tt |
213 |
|
if test -d verification ; then |
214 |
|
echo " check: dir verification exist" | tee -a $tdir/output_$tt |
215 |
|
else |
216 |
|
echo " missing dir verification --> end test $tt" | tee -a $tdir/output_$tt |
217 |
|
continue |
218 |
|
fi |
219 |
#-- download additional experience from Contrib: |
#-- download additional experience from Contrib: |
220 |
for exp2add in $addExp ; do |
for exp2add in $addExp ; do |
221 |
echo " add dir: $exp2add (from Contrib:verification_other)" |
echo " add dir: $exp2add (from Contrib:verification_other)" |
222 |
( cd verification ; $cmdCVS co -P -d $exp2add \ |
( cd verification ; $cmdCVS co -P -d $exp2add \ |
223 |
MITgcm_contrib/verification_other/$exp2add > /dev/null ) |
MITgcm_contrib/verification_other/$exp2add > /dev/null ) |
224 |
if test $exp2add = 'global_oce_cs32' ; then |
if test $exp2add = 'global_oce_cs32' ; then |
225 |
echo " link dir 'other_input/gael_oce_cs32_input' to 'input_fields'" |
echo " link dir 'other_input/core2_cnyf' in here" |
226 |
( cd verification/${exp2add} |
( cd verification/${exp2add} |
227 |
ln -s ../../../other_input/gael_oce_cs32_input input_fields ) |
ln -s ../../../other_input/core2_cnyf . ) |
228 |
fi |
fi |
229 |
if test $exp2add = 'shelfice_remeshing' ; then |
if test $exp2add = 'shelfice_remeshing' ; then |
230 |
echo " link dir 'other_input/remeshing_code' to 'extra_code'" |
echo " link dir 'other_input/remeshing_code' to 'extra_code'" |
234 |
done |
done |
235 |
fi |
fi |
236 |
else |
else |
237 |
pushd MITgcm |
cd $tdir/MITgcm |
238 |
fi |
fi |
239 |
cd verification |
cd verification |
240 |
|
|
253 |
else |
else |
254 |
comm="$comm -md cyrus-makedepend" |
comm="$comm -md cyrus-makedepend" |
255 |
fi |
fi |
256 |
comm="$comm -odir $outDir -a jmc@mitgcm.org" |
comm="$comm -odir $outDir -a jmc@dev.mitgcm.org" |
257 |
#-- set the optfile (+ mpi & match-precision) |
#-- set the optfile (+ mpi & match-precision) |
258 |
MPI=0 |
MPI=0 |
259 |
case $typ in |
case $typ in |
323 |
if test $tt != $typ |
if test $tt != $typ |
324 |
then |
then |
325 |
echo "testing restart using:" | tee -a $tdir/output_$tt |
echo "testing restart using:" | tee -a $tdir/output_$tt |
326 |
comm="../tools/do_tst_2+2 -o $outDir -a jmc@mitgcm.org" |
comm="../tools/do_tst_2+2 -o $outDir -a jmc@dev.mitgcm.org" |
327 |
if test $MPI = 0 ; then |
if test $MPI = 0 ; then |
328 |
echo " \"$comm\"" | tee -a $tdir/output_$tt |
echo " \"$comm\"" | tee -a $tdir/output_$tt |
329 |
echo "======================" |
echo "======================" |
355 |
echo "======================" |
echo "======================" |
356 |
echo |
echo |
357 |
fi |
fi |
358 |
popd |
cd $tdir |
359 |
|
|
360 |
done |
done |