1 | #!/bin/bash |
---|
2 | #set -vx |
---|
3 | # Default options |
---|
4 | # |
---|
5 | # |
---|
6 | # |
---|
7 | date |
---|
8 | #### 1 Set up the compiling options |
---|
9 | #### Define some directories |
---|
10 | submitdir=$( pwd ) |
---|
11 | modipsl=$submitdir/../.. |
---|
12 | arch_path=$submitdir/ARCH |
---|
13 | mysrc_path=$submitdir/SOURCES |
---|
14 | |
---|
15 | #### Set default options |
---|
16 | # Atmospheric resolution, for LMDZ/ORCHIDEE in regular mode |
---|
17 | resol_atm=144x142x79 |
---|
18 | # Oceanic resolution, for NEMO (ORCA2/ORCA1/ORCA025) |
---|
19 | resol_oce=ORCA1 |
---|
20 | # Version of ice model lim2/lim3 |
---|
21 | icemodel=lim3 |
---|
22 | # Coupled with ocean biogeochemistry (y/n) |
---|
23 | oceanbio=y |
---|
24 | # Version ESM CO2: CO2 interactif ocean/atmosphere (y/n) |
---|
25 | esmco2=n |
---|
26 | # Version ESM AER : Aer interactif chemistry / atmosphere (y/n) |
---|
27 | esmaer=n |
---|
28 | # Also compile ce0l subprogram to LMDZ (y/n) |
---|
29 | ce0l=n |
---|
30 | |
---|
31 | # Optimization mode |
---|
32 | # optmode=prod/dev/debug |
---|
33 | optmode=prod |
---|
34 | # fcm_arch |
---|
35 | fcm_arch=default |
---|
36 | # Default values to be overritten |
---|
37 | parallel=mpi_omp |
---|
38 | export fcm_arch parallel xios |
---|
39 | full_flag="" |
---|
40 | full_nemo=n |
---|
41 | full_inca="" |
---|
42 | full_xios="" |
---|
43 | full_lmdz="" |
---|
44 | full_orch="" |
---|
45 | |
---|
46 | |
---|
47 | |
---|
48 | # Output text file for compilation of each component |
---|
49 | datestr=`LC_ALL=C date +"%Y%m%dT%H%M"` |
---|
50 | outfile=$submitdir/out_compile_ipslcm6.$datestr |
---|
51 | echo > $outfile |
---|
52 | echo; echo "Text output from compilation will be stored in file out_compile_ipslcm6.$datestr"; echo |
---|
53 | |
---|
54 | #### Read arguments |
---|
55 | # Loop over all arguments to modify default set up |
---|
56 | while (($# > 0)) ; do |
---|
57 | case $1 in |
---|
58 | "-h") cat <<end_help |
---|
59 | ######################################################################## |
---|
60 | # Usage of the script compile_ipslcm6.sh |
---|
61 | # |
---|
62 | ######################################################################## |
---|
63 | |
---|
64 | ./compile_ipslcm6.sh [Options] |
---|
65 | |
---|
66 | |
---|
67 | Options: [LR / VLR / MR1 / MR025] Model resolution, choose only one. Default: LR. |
---|
68 | [ESMCO2] Compile IPSLCM6 for CO2 interactif ocean/atmosphere. |
---|
69 | [ESMAER] Compile IPSLCM6 for AER interactif on atmosphere |
---|
70 | [-full] Full recompilation of all components. This option can be added to all other options. |
---|
71 | [-cleannemo] Full recompilation of NEMO component only. |
---|
72 | [-debug / -dev / -prod] Level of optimization. One of these can be added to all other compile options. Default: -prod. |
---|
73 | |
---|
74 | |
---|
75 | Example 1: Default compilation of IPSLCM6 for resoltion LR |
---|
76 | (Resolution atmos: 144x142x79, ocean: ORCA1) |
---|
77 | ./compile_ipslcm6.sh |
---|
78 | |
---|
79 | Example 2: Compilation of IPSLCM6 for resolution MR025 |
---|
80 | (atmos: 256x256x79, ocean: ORCA025, NOPISCES) |
---|
81 | ./compile_ipslcm6.sh MR025 |
---|
82 | |
---|
83 | Example 3: Compilation of IPSLCM6 for ESM CO2 |
---|
84 | ./compile_ipslcm6.sh ESMCO2 -cleannemo |
---|
85 | |
---|
86 | Example 4: Default resoltuion (LR) compiled in debug mode |
---|
87 | ./compile_ipslcm6.sh -debug |
---|
88 | |
---|
89 | Example 5: Default compilation with full recompilation of all components. No clean is needed. |
---|
90 | ./compile_ipslcm6.sh -full |
---|
91 | |
---|
92 | Example 6: Full recompilation of resolution MR05 in debug mode |
---|
93 | ./compile_ipslcm6.sh MR025 -debug -full |
---|
94 | |
---|
95 | end_help |
---|
96 | exit;; |
---|
97 | "VLR") resol_atm=96x95x39; resol_oce=ORCA2 ; icemodel=lim2; oceanbio=y; shift ;; |
---|
98 | "LR") resol_atm=144x142x79; resol_oce=ORCA1 ; icemodel=lim3; oceanbio=y; shift ;; |
---|
99 | "MR1") resol_atm=256x256x79; resol_oce=ORCA1 ; icemodel=lim3; oceanbio=y; shift ;; |
---|
100 | "MR025") resol_atm=256x256x79; resol_oce=ORCA025 ; icemodel=lim3; oceanbio=n; shift ;; |
---|
101 | "ESMCO2") esmco2=y; shift ;; |
---|
102 | "ESMAER") esmaer=y; shift ;; |
---|
103 | "CE0L") ce0l=y ; shift ;; |
---|
104 | "-parallel") parallel=$2 ; shift ; shift ;; |
---|
105 | "-arch") fcm_arch="$2" ; shift ; shift ;; |
---|
106 | "-debug") optmode=debug ; shift ;; |
---|
107 | "-dev") optmode=dev ; shift ;; |
---|
108 | "-prod") optmode=prod ; shift ;; |
---|
109 | "-full") full_flag="-full"; full_nemo=y ; full_xios="--full" ; full_lmdz="-full" ; full_orch="-full" ; shift ;; |
---|
110 | "-full_xios") full_xios="--full" ; shift ;; # Note only full_xios is using double dash: --full |
---|
111 | "-full_lmdz") full_lmdz="-full" ; shift ;; |
---|
112 | "-full_orch") full_orch="-full" ; shift ;; |
---|
113 | "-full_nemo") full_nemo=y ; shift ;; |
---|
114 | "-full_inca") full_inca="-clean"; shift ;; |
---|
115 | "-cleannemo") full_nemo=y ; shift ;; |
---|
116 | *) echo "unknown option "$1" , exiting..." ; exit |
---|
117 | esac |
---|
118 | done |
---|
119 | |
---|
120 | echo "Following options are set in current compiling:" >> $outfile |
---|
121 | echo " resol_atm=${resol_atm}, resol_oce=${resol_oce}, icemodel=${icemodel}, oceanbio=${oceanbio}" >> $outfile |
---|
122 | echo " esmco2=${esmco2}, esmaer=${esmaer}" >> $outfile |
---|
123 | echo " ce0l=${ce0l}" >> $outfile |
---|
124 | echo " optmode = $optmode, parallel = $parallel, fcm_arch = $fcm_arch " >> $outfile |
---|
125 | echo " full_flag=$full_flag, full_xios=$full_xios, full_lmdz=$full_lmdz, full_orch=$full_orch, full_nemo=$full_nemo," >> $outfile |
---|
126 | echo >> $outfile |
---|
127 | |
---|
128 | ### Read host dependent default values |
---|
129 | ### These variables will not be changed if they were set as argument |
---|
130 | ###./host.sh $host |
---|
131 | # Later : Following lines should be set in host.sh file |
---|
132 | # begin host.sh |
---|
133 | if [ $fcm_arch == default ] ; then |
---|
134 | # Find out current host and source specific paths and commands for the host |
---|
135 | case $( hostname -s ) in |
---|
136 | jean-zay*) |
---|
137 | fcm_arch=X64_JEANZAY;; |
---|
138 | irene170|irene171|irene190|irene191|irene192|irene193) |
---|
139 | fcm_arch=X64_IRENE;; |
---|
140 | irene172|irene173|irene194|irene195) |
---|
141 | fcm_arch=X64_IRENE-AMD;; |
---|
142 | asterix*|obelix*) |
---|
143 | fcm_arch=ifort_LSCE |
---|
144 | if [ "${parallel}" == "mpi_omp" ] ; then |
---|
145 | echo "Warning!! Currently at Obelix hybrid mode is not possible." |
---|
146 | echo " Option -parallel mpi_omp is now changed to -parallel mpi" |
---|
147 | echo "" |
---|
148 | parallel=mpi |
---|
149 | else |
---|
150 | echo "You used -parallel" $parallel |
---|
151 | fi ;; |
---|
152 | ciclad*|climserv*|loholt*|camelot*) |
---|
153 | fcm_arch=ifort_CICLAD;; |
---|
154 | *) |
---|
155 | echo Current host is not known. You must use option -arch to specify which architecuture files to use. |
---|
156 | echo Exit now. |
---|
157 | exit |
---|
158 | esac |
---|
159 | fi |
---|
160 | |
---|
161 | # Set a link to arch.env if arch-${fcm_arch}.env file exist for current fcm_arch. |
---|
162 | # The link arch.env is also set in config.card and will be used by libIGCM to ensure the same running environnement. |
---|
163 | if [ -f ARCH/arch-${fcm_arch}.env ] ; then |
---|
164 | echo >> $outfile |
---|
165 | echo "The file ARCH/arch-${fcm_arch}.env will now be sourced with modules needed for compilation for all components." |
---|
166 | echo "Note that this new environement might be kept after compilation." |
---|
167 | echo "If this is the case, source again your personal environment after compilation. " |
---|
168 | echo " Personal module list before sourcing of ARCH/arch.env file:" >> $outfile |
---|
169 | module list >> $outfile 2>&1 |
---|
170 | |
---|
171 | # Make a link to this file, to be used also in config.card |
---|
172 | rm -f ARCH/arch.env |
---|
173 | ln -s arch-${fcm_arch}.env ARCH/arch.env |
---|
174 | |
---|
175 | # Source the file |
---|
176 | source ARCH/arch.env >> $outfile 2>&1 |
---|
177 | echo >> $outfile |
---|
178 | echo " New module list after sourcing of ARCH/arch.env file:" >> $outfile |
---|
179 | module list >> $outfile 2>&1 |
---|
180 | fi |
---|
181 | |
---|
182 | #### 2 Do the compilation |
---|
183 | ## 2.1 Compile ioipsl |
---|
184 | cd $modipsl/modeles/IOIPSL |
---|
185 | echo; echo "NOW COMPILE IOIPSL" |
---|
186 | echo >> $outfile ; echo " NOW COMPILE IOIPSL" >> $outfile |
---|
187 | |
---|
188 | # Check if compilation with fcm is included in IOIPSL |
---|
189 | if [ ! -f makeioipsl_fcm ] ; then |
---|
190 | echo "The file makeiopsl_fcm do not exist. Probably this is not the right version of IOIPSL." |
---|
191 | echo "Version of IOIPSL with fcm compilation is needed to compile with this script. Stop now." |
---|
192 | exit |
---|
193 | fi |
---|
194 | |
---|
195 | echo ./makeioipsl_fcm -$optmode -parallel -arch ${fcm_arch} -arch_path $arch_path -j 8 $full_flag >> $outfile |
---|
196 | ./makeioipsl_fcm -$optmode -parallel -arch ${fcm_arch} -arch_path $arch_path -j 8 $full_flag >> $outfile 2>&1 |
---|
197 | # Test if compiling succeded |
---|
198 | if [[ $? != 0 ]] ; then |
---|
199 | echo "THERE IS A PROBLEM IN IOIPSL COMPILATION - STOP" |
---|
200 | exit |
---|
201 | fi |
---|
202 | |
---|
203 | ## 2.2 Compile oasis3-mct |
---|
204 | cd $modipsl/oasis3-mct/util/make_dir |
---|
205 | echo; echo "NOW COMPILE OASIS3-MCT" |
---|
206 | echo >> $outfile ; echo " NOW COMPILE OASIS3-MCT" >> $outfile |
---|
207 | cp $mysrc_path/OASIS3-MCT/make_${fcm_arch} make.inc |
---|
208 | |
---|
209 | echo make -f TopMakefileOasis3 >> $outfile |
---|
210 | make -f TopMakefileOasis3 >> $outfile 2>&1 |
---|
211 | |
---|
212 | |
---|
213 | ## 2.3 Compile xios |
---|
214 | cd $modipsl/modeles/XIOS |
---|
215 | echo; echo "NOW COMPILE XIOS" |
---|
216 | echo >> $outfile ; echo " NOW COMPILE XIOS" >> $outfile |
---|
217 | echo ./make_xios --use_oasis oasis3_mct --$optmode --arch $fcm_arch --arch_path $arch_path --job 4 $full_xios >> $outfile |
---|
218 | ./make_xios --use_oasis oasis3_mct --$optmode --arch $fcm_arch --arch_path $arch_path --job 4 $full_xios >> $outfile 2>&1 |
---|
219 | # Test if compiling succeded |
---|
220 | if [[ $? != 0 ]] ; then |
---|
221 | echo "THERE IS A PROBLEM IN XIOS COMPILATION - STOP" |
---|
222 | exit |
---|
223 | fi |
---|
224 | # Move executables to modipsl/bin |
---|
225 | if [ -f $modipsl/modeles/XIOS/bin/xios_server.exe ] ; then |
---|
226 | mv $modipsl/modeles/XIOS/bin/xios_server.exe $modipsl/bin/xios_server_${optmode}.exe |
---|
227 | else |
---|
228 | echo "THERE IS A PROBLEM IN XIOS COMPILATION EXECUTABLE MISSING - STOP" |
---|
229 | exit |
---|
230 | fi |
---|
231 | |
---|
232 | |
---|
233 | ## 2.4 Compile orchidee |
---|
234 | cd $modipsl/modeles/ORCHIDEE |
---|
235 | echo; echo "NOW COMPILE ORCHIDEE" |
---|
236 | echo >> $outfile ; echo " NOW COMPILE ORCHIDEE" >> $outfile |
---|
237 | |
---|
238 | # Check if the compilation of ORCHIDEE was previsouly interupted prematured. |
---|
239 | # In that case, the files fcm.bld.lock exist. If the file exist, it is here removed to avoid makeorchidee_fcm |
---|
240 | # to ask question and wait for interactivly answer from the user. |
---|
241 | if [ -f build/fcm.bld.lock ] ; then |
---|
242 | echo >> $outfile |
---|
243 | echo " WARNING!! The file ORCHIDEE/build/fcm.bld.lock exist. " >> $outfile |
---|
244 | echo " This means that the compilation is either currently on going in another terminal was previous interupted before the end." >> $outfile |
---|
245 | echo " The file will now be removed. " >> $outfile |
---|
246 | echo >> $outfile |
---|
247 | rm -f build/fcm.bld.lock |
---|
248 | fi |
---|
249 | |
---|
250 | echo ./makeorchidee_fcm -j 8 -xios -parallel $parallel -$optmode -arch ${fcm_arch} -arch_path $arch_path $full_orch >> $outfile |
---|
251 | ./makeorchidee_fcm -j 8 -xios -parallel $parallel -$optmode -arch ${fcm_arch} -arch_path $arch_path $full_orch >> $outfile 2>&1 |
---|
252 | # Test if compiling finished |
---|
253 | if [[ $? != 0 ]] ; then |
---|
254 | echo "THERE IS A PROBLEM IN ORCHIDEE COMPILATION - STOP" |
---|
255 | exit |
---|
256 | fi |
---|
257 | |
---|
258 | |
---|
259 | ## 2.5 Compile NEMO |
---|
260 | nemo_root=$modipsl/modeles/NEMOGCM/CONFIG |
---|
261 | if [ ${icemodel} == lim2 ] ; then |
---|
262 | addkeys="key_lim2_vp key_diahth key_oasis3" |
---|
263 | delkeys="key_nosignedzero key_mpp_rep" |
---|
264 | else |
---|
265 | addkeys="key_top key_pisces key_age key_cfc key_cpl_carbon_cycle key_gas key_oasis3" |
---|
266 | if [ ${oceanbio} == y ] ; then |
---|
267 | if [ ${esmco2} == y ] ; then |
---|
268 | delkeys="key_nosignedzero key_mpp_rep" |
---|
269 | else |
---|
270 | delkeys="key_nosignedzero key_mpp_rep key_cpl_carbon_cycle key_gas" |
---|
271 | fi |
---|
272 | else |
---|
273 | delkeys="key_nosignedzero key_mpp_rep key_top key_pisces key_cfc key_age key_cpl_carbon_cycle key_gas" |
---|
274 | fi |
---|
275 | fi |
---|
276 | |
---|
277 | if [ ${oceanbio} == n ] ; then |
---|
278 | echo; echo "NOW COMPILE NEMO. Resolution = ${resol_oce} with icemodel ${icemodel} and without PISCES" |
---|
279 | echo >> $outfile ; echo " NOW COMPILE NEMO. Resolution = ${resol_oce} with icemodel ${icemodel} and without PISCES" >> $outfile |
---|
280 | else |
---|
281 | echo; echo "NOW COMPILE NEMO. Resolution = ${resol_oce} with icemodel ${icemodel} and PISCES" |
---|
282 | echo >> $outfile ; echo " NOW COMPILE NEMO. Resolution = ${resol_oce} with icemodel ${icemodel} and PISCES" >> $outfile |
---|
283 | fi |
---|
284 | echo >> $outfile ; echo cd $nemo_root >> $outfile |
---|
285 | echo >> $outfile ; echo cp $modipsl/config/IPSLCM6/SOURCES/NEMO/arch-${fcm_arch}.fcm ../ARCH/. >> $outfile |
---|
286 | echo >> $outfile |
---|
287 | |
---|
288 | cd $nemo_root ; cp $mysrc_path/NEMO/arch-${fcm_arch}.fcm ../ARCH/. |
---|
289 | |
---|
290 | if [ ${resol_oce} == ORCA2 ] ; then cfg_wrk=ORCA2_LIM_PISCES ; fi |
---|
291 | if [ ${resol_oce} == ORCA1 ] ; then cfg_wrk=ORCA1_LIM3_PISCES ; fi |
---|
292 | if [ ${resol_oce} == ORCA025 ] ; then cfg_wrk=ORCA025_LIM3_PISCES ; fi |
---|
293 | |
---|
294 | echo cp $modipsl/config/IPSLCM6/SOURCES/NEMO/*.*90 $nemo_root/$cfg_wrk/MY_SRC/ >> $outfile |
---|
295 | echo >> $outfile |
---|
296 | cp $mysrc_path/NEMO/*.*90 $nemo_root/$cfg_wrk/MY_SRC/ |
---|
297 | |
---|
298 | if [ $full_nemo == y ] ; then |
---|
299 | # To make a full compilation, first make a clean to remove all files produced during previous compilation |
---|
300 | echo ./makenemo -m ${fcm_arch} -n $cfg_wrk clean >> $outfile |
---|
301 | echo >> $outfile |
---|
302 | ./makenemo -m ${fcm_arch} -n $cfg_wrk clean >> $outfile 2>&1 |
---|
303 | fi |
---|
304 | echo ./makenemo -m ${fcm_arch} -n $cfg_wrk -j16 add_key "$addkeys" del_key "$delkeys" >> $outfile |
---|
305 | echo >> $outfile |
---|
306 | ./makenemo -m ${fcm_arch} -n $cfg_wrk -j16 add_key "$addkeys" del_key "$delkeys" >> $outfile 2>&1 |
---|
307 | |
---|
308 | |
---|
309 | # Test if compiling finished |
---|
310 | if [[ $? != 0 ]] ; then |
---|
311 | echo "THERE IS A PROBLEM IN NEMO COMPILATION - STOP" |
---|
312 | exit |
---|
313 | fi |
---|
314 | |
---|
315 | echo >> $outfile |
---|
316 | echo "Move nemo executable to modipsl/bin" >> $outfile |
---|
317 | echo ls -lrt $nemo_root/$cfg_wrk/BLD/bin >> $outfile |
---|
318 | ls -lrt $nemo_root/$cfg_wrk/BLD/bin >> $outfile |
---|
319 | echo >> $outfile |
---|
320 | |
---|
321 | if [ -f $nemo_root/$cfg_wrk/BLD/bin/nemo.exe ] ; then |
---|
322 | if [ ${esmco2} == y ] ; then |
---|
323 | mv $nemo_root/$cfg_wrk/BLD/bin/nemo.exe $modipsl/bin/opa.ESMCO2_${resol_oce}_${optmode} |
---|
324 | else |
---|
325 | mv $nemo_root/$cfg_wrk/BLD/bin/nemo.exe $modipsl/bin/opa_${resol_oce}_${optmode} |
---|
326 | fi |
---|
327 | fi |
---|
328 | |
---|
329 | |
---|
330 | ## 2.6 Compile LMDZ for regular latlon configuration |
---|
331 | # If necessary compile INCA modele with AER configuration |
---|
332 | if [ ${esmaer} == y ] ; then |
---|
333 | cd $modipsl/modeles/INCA |
---|
334 | #compile INCA regulat lat_lon chimie librairy |
---|
335 | echo; echo "NOW COMPILE INCA AER on resolution = ${resol_atm}" |
---|
336 | echo ./makeinca_fcm -chimie AER -$optmode -xios -parallel mpi_omp -resol ${resol_atm} -j 8 -arch ${fcm_arch} -arch_path $arch_path $full_flag $full_inca >> $outfile |
---|
337 | ./makeinca_fcm -chimie AER -$optmode -xios -parallel mpi_omp -resol ${resol_atm} -j 8 -arch ${fcm_arch} -arch_path $arch_path $full_flag $full_inca >> $outfile 2>&1 |
---|
338 | |
---|
339 | # Test if compiling finished |
---|
340 | if [[ $? != 0 ]] ; then |
---|
341 | echo "THERE IS A PROBLEM IN INCA COMPILATION - STOP" |
---|
342 | exit |
---|
343 | fi |
---|
344 | |
---|
345 | echo "Move inca.dat modipsl/bin" |
---|
346 | if [[ -f $modipsl/modeles/INCA/SIMULATIONS/AER/inca.dat ]] ; then |
---|
347 | mv $modipsl/modeles/INCA/SIMULATIONS/AER/inca.dat $modipsl/bin/inca_${resol_atm}_${optmode}_AER.dat ; |
---|
348 | else |
---|
349 | echo "THERE IS A PROBLEM IN INCA COMPILATION - STOP" |
---|
350 | exit |
---|
351 | fi |
---|
352 | |
---|
353 | fi |
---|
354 | |
---|
355 | |
---|
356 | # Compile LMDZ regular lat-lon executable |
---|
357 | cd $modipsl/modeles/LMDZ |
---|
358 | echo; echo "NOW COMPILE LMDZ REGULAR LAT-LON MODE. Resolution = ${resol_atm}" |
---|
359 | echo >> $outfile ; echo " NOW COMPILE LMDZ REGULAR LAT-LON MODE. Resolution = ${resol_atm}" >> $outfile |
---|
360 | |
---|
361 | # Check if the compilation of LMDZ was previsouly interupted prematured. |
---|
362 | # In that case, the files dimension.h and .lock exist. If the files exist, they are here removed to avoid makelmdz_fcm |
---|
363 | # to ask question and wait for interactivly answer from the user. |
---|
364 | if [ -f libf/grid/dimensions.h ] || [ -f .lock ] ; then |
---|
365 | echo >> $outfile |
---|
366 | echo " WARNING!! The file LMDZ/libf/grid/dimension.h and/or the LMDZ/.lock exist. " >> $outfile |
---|
367 | echo " This means that the compilation is either currently on going in another terminal was previous interupted before the end." >> $outfile |
---|
368 | echo " The files dimension.h and .lock will now be removed. " >> $outfile |
---|
369 | echo >> $outfile |
---|
370 | rm -f libf/grid/dimensions.h |
---|
371 | rm -f .lock |
---|
372 | fi |
---|
373 | |
---|
374 | if [ ${esmaer} == n ] ; then |
---|
375 | echo ./makelmdz_fcm -d ${resol_atm} -c OMCT -cosp true -rrtm true -$optmode -mem -parallel $parallel -io xios -v orchidee2.1 -arch $fcm_arch -arch_path $arch_path -j 8 $full_lmdz gcm >> $outfile |
---|
376 | ./makelmdz_fcm -d ${resol_atm} -c OMCT -cosp true -rrtm true -$optmode -mem -parallel $parallel -io xios -v orchidee2.1 -arch $fcm_arch -arch_path $arch_path -j 8 $full_lmdz gcm >> $outfile 2>&1 |
---|
377 | else |
---|
378 | #in esm aer case add chemistry option to lmdz compilation |
---|
379 | echo ./makelmdz_fcm -d ${resol_atm} -c OMCT -cosp true -rrtm true -$optmode -mem -parallel $parallel -chimie INCA -io xios -v orchidee2.1 -arch $fcm_arch -arch_path $arch_path -j 8 $full_lmdz gcm >> $outfile |
---|
380 | ./makelmdz_fcm -d ${resol_atm} -c OMCT -cosp true -rrtm true -$optmode -mem -parallel $parallel -chimie INCA -io xios -v orchidee2.1 -arch $fcm_arch -arch_path $arch_path -j 8 $full_lmdz gcm >> $outfile 2>&1 |
---|
381 | fi |
---|
382 | |
---|
383 | # Test if compiling finished |
---|
384 | if [[ $? != 0 ]] ; then |
---|
385 | echo "THERE IS A PROBLEM IN LMDZ REGULAR LATLON COMPILATION - STOP" |
---|
386 | exit |
---|
387 | fi |
---|
388 | |
---|
389 | # Move executables to modipsl/bin folder |
---|
390 | echo >> $outfile |
---|
391 | echo "Move gcm.e executable to modipsl/bin" >> $outfile |
---|
392 | echo ls -lrt $modipsl/modeles/LMDZ/bin >> $outfile |
---|
393 | ls -lrt $modipsl/modeles/LMDZ/bin >> $outfile |
---|
394 | echo >> $outfile |
---|
395 | if [ ${esmaer} == n ] ; then |
---|
396 | suffix=_${resol_atm}_phylmd_para_mem_orch_couple.e |
---|
397 | else |
---|
398 | suffix=_${resol_atm}_phylmd_para_mem_orch_couple_inca.e |
---|
399 | fi |
---|
400 | echo gcm suffix = $suffix |
---|
401 | |
---|
402 | if [ -f $modipsl/modeles/LMDZ/bin/gcm${suffix} ] ; then |
---|
403 | if [ ${esmaer} == n ] ; then |
---|
404 | mv $modipsl/modeles/LMDZ/bin/gcm${suffix} $modipsl/bin/gcm_${resol_atm}_${optmode}.e |
---|
405 | else |
---|
406 | mv $modipsl/modeles/LMDZ/bin/gcm${suffix} $modipsl/bin/gcm_${resol_atm}_${optmode}_AER.e |
---|
407 | fi |
---|
408 | else |
---|
409 | echo "ERROR gcm${suffix} executable does not exist." |
---|
410 | echo "THERE IS A PROBLEM IN LMDZ REGULAR LATLON COMPILATION - STOP" |
---|
411 | exit |
---|
412 | fi |
---|
413 | |
---|
414 | |
---|
415 | # Compile ce0l initialization program for LMDZ regular lat-lon exectuable |
---|
416 | if [ $ce0l == y ] ; then |
---|
417 | echo; echo "NOW COMPILE CE0L OF LMDZ. Resolution = ${resol_atm}" |
---|
418 | echo >> $outfile ; echo " NOW COMPILE CE0L OF LMDZ. Resolution = ${resol_atm}" >> $outfile |
---|
419 | |
---|
420 | echo ./makelmdz_fcm -d ${resol_atm} -rrtm true -$optmode -io xios -arch $fcm_arch -arch_path $arch_path -j 8 $full_lmdz ce0l >> $outfile |
---|
421 | ./makelmdz_fcm -d ${resol_atm} -rrtm true -$optmode -io xios -arch $fcm_arch -arch_path $arch_path -j 8 $full_lmdz ce0l >> $outfile 2>&1 |
---|
422 | # Test if compiling finished |
---|
423 | if [[ $? != 0 ]] ; then |
---|
424 | echo "THERE IS A PROBLEM IN CE0L (LMDZ) REGULAR LATLON COMPILATION - STOP" |
---|
425 | exit |
---|
426 | fi |
---|
427 | |
---|
428 | |
---|
429 | # Move executables to modipsl/bin folder |
---|
430 | echo >> $outfile |
---|
431 | echo "Move ce0l.e executable to modipsl/bin" >> $outfile |
---|
432 | echo ls -lrt $modipsl/modeles/LMDZ/bin >> $outfile |
---|
433 | ls -lrt $modipsl/modeles/LMDZ/bin >> $outfile |
---|
434 | echo >> $outfile |
---|
435 | # suffix=_${resol_atm}_phylmd_para_mem_orch_couple.e |
---|
436 | suffix=_${resol_atm}_phylmd_seq.e |
---|
437 | echo ce0l suffix = $suffix |
---|
438 | |
---|
439 | if [ -f $modipsl/modeles/LMDZ/bin/ce0l${suffix} ] ; then |
---|
440 | mv $modipsl/modeles/LMDZ/bin/ce0l${suffix} $modipsl/bin/ce0l_${resol_atm}_${optmode}.e |
---|
441 | else |
---|
442 | echo "ERROR ce0l${suffix} executable does not exist." |
---|
443 | echo "THERE IS A PROBLEM IN CE0L (LMDZ) REGULAR LATLON COMPILATION - STOP" |
---|
444 | exit |
---|
445 | fi |
---|
446 | fi |
---|
447 | |
---|
448 | echo >>$outfile ; echo "ALL COMPILING FINISHED" >> $outfile |
---|
449 | echo ls -lrt modipsl/bin >> $outfile |
---|
450 | ls -lrt $modipsl/bin >> $outfile |
---|
451 | |
---|
452 | echo; echo "ALL COMPILING FINISHED" ; echo |
---|
453 | echo "Executables are found in modipsl/bin" |
---|
454 | echo "Check that executable names correspond with the name set in config.card before launching the job" |
---|
455 | echo ls -lrt modipsl/bin |
---|
456 | ls -lrt $modipsl/bin |
---|
457 | |
---|
458 | date |
---|
459 | |
---|
460 | exit |
---|
461 | |
---|
462 | |
---|