source: trunk/MESOSCALE/LMD_MM_MARS/SIMU/meso_install.sh @ 1524

Last change on this file since 1524 was 1475, checked in by aslmd, 9 years ago

mesoscale install. also compile newstart.

File size: 4.2 KB
Line 
1#! /bin/bash
2
3################################
4# A. Spiga 09/06/2015
5# Install the LMD mesoscale model
6################################
7# prerequisite: NETCDF
8# -- NETCDF env variable
9################################
10## DEFAULT
11## name of the folder
12name="MESORUN"
13################################
14
15while getopts "n:h" options; do
16  case $options in
17   n ) name="${OPTARG}";;
18   h ) echo "
19# OPTIONS
20# -n [name] --> name of the folder to be created
21" ; exit ;;
22  esac
23done
24
25################################
26## machine on which you will compile
27machine="CICLAD"
28## fortran compiler used
29fortcom="ifort"
30## server for sources
31where_is_svn="http://svn.lmd.jussieu.fr/Planeto/trunk/"
32## grid definition for GCM
33dimgcm="64x48x29"
34## location of static data
35webrepo="http://data.spiga.fr/mesoscale_model/STATIC_DATA/"
36################################
37
38## -----------------------------
39## import settings and structure
40## -----------------------------
41echo "*** get structure"
42rm -rf $name > /dev/null 2> /dev/null
43svn -q co $where_is_svn"/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN" $name
44refrepo=$PWD/$name
45## fill here user input to obtain independent script
46case ${fortcom} in
47  "ifort") echo 1 > $refrepo/wpsin ; echo 5 > $refrepo/mesoin ; echo 1 >> $refrepo/mesoin ;;
48esac
49
50## ----------------
51## create code repo
52## ----------------
53echo "*** get SVN repository"
54\rm $refrepo/code
55svn -q co -N $where_is_svn $refrepo/code
56
57## ------------
58## get GCM code
59## ------------
60echo "*** get GCM code"
61cd $refrepo/code
62svn -q update LMDZ.MARS
63svn -q update LMDZ.COMMON
64cd $refrepo/code/LMDZ.COMMON
65svn -q co http://forge.ipsl.jussieu.fr/fcm/svn/PATCHED/FCM_V1.2
66ln -sf FCM_V1.2/bin/fcm .
67
68## --------------
69## compile IOIPSL
70## --------------
71log=$refrepo/code/logcompile_ioipsl
72echo "*** compile IOIPSL: check progress in "$log
73rm -rf $log ; touch $log
74cd $refrepo/code/LMDZ.COMMON/ioipsl
75./install_ioipsl_$fortcom".bash" > $log 2> $log
76
77## -----------
78## compile GCM
79## -----------
80log=$refrepo/code/logcompile_gcm
81echo "*** compile GCM: check progress in "$log
82rm -rf $log ; touch $log
83cd $refrepo/code/LMDZ.COMMON
84./makelmdz_fcm -cpp MESOINI -j 8 -s 2 -d $dimgcm -arch $machine$fortcom -parallel mpi -p mars gcm > $log 2> $log
85./makelmdz_fcm              -j 8 -s 2 -d $dimgcm -arch $machine$fortcom               -p mars newstart > $log 2> $log
86cd $refrepo/gcm
87\rm gcm.e
88ln -sf $refrepo/code/LMDZ.COMMON/bin/gcm_$dimgcm"_phymars_para.e" gcm.e
89cd $refrepo/gcm/newstart
90\rm newstart.e
91ln -sf $refrepo/code/LMDZ.COMMON/bin/newstart_$dimgcm"_phymars_seq.e" newstart.e
92
93## ----------------------
94## get and make mesoscale
95## ----------------------
96echo "*** get and compile mesoscale"
97cd $refrepo/code
98svn update MESOSCALE > /dev/null
99cd $refrepo/code/MESOSCALE/LMD_MM_MARS
100ls $refrepo/mesoin
101if [[ "$?" == 0 ]] ; then
102  ./makemeso -p < $refrepo/mesoin
103else
104  ./makemeso -p
105fi
106rm -rf $refrepo/mesoin
107rm -rf $refrepo/code_compiled
108ln -sf $refrepo/code/MESOSCALE/LMD_MM_MARS/LATEST $refrepo/code_compiled
109
110## -------------------------------
111## make ini&bdy tools in mesoscale
112## -------------------------------
113echo "*** compile initialization tools"
114cd $refrepo/code_compiled
115ln -sf $refrepo/code/MESOSCALE/LMD_MM_MARS/SRC/SCRIPTS/prepare_ini .
116./prepare_ini > /dev/null
117##
118cd $refrepo/code_compiled/PREP_MARS
119./compile"_"$fortcom
120##
121cd $refrepo/code_compiled/WPS
122ls $refrepo/wpsin
123if [[ "$?" == 0 ]] ; then
124  ./configure < $refrepo/wpsin > /dev/null 2> /dev/null
125else
126  ./configure
127fi
128rm -rf $refrepo/wpsin
129rm -rf logcompile
130./compile > logcompile 2>&1
131
132## ------------------
133## import static data
134## ------------------
135echo "*** get static data"
136rm -rf $refrepo/data_static
137svn co -q $where_is_svn/MESOSCALE/LMD_MM_MARS/WPS_GEOG $refrepo/data_static
138cd $refrepo/data_static
139rm -rf logdown
140wget $webrepo"/albedo_TES.tar.gz" -a logdown
141wget $webrepo"/mola_topo64.tar.gz" -a logdown
142wget $webrepo"/thermal_TES.tar.gz" -a logdown
143for fff in *.tar.gz; do
144  tar xzvf $fff > /dev/null
145  rm -rf $fff
146done
147
148## -----
149## check
150## -----
151echo "*** CHECKLIST:"
152ls -lL $refrepo/gcm/gcm.e
153ls -lL $refrepo/geogrid/geogrid.exe
154ls -lL $refrepo/metgrid/metgrid.exe
155ls -lL $refrepo/prep/readmeteo.exe
156ls -lL $refrepo/data_static/albedo_TES
157ls -lL $refrepo/real.exe
158ls -lL $refrepo/wrf.exe
159
Note: See TracBrowser for help on using the repository browser.