7 |
{ |
{ |
8 |
# rnp_loc arg_1 arg_2 |
# rnp_loc arg_1 arg_2 |
9 |
# rename files with prefix = 'arg_1' to files with prefix = 'arg_2' |
# rename files with prefix = 'arg_1' to files with prefix = 'arg_2' |
10 |
echo ' rnp_loc:' $1 $2 |
if [ $prt -ge 1 ] ; then echo ' rnp_loc:' $1 $2 ; fi |
11 |
# rnp -s $1 $2 |
# rnp -s $1 $2 |
12 |
listY=`ls -1 $1*` |
listY=`ls -1 $1*` |
13 |
for yy in $listY |
for yy in $listY |
14 |
do |
do |
15 |
zz=`echo $yy | sed "s/^$1/$2/"` |
zz=`echo $yy | sed "s/^$1/$2/"` |
16 |
mv $yy $zz |
if [ $prt -ge 2 ] ; then echo ' '$cmdMV $yy $zz ; fi |
17 |
|
if test $action = 1 ; then $cmdMV $yy $zz ; fi |
18 |
done |
done |
19 |
} |
} |
20 |
|
|
21 |
#--------------------------- |
#----------- |
22 |
|
|
23 |
#- default: |
move_outp() |
24 |
Nit=2 |
{ |
25 |
prt=1 # 1 = print some informations ; 2 = print more informations |
# move_outp arg_1 |
26 |
action=1 |
# move mitgcm output files to directory 'arg_1' |
27 |
cmd='mv -f' |
if [ $prt -ge 1 ] ; then echo ' move_outp:' $1 ; fi |
28 |
tmpDir='temp_tst' |
mv *.data *.meta $1 |
29 |
|
listF=`ls -1 *.txt STD???.00?? 2> /dev/null` |
30 |
|
if test "x$listF" != x ; then mv $listF $1 ; fi |
31 |
|
#- move back sym link: |
32 |
|
listL=`find $1 -type l` |
33 |
|
ttd=`echo $listL | wc -w` |
34 |
|
#echo "ttd=$ttd" |
35 |
|
if test $ttd != 0 ; then |
36 |
|
#echo "listL='$listL'" |
37 |
|
if [ $prt -ge 2 ] ; then echo " mv back:" $listL | sed "s/$1\///g" ; fi |
38 |
|
mv $listL . |
39 |
|
fi |
40 |
|
} |
41 |
|
|
42 |
#- executable: |
#--------------------------- |
|
mpi=0 |
|
|
if [ $mpi -ge 1 ] |
|
|
then gcmExc=run_ifc_mpi |
|
|
else gcmExc=mitgcmuv |
|
|
fi |
|
43 |
|
|
44 |
#- exit status: |
#- exit status: |
45 |
# 0 -> test is successful |
# 0 -> test is successful |
46 |
# 1 -> fail in 1rst run |
# 1 -> fail in 1rst run |
47 |
# 2 -> fail in 2nd run |
# 2 -> fail in 2nd run |
48 |
# 3 -> fail in 3rd run |
# 3 -> fail in 3rd run |
49 |
# 4 -> pickup*.data (written at the end of 2+2 & 4 it run) are different |
# 4 -> pickup*.data (written at the end of 2+2 & 4 it run) are different |
50 |
# 5 -> pickup*.meta (written at the end of 2+2 & 4 it run) are different |
# 5 -> pickup*.meta (written at the end of 2+2 & 4 it run) are different |
51 |
# 6 -> missing 'data.tst' file (removed or not yet generated ?) |
# 6 -> missing 'data.tst' file (removed or not yet generated ?) |
52 |
# 7 -> missing standard output from previous run |
# 7 -> missing executable or standard output from previous run |
53 |
# 8 -> missing information (in standard output of previous run) about pickup |
# 8 -> missing information (in standard output of previous run) about pickup |
54 |
# 9 -> error in argument list |
# 9 -> error in argument list |
55 |
|
|
56 |
|
#- default: |
57 |
|
Nit=2 |
58 |
|
prt=1 # 1 = print some informations ; 2 = print more informations |
59 |
|
action=1 |
60 |
|
cmdMV='mv -f' |
61 |
|
tmpDir='temp_tst' |
62 |
|
wait2run=0 # if needs sometime for file system syncro on all nodes |
63 |
|
|
64 |
|
#- default executable, command-line , using MPI: |
65 |
|
gcmEXE=./mitgcmuv |
66 |
|
cmdEXE= |
67 |
|
mpi=0 |
68 |
|
|
69 |
nArg=$# |
nArg=$# |
70 |
if [ $nArg -ge 3 ] |
prev= |
71 |
then |
for xx ; do |
72 |
if test $2 = '-exe' ; then gcmExc=$3 ; nArg=`expr $nArg - 2` ; fi |
#echo "xx='$xx'" |
73 |
if test $1 = '-exe' ; then gcmExc=$2 ; shift ; shift ; nArg=$# ; fi |
# If the previous option needs an argument, assign it. |
74 |
fi |
if test -n "$prev"; then |
75 |
|
eval "$prev=\$xx" |
76 |
|
prev= |
77 |
|
nArg=`expr $nArg - 2` |
78 |
|
continue |
79 |
|
fi |
80 |
|
|
81 |
|
case $xx in |
82 |
|
-mpi ) mpi=1 ; nArg=`expr $nArg - 1` ;; |
83 |
|
-exe ) prev=gcmEXE ;; |
84 |
|
-command ) prev=cmdEXE ;; |
85 |
|
*) flag=$xx ;; |
86 |
|
esac |
87 |
|
done |
88 |
|
#echo "cmdEXE='$cmdEXE'" |
89 |
|
#echo "nArg=$nArg ; mpi=$mpi ; flag='$flag'" |
90 |
|
|
91 |
case $nArg in |
case $nArg in |
92 |
1) ;; |
1) ;; |
93 |
*) echo "Usage: `basename $0` flag [-exe EXECUTABLE]" |
*) echo "Usage: `basename $0` flag [-mpi] [-exe EXECUTABLE] [-command COMMAND]" |
94 |
echo " Check restart: compare 1 run of 2 x $Nit it long" |
echo " Check restart: compare 1 run of 2 x $Nit it long" |
95 |
echo " with 2 consecutive runs of $Nit it long each" |
echo " with 2 consecutive runs of $Nit it long each" |
96 |
echo " where: flag = 0 -> prepare (from a previous run) pickup & data files" |
echo " where: flag = 0 -> prepare (from a previous run) pickup & data files" |
97 |
echo " flag = 1 -> do the 3 runs (with EXECUTABLE, default=mitgcmuv)" |
echo " flag = 1 -> do the 3 runs (using COMMAND" |
98 |
|
echo " or simply using EXECUTABLE, default=$gcmEXE)" |
99 |
echo " flag = 2 -> compare std_outp" |
echo " flag = 2 -> compare std_outp" |
100 |
echo " flag = 3 -> compare pickup files" |
echo " flag = 3 -> compare pickup files" |
101 |
echo " flag = 4 -> clean-up output files" |
echo " flag = 4 -> clean-up output files" |
102 |
|
echo " flag = NC -> do 0,1,2,3 sequentially (no cleaning)" |
103 |
echo " flag = All -> do 0,1,2,3,4 sequentially" |
echo " flag = All -> do 0,1,2,3,4 sequentially" |
104 |
exit 9 ;; |
exit 9 ;; |
105 |
esac |
esac |
106 |
flag=$1 |
if test $flag = 'NC' -o $flag = 'All' ; then Multi=1 ; else Multi=0 ; fi |
107 |
|
|
108 |
|
#-- set the run-command : |
109 |
|
if test "x$cmdEXE" = x |
110 |
|
then |
111 |
|
if [ $mpi -ge 1 ] ; then |
112 |
|
cmdEXE="mpirun -machinefile ../../mf -v -np 2 $gcmEXE" |
113 |
|
else |
114 |
|
cmdEXE=$gcmEXE |
115 |
|
fi |
116 |
|
fi |
117 |
|
echo "cmdEXE='$cmdEXE'" |
118 |
#========================= |
#========================= |
119 |
|
|
120 |
if test $flag = '0' -o $flag = 'All' ; then |
if test $flag = '0' -o $Multi = '1' ; then |
121 |
#---------------------------------------------------------------------- |
#---------------------------------------------------------------------- |
122 |
|
# check for executable: |
123 |
|
if test ! -x $gcmEXE |
124 |
|
echo "file '$gcmEXE' does not exist or is not executable" |
125 |
|
exit 7 |
126 |
|
fi |
127 |
# last pickup written (from previous run): |
# last pickup written (from previous run): |
128 |
if [ $mpi -ge 1 ] |
if [ $mpi -ge 1 ] |
129 |
then outpRun='STDOUT.0000' |
then outpRun='STDOUT.0000' |
130 |
else outpRun='output.txt' |
else outpRun='output.txt' |
131 |
fi |
fi |
132 |
if test -r $outpRun |
if test -r $outpRun |
133 |
then |
then |
134 |
# grep ' %CHECKPOINT ' $outpRun | tail -1 |
# grep ' %CHECKPOINT ' $outpRun | tail -1 |
135 |
lastPick=`grep ' %CHECKPOINT ' $outpRun | sed 's/^.*%CHECKPOINT //' | tail -1` |
lastPick=`grep ' %CHECKPOINT ' $outpRun | sed 's/^.*%CHECKPOINT //' | tail -1` |
136 |
if test "x$lastPick" = x |
if test "x$lastPick" = x |
137 |
then |
then |
138 |
echo "no pickup information written in '$outpRun' from previous run" |
echo "no pickup information written in '$outpRun' from previous run" |
139 |
exit 8 |
exit 8 |
140 |
else |
else |
141 |
iter=`echo $lastPick | awk '{print $1}'` |
iter=`echo $lastPick | awk '{print $1}'` |
142 |
zz=`echo $lastPick | awk '{print $2}'` |
sufx=`echo $lastPick | awk '{print $2}'` |
143 |
echo "from previous run std.outp, lastPick='$lastPick' ; iter='$iter' ; zz='$zz'" |
echo "from previous run std.outp, lastPick='$lastPick' ; iter='$iter' ; sufx='$sufx'" |
144 |
fi |
fi |
145 |
else |
else |
146 |
echo "no standard output file '$outpRun' from previous run" |
echo "no standard output file '$outpRun' from previous run" |
147 |
exit 7 |
exit 7 |
148 |
fi |
fi |
149 |
|
|
|
#- rename pickup (if needed) |
|
|
sufx=`printf "%10.10i\n" $iter` |
|
|
if test $zz = $sufx |
|
|
then |
|
|
echo "no need to change pickup sufix" |
|
|
else |
|
|
# echo "rename pickup sufix: $zz -> $sufx" |
|
|
listP=`ls pickup*.${zz}* 2> /dev/null | sed 's/\..*//g' | uniq` |
|
|
if test "x$listP" = x |
|
|
then echo ' rename' $zz '->' $sufx ': no file to rename' |
|
|
else |
|
|
if [ $prt -ge 1 ] ; then echo ' rename' $zz '->' $sufx 'for all:' $listP ; fi |
|
|
for yy in $listP |
|
|
do |
|
|
listF=`ls -1 $yy.${zz}*` |
|
|
for xx in $listF |
|
|
do |
|
|
new=`echo $xx | sed "s/^$yy\.$zz/$yy\.$sufx/"` |
|
|
if [ $prt -ge 2 ] ; then echo ' '$cmd $xx $new ; fi |
|
|
if test $action = 1 ; then $cmd $xx $new ; fi |
|
|
done |
|
|
done |
|
|
fi |
|
|
fi |
|
150 |
#------------------------- |
#------------------------- |
151 |
echo "prepare parameter file 'data.tst' :" |
echo "prepare parameter file 'data.tst' :" |
152 |
cp -p -f data data.tst |
cp -p -f data data.tst |
153 |
listOut='startTime endTime nIter0 nTimeSteps nEndIter chkPtFreq pChkPtFreq globalFiles' |
listOut='startTime endTime nIter0 nTimeSteps nEndIter chkPtFreq pChkPtFreq' |
154 |
listOut=$listOut' useSingleCpuIO pickupSuff usePickupBeforeC54 mdsioLocalDir' |
listOut=$listOut' pickupSuff usePickupBeforeC54 mdsioLocalDir pickupStrictlyMatch' |
155 |
#- comment out (in data.tst) all parameters from list: 'listOut' |
#- comment out (in data.tst) all parameters from list: 'listOut' |
156 |
for yy in $listOut |
for yy in $listOut |
157 |
do |
do |
178 |
sed "/^ *\&PARM03/a \ nIter0=$iter," data.tst > data.tmp_$$ |
sed "/^ *\&PARM03/a \ nIter0=$iter," data.tst > data.tmp_$$ |
179 |
mv -f data.tmp_$$ data.tst |
mv -f data.tmp_$$ data.tst |
180 |
echo "prepare file 'data.tst' : done" |
echo "prepare file 'data.tst' : done" |
181 |
if [ $prt -ge 1 ] ; then |
if [ $prt -ge 1 ] ; then |
182 |
echo ' diff data.tst data' ; diff data.tst data ; echo ' ' ; |
echo ' diff data.tst data' ; diff data.tst data ; echo ' ' ; |
183 |
fi |
fi |
184 |
#---- clean up current dir: move output to temp_tst dir: |
#---- clean up current dir: move output to temp_tst dir: |
187 |
mkdir $tmpDir |
mkdir $tmpDir |
188 |
mv -f *.data $tmpDir |
mv -f *.data $tmpDir |
189 |
mv -f *.meta $tmpDir |
mv -f *.meta $tmpDir |
190 |
mv -f *.txt $tmpDir |
mv -f *.txt $tmpDir 2> /dev/null |
191 |
listS=`ls $tmpDir/pickup*.${sufx}* 2> /dev/null | head -1` |
mv -f STD???.0[0-9][0-9][0-9] $tmpDir |
|
if test "x$listS" != x ; then mv $tmpDir/pickup*.${sufx}* . ; fi |
|
192 |
#- move main parameter file "data": |
#- move main parameter file "data": |
193 |
mv -f data $tmpDir |
mv -f data $tmpDir |
194 |
#- do not deal with MNC pickup at all: |
#- do not deal with MNC pickup at all: |
205 |
for ll in $listN |
for ll in $listN |
206 |
do |
do |
207 |
sed "$ll s/^./#&/" data.pkg > data.tmp_$$ |
sed "$ll s/^./#&/" data.pkg > data.tmp_$$ |
208 |
if [ $prt -ge 1 ] ; then echo ' changes in data.pkg' |
if [ $prt -ge 1 ] ; then echo ' changes in data.pkg' |
209 |
diff data.tmp_$$ data.pkg ; echo ' ' ; fi |
diff data.tmp_$$ data.pkg ; echo ' ' ; fi |
210 |
mv -f data.tmp_$$ data.pkg |
mv -f data.tmp_$$ data.pkg |
211 |
done |
done |
212 |
else if [ $prt -ge 2 ] ; then echo ' : not found' ; echo ' ' ; fi |
else if [ $prt -ge 2 ] ; then echo ' : not found' ; echo ' ' ; fi |
213 |
fi |
fi |
214 |
fi |
fi |
215 |
|
#------------------------- |
216 |
|
#-- link back pickup files |
217 |
|
listS=`ls $tmpDir/pickup*.${sufx}* 2> /dev/null | head -1` |
218 |
|
if test "x$listS" != x ; then |
219 |
|
if [ $prt -ge 1 ] ; then echo ' link back:' $tmpDir'/pickup*.'${sufx}'*' ; fi |
220 |
|
if test $action = 1 ; then ln -s $tmpDir/pickup*.${sufx}* . ; fi |
221 |
|
fi |
222 |
|
#- rename pickup (if needed) |
223 |
|
nIt0c=`printf "%10.10i\n" $iter` |
224 |
|
if test $sufx = $nIt0c |
225 |
|
then |
226 |
|
echo "no need to change pickup sufix" |
227 |
|
else |
228 |
|
listP=`ls pickup*.${sufx}* 2> /dev/null | sed 's/\..*//g' | uniq` |
229 |
|
if test "x$listP" = x |
230 |
|
then echo ' rename' $sufx '->' $nIt0c ': no file to rename' |
231 |
|
else |
232 |
|
if [ $prt -ge 1 ] ; then echo ' rename' $sufx '->' $nIt0c 'for all:' $listP ; fi |
233 |
|
for yy in $listP |
234 |
|
do |
235 |
|
rnp_loc $yy.${sufx} $yy.$nIt0c |
236 |
|
done |
237 |
|
fi |
238 |
|
fi |
239 |
#---------------------------------------------------------------------- |
#---------------------------------------------------------------------- |
240 |
fi |
fi |
241 |
|
|
265 |
num2c=`printf "%10.10i\n" $num2` |
num2c=`printf "%10.10i\n" $num2` |
266 |
echo " start-end iter: $num0 , $num1 , $num2" |
echo " start-end iter: $num0 , $num1 , $num2" |
267 |
echo " sufix: '$num0c' '$num1c' '$num2c'" |
echo " sufix: '$num0c' '$num1c' '$num2c'" |
268 |
echo ' gcmExc='$gcmExc |
echo ' cmdEXE='$cmdEXE |
269 |
#exit |
#exit |
270 |
#--------------------------- |
#--------------------------- |
271 |
|
|
272 |
if test $flag = '1' -o $flag = 'All' ; then |
if test $flag = '1' -o $Multi = '1' ; then |
273 |
#---------------------------------------------------------------------- |
#---------------------------------------------------------------------- |
274 |
#- check at the end of each run for pickup with prefix: |
#- check at the end of each run for pickup with prefix: |
275 |
pref='pickup' |
pref='pickup' |
290 |
cp -p data.tst data |
cp -p data.tst data |
291 |
echo '==> START RUN 2 x' $Nit 'it' |
echo '==> START RUN 2 x' $Nit 'it' |
292 |
if [ $mpi -ge 1 ] |
if [ $mpi -ge 1 ] |
293 |
then ./$gcmExc std_outp.2it > TTT.out.2it 2>&1 |
then |
294 |
else ./$gcmExc > std_outp.2it |
sleep $wait2run |
295 |
|
$cmdEXE > TTT.out.2it 2>&1 |
296 |
|
mv STDOUT.0000 std_outp.2it |
297 |
|
cat TTT.out.2it |
298 |
|
else $cmdEXE > std_outp.2it |
299 |
fi |
fi |
300 |
mv STDERR.0000 std__err.2it |
mv STDERR.0000 std__err.2it |
301 |
out=`egrep -c 'STOP ABNORMAL END' std_outp.2it` |
out=`egrep -c 'STOP ABNORMAL END' std_outp.2it` |
302 |
if test $out != 0 |
if test $out != 0 |
303 |
then echo "==> RUN 2 x $Nit it : ABNORMAL END => exit" ; exit 1 ; fi |
then echo "==> RUN 2 x $Nit it : ABNORMAL END => exit" ; exit 1 ; fi |
304 |
if test -f $pref.ckptA.001.001.data |
listF=`ls -1 $pref.ckptA*.data 2> /dev/null` |
305 |
then echo "==> END RUN 2 x $Nit it" |
if test "x$listF" = x |
306 |
else echo "==> RUN 2 x $Nit it STOP without writing $pref => exit" ; exit 1 ; fi |
then echo "==> RUN 2 x $Nit it STOP without writing $pref => exit" ; exit 1 |
307 |
|
else echo "==> END RUN 2 x $Nit it" ; fi |
308 |
listP=`ls pickup*.ckptA* | sed 's/\..*//g' | uniq` |
listP=`ls pickup*.ckptA* | sed 's/\..*//g' | uniq` |
309 |
echo ' listP=' $listP |
echo ' listP=' $listP |
310 |
for xx in $listP |
for xx in $listP |
311 |
do |
do |
312 |
rnp_loc $xx.ckptA $xx.$num2c |
rnp_loc $xx.ckptA $xx.$num2c |
313 |
done |
done |
314 |
mv *.0??.0??.* $dir1 |
move_outp $dir1 |
|
txtF=`ls -1 *.txt 2> /dev/null` |
|
|
mv R?.data R?.meta DR?.data DR?.meta $txtF $dir1 |
|
|
listS=`ls $dir1/pickup*.${num0c}* 2> /dev/null | head -1` |
|
|
if test "x$listS" != x ; then mv $dir1/pickup*.${num0c}* . ; fi |
|
315 |
#--- 2nd run ( Nit iter , restart from same Iter = num0 as 1rst run ) |
#--- 2nd run ( Nit iter , restart from same Iter = num0 as 1rst run ) |
316 |
sed "s/^ nTimeSteps=$Dbl/ nTimeSteps=$Nit/g" data.tst > data |
sed "s/^ nTimeSteps=$Dbl/ nTimeSteps=$Nit/g" data.tst > data.tmp |
317 |
|
mv -f data.tmp data |
318 |
echo '==> START RUN 1iA' |
echo '==> START RUN 1iA' |
319 |
if [ $mpi -ge 1 ] |
if [ $mpi -ge 1 ] |
320 |
then ./$gcmExc std_outp.1iA > TTT.out.1iA 2>&1 |
then |
321 |
else ./$gcmExc > std_outp.1iA |
sleep $wait2run |
322 |
|
$cmdEXE > TTT.out.1iA 2>&1 |
323 |
|
mv STDOUT.0000 std_outp.1iA |
324 |
|
cat TTT.out.1iA |
325 |
|
else $cmdEXE > std_outp.1iA |
326 |
fi |
fi |
327 |
mv STDERR.0000 std__err.1iA |
mv STDERR.0000 std__err.1iA |
328 |
out=`egrep -c 'STOP ABNORMAL END' std_outp.1iA` |
out=`egrep -c 'STOP ABNORMAL END' std_outp.1iA` |
329 |
if test $out != 0 |
if test $out != 0 |
330 |
then echo "==> RUN 1iA : ABNORMAL END => exit" ; exit 2 ; fi |
then echo "==> RUN 1iA : ABNORMAL END => exit" ; exit 2 ; fi |
331 |
if test -f $pref.ckptA.001.001.data |
listF=`ls -1 $pref.ckptA*.data 2> /dev/null` |
332 |
then echo "==> END RUN 1iA" |
if test "x$listF" = x |
333 |
else echo "==> RUN 1iA STOP without writing $pref => exit" ; exit 2 ; fi |
then echo "==> RUN 1iA STOP without writing $pref => exit" ; exit 2 |
334 |
|
else echo "==> END RUN 1iA" ; fi |
335 |
for xx in $listP |
for xx in $listP |
336 |
do |
do |
337 |
rnp_loc $xx.ckptA $xx.$num1c |
rnp_loc $xx.ckptA $xx.$num1c |
338 |
done |
done |
339 |
mv *.0??.0??.* $dir2 |
move_outp $dir2 |
|
txtF=`ls -1 *.txt 2> /dev/null` |
|
|
mv R?.data R?.meta DR?.data DR?.meta $txtF $dir2 |
|
|
listS=`ls $dir2/pickup*.${num0c}* 2> /dev/null | head -1` |
|
|
if test "x$listS" != x ; then mv $dir2/pickup*.${num0c}* . ; fi |
|
340 |
#--- 3rd run ( Nit iter , restart from 2nd ) |
#--- 3rd run ( Nit iter , restart from 2nd ) |
341 |
ln -s $dir2/pickup*.$num1c.* . |
ln -s $dir2/pickup*.$num1c.* . |
342 |
sed "s/^ nIter0=$num0/ nIter0=$num1/g" data > data.tmp |
sed "s/^ nIter0=$num0/ nIter0=$num1/g" data > data.tmp |
343 |
mv -f data.tmp data |
mv -f data.tmp data |
344 |
echo '==> START RUN 1iB' |
echo '==> START RUN 1iB' |
345 |
if [ $mpi -ge 1 ] |
if [ $mpi -ge 1 ] |
346 |
then ./$gcmExc std_outp.1iB > TTT.out.1iB 2>&1 |
then |
347 |
else ./$gcmExc > std_outp.1iB |
sleep $wait2run |
348 |
|
$cmdEXE > TTT.out.1iB 2>&1 |
349 |
|
mv STDOUT.0000 std_outp.1iB |
350 |
|
cat TTT.out.1iB |
351 |
|
else $cmdEXE > std_outp.1iB |
352 |
fi |
fi |
353 |
mv STDERR.0000 std__err.1iB |
mv STDERR.0000 std__err.1iB |
354 |
out=`egrep -c 'STOP ABNORMAL END' std_outp.1iB` |
out=`egrep -c 'STOP ABNORMAL END' std_outp.1iB` |
355 |
if test $out != 0 |
if test $out != 0 |
356 |
then echo "==> RUN 1iB : ABNORMAL END => exit" ; exit 3 ; fi |
then echo "==> RUN 1iB : ABNORMAL END => exit" ; exit 3 ; fi |
357 |
if test -f $pref.ckptA.001.001.data |
listF=`ls -1 $pref.ckptA*.data 2> /dev/null` |
358 |
then echo "==> END RUN 1iB" |
if test "x$listF" = x |
359 |
else echo "==> RUN 1iB STOP without writing $pref => exit" ; exit 3 ; fi |
then echo "==> RUN 1iB STOP without writing $pref => exit" ; exit 3 |
360 |
|
else echo "==> END RUN 1iB" ; fi |
361 |
for xx in $listP |
for xx in $listP |
362 |
do |
do |
363 |
rnp_loc $xx.ckptA $xx.$num2c |
rnp_loc $xx.ckptA $xx.$num2c |
364 |
done |
done |
365 |
mv *.0??.0??.* $dir3 |
# remove pickup*.$mun1c* sym-link: |
366 |
txtF=`ls -1 *.txt 2> /dev/null` |
find . ! -name . -prune -type l -name 'pickup*.'${num1c}'*' -exec rm {} \; |
367 |
mv R?.data R?.meta DR?.data DR?.meta $txtF $dir3 |
move_outp $dir3 |
|
listS=`ls $dir3/pickup*.${num0c}* 2> /dev/null | head -1` |
|
|
if test "x$listS" != x ; then mv $dir3/pickup*.${num0c}* . ; fi |
|
|
rm $dir3/pickup*.$num1c.* |
|
368 |
rm data |
rm data |
369 |
#---------------------------------------------------------------------- |
#---------------------------------------------------------------------- |
370 |
fi |
fi |
371 |
|
|
372 |
if test $flag = '2' -o $flag = 'All' ; then |
if test $flag = '2' -o $Multi = '1' ; then |
373 |
#---------------------------------------------------------------------- |
#---------------------------------------------------------------------- |
374 |
echo ' ' ; echo '== compare cg2d_init_res :' |
listCGini="2" |
375 |
echo ' run 1iA:' |
#-- check if using 3-D solver |
376 |
grep "cg2d_init_res" std_outp.1iA \ |
nn=`grep -i -c "^ *nonHydrostatic *= *\.TRUE\." data.tst` |
377 |
| sed 's/.* cg2d_init_res =//' |
if [ $nn -eq 0 ] ; then |
378 |
echo ' run 1iB:' |
nn=`grep -i -c "^ *implicitIntGravWave *= *\.TRUE\." data.tst` |
379 |
grep "cg2d_init_res" std_outp.1iB \ |
fi |
380 |
| sed 's/.* cg2d_init_res =//' |
if [ $nn -ge 1 ] ; then listCGini="$listCGini 3"; fi |
381 |
echo ' run 2it:' |
for nn in $listCGini |
382 |
grep "cg2d_init_res" std_outp.2it \ |
do |
383 |
| sed 's/.* cg2d_init_res =//' |
echo ' ' ; echo "== compare cg${nn}d_init_res :" |
384 |
|
echo ' run 1iA:' |
385 |
|
grep "cg${nn}d_init_res" std_outp.1iA \ |
386 |
|
| sed "s/.* cg${nn}d_init_res =//" |
387 |
|
echo ' run 1iB:' |
388 |
|
grep "cg${nn}d_init_res" std_outp.1iB \ |
389 |
|
| sed "s/.* cg${nn}d_init_res =//" |
390 |
|
echo ' run 2it:' |
391 |
|
grep "cg${nn}d_init_res" std_outp.2it \ |
392 |
|
| sed "s/.* cg${nn}d_init_res =//" |
393 |
|
done |
394 |
#---------------------------------------------------------------------- |
#---------------------------------------------------------------------- |
395 |
fi |
fi |
396 |
|
|
397 |
if test $flag = '3' -o $flag = 'All' ; then |
if test $flag = '3' -o $Multi = '1' ; then |
398 |
#---------------------------------------------------------------------- |
#---------------------------------------------------------------------- |
399 |
echo ' ' |
echo ' ' |
400 |
echo "== diff pickup files : end of 1rst run (2x$Nit it) & end of 3rd run (2nd $Nit it)" |
echo "== diff pickup files : end of 1rst run (2x$Nit it) & end of 3rd run (2nd $Nit it)" |
401 |
listP=`( cd $dir1 ; ls pickup*.$num2c* | sed 's/\..*//g' | uniq )` |
listP=`( cd $dir1 ; ls pickup*.$num2c* | sed 's/\..*//g' | uniq )` |
402 |
chkmeta='Y' |
chkmeta='Y' |
403 |
for yy in $listP |
for yy in $listP |
404 |
do |
do |
405 |
listY=`(cd $dir1 ; ls $yy.$num2c.*.data | sed "s/$yy\.$num2c\.//" | sed "s/\.data//")` |
listY=`(cd $dir1 ; ls $yy.$num2c*.data | sed "s/$yy\.$num2c//" | sed "s/data$//")` |
406 |
zz=$yy.$num2c |
zz=$yy.$num2c |
407 |
echo '--> file='$zz', listY='$listY |
echo '--> file='$zz', listY='$listY |
408 |
for xx in $listY |
for xx in $listY |
409 |
do |
do |
410 |
echo ' diff' $dir1/$zz.$xx.data $dir3 |
echo ' diff' $dir1/$zz${xx}data $dir3 |
411 |
diff $dir1/$zz.$xx.data $dir3 |
diff $dir1/$zz${xx}data $dir3 |
412 |
out=$? |
out=$? |
413 |
if test $out != 0 ; then |
if test $out != 0 ; then |
414 |
echo 'Diff outp=' $out ' ==> stop' |
echo 'Diff outp=' $out ' ==> stop' |
415 |
exit 4 |
exit 4 |
416 |
fi |
fi |
417 |
if test $chkmeta = 'Y' -a -f $dir1/$zz.$xx.meta ; then |
if test $chkmeta = 'Y' -a -f $dir1/$zz${xx}meta ; then |
418 |
echo ' diff' $dir1/$zz.$xx.meta $dir3 |
echo ' diff' $dir1/$zz${xx}meta $dir3 |
419 |
diff $dir1/$zz.$xx.meta $dir3 |
diff $dir1/$zz${xx}meta $dir3 |
420 |
out=$? |
out=$? |
421 |
if test $out != 0 ; then |
if test $out != 0 ; then |
422 |
echo 'Diff outp=' $out ' ==> stop' |
echo 'Diff outp=' $out ' ==> stop' |
423 |
exit 5 |
exit 5 |
424 |
fi |
fi |
430 |
|
|
431 |
if test $flag = '4' -o $flag = 'All' ; then |
if test $flag = '4' -o $flag = 'All' ; then |
432 |
#------------- |
#------------- |
433 |
echo ' ' |
echo ' ' |
434 |
echo "== clean-up and reset :" |
echo "== clean-up and reset :" |
435 |
|
echo '--> remove pickup*.'$num0c'* sym-links:' |
436 |
|
#find . ! -name . -prune -type l -name 'pickup*.'${num0c}'*' -exec rm {} \; |
437 |
|
listS=`find . ! -name . -prune -type l -name 'pickup*.'${num0c}'*'` |
438 |
|
if [ $prt -ge 2 ] ; then echo ' rm' $listS ; fi |
439 |
|
rm -f $listS |
440 |
echo '--> remove output dir and output files:' |
echo '--> remove output dir and output files:' |
441 |
echo ' rm -rf' $dir1 $dir2 $dir3 |
echo ' rm -rf' $dir1 $dir2 $dir3 |
442 |
rm -rf $dir1 $dir2 $dir3 |
rm -rf $dir1 $dir2 $dir3 |
443 |
echo ' rm -f' std_????.?i? |
echo ' rm -f' std_????.?i? |
444 |
rm -f std_????.?i? |
rm -f std_????.?i? |
445 |
|
rm -f TTT.out.?i? 2> /dev/null |
446 |
echo ' rm -f' data.pkg data.tst |
echo ' rm -f' data.pkg data.tst |
447 |
rm -f data.pkg data.tst |
rm -f data.pkg data.tst |
448 |
#- move back files from temp_tst dir: |
#- move back files from temp_tst dir: |