source: CONFIG/UNIFORM/v6/IPSLCM6.3/compile_ipslcm6.sh @ 6574

Last change on this file since 6574 was 6574, checked in by acosce, 10 months ago

update with last version of ORCA1_LIM3_PISCES + fix typo error in SOURCES/LMDZ

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