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

Annotation of /MITgcm_contrib/jmc_script/tst1+1

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


Revision 1.3 - (hide annotations) (download)
Wed Mar 30 22:41:50 2005 UTC (20 years, 3 months ago) by jmc
Branch: MAIN
Changes since 1.2: +5 -5 lines
fix for more than 9 tiles (in X or Y)

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

  ViewVC Help
Powered by ViewVC 1.1.22