3 |
# $Header$ |
# $Header$ |
4 |
# $Name$ |
# $Name$ |
5 |
|
|
6 |
#- uses scripts in the path (1rst) or if not in the path, from dScript directory: |
rnp_loc() |
7 |
dScript=../../../../MITgcm_contrib/jmc_script |
{ |
8 |
|
# rnp_loc arg_1 arg_2 |
9 |
|
# rename files with prefix = 'arg_1' to files with prefix = 'arg_2' |
10 |
|
echo 'rnp_loc:' $1 $2 |
11 |
|
# rnp -s $1 $2 |
12 |
|
listY=`ls -1 $1*` |
13 |
|
for yy in $listY |
14 |
|
do |
15 |
|
zz=`echo $yy | sed "s/^$1/$2/"` |
16 |
|
mv $yy $zz |
17 |
|
done |
18 |
|
} |
19 |
|
|
20 |
|
#--------------------------- |
21 |
#- input : |
#- input : |
22 |
# 1) data.tst = parameter file "data" for 2.Nit iter run |
# 1) data.tst = parameter file "data" for 2.Nit iter run |
23 |
# 2) here or in dir temp : pickup(_cd).0..0{num0}.001.001.data |
# 2) here or in dir temp : pickup(_cd).0..0{num0}.001.001.data |
63 |
dir3=res_1iB |
dir3=res_1iB |
64 |
|
|
65 |
#--------------------------- |
#--------------------------- |
|
# find where the 3 little scripts are: |
|
|
|
|
|
#export PATH=${PATH}:$HOME/MITgcm_contrib/jmc_script |
|
|
|
|
|
if test -d $dScript ; then : ; else echo 'dScript='$dScript 'is not a directory' ; fi |
|
|
|
|
|
ff=rnp ; |
|
|
RNPs=`which $ff 2> /dev/null` |
|
|
if test "x$RNPs" = x -a -x $dScript/$ff ; then RNPs=$dScript/$ff ; fi |
|
|
if test "x$RNPs" != x ; then RNPs=$RNPs" -s" ; fi |
|
|
ff=add0upto10c ; |
|
|
P10c=`which $ff 2> /dev/null` |
|
|
if test "x$P10c" = x -a -x $dScript/$ff ; then P10c=$dScript/$ff ; fi |
|
|
ff=dif_data ; |
|
|
DIFd=`which $ff 2> /dev/null` |
|
|
if test "x$DIFd" = x -a -x $dScript/$ff ; then DIFd=$dScript/$ff ; fi |
|
|
echo " use script: P10c='$P10c'" |
|
|
echo " RNPs='$RNPs'" |
|
|
echo " and DIFd='$DIFd'" |
|
|
if test "x$RNPs" = x -o "x$P10c" = x -o "x$DIFd" = x |
|
|
then echo 'missing some scripts' ; exit ; fi |
|
|
#--------------------------- |
|
66 |
Dbl=`expr $Nit + $Nit` |
Dbl=`expr $Nit + $Nit` |
67 |
num1=`expr $num0 + $Nit` |
num1=`expr $num0 + $Nit` |
68 |
num2=`expr $num0 + $Dbl` |
num2=`expr $num0 + $Dbl` |
69 |
num0c=`$P10c $num0` |
num0c=`printf "%10.10i\n" $num0` |
70 |
num1c=`$P10c $num1` |
num1c=`printf "%10.10i\n" $num1` |
71 |
num2c=`$P10c $num2` |
num2c=`printf "%10.10i\n" $num2` |
72 |
echo $num0 $num1 $num2 |
echo $num0 $num1 $num2 |
73 |
echo $num0c $num1c $num2c |
echo $num0c $num1c $num2c |
74 |
echo 'gcmExc='$gcmExc |
echo 'gcmExc='$gcmExc |
75 |
# exit |
#exit |
76 |
#--------------------------- |
#--------------------------- |
77 |
|
|
78 |
if test $flag = 1 ; then |
if test $flag = 1 ; then |
105 |
echo ' listP=' $listP |
echo ' listP=' $listP |
106 |
for xx in $listP |
for xx in $listP |
107 |
do |
do |
108 |
$RNPs $xx.ckptA $xx.$num2c |
rnp_loc $xx.ckptA $xx.$num2c |
109 |
done |
done |
110 |
mv *.0??.0??.* $dir1 |
mv *.0??.0??.* $dir1 |
111 |
txtF=`ls -1 *.txt 2> /dev/null` |
txtF=`ls -1 *.txt 2> /dev/null` |
127 |
echo '==> END RUN 1iA' |
echo '==> END RUN 1iA' |
128 |
for xx in $listP |
for xx in $listP |
129 |
do |
do |
130 |
$RNPs $xx.ckptA $xx.$num1c |
rnp_loc $xx.ckptA $xx.$num1c |
131 |
done |
done |
132 |
mv *.0??.0??.* $dir2 |
mv *.0??.0??.* $dir2 |
133 |
txtF=`ls -1 *.txt 2> /dev/null` |
txtF=`ls -1 *.txt 2> /dev/null` |
151 |
echo '==> END RUN 1iB' |
echo '==> END RUN 1iB' |
152 |
for xx in $listP |
for xx in $listP |
153 |
do |
do |
154 |
$RNPs $xx.ckptA $xx.$num2c |
rnp_loc $xx.ckptA $xx.$num2c |
155 |
done |
done |
156 |
mv *.0??.0??.* $dir3 |
mv *.0??.0??.* $dir3 |
157 |
txtF=`ls -1 *.txt 2> /dev/null` |
txtF=`ls -1 *.txt 2> /dev/null` |
180 |
if test $flag = 3 ; then |
if test $flag = 3 ; then |
181 |
#------------ |
#------------ |
182 |
listP=`( cd $dir1 ; ls pickup*.$num2c* | sed 's/\..*//g' | uniq )` |
listP=`( cd $dir1 ; ls pickup*.$num2c* | sed 's/\..*//g' | uniq )` |
183 |
for xx in $listP |
chkmeta='Y' |
184 |
|
for yy in $listP |
185 |
do |
do |
186 |
$DIFd $dir1 $dir3 $xx.$num2c |
listY=`(cd $dir1 ; ls $yy.$num2c.*.data | sed "s/$yy\.$num2c\.//" | sed "s/\.data//")` |
187 |
|
zz=$yy.$num2c |
188 |
|
echo '--> file='$zz', listY='$listY |
189 |
|
for xx in $listY |
190 |
|
do |
191 |
|
echo diff $dir1/$zz.$xx.data $dir3 |
192 |
|
diff $dir1/$zz.$xx.data $dir3 |
193 |
|
out=$? |
194 |
|
if test $out != 0 |
195 |
|
then echo 'Diff outp=' $out ' ==> stop' |
196 |
|
exit ; fi |
197 |
|
if test $chkmeta = 'Y' |
198 |
|
then |
199 |
|
echo diff $dir1/$zz.$xx.meta $dir3 |
200 |
|
diff $dir1/$zz.$xx.meta $dir3 |
201 |
|
out=$? |
202 |
|
if test $out != 0 |
203 |
|
then echo 'Diff outp=' $out ' ==> stop' |
204 |
|
exit ; fi |
205 |
|
fi |
206 |
|
done |
207 |
done |
done |
208 |
exit |
exit |
209 |
#------------ |
#------------ |