63 |
tdir=$TESTDIR |
tdir=$TESTDIR |
64 |
updFile='updated_code' ; today=`date +%Y%m%d` |
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_today/CVS ; then |
67 |
echo $tdir/MITgcm/CVS 'exist' |
echo $tdir/MITgcm_today/CVS 'exist' |
68 |
if test $sepDir = 0 -a $checkOut = 1 ; then |
if test $sepDir = 0 -a $checkOut = 1 ; then |
69 |
#- remove date/lock-file: |
#- remove date/lock-file: |
70 |
if test -f $tdir/$updFile ; then rm -f $tdir/$updFile ; sleep 2 ; fi |
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_today |
73 |
$cmdCVS update -P -d |
$cmdCVS update -P -d |
74 |
echo " done" |
echo " done" |
75 |
#- update date/lock-file: |
#- update date/lock-file: |
77 |
sleep 2 ; ls -l $updFile ) |
sleep 2 ; ls -l $updFile ) |
78 |
fi |
fi |
79 |
else |
else |
80 |
echo -n $tdir/MITgcm 'missing ; ' |
echo -n $tdir/MITgcm_today 'missing ; ' |
81 |
checkOut=2 |
checkOut=2 |
82 |
fi |
fi |
83 |
fi |
fi |
84 |
if test $checkOut = 2 ; then |
if test $checkOut = 2 ; then |
85 |
if test -e $tdir ; then |
if test -e $tdir ; then |
86 |
echo -n "Removing working copy: $tdir/MITgcm ..." |
echo -n "Removing working copy: $tdir/MITgcm_today ..." |
87 |
test -e $tdir/MITgcm && rm -rf $tdir/MITgcm |
test -e $tdir/MITgcm_today && rm -rf $tdir/MITgcm_today |
88 |
else |
else |
89 |
echo -n "Creating a working dir: $tdir ..." |
echo -n "Creating a working dir: $tdir ..." |
90 |
mkdir $tdir |
mkdir $tdir |
94 |
#- remove date/lock-file: |
#- remove date/lock-file: |
95 |
if test -f $updFile ; then rm -f $updFile ; sleep 2 ; fi |
if test -f $updFile ; then rm -f $updFile ; sleep 2 ; fi |
96 |
echo -n "Downloading the MITgcm code using: $cmdCVS ..." |
echo -n "Downloading the MITgcm code using: $cmdCVS ..." |
97 |
$cmdCVS co -P MITgcm > /dev/null |
$cmdCVS co -P -d MITgcm_today MITgcm > /dev/null |
98 |
echo " done" |
retVal=$? |
99 |
|
if test "x$retVal" != x0 ; then echo '' |
100 |
|
echo -n "'$cmdCVS co -P -d MITgcm_today MITgcm'" |
101 |
|
echo " on '"`hostname`"' fail (return val=$retVal) => exit" |
102 |
|
exit |
103 |
|
else echo " done" |
104 |
|
#echo "'$cmdCVS co -P -d MITgcm_today MITgcm' on '"`hostname`"' work" |
105 |
|
fi |
106 |
if test -d other_input ; then |
if test -d other_input ; then |
107 |
list_dirs=`(cd other_input ; ls 2> /dev/null )` |
list_dirs=`(cd other_input ; ls 2> /dev/null )` |
108 |
echo "Updating ( $cmdCVS update -P -d ) 'other_input' extra dirs:" |
echo "Updating ( $cmdCVS update -P -d ) 'other_input' extra dirs:" |
157 |
#- clean-up old output files |
#- clean-up old output files |
158 |
rm -f $tdir/output_${typ}* |
rm -f $tdir/output_${typ}* |
159 |
touch $tdir/output_$tt |
touch $tdir/output_$tt |
160 |
|
echo -n "-- Starting test: $tt at: " >> $tdir/output_$tt |
161 |
|
date >> $tdir/output_$tt |
162 |
|
echo " typ='$typ', addExp='$addExp'" >> $tdir/output_$tt |
163 |
if test $sepDir = 1 ; then |
if test $sepDir = 1 ; then |
164 |
new_dir="MITgcm_$typ" |
new_dir="MITgcm_$typ" |
165 |
reUse=1 ; if [ $checkOut -ge 2 ] ; then reUse=0 ; fi |
reUse=1 ; if [ $checkOut -ge 2 ] ; then reUse=0 ; fi |
169 |
( cd verification ; ../tools/do_tst_2+2 -clean ) |
( cd verification ; ../tools/do_tst_2+2 -clean ) |
170 |
fi |
fi |
171 |
if test $checkOut = 1 ; then |
if test $checkOut = 1 ; then |
172 |
echo -n "Update the MITgcm code using: $cmdCVS ..." |
echo -n "Update the MITgcm code using: $cmdCVS ..." | tee -a $tdir/output_$tt |
173 |
$cmdCVS update -P -d |
$cmdCVS update -P -d | tee -a $tdir/output_$tt |
174 |
echo " done" |
echo " done" | tee -a $tdir/output_$tt |
175 |
fi |
fi |
176 |
else |
else |
177 |
if test -d prev ; then |
if test -d prev ; then |
186 |
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 |
187 |
fi |
fi |
188 |
fi |
fi |
189 |
|
echo " remove dir: $new_dir and make new one" >> $tdir/output_$tt |
190 |
test -e $new_dir && rm -rf $new_dir |
test -e $new_dir && rm -rf $new_dir |
191 |
mkdir $new_dir |
mkdir $new_dir |
192 |
#- before making a copy, check that code has been updated |
#- before making a copy, check that code has been updated |
206 |
ls -l $updFile | tee -a $tdir/output_$tt |
ls -l $updFile | tee -a $tdir/output_$tt |
207 |
echo " waited nCount=$nCount for updated code ($updDate) to copy" | tee -a $tdir/output_$tt |
echo " waited nCount=$nCount for updated code ($updDate) to copy" | tee -a $tdir/output_$tt |
208 |
#----------------------------- |
#----------------------------- |
209 |
if test -d MITgcm -a -d $new_dir ; then |
if test -d MITgcm_today -a -d $new_dir ; then |
210 |
echo " copy main code from MITgcm to $new_dir" | tee -a $tdir/output_$tt |
echo " copy main code from MITgcm_today to $new_dir" | tee -a $tdir/output_$tt |
211 |
cp -ra MITgcm/* $new_dir 2>&1 | tee -a $tdir/output_$tt |
cp -ra MITgcm_today/* $new_dir 2>&1 | tee -a $tdir/output_$tt |
212 |
else |
else |
213 |
if test -d MITgcm ; then |
if test -d MITgcm_today ; then |
214 |
echo " missing dir $new_dir --> end test $tt" | tee -a $tdir/output_$tt |
echo " missing dir $new_dir --> end test $tt" | tee -a $tdir/output_$tt |
215 |
else |
else |
216 |
echo " missing dir MITgcm --> end test $tt" | tee -a $tdir/output_$tt |
echo " missing dir MITgcm_today --> end test $tt" | tee -a $tdir/output_$tt |
217 |
fi |
fi |
218 |
continue |
continue |
219 |
fi |
fi |
220 |
echo -n " cd $tdir/$new_dir " | tee -a $tdir/output_$tt |
echo -n " cd $tdir/$new_dir " | tee -a $tdir/output_$tt |
221 |
cd $tdir/$new_dir |
cd $tdir/$new_dir |
222 |
retVal=$? |
retVal=$? |
223 |
( echo "(retVal= $retVal )" ; pwd ) | tee -a $tdir/output_$tt |
( echo "(retVal= $retVal )" ; pwd ) | tee -a $tdir/output_$tt |
224 |
if test -d verification ; then |
if test -d verification ; then |
225 |
echo " check: dir verification exist" | tee -a $tdir/output_$tt |
echo " check: dir verification exist" | tee -a $tdir/output_$tt |
226 |
else |
else |
227 |
echo " missing dir verification --> end test $tt" | tee -a $tdir/output_$tt |
echo " missing dir verification --> end test $tt" | tee -a $tdir/output_$tt |
228 |
continue |
continue |
229 |
fi |
fi |
230 |
#-- download additional experience from Contrib: |
#-- download additional experience from Contrib: |
231 |
for exp2add in $addExp ; do |
for exp2add in $addExp ; do |
232 |
echo " add dir: $exp2add (from Contrib:verification_other)" |
echo " add dir: $exp2add (from Contrib:verification_other)" | tee -a $tdir/output_$tt |
233 |
( cd verification ; $cmdCVS co -P -d $exp2add \ |
( cd verification ; $cmdCVS co -P -d $exp2add \ |
234 |
MITgcm_contrib/verification_other/$exp2add > /dev/null ) |
MITgcm_contrib/verification_other/$exp2add > /dev/null ) |
235 |
if test $exp2add = 'global_oce_cs32' ; then |
if test $exp2add = 'global_oce_cs32' ; then |
236 |
echo " link dir 'other_input/core2_cnyf' in here" |
echo " link dir 'other_input/core2_cnyf' in here" | tee -a $tdir/output_$tt |
237 |
( cd verification/${exp2add} |
( cd verification/${exp2add} |
238 |
ln -s ../../../other_input/core2_cnyf . ) |
ln -s ../../../other_input/core2_cnyf . ) |
239 |
fi |
fi |
240 |
if test $exp2add = 'shelfice_remeshing' ; then |
if test $exp2add = 'shelfice_remeshing' ; then |
241 |
echo " link dir 'other_input/remeshing_code' to 'extra_code'" |
echo " link dir 'other_input/remeshing_code' to 'extra_code'" | tee -a $tdir/output_$tt |
242 |
( cd verification/${exp2add} |
( cd verification/${exp2add} |
243 |
ln -s ../../../other_input/remeshing_code extra_code ) |
ln -s ../../../other_input/remeshing_code extra_code ) |
244 |
fi |
fi |
245 |
done |
done |
246 |
fi |
fi |
247 |
else |
else |
248 |
cd $tdir/MITgcm |
cd $tdir/MITgcm_today |
249 |
fi |
fi |
250 |
cd verification |
cd verification |
251 |
|
|
352 |
if test $sepDir = 0 ; then |
if test $sepDir = 0 ; then |
353 |
#-- cleaning: |
#-- cleaning: |
354 |
echo "======================" |
echo "======================" |
355 |
echo "Cleaning test directories:" | tee -a $tdir/output_$tt |
echo "Cleaning test directories:" | tee -a $tdir/output_$tt |
356 |
if test $tt != $typ ; then |
if test $tt != $typ ; then |
357 |
cmdCLN="../tools/do_tst_2+2 -clean" |
cmdCLN="../tools/do_tst_2+2 -clean" |
358 |
echo " clean tst_2+2 running: $cmdCLN" | tee -a $tdir/output_$tt |
echo " clean tst_2+2 running: $cmdCLN" | tee -a $tdir/output_$tt |