Last change
on this file since 1000 was
492,
checked in by emillour, 13 years ago
|
Common dynamics: updates to keep up with LMDZ5 Earth (rev 1605)
See file "DOC/chantiers/commit_importants.log" for details.
EM
|
File size:
1.5 KB
|
Rev | Line | |
---|
[492] | 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 |
---|
[1] | 18 | done |
---|
| 19 | fichdim=dimensions${list} |
---|
| 20 | |
---|
[492] | 21 | if [ ! -f $fichdim ] |
---|
| 22 | then |
---|
| 23 | # echo "$fichdim does not exist" |
---|
[1] | 24 | |
---|
[492] | 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 |
---|
[1] | 45 | |
---|
[492] | 46 | # since the file doesn't exist, we create it |
---|
[1] | 47 | cat << EOF > $fichdim |
---|
| 48 | !----------------------------------------------------------------------- |
---|
| 49 | ! INCLUDE 'dimensions.h' |
---|
| 50 | ! |
---|
| 51 | ! dimensions.h contient les dimensions du modele |
---|
| 52 | ! ndm est tel que iim=2**ndm |
---|
| 53 | !----------------------------------------------------------------------- |
---|
| 54 | |
---|
| 55 | INTEGER iim,jjm,llm,ndm |
---|
| 56 | |
---|
| 57 | PARAMETER (iim= $im,jjm=$jm,llm=$lm,ndm=$ndm) |
---|
| 58 | |
---|
| 59 | !----------------------------------------------------------------------- |
---|
| 60 | EOF |
---|
| 61 | |
---|
| 62 | fi |
---|
| 63 | |
---|
[492] | 64 | # remove 'old' dimensions.h file (if any) and replace it with new one |
---|
| 65 | if [ -f ../dimensions.h ] ; then |
---|
[1] | 66 | \rm ../dimensions.h |
---|
[492] | 67 | fi |
---|
[1] | 68 | tar cf - $fichdim | ( cd .. ; tar xf - ; mv $fichdim dimensions.h ) |
---|
[492] | 69 | # line above is a trick to preserve time of creation of dimensions.h files |
---|
Note: See
TracBrowser
for help on using the repository browser.