[4176] | 1 | #!/bin/bash |
---|
| 2 | |
---|
| 3 | function cmd_install_lmdz() |
---|
| 4 | { |
---|
[4178] | 5 | # Installation du modele en mode sequentiel |
---|
[4176] | 6 | echo "cmd_install_lmdz" |
---|
[4177] | 7 | wget -N http://www.lmd.jussieu.fr/~lmdz/pub/install_lmdz.sh |
---|
[4176] | 8 | export LANG=C # fixes issue with sed on MaxOSX |
---|
| 9 | sed -e 's/veget=1/veget=0/g' install_lmdz.sh > install_lmdz_patched.sh |
---|
[4177] | 10 | sed -i .bak -e 's/makelmdz_fcm/echo makelmdz_fcm/g' install_lmdz_patched.sh |
---|
| 11 | rm -f *.bak |
---|
[4176] | 12 | chmod +x install_lmdz_patched.sh |
---|
[4177] | 13 | echo "Watch $PWD/install_lmdz_patched.log" |
---|
| 14 | ./install_lmdz_patched.sh -parallel none -v $version >install_lmdz_patched.log 2>&1 |
---|
[4176] | 15 | } |
---|
| 16 | |
---|
| 17 | function cmd_patch_lmdz() |
---|
| 18 | { |
---|
| 19 | # Modification du code source pour prendre en compte la physique |
---|
| 20 | # a 20 parametres |
---|
| 21 | echo "cmd_patch_lmdz" |
---|
| 22 | cd $LMDZ/libf |
---|
| 23 | rm -rf phyparam dynphy_lonlat/phyparam |
---|
| 24 | mkdir phyparam dynphy_lonlat/phyparam |
---|
| 25 | cd phyparam |
---|
| 26 | ln -s ../phydev/* . |
---|
[4224] | 27 | rm -f physiq_mod.F90 # we have our own one in dynphy_lonlat |
---|
[4176] | 28 | ln -sf $ROOT/phyparam/param/* . |
---|
[4181] | 29 | ln -sf $ROOT/phyparam/physics/* . |
---|
[4176] | 30 | cd ../dynphy_lonlat/phyparam |
---|
| 31 | ln -s ../phydev/* . |
---|
[4178] | 32 | ln -sf $ROOT/phyparam/dynphy_lonlat/* . |
---|
[4176] | 33 | cd $LMDZ |
---|
[4230] | 34 | echo "./makelmdz_fcm $* -rrtm false -v false -arch local -j 8 -p param -d 32x32x39 gcm" > compile.sh |
---|
[4177] | 35 | chmod +x compile.sh |
---|
| 36 | ./compile.sh |
---|
[4176] | 37 | } |
---|
| 38 | |
---|
[4202] | 39 | function cmd_full() |
---|
| 40 | { |
---|
| 41 | cd $LMDZ |
---|
| 42 | echo "./makelmdz_fcm -rrtm false -v false -arch local -j 8 -p param -d 32x32x39 -full gcm" > compile.sh |
---|
| 43 | chmod +x compile.sh |
---|
| 44 | ./compile.sh |
---|
| 45 | } |
---|
| 46 | |
---|
[4176] | 47 | function cmd_() |
---|
| 48 | { |
---|
[4178] | 49 | rm -rf LMDZ$version install_lmdz.* |
---|
[4176] | 50 | cmd_install_lmdz |
---|
| 51 | cmd_patch_lmdz |
---|
[4178] | 52 | echo "Now cd TEST_PARAM and execute ./gcm.e" |
---|
[4176] | 53 | } |
---|
| 54 | |
---|
| 55 | # On peut choisir la version de LMDZ a insitaller |
---|
| 56 | version=20191106.trunk |
---|
[4178] | 57 | LMDZ=$PWD/LMDZ$version/modipsl/modeles/LMDZ |
---|
| 58 | ROOT=$(cd -P ../.. ; pwd) |
---|
[4176] | 59 | |
---|
[4230] | 60 | CMD=$1 |
---|
| 61 | shift |
---|
| 62 | cmd_$CMD $* |
---|
| 63 | |
---|