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