[5479] | 1 | #!/bin/bash |
---|
| 2 | # Default options |
---|
| 3 | # |
---|
| 4 | # |
---|
| 5 | # |
---|
| 6 | date |
---|
| 7 | #### 1 Set up the compiling options |
---|
| 8 | #### Define some directories |
---|
| 9 | submitdir=$( pwd ) |
---|
| 10 | modipsl=$submitdir/../.. |
---|
| 11 | arch_path=$submitdir/ARCH |
---|
| 12 | mysrc_path=$submitdir/SOURCES |
---|
| 13 | export ROOT=$modipsl/modeles/DYNAMICO |
---|
| 14 | #### Set default options |
---|
| 15 | # Resolution if compiling LMDZ in regular mode without DYNAMICO |
---|
| 16 | # Use for example following "./compile_icolmdzor.sh -regular_latlon 144x142x79" |
---|
| 17 | regular_latlon=no |
---|
| 18 | # Atmospheric resolution, for LMDZ/ORCHIDEE in regular mode |
---|
| 19 | resol_atm=144x142x79 |
---|
| 20 | # Oceanic resolution, for NEMO (ORCA2/ORCA1/ORCA025) |
---|
| 21 | resol_oce=ORCA1 |
---|
| 22 | # Version of ice model lim2/lim3 |
---|
| 23 | icemodel=lim3 |
---|
| 24 | # Coupled with ocean biogeochemistry (y/n) |
---|
| 25 | oceanbio=y |
---|
| 26 | # Version ESM CO2: CO2 interactif ocean/atmosphere (y/n) |
---|
| 27 | esmco2=n |
---|
| 28 | # Optimization mode |
---|
| 29 | # optmode=prod/dev/debug |
---|
| 30 | optmode=prod |
---|
| 31 | # Resolution if compiling LMDZ in regular mode without DYNAMICO |
---|
| 32 | # Use for example following "./compile_icolmdzor.sh -regular_latlon 144x142x79" |
---|
| 33 | regular_latlon=no |
---|
| 34 | # fcm_arch |
---|
| 35 | fcm_arch=default |
---|
| 36 | # Default values to be overritten |
---|
| 37 | parallel=mpi_omp |
---|
| 38 | export fcm_arch parallel xios |
---|
| 39 | full_flag="" |
---|
| 40 | full_nemo=n |
---|
| 41 | full_inca="" |
---|
| 42 | full_xios="" |
---|
| 43 | full_lmdz="" |
---|
| 44 | full_orch="" |
---|
| 45 | full_dyna="" |
---|
[6296] | 46 | # choose radiative code compilation option |
---|
| 47 | rad=rrtm |
---|
| 48 | opt_rad="" |
---|
[5479] | 49 | # Default netcdf_lib is used for XIOS but can be change by argument |
---|
| 50 | netcdf_lib="" |
---|
| 51 | |
---|
| 52 | # Output text file for compilation of each component |
---|
| 53 | datestr=`LC_ALL=C date +"%Y%m%dT%H%M"` |
---|
| 54 | outfile=$submitdir/out_compile_ipslcm7.$datestr |
---|
| 55 | echo > $outfile |
---|
| 56 | echo; echo "Text output from compilation will be stored in file out_compile_ipslcm7.$datestr"; echo |
---|
| 57 | |
---|
| 58 | #### Read arguments |
---|
| 59 | # Loop over all arguments to modify default set up |
---|
| 60 | while (($# > 0)) ; do |
---|
| 61 | case $1 in |
---|
| 62 | "-h") cat <<end_help |
---|
| 63 | ######################################################################## |
---|
| 64 | # Usage of the script compile_ipslcm7.sh |
---|
| 65 | # |
---|
| 66 | ######################################################################## |
---|
| 67 | |
---|
| 68 | ./compile_ipslcm7.sh [Options] |
---|
| 69 | |
---|
| 70 | |
---|
| 71 | Options: [-full] Full recompilation of all components. This option can be added to all other options. |
---|
| 72 | [-cleannemo] Full recompilation of NEMO component only. |
---|
| 73 | [-regular_latlon] |
---|
| 74 | [-debug / -dev / -prod] Level of optimization. One of these can be added to all other compile options. Default: -prod. |
---|
| 75 | |
---|
| 76 | |
---|
| 77 | Example 1: Default compilation of IPSLCM7 for resolution LR |
---|
| 78 | (Resolution atmos: nbp40, ocean: ORCA1) |
---|
| 79 | ./compile_ipslcm7.sh |
---|
| 80 | |
---|
| 81 | Example 2: Default resoltuion (LR) compiled in debug mode |
---|
| 82 | ./compile_ipslcm7.sh -debug |
---|
| 83 | |
---|
| 84 | Example 3: Default compilation with full recompilation of all components. No clean is needed. |
---|
| 85 | ./compile_ipslcm7.sh -full |
---|
| 86 | |
---|
| 87 | Example 4: Compilation of LMDZ in regular lat-lon for dimension 144x142x79. |
---|
| 88 | The dimension can be changed to any other 3d dimension. DYNAMICO is also compiled as default. |
---|
| 89 | ./compile_ipslcm7.sh -regular_latlon 144x142x79 |
---|
| 90 | |
---|
| 91 | end_help |
---|
| 92 | exit;; |
---|
| 93 | |
---|
| 94 | "-parallel") parallel=$2 ; shift ; shift ;; |
---|
| 95 | "-arch") fcm_arch="$2" ; shift ; shift ;; |
---|
| 96 | "-debug") optmode=debug ; shift ;; |
---|
| 97 | "-dev") optmode=dev ; shift ;; |
---|
| 98 | "-prod") optmode=prod ; shift ;; |
---|
| 99 | "-regular_latlon") regular_latlon=yes ; resol_atm=$2 ; shift ; shift ;; |
---|
| 100 | "-full") full_flag="-full"; full_nemo=y ; full_xios="--full" ; full_lmdz="-full" ; full_orch="-full" ; shift ;; |
---|
| 101 | "-full_xios") full_xios="--full" ; shift ;; # Note only full_xios is using double dash: --full |
---|
| 102 | "-full_lmdz") full_lmdz="-full" ; shift ;; |
---|
| 103 | "-full_orch") full_orch="-full" ; shift ;; |
---|
| 104 | "-full_nemo") full_nemo=y ; shift ;; |
---|
| 105 | "-full_inca") full_inca="-clean"; shift ;; |
---|
| 106 | "-cleannemo") full_nemo=y ; shift ;; |
---|
[6296] | 107 | "-rad") rad=$2; shift ; shift ;; |
---|
[5479] | 108 | *) echo "unknown option "$1" , exiting..." ; exit |
---|
| 109 | esac |
---|
| 110 | done |
---|
| 111 | |
---|
| 112 | echo "Following options are set in current compiling:" >> $outfile |
---|
| 113 | echo " regular_latlon=$regular_latlon (if yes, then resol_atm=${resol_atm})" >> $outfile |
---|
| 114 | echo " resol_atm=${resol_atm}, resol_oce=${resol_oce}, icemodel=${icemodel}, oceanbio=${oceanbio}" >> $outfile |
---|
| 115 | echo " optmode = $optmode, parallel = $parallel, fcm_arch = $fcm_arch " >> $outfile |
---|
| 116 | echo " full_flag=$full_flag, full_xios=$full_xios, full_lmdz=$full_lmdz, full_orch=$full_orch, full_nemo=$full_nemo, full_dyna=$full_dyna" >> $outfile |
---|
| 117 | echo >> $outfile |
---|
| 118 | |
---|
| 119 | ### Read host dependent default values |
---|
| 120 | ### These variables will not be changed if they were set as argument |
---|
| 121 | ###./host.sh $host |
---|
| 122 | # Later : Following lines should be set in host.sh file |
---|
| 123 | # begin host.sh |
---|
| 124 | if [ $fcm_arch == default ] ; then |
---|
| 125 | # Find out current host and source specific paths and commands for the host |
---|
| 126 | case $( hostname -s ) in |
---|
| 127 | jean-zay*) |
---|
| 128 | fcm_arch=X64_JEANZAY;; |
---|
| 129 | irene170|irene171|irene190|irene191|irene192|irene193) |
---|
| 130 | fcm_arch=X64_IRENE;; |
---|
| 131 | irene172|irene173|irene194|irene195) |
---|
| 132 | fcm_arch=X64_IRENE-AMD;; |
---|
| 133 | asterix*|obelix*) |
---|
| 134 | fcm_arch=ifort_LSCE |
---|
| 135 | if [ "${parallel}" == "mpi_omp" ] ; then |
---|
| 136 | echo "Warning!! Currently at Obelix hybrid mode is not possible." |
---|
| 137 | echo " Option -parallel mpi_omp is now changed to -parallel mpi" |
---|
| 138 | echo "" |
---|
| 139 | parallel=mpi |
---|
| 140 | else |
---|
| 141 | echo "You used -parallel" $parallel |
---|
| 142 | fi ;; |
---|
[6296] | 143 | spirit*) |
---|
| 144 | fcm_arch=ifort_MESOIPSL;; |
---|
[5479] | 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." |
---|
[6296] | 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 | svn_version=$(module list -t | grep subversion) |
---|
| 164 | |
---|
[5479] | 165 | # Make a link to this file, to be used also in config.card |
---|
| 166 | rm -f ARCH/arch.env |
---|
| 167 | ln -s arch-${fcm_arch}.env ARCH/arch.env |
---|
| 168 | |
---|
| 169 | # Source the file |
---|
[6296] | 170 | source ARCH/arch.env >> $outfile 2>&1 |
---|
| 171 | if [ X$svn_version != X ] ; then |
---|
| 172 | module load ${svn_version} |
---|
| 173 | fi |
---|
| 174 | echo >> $outfile |
---|
| 175 | echo " New module list after sourcing of ARCH/arch.env file:" >> $outfile |
---|
| 176 | module list >> $outfile 2>&1 |
---|
[5479] | 177 | fi |
---|
| 178 | |
---|
| 179 | #### 2 Do the compilation |
---|
| 180 | ## 2.1 Compile ioipsl |
---|
| 181 | cd $modipsl/modeles/IOIPSL |
---|
| 182 | echo; echo "NOW COMPILE IOIPSL" |
---|
| 183 | echo >> $outfile ; echo " NOW COMPILE IOIPSL" >> $outfile |
---|
| 184 | |
---|
| 185 | echo ./makeioipsl_fcm -$optmode -parallel -arch ${fcm_arch} -arch_path $arch_path -j 8 $full_flag >> $outfile |
---|
| 186 | ./makeioipsl_fcm -$optmode -parallel -arch ${fcm_arch} -arch_path $arch_path -j 8 $full_flag >> $outfile 2>&1 |
---|
| 187 | # Test if compiling succeded |
---|
| 188 | if [[ $? != 0 ]] ; then |
---|
| 189 | echo "THERE IS A PROBLEM IN IOIPSL COMPILATION - STOP" |
---|
| 190 | exit |
---|
| 191 | fi |
---|
| 192 | |
---|
| 193 | ## 2.2 Compile oasis3-mct |
---|
| 194 | cd $modipsl/oasis3-mct/util/make_dir |
---|
| 195 | echo; echo "NOW COMPILE OASIS3-MCT" |
---|
| 196 | echo >> $outfile ; echo " NOW COMPILE OASIS3-MCT" >> $outfile |
---|
| 197 | cp $mysrc_path/OASIS3-MCT/make_${fcm_arch} make.inc |
---|
| 198 | |
---|
| 199 | echo make -f TopMakefileOasis3 >> $outfile |
---|
| 200 | make -f TopMakefileOasis3 >> $outfile 2>&1 |
---|
| 201 | |
---|
| 202 | |
---|
| 203 | ## 2.3 Compile xios |
---|
| 204 | cd $modipsl/modeles/XIOS |
---|
| 205 | echo; echo "NOW COMPILE XIOS" |
---|
| 206 | echo >> $outfile ; echo " NOW COMPILE XIOS" >> $outfile |
---|
| 207 | echo ./make_xios --use_oasis oasis3_mct --$optmode --arch $fcm_arch --arch_path $arch_path ${netcdf_lib} --job 4 $full_xios >> $outfile |
---|
| 208 | ./make_xios --use_oasis oasis3_mct --$optmode --arch $fcm_arch --arch_path $arch_path ${netcdf_lib} --job 4 $full_xios >> $outfile 2>&1 |
---|
| 209 | # Test if compiling succeded |
---|
| 210 | if [[ $? != 0 ]] ; then |
---|
| 211 | echo "THERE IS A PROBLEM IN XIOS COMPILATION - STOP" |
---|
| 212 | exit |
---|
| 213 | fi |
---|
| 214 | # Move executables to modipsl/bin |
---|
| 215 | if [ -f $modipsl/modeles/XIOS/bin/xios_server.exe ] ; then |
---|
| 216 | mv $modipsl/modeles/XIOS/bin/xios_server.exe $modipsl/bin/xios_server_${optmode}.exe |
---|
| 217 | else |
---|
| 218 | echo "THERE IS A PROBLEM IN XIOS COMPILATION EXECUTABLE MISSING - STOP" |
---|
| 219 | exit |
---|
| 220 | fi |
---|
| 221 | |
---|
| 222 | |
---|
| 223 | ## 2.4 Compile orchidee |
---|
| 224 | cd $modipsl/modeles/ORCHIDEE |
---|
| 225 | echo; echo "NOW COMPILE ORCHIDEE" |
---|
| 226 | echo >> $outfile ; echo " NOW COMPILE ORCHIDEE" >> $outfile |
---|
| 227 | |
---|
| 228 | # Check if the compilation of ORCHIDEE was previsouly interupted prematured. |
---|
| 229 | # In that case, the files fcm.bld.lock exist. If the file exist, it is here removed to avoid makeorchidee_fcm |
---|
| 230 | # to ask question and wait for interactivly answer from the user. |
---|
| 231 | if [ -f build/fcm.bld.lock ] ; then |
---|
| 232 | echo >> $outfile |
---|
| 233 | echo " WARNING!! The file ORCHIDEE/build/fcm.bld.lock exist. " >> $outfile |
---|
| 234 | echo " This means that the compilation is either currently on going in another terminal was previous interupted before the end." >> $outfile |
---|
| 235 | echo " The file will now be removed. " >> $outfile |
---|
| 236 | echo >> $outfile |
---|
| 237 | rm -f build/fcm.bld.lock |
---|
| 238 | fi |
---|
| 239 | |
---|
| 240 | echo ./makeorchidee_fcm -j 8 -xios -parallel $parallel -$optmode -arch ${fcm_arch} -arch_path $arch_path $full_orch >> $outfile |
---|
| 241 | ./makeorchidee_fcm -j 8 -xios -parallel $parallel -$optmode -arch ${fcm_arch} -arch_path $arch_path $full_orch >> $outfile 2>&1 |
---|
| 242 | # Test if compiling finished |
---|
| 243 | if [[ $? != 0 ]] ; then |
---|
| 244 | echo "THERE IS A PROBLEM IN ORCHIDEE COMPILATION - STOP" |
---|
| 245 | exit |
---|
| 246 | fi |
---|
| 247 | |
---|
| 248 | |
---|
| 249 | ## 2.5 Compile NEMO |
---|
| 250 | nemo_root=$modipsl/modeles/NEMOGCM/CONFIG |
---|
| 251 | if [ ${icemodel} == lim2 ] ; then |
---|
| 252 | addkeys="key_lim2_vp key_diahth key_oasis3" |
---|
| 253 | delkeys="key_nosignedzero key_mpp_rep" |
---|
| 254 | else |
---|
| 255 | addkeys="key_top key_pisces key_age key_cfc key_cpl_carbon_cycle key_gas key_oasis3" |
---|
| 256 | if [ ${oceanbio} == y ] ; then |
---|
| 257 | if [ ${esmco2} == y ] ; then |
---|
| 258 | delkeys="key_nosignedzero key_mpp_rep" |
---|
| 259 | else |
---|
| 260 | delkeys="key_nosignedzero key_mpp_rep key_cpl_carbon_cycle key_gas" |
---|
| 261 | fi |
---|
| 262 | else |
---|
| 263 | delkeys="key_nosignedzero key_mpp_rep key_top key_pisces key_cfc key_age key_cpl_carbon_cycle key_gas" |
---|
| 264 | fi |
---|
| 265 | fi |
---|
| 266 | |
---|
| 267 | if [ ${oceanbio} == n ] ; then |
---|
| 268 | echo; echo "NOW COMPILE NEMO. Resolution = ${resol_oce} with icemodel ${icemodel} and without PISCES" |
---|
| 269 | echo >> $outfile ; echo " NOW COMPILE NEMO. Resolution = ${resol_oce} with icemodel ${icemodel} and without PISCES" >> $outfile |
---|
| 270 | else |
---|
| 271 | echo; echo "NOW COMPILE NEMO. Resolution = ${resol_oce} with icemodel ${icemodel} and PISCES" |
---|
| 272 | echo >> $outfile ; echo " NOW COMPILE NEMO. Resolution = ${resol_oce} with icemodel ${icemodel} and PISCES" >> $outfile |
---|
| 273 | fi |
---|
| 274 | echo >> $outfile ; echo cd $nemo_root >> $outfile |
---|
| 275 | echo >> $outfile ; echo cp $modipsl/config/IPSLCM7/SOURCES/NEMO/arch-${fcm_arch}.fcm ../ARCH/. >> $outfile |
---|
| 276 | echo >> $outfile |
---|
| 277 | |
---|
| 278 | cd $nemo_root ; cp $mysrc_path/NEMO/arch-${fcm_arch}.fcm ../ARCH/. |
---|
| 279 | |
---|
| 280 | if [ ${resol_oce} == ORCA2 ] ; then cfg_wrk=ORCA2_LIM_PISCES ; fi |
---|
| 281 | if [ ${resol_oce} == ORCA1 ] ; then cfg_wrk=ORCA1_LIM3_PISCES ; fi |
---|
| 282 | if [ ${resol_oce} == ORCA025 ] ; then cfg_wrk=ORCA025_LIM3_PISCES ; fi |
---|
| 283 | |
---|
| 284 | echo cp $modipsl/config/IPSLCM7/SOURCES/NEMO/*.*90 $nemo_root/$cfg_wrk/MY_SRC/ >> $outfile |
---|
| 285 | echo >> $outfile |
---|
| 286 | cp $mysrc_path/NEMO/*.*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 | |
---|
| 299 | # Test if compiling finished |
---|
| 300 | if [[ $? != 0 ]] ; then |
---|
| 301 | echo "THERE IS A PROBLEM IN NEMO COMPILATION - STOP" |
---|
| 302 | exit |
---|
| 303 | fi |
---|
| 304 | |
---|
| 305 | echo >> $outfile |
---|
| 306 | echo "Move nemo executable to modipsl/bin" >> $outfile |
---|
| 307 | echo ls -lrt $nemo_root/$cfg_wrk/BLD/bin >> $outfile |
---|
| 308 | ls -lrt $nemo_root/$cfg_wrk/BLD/bin >> $outfile |
---|
| 309 | echo >> $outfile |
---|
| 310 | |
---|
| 311 | if [ -f $nemo_root/$cfg_wrk/BLD/bin/nemo.exe ] ; then |
---|
| 312 | if [ ${esmco2} == y ] ; then |
---|
| 313 | mv $nemo_root/$cfg_wrk/BLD/bin/nemo.exe $modipsl/bin/opa.ESMCO2_${resol_oce}_${optmode} |
---|
| 314 | else |
---|
| 315 | mv $nemo_root/$cfg_wrk/BLD/bin/nemo.exe $modipsl/bin/opa_${resol_oce}_${optmode} |
---|
| 316 | fi |
---|
| 317 | fi |
---|
| 318 | |
---|
| 319 | # Compile LMDZ |
---|
| 320 | cd $modipsl/modeles/LMDZ |
---|
| 321 | # Compile LMDZ as library to couple to DYNAMICO |
---|
| 322 | echo; echo "NOW COMPILE LMDZ FOR COUPLING TO DYNAMICO" |
---|
| 323 | echo >> $outfile ; echo " NOW COMPILE LMDZ FOR COUPLING TO DYNAMICO" >> $outfile |
---|
[6296] | 324 | # Retrieve the final svn release number, needed for radiative code suffix of executable |
---|
| 325 | lmdzsvn=`svnversion . | egrep -o "[0-9]+" | awk 'NR==1'` |
---|
[5479] | 326 | # Temporary use of SOURCES/LMDZ to handle modifications needed by IPSLCM7 |
---|
| 327 | cp $mysrc_path/LMDZ/*.*90 libf/phylmd/. |
---|
| 328 | |
---|
| 329 | # Check if the compilation of LMDZ was previsouly interupted prematured. |
---|
| 330 | # In that case, the files dimension.h and .lock exist. If the files exist, they are here removed to avoid makelmdz_fcm |
---|
| 331 | # to ask question and wait for interactivly answer from the user. |
---|
| 332 | if [ -f libf/grid/dimensions.h ] || [ -f .lock ] ; then |
---|
| 333 | echo >> $outfile |
---|
| 334 | echo " WARNING!! The file LMDZ/libf/grid/dimension.h and/or the LMDZ/.lock exist. " >> $outfile |
---|
| 335 | echo " This means that the compilation is either currently on going in another terminal was previous interupted before the end." >> $outfile |
---|
| 336 | echo " The files dimension.h and .lock will now be removed. " >> $outfile |
---|
| 337 | echo >> $outfile |
---|
| 338 | rm -f libf/grid/dimensions.h |
---|
| 339 | rm -f .lock |
---|
| 340 | fi |
---|
| 341 | |
---|
[6296] | 342 | # Need to define the proper option for radiative code compilation. By default, we use rrtm |
---|
| 343 | case $rad in |
---|
| 344 | oldrad) opt_rad="" ;; |
---|
| 345 | rrtm) if [ $lmdzsvn -le 4185 ] ; then opt_rad="-rrtm true" ; else opt_rad="-rad rrtm" ; fi ;; |
---|
| 346 | ecrad) opt_rad="-rad ecrad" ;; |
---|
| 347 | *) echo Only oldrad rrtm ecrad for rad option ; exit |
---|
| 348 | esac |
---|
| 349 | |
---|
| 350 | if [ $lmdzsvn -le 4185 -a $rad = "ecrad" ] ; then echo "ecrad only available for LMDZ rev starting with 4186 " ; exit ; fi |
---|
| 351 | |
---|
| 352 | echo ./makelmdz_fcm -p lmd -c OMCT $opt_rad -$optmode -mem -parallel $parallel -libphy -v orchidee2.1 -io xios -arch $fcm_arch -j 8 $full_lmdz >> $outfile |
---|
| 353 | ./makelmdz_fcm -p lmd -c OMCT $opt_rad -$optmode -mem -parallel $parallel -libphy -v orchidee2.1 -io xios -arch $fcm_arch -j 8 $full_lmdz >> $outfile 2>&1 |
---|
[5479] | 354 | # Test if compiling finished |
---|
| 355 | if [[ $? != 0 ]] ; then |
---|
| 356 | echo "THERE IS A PROBLEM IN LMDZ PHYSICS COMPILATION - STOP" |
---|
| 357 | exit |
---|
| 358 | fi |
---|
| 359 | |
---|
| 360 | |
---|
| 361 | ## 2.5 Compile DYNAMICO |
---|
| 362 | cd $modipsl/modeles/DYNAMICO |
---|
| 363 | echo; echo "NOW COMPILE DYNAMICO " |
---|
| 364 | echo >> $outfile ; echo " NOW COMPILE DYNAMICO" >> $outfile |
---|
| 365 | |
---|
[6296] | 366 | echo ./make_icosa -$optmode -with_fcm1 -parallel $parallel -external_ioipsl -with_oasis -with_xios -arch $fcm_arch -arch_path $arch_path -job 8 $full_dyna >> $outfile |
---|
| 367 | ./make_icosa -$optmode -with_fcm1 -parallel $parallel -external_ioipsl -with_oasis -with_xios -arch $fcm_arch -arch_path $arch_path -job 8 $full_dyna >> $outfile 2>&1 |
---|
[5479] | 368 | # Test if compiling finished |
---|
| 369 | if [[ $? != 0 ]] ; then |
---|
| 370 | echo "THERE IS A PROBLEM IN DYNAMICO COMPILATION - STOP" |
---|
| 371 | exit |
---|
| 372 | fi |
---|
| 373 | |
---|
| 374 | ## 2.6 Compile interface ICOSA_LMDZ |
---|
| 375 | cd $modipsl/modeles/ICOSA_LMDZ |
---|
| 376 | echo; echo "NOW COMPILE ICOSA_LMDZ " |
---|
| 377 | echo >> $outfile ; echo " NOW COMPILE ICOSA_LMDZ" >> $outfile |
---|
| 378 | |
---|
| 379 | echo ./make_icosa_lmdz -nodeps -p lmd -$optmode -parallel $parallel -with_oasis -with_orchidee -arch ${fcm_arch} -arch_path ${arch_path} -job 8 $full_dyna >> $outfile |
---|
| 380 | ./make_icosa_lmdz -nodeps -p lmd -$optmode -parallel $parallel -with_oasis -with_orchidee -arch ${fcm_arch} -arch_path ${arch_path} -job 8 $full_dyna >> $outfile 2>&1 |
---|
| 381 | # Test if compiling finished |
---|
| 382 | if [[ $? != 0 ]] ; then |
---|
| 383 | echo "THERE IS A PROBLEM IN ICOSA_LMDZ COMPILATION - STOP" |
---|
| 384 | exit |
---|
| 385 | fi |
---|
| 386 | # Move executables to modipsl/bin |
---|
| 387 | if [ -f $modipsl/modeles/ICOSA_LMDZ/bin/icosa_lmdz.exe ] ; then |
---|
| 388 | mv $modipsl/modeles/ICOSA_LMDZ/bin/icosa_lmdz.exe $modipsl/bin/icosa_lmdz_${optmode}.exe |
---|
| 389 | else |
---|
| 390 | echo "THERE IS A PROBLEM IN ICOSA_LMDZ COMPILATION EXECUTABLE MISSING - STOP" |
---|
| 391 | exit |
---|
| 392 | fi |
---|
| 393 | |
---|
| 394 | |
---|
| 395 | |
---|
| 396 | ## 2.7 Compile LMDZ for regular latlon configuration |
---|
| 397 | if [ $regular_latlon = yes ] ; then |
---|
| 398 | |
---|
| 399 | cd $modipsl/modeles/LMDZ |
---|
| 400 | # Compile LMDZ regular lat-lon exectuable |
---|
| 401 | echo; echo "NOW COMPILE LMDZ REGULAR LAT-LON MODE. Resolution = ${resol_atm}" |
---|
| 402 | echo >> $outfile ; echo " NOW COMPILE LMDZ REGULAR LAT-LON MODE. Resolution = ${resol_atm}" >> $outfile |
---|
| 403 | # Check if the compilation of LMDZ was previsouly interupted prematured. |
---|
| 404 | # In that case, the files dimension.h and .lock exist. If the files exist, they are here removed to avoid makelmdz_fcm |
---|
| 405 | # to ask question and wait for interactivly answer from the user. |
---|
| 406 | if [ -f libf/grid/dimensions.h ] || [ -f .lock ] ; then |
---|
| 407 | echo >> $outfile |
---|
| 408 | echo " WARNING!! The file LMDZ/libf/grid/dimension.h and/or the LMDZ/.lock exist. " >> $outfile |
---|
| 409 | echo " This means that the compilation is either currently on going in another terminal was previous interupted before the end." >> $outfile |
---|
| 410 | echo " The files dimension.h and .lock will now be removed. " >> $outfile |
---|
| 411 | echo >> $outfile |
---|
| 412 | rm -f libf/grid/dimensions.h |
---|
| 413 | rm -f .lock |
---|
| 414 | fi |
---|
[6296] | 415 | echo ./makelmdz_fcm -d ${resol_atm} -c OMCT -p lmd $opt_rad -$optmode -mem -parallel $parallel -io xios -v orchidee2.1 -arch $fcm_arch -j 8 $full_lmdz gcm >> $outfile |
---|
| 416 | ./makelmdz_fcm -d ${resol_atm} -c OMCT -p lmd $opt_rad -$optmode -mem -parallel $parallel -io xios -v orchidee2.1 -arch $fcm_arch -j 8 $full_lmdz gcm >> $outfile 2>&1 |
---|
[5479] | 417 | # Test if compiling finished |
---|
| 418 | if [[ $? != 0 ]] ; then |
---|
| 419 | echo "THERE IS A PROBLEM IN LMDZ REGULAR LATLON COMPILATION - STOP" |
---|
| 420 | exit |
---|
| 421 | fi |
---|
| 422 | |
---|
| 423 | # Compile ce0l initialization program for LMDZ regular lat-lon exectuable |
---|
| 424 | echo; echo "NOW COMPILE CE0L OF LMDZ. Resolution = ${resol_atm}" |
---|
| 425 | echo >> $outfile ; echo " NOW COMPILE CE0L OF LMDZ. Resolution = ${resol_atm}" >> $outfile |
---|
| 426 | |
---|
| 427 | echo ./makelmdz_fcm -d ${resol_atm} -p lmd -rrtm true -$optmode -mem -parallel $parallel -io xios -v orchidee2.1 -arch $fcm_arch -j 8 $full_lmdz ce0l >> $outfile |
---|
| 428 | ./makelmdz_fcm -d ${resol_atm} -p lmd -rrtm true -$optmode -mem -parallel $parallel -io xios -v orchidee2.1 -arch $fcm_arch -j 8 $full_lmdz ce0l >> $outfile 2>&1 |
---|
| 429 | # Test if compiling finished |
---|
| 430 | if [[ $? != 0 ]] ; then |
---|
| 431 | echo "THERE IS A PROBLEM IN CE0L (LMDZ) REGULAR LATLON COMPILATION - STOP" |
---|
| 432 | exit |
---|
| 433 | fi |
---|
| 434 | |
---|
[6296] | 435 | # Find executable suffix |
---|
| 436 | suffix=_${resol_atm}_phylmd |
---|
| 437 | if [ $lmdzsvn -ge 4186 ] ; then suffix=${suffix}_${rad} ; fi |
---|
| 438 | if [ $parallel == seq ] || [ $parallel == none ] ; then |
---|
| 439 | suffix=${suffix}_seq_orch.e |
---|
| 440 | else |
---|
| 441 | suffix=${suffix}_para_mem_orch.e |
---|
| 442 | fi |
---|
| 443 | echo gcm suffix = $suffix |
---|
| 444 | |
---|
[5479] | 445 | |
---|
| 446 | # Move executables to modipsl/bin folder |
---|
| 447 | echo "Move gcm.e and ce0l executable to modipsl/bin" |
---|
| 448 | if [ -f $modipsl/modeles/LMDZ/bin/gcm${suffix} ] ; then |
---|
| 449 | mv $modipsl/modeles/LMDZ/bin/gcm${suffix} $modipsl/bin/gcm_${resol_atm}_${optmode}.e |
---|
| 450 | else |
---|
| 451 | echo "ERROR gcm${suffix} executable does not exist." |
---|
| 452 | echo "THERE IS A PROBLEM IN LMDZ REGULAR LATLON COMPILATION - STOP" |
---|
| 453 | exit |
---|
| 454 | fi |
---|
| 455 | |
---|
| 456 | if [ -f $modipsl/modeles/LMDZ/bin/ce0l${suffix} ] ; then |
---|
| 457 | mv $modipsl/modeles/LMDZ/bin/ce0l${suffix} $modipsl/bin/ce0l_${resol_atm}_${optmode}.e |
---|
| 458 | else |
---|
| 459 | echo "ERROR ce0l${suffix} executable does not exist." |
---|
| 460 | echo "THERE IS A PROBLEM IN LMDZ REGULAR LATLON COMPILATION - STOP" |
---|
| 461 | exit |
---|
| 462 | fi |
---|
| 463 | fi |
---|
| 464 | |
---|
| 465 | echo >>$outfile ; echo "ALL COMPILING FINISHED" >> $outfile |
---|
| 466 | echo ls -lrt modipsl/bin >> $outfile |
---|
| 467 | ls -lrt $modipsl/bin >> $outfile |
---|
| 468 | |
---|
| 469 | echo; echo "ALL COMPILING FINISHED" ; echo |
---|
| 470 | echo "Executables are found in modipsl/bin" |
---|
| 471 | echo "Check that executable names correspond with the name set in config.card before launching the job" |
---|
| 472 | echo ls -lrt modipsl/bin |
---|
| 473 | ls -lrt $modipsl/bin |
---|
| 474 | |
---|
| 475 | date |
---|
| 476 | |
---|
| 477 | exit |
---|
| 478 | |
---|
| 479 | |
---|