Changeset 492 for trunk/LMDZ.COMMON/libf/grid
- Timestamp:
- Jan 5, 2012, 8:28:41 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.COMMON/libf/grid/dimension/makdim
r1 r492 1 for i in $* ; do 2 list=$list.$i 1 #!/bin/bash 2 #set -xv 3 4 # sanity check: do we have the required argument ? 5 if (( $# < 1 )) || (( $# > 3 )) 6 then 7 echo "Wrong number of parameters in $0 !!!" 8 echo " Usage:" 9 echo " $0 [im] [jm] lm" 10 echo " where im, jm and lm are the dimensions" 11 exit 12 fi 13 14 # build "fichnom", the relevant 'dimensions.im.jm.lm' file name 15 for i in $* 16 do 17 list=$list.$i 3 18 done 4 19 fichdim=dimensions${list} 5 20 6 if [ ! -f $fichdim ] ; then 7 # si le fichier de dimensions n'existe pas, on le cree 21 if [ ! -f $fichdim ] 22 then 23 # echo "$fichdim does not exist" 8 24 9 if [ $# -ge 3 ] ; then 10 im=$1 11 jm=$2 12 lm=$3 13 n2=$1 14 ndm=1 25 # assign values of im, jm and lm 26 if [ $# -ge 3 ] 27 then 28 im=$1 29 jm=$2 30 lm=$3 31 ndm=1 32 elif [ $# -ge 2 ] 33 then 34 im=1 35 jm=$1 36 lm=$2 37 ndm=1 38 elif [ $# -ge 1 ] 39 then 40 im=1 41 jm=1 42 lm=$1 43 ndm=1 44 fi 15 45 16 # Le test suivant est commente car il est inutile avec le nouveau 17 # filtre filtrez. Attention avec le "vieux" filtre (F. Forget,11/1994) 18 # 19 # while [ "$n2" -gt 2 ]; do 20 # n2=`expr $n2 / 2` 21 # ndm=`expr $ndm + 1` 22 # echo $n2 23 # done 24 # if [ "$n2" != 2 ] ; then 25 # echo le nombre de longitude doit etre une puissance de 2 26 # exit 27 # fi 28 29 30 else if [ $# -ge 2 ] ; then 31 im=1 32 jm=$1 33 lm=$2 34 ndm=1 35 else if [ $# -ge 1 ] ; then 36 im=1 37 jm=1 38 lm=$1 39 ndm=1 40 else 41 echo il faut au moins une dimension 42 exit 43 fi 44 fi 45 fi 46 46 # since the file doesn't exist, we create it 47 47 cat << EOF > $fichdim 48 48 !----------------------------------------------------------------------- … … 62 62 fi 63 63 64 # remove 'old' dimensions.h file (if any) and replace it with new one 65 if [ -f ../dimensions.h ] ; then 64 66 \rm ../dimensions.h 67 fi 65 68 tar cf - $fichdim | ( cd .. ; tar xf - ; mv $fichdim dimensions.h ) 69 # line above is a trick to preserve time of creation of dimensions.h files
Note: See TracChangeset
for help on using the changeset viewer.