| 1 | #!/bin/bash |
|---|
| 2 | |
|---|
| 3 | set -vx |
|---|
| 4 | |
|---|
| 5 | phys=NPv6.1 |
|---|
| 6 | LMAX=79 |
|---|
| 7 | |
|---|
| 8 | |
|---|
| 9 | # Path management for LMDZ |
|---|
| 10 | LMDZ=LMDZtrunk |
|---|
| 11 | version=trunk |
|---|
| 12 | rel=3570 |
|---|
| 13 | rel="" |
|---|
| 14 | |
|---|
| 15 | if [ "$rel" != "" ] ; then opt_rel="-r $rel" ; fi |
|---|
| 16 | |
|---|
| 17 | LMDZ=LMDZ$version$rel |
|---|
| 18 | |
|---|
| 19 | ROOT=`pwd | sed -e 's/HighTune/ /' | cut -d" " -f1`HighTune |
|---|
| 20 | echo $ROOT |
|---|
| 21 | |
|---|
| 22 | ###################################################################### |
|---|
| 23 | # Checking if model already exists |
|---|
| 24 | ###################################################################### |
|---|
| 25 | |
|---|
| 26 | LMDZroot="" |
|---|
| 27 | if [ -d $ROOT/../../$LMDZ ] ; then |
|---|
| 28 | LMDZroot=$ROOT/../.. |
|---|
| 29 | else |
|---|
| 30 | # By default, LMDZ is installed next to HighTune |
|---|
| 31 | LMDZroot=$ROOT/.. |
|---|
| 32 | fi |
|---|
| 33 | LMDZdir=$ROOT/../$LMDZ |
|---|
| 34 | |
|---|
| 35 | echo LMDZdir $LMDZdir |
|---|
| 36 | |
|---|
| 37 | # Could be written with "sed -i" but this option is not safe on MacOSX |
|---|
| 38 | sed -e 's:LMDZdir=.*.$:LMDZdir='$LMDZdir':' $ROOT/models/LMDZ/serie_LMDZ.sh >| tmp |
|---|
| 39 | \mv -f tmp $ROOT/models/LMDZ/serie_LMDZ.sh |
|---|
| 40 | chmod +x $ROOT/models/LMDZ/serie_LMDZ.sh |
|---|
| 41 | |
|---|
| 42 | sed -e 's:LMDZdir=.*.$:LMDZdir='$LMDZdir':' $ROOT/models/LMDZ/std2std.sh >| tmp |
|---|
| 43 | \mv -f tmp $ROOT/models/LMDZ/std2std.sh |
|---|
| 44 | chmod +x $ROOT/models/LMDZ/std2std.sh |
|---|
| 45 | |
|---|
| 46 | ###################################################################### |
|---|
| 47 | # Installing LMDZ if needed |
|---|
| 48 | # To force reinstalling, you should run |
|---|
| 49 | # \rm -rf LMDZtrunk |
|---|
| 50 | ###################################################################### |
|---|
| 51 | if [ ! -d $LMDZdir ] ; then |
|---|
| 52 | echo LMDZ directory called $LMDZdir does not exists |
|---|
| 53 | echo LMDZ installation will start within 3 seconds |
|---|
| 54 | sleep 3 |
|---|
| 55 | cd $LMDZroot |
|---|
| 56 | wget http://www.lmd.jussieu.fr/~lmdz/pub/install_lmdz.sh |
|---|
| 57 | chmod +x install_lmdz.sh |
|---|
| 58 | ./install_lmdz.sh -v $version $opt_rel -bench 0 # not installing the 1D automatically with -SCM |
|---|
| 59 | # to allow modifying run.sh |
|---|
| 60 | cd - |
|---|
| 61 | fi |
|---|
| 62 | |
|---|
| 63 | ###################################################################### |
|---|
| 64 | # Installing the SCM package if needed |
|---|
| 65 | ###################################################################### |
|---|
| 66 | if [ ! -d $LMDZdir/1D ] ; then |
|---|
| 67 | cd $LMDZdir |
|---|
| 68 | wget http://www.lmd.jussieu.fr/~lmdz/pub/1D/1D.tar.gz |
|---|
| 69 | tar xvf 1D.tar.gz |
|---|
| 70 | cd - |
|---|
| 71 | fi |
|---|