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

Last change on this file since 6477 was 6472, checked in by jgipsl, 14 months ago

Corrected error in reading arguments if using -orch22 or -orch4.

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