Changeset 1605 for LMDZ5/trunk/libf/grid/dimension
- Timestamp:
- Jan 2, 2012, 2:48:17 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ5/trunk/libf/grid/dimension/makdim
r1604 r1605 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 1 15 for i in $* 2 16 do … … 7 21 if [ ! -f $fichdim ] 8 22 then 9 # si le fichier de dimensions n'existe pas, on le cree23 # echo "$fichdim does not exist" 10 24 25 # assign values of im, jm and lm 11 26 if [ $# -ge 3 ] 12 then 13 im=$1 14 jm=$2 15 lm=$3 16 n2=$1 17 ndm=1 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 18 45 19 # Le test suivant est commente car il est inutile avec le nouveau 20 # filtre filtrez. Attention avec le "vieux" filtre (F. Forget,11/1994) 21 # 22 # while [ "$n2" -gt 2 ]; do 23 # n2=`expr $n2 / 2` 24 # ndm=`expr $ndm + 1` 25 # echo $n2 26 # done 27 # if [ "$n2" != 2 ] ; then 28 # echo le nombre de longitude doit etre une puissance de 2 29 # exit 30 # fi 31 32 33 else if [ $# -ge 2 ] 34 then 35 im=1 36 jm=$1 37 lm=$2 38 ndm=1 39 else if [ $# -ge 1 ] 40 then 41 im=1 42 jm=1 43 lm=$1 44 ndm=1 45 else 46 echo il faut au moins une dimension 47 exit 48 fi 49 fi 50 46 # since the file doesn't exist, we create it 51 47 cat << EOF > $fichdim 52 48 !----------------------------------------------------------------------- … … 64 60 EOF 65 61 62 fi 63 64 # remove 'old' dimensions.h file (if any) and replace it with new one 65 if [ -f ../dimensions.h ] ; then 66 66 \rm ../dimensions.h 67 fi 67 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.