/[MITgcm]/MITgcm_contrib/jmc_script/tst1+1
ViewVC logotype

Contents of /MITgcm_contrib/jmc_script/tst1+1

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.4 - (show annotations) (download)
Thu Mar 31 14:48:15 2005 UTC (20 years, 3 months ago) by jmc
Branch: MAIN
Changes since 1.3: +10 -7 lines
minor changes

1 #!/bin/sh
2
3 # Nit = Nb of iter of 2nd & 3rd run (1rst one is 2 x Nit iter long)
4 Dbl=`sed -n 's/nTimeSteps=//p' data.tst | sed 's/,//g'`
5 Nit=`expr $Dbl / 2`
6 #Nit=2
7
8 case $# in
9 1) ;;
10 *) echo "Usage: `basename $0` flag"
11 echo " Check restart: compare 1 run of 2 x $Nit it long"
12 echo " with 2 consecutive runs of $Nit it long each"
13 echo " where: flag = 1 -> do the 3 run"
14 echo " flag = 2 -> compare std_outp"
15 echo " flag = 3 -> compare pickup files"
16 exit ;;
17 esac
18 flag=$1
19
20
21 #- input :
22 # 1) data.tst = parameter file "data" for 2.Nit iter run
23 # 2) in dir temp : pickup(_cd).0..0{num0}.001.001.data
24
25 num0=`sed -n 's/nIter0=//p' data.tst | sed 's/,//g' | sed 's/ //g'`
26 #num0="72000"
27
28 gcmExc=mitgcmuv
29 # list of pickup(s) that are needed for a restart :
30 listP='pickup'
31 #listP='pickup pickup_cd'
32
33 #- dir where to put the results :
34 dir1=res_2it
35 dir2=res_1iA
36 dir3=res_1iB
37 #---------------------------
38 Dbl=`expr $Nit + $Nit`
39 num1=`expr $num0 + $Nit`
40 num2=`expr $num0 + $Dbl`
41 num0c=`add0upto10c $num0`
42 num1c=`add0upto10c $num1`
43 num2c=`add0upto10c $num2`
44 echo $num0 $num1 $num2
45 echo $num0c $num1c $num2c
46 echo 'gcmExc='$gcmExc
47 # exit
48 #------------------------
49
50 if test $flag = 1 ; then
51 #------------
52 rm -r $dir1 $dir2 $dir3
53 mkdir $dir1 $dir2 $dir3
54
55 cp -p data.tst data
56 ln -s temp/pickup*.${num0c}* .
57 echo '==> START RUN 2 x' $Nit 'it'
58 ./$gcmExc > std_outp.2it 2>&1
59 if test -f pickup.ckptA.001.001.data
60 then out=`egrep -c 'STOP ABNORMAL END' std_outp.2it`
61 else out=9 ; fi
62 if test $out != 0 ; then echo 'RUN 2it STOP before END => exit' ; exit ; fi
63 echo '==> END RUN 2 x' $Nit 'it'
64 for xx in $listP
65 do
66 rnp -s $xx.ckptA $xx.$num2c
67 done
68 mv *.0??.0??.* $dir1
69 mv $dir1/pickup*.${num0c}* .
70 #--
71 sed "s/^ nTimeSteps=$Dbl/ nTimeSteps=$Nit/g" data.tst > data
72 echo '==> START RUN 1iA'
73 ./$gcmExc > std_outp.1iA 2>&1
74 if test -f pickup.ckptA.001.001.data
75 then out=`egrep -c 'STOP ABNORMAL END' std_outp.1iA`
76 else out=9 ; fi
77 if test $out != 0 ; then echo 'RUN 1iA STOP before END => exit' ; exit ; fi
78 echo '==> END RUN 1iA'
79 for xx in $listP
80 do
81 rnp -s $xx.ckptA $xx.$num1c
82 done
83 mv *.0??.0??.* $dir2
84 rm $dir2/pickup*.${num0c}*
85 #--
86 ln -s $dir2/pickup*.$num1c.* .
87 mv data data.tmp
88 sed "s/^ nIter0=$num0/ nIter0=$num1/g" data.tmp > data
89 echo '==> START RUN 1iB'
90 ./$gcmExc > std_outp.1iB 2>&1
91 if test -f pickup.ckptA.001.001.data
92 then out=`egrep -c 'STOP ABNORMAL END' std_outp.1iB`
93 else out=9 ; fi
94 if test $out != 0 ; then echo 'RUN 1iB STOP before END => exit' ; exit ; fi
95 echo '==> END RUN 1iB'
96 for xx in $listP
97 do
98 rnp -s $xx.ckptA $xx.$num2c
99 done
100 mv *.0??.0??.* $dir3
101 rm $dir3/pickup*.$num1c.*
102 exit
103 #------------
104 fi
105
106 if test $flag = 2 ; then
107 #------------
108 echo ' ' ; echo '-- compare cg2d_init_res :'
109 echo ' run 1iA:'
110 grep "cg2d_init_res" std_outp.1iA \
111 | sed 's/.* cg2d_init_res =//'
112 echo ' run 1iB:'
113 grep "cg2d_init_res" std_outp.1iB \
114 | sed 's/.* cg2d_init_res =//'
115 echo ' run 2it:'
116 grep "cg2d_init_res" std_outp.2it \
117 | sed 's/.* cg2d_init_res =//'
118 exit
119 #------------
120 fi
121
122 if test $flag = 3 ; then
123 #------------
124 difex=`ls ~jmc/bin/dif_data`
125 for xx in $listP
126 do
127 $difex $dir1 $dir3 $xx.$num2c
128 done
129 exit
130 #------------
131 fi

  ViewVC Help
Powered by ViewVC 1.1.22