source: CONFIG/UNIFORM/v6/IPSLCM6.3/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.4 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)
27esmchem=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         [ESMCYCLE] Compile IPSLCM6 for both interactive CO2 and chemistry, and transfer from PISCES to LMDZ and 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 coupling between ATM / OCE  and  INCA chemistry AER
105./compile_ipslcm6.sh ESMCYCLE -chimie AER
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        "ESMCYCLE")    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            if [[ $( hostname -s ) != *"pp"* ]] ; then
158                echo "Warning! You MUST compile on jean-zay-pp."
159                echo "EXIT"
160                exit
161            else
162                fcm_arch=X64_JEANZAY
163            fi ;;
164        irene170|irene171|irene190|irene191|irene192|irene193)
165            fcm_arch=X64_IRENE;;
166        irene172|irene173|irene194|irene195)
167            fcm_arch=X64_IRENE-AMD;;
168        asterix*|obelix*)
169            fcm_arch=ifort_LSCE
170            if [ "${parallel}" == "mpi_omp" ] ; then
171                echo "Warning!! Currently at Obelix hybrid mode is not possible."
172                echo "          Option -parallel mpi_omp is now changed to -parallel mpi"
173                echo ""
174                parallel=mpi
175            else
176                echo "You used -parallel" $parallel
177            fi ;;
178        ciclad*|climserv*|loholt*|camelot*)
179            fcm_arch=ifort_CICLAD;;
180        *)
181            echo Current host is not known. You must use option -arch to specify which architecuture files to use.
182            echo Exit now.
183            exit
184    esac
185fi
186
187# Set a link to arch.env if arch-${fcm_arch}.env file exist for current fcm_arch.
188# The link arch.env is also set in config.card and will be used by libIGCM to ensure the same running environnement.
189if [ -f ARCH/arch-${fcm_arch}.env ] ; then
190    echo >> $outfile
191    echo "The file ARCH/arch-${fcm_arch}.env will now be sourced with modules needed for compilation for all components."
192    echo "Note that this new environement might be kept after compilation." 
193    echo "If this is the case, source again your personal environment after compilation. "
194    echo " Personal module list before sourcing of ARCH/arch.env file:"    >> $outfile 
195    module list   >> $outfile 2>&1
196    # Get initial svn version
197    svn_version=$(module list -t | grep subversion)
198
199    # Make a link to this file, to be used also in config.card
200    rm -f ARCH/arch.env
201    ln -s arch-${fcm_arch}.env ARCH/arch.env
202
203    # Source the file
204    source ARCH/arch.env   >> $outfile 2>&1
205    if [ X$svn_version != X ] ; then
206        # Put back initial version of svn
207        module load ${svn_version}
208    fi
209    echo >> $outfile 
210    echo " New module list after sourcing of ARCH/arch.env file:"    >> $outfile 
211    module list   >> $outfile 2>&1
212fi
213
214#### 2 Do the compilation
215## 2.1 Compile ioipsl
216cd $modipsl/modeles/IOIPSL
217echo; echo "NOW COMPILE IOIPSL"
218echo >> $outfile ; echo " NOW COMPILE IOIPSL"   >> $outfile 
219
220# Check if compilation with fcm is included in IOIPSL
221if [ ! -f makeioipsl_fcm ] ; then
222  echo "The file makeiopsl_fcm do not exist. Probably this is not the right version of IOIPSL."
223  echo "Version of IOIPSL with fcm compilation is needed to compile with this script. Stop now."
224  exit
225fi
226
227echo ./makeioipsl_fcm -$optmode -parallel -arch ${fcm_arch} -arch_path $arch_path -j 8 $full_flag   >> $outfile 
228     ./makeioipsl_fcm -$optmode -parallel -arch ${fcm_arch} -arch_path $arch_path -j 8 $full_flag   >> $outfile 2>&1
229# Test if compiling succeded
230if [[ $? != 0 ]] ; then
231    echo "THERE IS A PROBLEM IN IOIPSL COMPILATION - STOP"
232    exit
233fi
234
235## 2.2 Compile oasis3-mct
236cd $modipsl/oasis3-mct/util/make_dir
237echo; echo "NOW COMPILE OASIS3-MCT"
238echo >> $outfile ; echo " NOW COMPILE OASIS3-MCT"   >> $outfile
239cp $mysrc_path/OASIS3-MCT/make_${fcm_arch} make.inc
240
241echo make -f TopMakefileOasis3 >> $outfile
242     make -f TopMakefileOasis3 >> $outfile 2>&1
243
244
245## 2.3 Compile xios
246cd $modipsl/modeles/XIOS
247echo; echo "NOW COMPILE XIOS"
248echo >> $outfile ; echo " NOW COMPILE XIOS"   >> $outfile 
249echo ./make_xios --use_oasis oasis3_mct --$optmode --arch $fcm_arch --arch_path $arch_path --job 4 $full_xios   >> $outfile 
250     ./make_xios --use_oasis oasis3_mct --$optmode --arch $fcm_arch --arch_path $arch_path --job 4 $full_xios   >> $outfile 2>&1
251# Test if compiling succeded
252if [[ $? != 0 ]] ; then
253    echo "THERE IS A PROBLEM IN XIOS COMPILATION - STOP"
254    exit
255fi
256# Move executables to modipsl/bin
257if [ -f $modipsl/modeles/XIOS/bin/xios_server.exe ] ; then
258    mv $modipsl/modeles/XIOS/bin/xios_server.exe $modipsl/bin/xios_server_${optmode}.exe
259else
260    echo "THERE IS A PROBLEM IN XIOS COMPILATION EXECUTABLE MISSING - STOP"
261    exit
262fi
263
264
265## 2.4 Compile orchidee
266cd $modipsl/modeles/ORCHIDEE
267echo; echo "NOW COMPILE ORCHIDEE"
268echo >> $outfile ; echo " NOW COMPILE ORCHIDEE"   >> $outfile 
269
270# Check if the compilation of ORCHIDEE was previsouly interupted prematured.
271# In that case, the files fcm.bld.lock exist. If the file exist, it is here removed to avoid makeorchidee_fcm
272# to ask question and wait for interactivly answer from the user.
273if [ -f build/fcm.bld.lock ] ; then
274    echo >> $outfile
275    echo " WARNING!! The file ORCHIDEE/build/fcm.bld.lock exist. "   >> $outfile
276    echo "           This means that the compilation is either currently on going in another terminal was previous interupted before the end."   >> $outfile
277    echo "           The file will now be removed. "   >> $outfile
278    echo >> $outfile
279    rm -f build/fcm.bld.lock
280fi
281
282echo    ./makeorchidee_fcm -j 8 -xios -parallel $parallel -$optmode -arch ${fcm_arch} -arch_path $arch_path $full_orch   >> $outfile 
283        ./makeorchidee_fcm -j 8 -xios -parallel $parallel -$optmode -arch ${fcm_arch} -arch_path $arch_path $full_orch   >> $outfile 2>&1
284# Test if compiling finished
285if [[ $? != 0 ]] ; then
286    echo "THERE IS A PROBLEM IN ORCHIDEE COMPILATION - STOP"
287    exit
288fi
289
290
291## 2.5 Compile NEMO
292nemo_root=$modipsl/modeles/NEMOGCM/CONFIG
293if [ ${icemodel} == lim2 ] ; then
294   addkeys="key_lim2_vp key_diahth key_oasis3"
295   delkeys="key_nosignedzero key_mpp_rep"
296else
297   addkeys="key_top key_pisces key_age key_cfc key_cpl_carbon_cycle key_gas key_oasis3"
298   if [ ${oceanbio} == y ] ; then
299      if [ ${esmco2} == y ] ; then
300        if [ ${esmchem} == y ] ; then
301           delkeys="key_nosignedzero key_mpp_rep"
302        else
303           delkeys="key_nosignedzero key_mpp_rep"
304        fi
305      else
306         delkeys="key_nosignedzero key_mpp_rep key_cpl_carbon_cycle key_gas"
307      fi
308   else
309      delkeys="key_nosignedzero key_mpp_rep key_top key_pisces key_cfc key_age key_cpl_carbon_cycle key_gas"
310   fi
311fi
312
313if [ ${oceanbio} == n ] ; then
314   echo; echo "NOW COMPILE NEMO. Resolution = ${resol_oce} with icemodel ${icemodel} and without PISCES"
315   echo >> $outfile ; echo " NOW COMPILE NEMO. Resolution = ${resol_oce} with icemodel ${icemodel} and without PISCES"   >> $outfile
316else
317   echo; echo "NOW COMPILE NEMO. Resolution = ${resol_oce} with icemodel ${icemodel} and PISCES"
318   echo >> $outfile ; echo " NOW COMPILE NEMO. Resolution = ${resol_oce} with icemodel ${icemodel} and PISCES"   >> $outfile
319fi
320echo >> $outfile ; echo cd $nemo_root  >> $outfile
321echo >> $outfile ; echo cp $modipsl/config/IPSLCM6/SOURCES/NEMO/arch-${fcm_arch}.fcm ../ARCH/.   >> $outfile
322echo >> $outfile
323
324cd $nemo_root ; cp $mysrc_path/NEMO/arch-${fcm_arch}.fcm ../ARCH/.
325
326
327if [ ${resol_oce} == ORCA2 ]   ; then  cfg_wrk=ORCA2_LIM_PISCES    ; fi
328if [ ${resol_oce} == ORCA1 ]   ; then  cfg_wrk=ORCA1_LIM3_PISCES    ; fi
329if [ ${resol_oce} == ORCA025 ] ; then  cfg_wrk=ORCA025_LIM3_PISCES  ; fi
330
331
332echo cp $modipsl/config/IPSLCM6/SOURCES/NEMO/*.*90 $nemo_root/$cfg_wrk/MY_SRC/   >> $outfile
333echo >> $outfile
334cp $mysrc_path/NEMO/*.*90  $nemo_root/$cfg_wrk/MY_SRC/
335
336if [ $full_nemo == y ] ; then
337   # To make a full compilation, first make a clean to remove all files produced during previous compilation
338   echo ./makenemo -m ${fcm_arch} -n $cfg_wrk clean   >> $outfile
339   echo >> $outfile
340   ./makenemo -m ${fcm_arch} -n $cfg_wrk clean  >> $outfile 2>&1
341fi
342echo ./makenemo -m ${fcm_arch} -n $cfg_wrk -j16 add_key "$addkeys"  del_key "$delkeys"   >> $outfile
343echo >> $outfile
344./makenemo -m ${fcm_arch} -n $cfg_wrk -j16 add_key "$addkeys"  del_key "$delkeys"  >> $outfile 2>&1
345
346
347# Test if compiling finished
348if [[ $? != 0 ]] ; then
349    echo "THERE IS A PROBLEM IN NEMO COMPILATION - STOP"
350    exit
351fi
352
353echo >> $outfile
354echo "Move nemo executable to modipsl/bin" >> $outfile
355echo ls -lrt $nemo_root/$cfg_wrk/BLD/bin   >> $outfile
356ls -lrt $nemo_root/$cfg_wrk/BLD/bin  >> $outfile
357echo >> $outfile
358
359if [ -f $nemo_root/$cfg_wrk/BLD/bin/nemo.exe ] ; then
360    if [ ${esmco2} == y ] && [ ${esmchem} == n ] ;  then
361        mv $nemo_root/$cfg_wrk/BLD/bin/nemo.exe $modipsl/bin/opa.ESMCO2_${resol_oce}_${optmode}
362    elif [ ${esmco2} == y ] && [ ${esmchem} == y ] ;  then
363    mv $nemo_root/$cfg_wrk/BLD/bin/nemo.exe $modipsl/bin/opa.ESMCYCLE_${resol_oce}_${optmode}
364    else
365        mv $nemo_root/$cfg_wrk/BLD/bin/nemo.exe $modipsl/bin/opa_${resol_oce}_${optmode}
366    fi
367fi
368
369
370## 2.6 Compile LMDZ for regular latlon configuration
371# If necessary compile INCA modele with AER configuration
372if [ ${esmchem} == y ] ;  then
373    cd $modipsl/modeles/INCA
374    #compile INCA regulat lat_lon chimie library
375    echo; echo "NOW COMPILE INCA ${optchimie} on resolution = ${resol_atm}"
376    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
377         ./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
378   
379    # Test if compiling finished
380    if [[ $? != 0 ]] ; then
381        echo "THERE IS A PROBLEM IN INCA COMPILATION - STOP"
382        exit
383    fi
384
385    echo "Move inca.dat modipsl/bin"
386    if [[ -f $modipsl/modeles/INCA/SIMULATIONS/$optchimie/inca.dat ]] ;  then 
387        mv $modipsl/modeles/INCA/SIMULATIONS/$optchimie/inca.dat $modipsl/bin/inca_${optchimie}.dat ;
388    else
389        echo "THERE IS A PROBLEM IN INCA COMPILATION - STOP"
390        exit   
391    fi
392
393    echo "Move tracer.def to  modipsl/bin"
394    if [[ -f $modipsl/modeles/INCA/tracer.def ]] ;  then
395        mv $modipsl/modeles/INCA/tracer.def $modipsl/bin/tracer_${optchimie}.def ;
396    fi
397
398
399   
400fi 
401
402
403# Compile LMDZ regular lat-lon executable
404cd $modipsl/modeles/LMDZ
405echo; echo "NOW COMPILE LMDZ REGULAR LAT-LON MODE. Resolution = ${resol_atm}"
406echo >> $outfile ; echo " NOW COMPILE LMDZ REGULAR LAT-LON MODE. Resolution = ${resol_atm}"   >> $outfile 
407
408# Temporary use of SOURCES/LMDZ to handle modifications needed by LMDZ rev 4515
409cp $mysrc_path/LMDZ/*.*90  libf/phylmd/.
410
411
412# Check if the compilation of LMDZ was previsouly interupted prematured.
413# In that case, the files dimension.h and .lock exist. If the files exist, they are here removed to avoid makelmdz_fcm
414# to ask question and wait for interactivly answer from the user.
415if [ -f libf/grid/dimensions.h ] || [ -f .lock ] ; then
416  echo >> $outfile
417  echo " WARNING!! The file LMDZ/libf/grid/dimension.h and/or the LMDZ/.lock exist. "   >> $outfile
418  echo "           This means that the compilation is either currently on going in another terminal was previous interupted before the end."   >> $outfile
419  echo "           The files dimension.h and .lock will now be removed. "   >> $outfile
420  echo >> $outfile
421  rm -f libf/grid/dimensions.h
422  rm -f .lock
423fi
424
425# Need to define the proper option for radiative code compilation. By default, we use rrtm
426case $rad in
427    oldrad) opt_rad="" ;;
428    rrtm)    opt_rad="-rad rrtm"  ;;
429    ecrad)  opt_rad="-rad ecrad" ;;
430    *) echo Only oldrad rrtm ecrad for rad option ; exit
431esac
432
433if [ ${esmchem} == n ] ;  then
434    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
435         ./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
436else
437    #in esm aer case add chemistry option to lmdz compilation
438    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
439         ./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
440fi
441
442# Test if compiling finished
443if [[ $? != 0 ]] ; then
444    echo "THERE IS A PROBLEM IN LMDZ REGULAR LATLON COMPILATION - STOP"
445    exit
446fi
447
448
449# Move executables to modipsl/bin folder
450echo >> $outfile
451echo "Move gcm.e executable to modipsl/bin" >> $outfile
452echo ls -lrt $modipsl/modeles/LMDZ/bin   >> $outfile
453ls -lrt $modipsl/modeles/LMDZ/bin  >> $outfile
454echo >> $outfile
455
456
457suffix=_${resol_atm}_phylmd
458suffix=${suffix}_${rad} 
459suffix=${suffix}_para_mem_orch_couple
460if [ ${esmchem} == n ] ;  then
461    suffix=${suffix}.e
462else
463    suffix=${suffix}_inca.e
464fi
465
466echo gcm suffix = $suffix
467
468if [ -f $modipsl/modeles/LMDZ/bin/gcm${suffix} ] ;  then
469    if [ ${esmchem} == n ] ;  then
470        mv $modipsl/modeles/LMDZ/bin/gcm${suffix} $modipsl/bin/gcm_${resol_atm}_${optmode}.e
471    else
472        mv $modipsl/modeles/LMDZ/bin/gcm${suffix} $modipsl/bin/gcm_${resol_atm}_${optmode}_${optchimie}.e
473    fi
474else
475    echo "ERROR gcm${suffix} executable does not exist." 
476    echo "THERE IS A PROBLEM IN LMDZ REGULAR LATLON COMPILATION - STOP"
477    exit
478fi 
479
480
481
482
483
484# Compile ce0l initialization program for LMDZ regular lat-lon exectuable
485if [ $ce0l == y ] ; then
486    echo; echo "NOW COMPILE CE0L OF LMDZ. Resolution = ${resol_atm}"
487    echo >> $outfile ; echo " NOW COMPILE CE0L OF LMDZ. Resolution = ${resol_atm}"   >> $outfile 
488   
489    echo ./makelmdz_fcm -d ${resol_atm} $opt_rad -$optmode -arch $fcm_arch -arch_path $arch_path -j 8 $full_lmdz ce0l    >> $outfile 
490    ./makelmdz_fcm -d ${resol_atm} $opt_rad -$optmode -arch $fcm_arch -arch_path $arch_path -j 8 $full_lmdz ce0l    >> $outfile 2>&1
491
492# 1er aout - remove xios from ce0l compilation #
493#    echo ./makelmdz_fcm -d ${resol_atm} $opt_rad -$optmode -io xios -arch $fcm_arch -arch_path $arch_path -j 8 $full_lmdz ce0l    >> $outfile
494#    ./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
495
496    # Test if compiling finished
497    if [[ $? != 0 ]] ; then
498        echo "THERE IS A PROBLEM IN CE0L (LMDZ) REGULAR LATLON COMPILATION - STOP"
499        exit
500    fi
501
502
503    # Move executables to modipsl/bin folder
504    echo >> $outfile
505    echo "Move ce0l.e executable to modipsl/bin" >> $outfile
506    echo ls -lrt $modipsl/modeles/LMDZ/bin   >> $outfile
507    ls -lrt $modipsl/modeles/LMDZ/bin  >> $outfile
508    echo >> $outfile
509
510    suffix=_${resol_atm}_phylmd_seq.e
511    if [ $lmdzsvn -ge 4186 ] ; then suffix=_${resol_atm}_phylmd_${rad}_seq.e ; fi
512    echo ce0l suffix = $suffix
513
514    if [ -f $modipsl/modeles/LMDZ/bin/ce0l${suffix} ] ;  then
515        mv $modipsl/modeles/LMDZ/bin/ce0l${suffix} $modipsl/bin/ce0l_${resol_atm}_${optmode}.e
516    else
517        echo "ERROR ce0l${suffix} executable does not exist." 
518        echo "THERE IS A PROBLEM IN CE0L (LMDZ) REGULAR LATLON COMPILATION - STOP"
519        exit
520    fi 
521fi
522
523echo >>$outfile ; echo "ALL COMPILING FINISHED" >> $outfile
524echo ls -lrt modipsl/bin >> $outfile
525ls -lrt $modipsl/bin >> $outfile
526
527echo; echo "ALL COMPILING FINISHED" ; echo
528echo "Executables are found in modipsl/bin"
529echo "Check that executable names correspond with the name set in config.card before launching the job"
530echo ls -lrt modipsl/bin
531ls -lrt $modipsl/bin
532
533date
534
535exit
536
537
Note: See TracBrowser for help on using the repository browser.