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