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