source: models/LMDZ/setup_LMDZ.sh @ 178

Last change on this file since 178 was 178, checked in by htune, 6 years ago

LMDZ scripts improvements
Fredho

  • Property svn:executable set to *
File size: 2.0 KB
Line 
1#!/bin/bash
2
3set -vx
4
5phys=NPv6.1
6LMAX=79
7
8
9# Path management for LMDZ
10LMDZ=LMDZtrunk
11version=trunk
12rel=3570
13rel=""
14
15if [ "$rel" != "" ] ; then opt_rel="-r $rel" ; fi
16
17LMDZ=LMDZ$version$rel
18
19ROOT=`pwd | sed -e 's/HighTune/ /' | cut -d" " -f1`HighTune
20echo $ROOT
21
22######################################################################
23# Checking if model already exists
24######################################################################
25
26LMDZroot=""
27if [ -d $ROOT/../../$LMDZ ] ; then
28   LMDZroot=$ROOT/../..
29else
30   # By default, LMDZ is installed next to HighTune
31   LMDZroot=$ROOT/..
32fi
33LMDZdir=$ROOT/../$LMDZ
34
35echo LMDZdir $LMDZdir
36
37# Could be written with "sed -i" but this option is not safe on MacOSX
38sed -e 's:LMDZdir=.*.$:LMDZdir='$LMDZdir':' $ROOT/models/LMDZ/serie_LMDZ.sh >| tmp
39\mv -f tmp $ROOT/models/LMDZ/serie_LMDZ.sh
40chmod +x $ROOT/models/LMDZ/serie_LMDZ.sh
41
42sed -e 's:LMDZdir=.*.$:LMDZdir='$LMDZdir':' $ROOT/models/LMDZ/std2std.sh >| tmp
43\mv -f tmp $ROOT/models/LMDZ/std2std.sh
44chmod +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######################################################################
51if [ ! -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 -
61fi
62
63######################################################################
64# Installing the SCM package if needed
65######################################################################
66if [ ! -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 -
71fi
Note: See TracBrowser for help on using the repository browser.