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

Last change on this file since 1456 was 1456, checked in by aslmd, 10 years ago

MESOSCALE. added download fcm for meso_install.sh script

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