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