source: CONFIG/UNIFORM/v7/IPSLCM7/compile_ipslcm7.sh @ 6538

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

Add creation of a link on the last out_compile_ipslcm7.$date file

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