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

Diff of /MITgcm_contrib/jmc_script/tst1+1

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

revision 1.11 by jmc, Sun Nov 4 20:11:07 2007 UTC revision 1.12 by jmc, Wed Nov 7 01:40:47 2007 UTC
# Line 3  Line 3 
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
# Line 51  dir2=res_1iA Line 63  dir2=res_1iA
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
# Line 115  listP=`ls pickup*.ckptA* | sed 's/\..*// Line 105  listP=`ls pickup*.ckptA* | sed 's/\..*//
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`
# Line 137  if test $out != 0 ; then echo 'RUN 1iA S Line 127  if test $out != 0 ; then echo 'RUN 1iA S
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`
# Line 161  if test $out != 0 ; then echo 'RUN 1iB S Line 151  if test $out != 0 ; then echo 'RUN 1iB S
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`
# Line 190  fi Line 180  fi
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  #------------  #------------

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.12

  ViewVC Help
Powered by ViewVC 1.1.22