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

Last change on this file since 6569 was 6550, checked in by acosce, 12 months ago

Modification of compilation script, to compile with Inca we need to choose ESMCHEM + -chimie (default is AER)

Add experiments with Inca in IPSLCM6.3

  • EXPERIMENTS/IPSLESM/AER to run a couple with aerosol interactif
  • EXPERIMENTS/LMDZORINCA/GES to run a simulation without ocean and with GES INCA chemistry
  • Property svn:executable set to *
File size: 21.0 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 key_transm_ocninca"
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 key_transm_ocninca"
298        fi
299      else
300         delkeys="key_nosignedzero key_mpp_rep key_cpl_carbon_cycle key_gas key_transm_ocninca"
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 key_transm_ocninca"
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
320if [ ${resol_oce} == ORCA2 ]   ; then  cfg_wrk=ORCA2_LIM_PISCES    ; fi
321if [ ${resol_oce} == ORCA1 ]   ; then  cfg_wrk=ORCA1_LIM3_PISCES    ; fi
322if [ ${resol_oce} == ORCA025 ] ; then  cfg_wrk=ORCA025_LIM3_PISCES  ; fi
323
324echo cp $modipsl/config/IPSLCM6/SOURCES/NEMO/*.*90 $nemo_root/$cfg_wrk/MY_SRC/   >> $outfile
325echo >> $outfile
326cp $mysrc_path/NEMO/*.*90  $nemo_root/$cfg_wrk/MY_SRC/
327
328if [ $full_nemo == y ] ; then
329   # To make a full compilation, first make a clean to remove all files produced during previous compilation
330   echo ./makenemo -m ${fcm_arch} -n $cfg_wrk clean   >> $outfile
331   echo >> $outfile
332   ./makenemo -m ${fcm_arch} -n $cfg_wrk clean  >> $outfile 2>&1
333fi
334echo ./makenemo -m ${fcm_arch} -n $cfg_wrk -j16 add_key "$addkeys"  del_key "$delkeys"   >> $outfile
335echo >> $outfile
336./makenemo -m ${fcm_arch} -n $cfg_wrk -j16 add_key "$addkeys"  del_key "$delkeys"  >> $outfile 2>&1
337
338
339# Test if compiling finished
340if [[ $? != 0 ]] ; then
341    echo "THERE IS A PROBLEM IN NEMO COMPILATION - STOP"
342    exit
343fi
344
345echo >> $outfile
346echo "Move nemo executable to modipsl/bin" >> $outfile
347echo ls -lrt $nemo_root/$cfg_wrk/BLD/bin   >> $outfile
348ls -lrt $nemo_root/$cfg_wrk/BLD/bin  >> $outfile
349echo >> $outfile
350
351if [ -f $nemo_root/$cfg_wrk/BLD/bin/nemo.exe ] ; then
352    if [ ${esmco2} == y ] && [ ${esmchem} == n ] ;  then
353        mv $nemo_root/$cfg_wrk/BLD/bin/nemo.exe $modipsl/bin/opa.ESMCO2_${resol_oce}_${optmode}
354    elif [ ${esmco2} == y ] && [ ${esmchem} == y ] ;  then
355    mv $nemo_root/$cfg_wrk/BLD/bin/nemo.exe $modipsl/bin/opa.ESMCO2AER_${resol_oce}_${optmode}
356    else
357        mv $nemo_root/$cfg_wrk/BLD/bin/nemo.exe $modipsl/bin/opa_${resol_oce}_${optmode}
358    fi
359fi
360
361
362## 2.6 Compile LMDZ for regular latlon configuration
363# If necessary compile INCA modele with AER configuration
364if [ ${esmchem} == y ] ;  then
365    cd $modipsl/modeles/INCA
366    #compile INCA regulat lat_lon chimie library
367    echo; echo "NOW COMPILE INCA AER on resolution = ${resol_atm}"
368    if [ ${esmco2} == y ] ; then
369      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
370           ./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
371    else
372      echo ./makeinca_fcm -chimie ${optchimie} -$optmode -xios -parallel mpi_omp -j 8 -arch ${fcm_arch} -arch_path $arch_path $full_flag $full_inca >> $outfile 
373           ./makeinca_fcm -chimie ${optchimie} -$optmode -xios -parallel mpi_omp -j 8 -arch ${fcm_arch} -arch_path $arch_path  $full_flag $full_inca >> $outfile 2>&1
374    fi
375    # Test if compiling finished
376    if [[ $? != 0 ]] ; then
377        echo "THERE IS A PROBLEM IN INCA COMPILATION - STOP"
378        exit
379    fi
380
381    echo "Move inca.dat modipsl/bin"
382    if [[ -f $modipsl/modeles/INCA/SIMULATIONS/$optchimie/inca.dat ]] ;  then 
383        mv $modipsl/modeles/INCA/SIMULATIONS/$optchimie/inca.dat $modipsl/bin/inca_${optchimie}.dat ;
384    else
385        echo "THERE IS A PROBLEM IN INCA COMPILATION - STOP"
386        exit   
387    fi
388
389    echo "Move tracer.def to  modipsl/bin"
390    if [[ -f $modipsl/modeles/INCA/tracer.def ]] ;  then
391        mv $modipsl/modeles/INCA/tracer.def $modipsl/bin/tracer_${optchimie}.def ;
392    fi
393
394
395   
396fi 
397
398
399# Compile LMDZ regular lat-lon executable
400cd $modipsl/modeles/LMDZ
401echo; echo "NOW COMPILE LMDZ REGULAR LAT-LON MODE. Resolution = ${resol_atm}"
402echo >> $outfile ; echo " NOW COMPILE LMDZ REGULAR LAT-LON MODE. Resolution = ${resol_atm}"   >> $outfile 
403
404# Check if the compilation of LMDZ was previsouly interupted prematured.
405# In that case, the files dimension.h and .lock exist. If the files exist, they are here removed to avoid makelmdz_fcm
406# to ask question and wait for interactivly answer from the user.
407if [ -f libf/grid/dimensions.h ] || [ -f .lock ] ; then
408  echo >> $outfile
409  echo " WARNING!! The file LMDZ/libf/grid/dimension.h and/or the LMDZ/.lock exist. "   >> $outfile
410  echo "           This means that the compilation is either currently on going in another terminal was previous interupted before the end."   >> $outfile
411  echo "           The files dimension.h and .lock will now be removed. "   >> $outfile
412  echo >> $outfile
413  rm -f libf/grid/dimensions.h
414  rm -f .lock
415fi
416
417# Need to define the proper option for radiative code compilation. By default, we use rrtm
418case $rad in
419    oldrad) opt_rad="" ;;
420    rrtm)    opt_rad="-rad rrtm"  ;;
421    ecrad)  opt_rad="-rad ecrad" ;;
422    *) echo Only oldrad rrtm ecrad for rad option ; exit
423esac
424
425
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    if [ ${esmco2} == y ] ; then
433      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
434           ./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
435    else
436      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
437           ./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
438    fi
439fi
440
441# Test if compiling finished
442if [[ $? != 0 ]] ; then
443    echo "THERE IS A PROBLEM IN LMDZ REGULAR LATLON COMPILATION - STOP"
444    exit
445fi
446
447
448
449
450# Move executables to modipsl/bin folder
451echo >> $outfile
452echo "Move gcm.e executable to modipsl/bin" >> $outfile
453echo ls -lrt $modipsl/modeles/LMDZ/bin   >> $outfile
454ls -lrt $modipsl/modeles/LMDZ/bin  >> $outfile
455echo >> $outfile
456
457
458suffix=_${resol_atm}_phylmd
459suffix=${suffix}_${rad} 
460suffix=${suffix}_para_mem_orch_couple
461if [ ${esmchem} == n ] ;  then
462    suffix=${suffix}.e
463else
464    suffix=${suffix}_inca.e
465fi
466
467echo gcm suffix = $suffix
468
469if [ -f $modipsl/modeles/LMDZ/bin/gcm${suffix} ] ;  then
470    if [ ${esmchem} == n ] ;  then
471        mv $modipsl/modeles/LMDZ/bin/gcm${suffix} $modipsl/bin/gcm_${resol_atm}_${optmode}.e
472    else
473        mv $modipsl/modeles/LMDZ/bin/gcm${suffix} $modipsl/bin/gcm_${resol_atm}_${optmode}_${optchimie}.e
474    fi
475else
476    echo "ERROR gcm${suffix} executable does not exist." 
477    echo "THERE IS A PROBLEM IN LMDZ REGULAR LATLON COMPILATION - STOP"
478    exit
479fi 
480
481
482
483
484
485# Compile ce0l initialization program for LMDZ regular lat-lon exectuable
486if [ $ce0l == y ] ; then
487    echo; echo "NOW COMPILE CE0L OF LMDZ. Resolution = ${resol_atm}"
488    echo >> $outfile ; echo " NOW COMPILE CE0L OF LMDZ. Resolution = ${resol_atm}"   >> $outfile 
489   
490    echo ./makelmdz_fcm -d ${resol_atm} $opt_rad -$optmode -arch $fcm_arch -arch_path $arch_path -j 8 $full_lmdz ce0l    >> $outfile 
491    ./makelmdz_fcm -d ${resol_atm} $opt_rad -$optmode -arch $fcm_arch -arch_path $arch_path -j 8 $full_lmdz ce0l    >> $outfile 2>&1
492
493# 1er aout - remove xios from ce0l compilation #
494#    echo ./makelmdz_fcm -d ${resol_atm} $opt_rad -$optmode -io xios -arch $fcm_arch -arch_path $arch_path -j 8 $full_lmdz ce0l    >> $outfile
495#    ./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
496
497    # Test if compiling finished
498    if [[ $? != 0 ]] ; then
499        echo "THERE IS A PROBLEM IN CE0L (LMDZ) REGULAR LATLON COMPILATION - STOP"
500        exit
501    fi
502
503
504    # Move executables to modipsl/bin folder
505    echo >> $outfile
506    echo "Move ce0l.e executable to modipsl/bin" >> $outfile
507    echo ls -lrt $modipsl/modeles/LMDZ/bin   >> $outfile
508    ls -lrt $modipsl/modeles/LMDZ/bin  >> $outfile
509    echo >> $outfile
510
511    suffix=_${resol_atm}_phylmd_seq.e
512    if [ $lmdzsvn -ge 4186 ] ; then suffix=_${resol_atm}_phylmd_${rad}_seq.e ; fi
513    echo ce0l suffix = $suffix
514
515    if [ -f $modipsl/modeles/LMDZ/bin/ce0l${suffix} ] ;  then
516        mv $modipsl/modeles/LMDZ/bin/ce0l${suffix} $modipsl/bin/ce0l_${resol_atm}_${optmode}.e
517    else
518        echo "ERROR ce0l${suffix} executable does not exist." 
519        echo "THERE IS A PROBLEM IN CE0L (LMDZ) REGULAR LATLON COMPILATION - STOP"
520        exit
521    fi 
522fi
523
524echo >>$outfile ; echo "ALL COMPILING FINISHED" >> $outfile
525echo ls -lrt modipsl/bin >> $outfile
526ls -lrt $modipsl/bin >> $outfile
527
528echo; echo "ALL COMPILING FINISHED" ; echo
529echo "Executables are found in modipsl/bin"
530echo "Check that executable names correspond with the name set in config.card before launching the job"
531echo ls -lrt modipsl/bin
532ls -lrt $modipsl/bin
533
534date
535
536exit
537
538
Note: See TracBrowser for help on using the repository browser.