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 |
|
|
39 |
|
dNam=`hostname -s | tr '[:upper:]' '[:lower:]'` |
40 |
|
TESTDIR="/scratch/jmc/test_${dName}" |
41 |
outDir=`hostname -s` |
outDir=`hostname -s` |
|
TESTDIR="/scratch/jmc/test_${outDir}" |
|
|
outDir="${outDir}-${tst_grp}" |
|
42 |
MC=13 |
MC=13 |
43 |
sepDir=1 |
sepDir=1 |
44 |
option= |
option= |
45 |
|
|
46 |
#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' |
47 |
#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 |
48 |
if test $tst_grp = 'a' ; then |
if test $tst_grp = 'a' ; then |
60 |
|
|
61 |
TODAY=`date +%d` |
TODAY=`date +%d` |
62 |
tdir=$TESTDIR |
tdir=$TESTDIR |
63 |
|
updFile='updated_code' ; today=`date +%Y%m%d` |
64 |
if test $checkOut != 2 ; then |
if test $checkOut != 2 ; then |
65 |
if test -e $tdir/MITgcm/CVS ; then |
if test -e $tdir/MITgcm/CVS ; then |
66 |
echo $tdir/MITgcm/CVS 'exist' |
echo $tdir/MITgcm/CVS 'exist' |
67 |
if test $sepDir = 0 -a $checkOut = 1 ; then |
if test $sepDir = 0 -a $checkOut = 1 ; then |
68 |
|
#- remove date/lock-file: |
69 |
|
if test -f $tdir/$updFile ; then rm -f $tdir/$updFile ; sleep 2 ; fi |
70 |
echo -n "Update the MITgcm code using: $cmdCVS ..." |
echo -n "Update the MITgcm code using: $cmdCVS ..." |
71 |
cd $tdir/MITgcm |
cd $tdir/MITgcm |
72 |
$cmdCVS update -P -d |
$cmdCVS update -P -d |
73 |
echo " done" |
echo " done" |
74 |
|
#- update date/lock-file: |
75 |
|
( cd $tdir ; echo $today > $updFile |
76 |
|
sleep 2 ; ls -l $updFile ) |
77 |
fi |
fi |
78 |
else |
else |
79 |
echo -n $tdir/MITgcm 'missing ; ' |
echo -n $tdir/MITgcm 'missing ; ' |
89 |
mkdir $tdir |
mkdir $tdir |
90 |
fi |
fi |
91 |
echo " done" |
echo " done" |
|
echo -n "Downloading the MITgcm code using: $cmdCVS ..." |
|
92 |
cd $tdir |
cd $tdir |
93 |
|
#- remove date/lock-file: |
94 |
|
if test -f $updFile ; then rm -f $updFile ; sleep 2 ; fi |
95 |
|
echo -n "Downloading the MITgcm code using: $cmdCVS ..." |
96 |
$cmdCVS co -P MITgcm > /dev/null |
$cmdCVS co -P MITgcm > /dev/null |
97 |
echo " done" |
echo " done" |
98 |
if test -d other_input ; then |
if test -d other_input ; then |
105 |
done |
done |
106 |
echo " <-- update of 'other_input' dirs done" |
echo " <-- update of 'other_input' dirs done" |
107 |
fi |
fi |
108 |
|
#- update date/lock-file: |
109 |
|
echo $today > $updFile ; sleep 2 ; ls -l $updFile |
110 |
else |
else |
111 |
cd $tdir |
cd $tdir |
112 |
fi |
fi |
153 |
new_dir="MITgcm_$typ" |
new_dir="MITgcm_$typ" |
154 |
reUse=1 ; if [ $checkOut -ge 2 ] ; then reUse=0 ; fi |
reUse=1 ; if [ $checkOut -ge 2 ] ; then reUse=0 ; fi |
155 |
if test -d $new_dir/CVS -a $reUse = 1 ; then |
if test -d $new_dir/CVS -a $reUse = 1 ; then |
156 |
pushd $new_dir |
cd $tdir/$new_dir |
157 |
if test $tt != $typ ; then |
if test $tt != $typ ; then |
158 |
( cd verification ; ../tools/do_tst_2+2 -clean ) |
( cd verification ; ../tools/do_tst_2+2 -clean ) |
159 |
fi |
fi |
177 |
fi |
fi |
178 |
test -e $new_dir && rm -rf $new_dir |
test -e $new_dir && rm -rf $new_dir |
179 |
mkdir $new_dir |
mkdir $new_dir |
180 |
pushd $new_dir |
#- before making a copy, check that code has been updated |
181 |
cp -ra ../MITgcm/* . |
nCount=0; today=`date +%Y%m%d` |
182 |
|
updDate=0 ; test -f $updFile && updDate=`cat $updFile` |
183 |
|
while [ $today -gt $updDate ] ; do |
184 |
|
nCount=`expr $nCount + 1` |
185 |
|
if [ $nCount -gt 40 ] ; then |
186 |
|
echo " waiting too long (nCount=$nCount) for updated code" |
187 |
|
echo " today=$today , updDate=$updDate " |
188 |
|
ls -l $updFile |
189 |
|
exit |
190 |
|
fi |
191 |
|
sleep 60 |
192 |
|
updDate=0 ; test -f $updFile && updDate=`cat $updFile` |
193 |
|
done |
194 |
|
ls -l $updFile | tee -a $tdir/output_$tt |
195 |
|
echo " waited nCount=$nCount for updated code ($updDate) to copy" | tee -a $tdir/output_$tt |
196 |
|
#----------------------------- |
197 |
|
if test -d MITgcm -a -d $new_dir ; then |
198 |
|
echo " copy main code from MITgcm to $new_dir" | tee -a $tdir/output_$tt |
199 |
|
cp -ra MITgcm/* $new_dir 2>&1 | tee -a $tdir/output_$tt |
200 |
|
else |
201 |
|
if test -d MITgcm ; then |
202 |
|
echo " missing dir $new_dir --> end test $tt" | tee -a $tdir/output_$tt |
203 |
|
else |
204 |
|
echo " missing dir MITgcm --> end test $tt" | tee -a $tdir/output_$tt |
205 |
|
fi |
206 |
|
continue |
207 |
|
fi |
208 |
|
echo -n " cd $tdir/$new_dir " | tee -a $tdir/output_$tt |
209 |
|
cd $tdir/$new_dir |
210 |
|
retVal=$? |
211 |
|
( echo "(retVal= $retVal )" ; pwd ) | tee -a $tdir/output_$tt |
212 |
|
if test -d verification ; then |
213 |
|
echo " check: dir verification exist" | tee -a $tdir/output_$tt |
214 |
|
else |
215 |
|
echo " missing dir verification --> end test $tt" | tee -a $tdir/output_$tt |
216 |
|
continue |
217 |
|
fi |
218 |
#-- download additional experience from Contrib: |
#-- download additional experience from Contrib: |
219 |
for exp2add in $addExp ; do |
for exp2add in $addExp ; do |
220 |
echo " add dir: $exp2add (from Contrib:verification_other)" |
echo " add dir: $exp2add (from Contrib:verification_other)" |
233 |
done |
done |
234 |
fi |
fi |
235 |
else |
else |
236 |
pushd MITgcm |
cd $tdir/MITgcm |
237 |
fi |
fi |
238 |
cd verification |
cd verification |
239 |
|
|
354 |
echo "======================" |
echo "======================" |
355 |
echo |
echo |
356 |
fi |
fi |
357 |
popd |
cd $tdir |
358 |
|
|
359 |
done |
done |