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