source: CONFIG/UNIFORM/v6/IPSLCM6.2/compile_ipslcm6.sh @ 6629

Last change on this file since 6629 was 6629, checked in by falletti, 10 months ago

Adding a compilation check on Jean-Zay, to be sure that we compile on jean-za-pp (_work configurations)

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