[5586] | 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 | export ROOT=$modipsl/modeles/DYNAMICO |
---|
| 14 | |
---|
| 15 | #### Set default options |
---|
| 16 | # Optimization mode |
---|
| 17 | # optmode=prod/dev/debug |
---|
| 18 | optmode=prod |
---|
| 19 | # Resolution if compiling LMDZ in regular mode without DYNAMICO |
---|
| 20 | # Use for example following "./compile_icolmdzorinca.sh -regular_latlon 144x142x79" |
---|
[6083] | 21 | resol_atm="144x142x79" |
---|
[5586] | 22 | # fcm_arch |
---|
| 23 | fcm_arch=default |
---|
| 24 | # Default values to be overritten |
---|
| 25 | parallel=mpi_omp |
---|
| 26 | export fcm_arch parallel xios |
---|
| 27 | full_flag="" |
---|
| 28 | full_xios="" |
---|
| 29 | full_lmdz="" |
---|
| 30 | full_orch="" |
---|
| 31 | full_dyna="" |
---|
[6083] | 32 | #choose if we want to compile only grid ico, grid reg. If no for both of them, we will compile the two grids |
---|
[5958] | 33 | ico_only=no |
---|
| 34 | reg_only=no |
---|
[6083] | 35 | #choose if we want to compile only create_etat0_limit |
---|
| 36 | ce0l_only=no |
---|
| 37 | #choose chemistry inca configuration |
---|
[5586] | 38 | optchimie=GES |
---|
| 39 | |
---|
| 40 | # Default netcdf_lib is used for XIOS but can be change by argument |
---|
| 41 | netcdf_lib="" |
---|
| 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_icolmdzorinca.$datestr |
---|
| 46 | echo > $outfile |
---|
[5907] | 47 | echo; echo "Text output from compilation will be stored in file out_compile_icolmdzorinca.$datestr"; echo |
---|
[5586] | 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 | ######################################################################## |
---|
| 56 | # Usage of the script compile_icolmdzorinca.sh |
---|
| 57 | # |
---|
| 58 | ######################################################################## |
---|
| 59 | |
---|
| 60 | ./compile_config [Options] |
---|
| 61 | |
---|
| 62 | Options: -full, -regular_latlon, -debug, -dev, -prod(default) |
---|
| 63 | |
---|
[6083] | 64 | Example 1: Default compilation of [DYNAMICO-LMDZ-ORCHIDEE-INCA GES with XIOS and IOIPSL] and [LMDZ(144x142x79)-ORCHIDEE-INCA GES with XIOS and IOIPSL] and [create_etat0_limit] |
---|
[5586] | 65 | ./compile_icolmdzorinca.sh |
---|
| 66 | |
---|
| 67 | Example 2: Compile in debug mode |
---|
| 68 | ./compile_icolmdzorinca.sh -debug |
---|
| 69 | |
---|
| 70 | Example 3: Default compilation with full recompilation of all components |
---|
| 71 | ./compile_icolmdzorinca.sh -full |
---|
| 72 | |
---|
[6083] | 73 | Example 4: Define dimension for regular grid (default one is 144x142x79) |
---|
| 74 | The dimension can be changed to any other 3d dimension - in this example DYNAMICO is also compiled as default. |
---|
| 75 | ./compile_icolmdzorinca.sh -regular_latlon 256x256x79 |
---|
[5586] | 76 | |
---|
[6083] | 77 | Example 5: Compilation with a chosen chemistry, for example DUSS (default: GES) |
---|
[5586] | 78 | ./compile_icolmdzorinca.sh -chimie DUSS |
---|
| 79 | |
---|
[5958] | 80 | Example 6: Compile only ico grid |
---|
| 81 | ./compile_icolmdzorinca.sh -ico_only |
---|
[5586] | 82 | |
---|
[5958] | 83 | Example 7: Compile only reg grid |
---|
| 84 | ./compile_icolmdzorinca.sh -reg_only |
---|
| 85 | |
---|
[6083] | 86 | Example 8: compile only create_etat0_limit |
---|
| 87 | ./compile_icolmdzorinca.sh -ce0l_only |
---|
[5958] | 88 | |
---|
[5586] | 89 | end_help |
---|
| 90 | exit;; |
---|
| 91 | |
---|
| 92 | "-parallel") parallel=$2 ; shift ; shift ;; |
---|
| 93 | "-arch") fcm_arch="$2" ; shift ; shift ;; |
---|
| 94 | "-xios") xios="$2" ; shift ; shift ;; |
---|
| 95 | "-debug") optmode=debug ; shift ;; |
---|
| 96 | "-dev") optmode=dev ; shift ;; |
---|
| 97 | "-prod") optmode=prod ; shift ;; |
---|
| 98 | "-regular_latlon") regular_latlon=yes ; resol_atm=$2 ; shift ; shift ;; |
---|
| 99 | "-full") full_flag="-full"; full_xios="--full" ; full_lmdz="-full" ; full_orch="-full" ; full_dyna="-full" ; shift ;; |
---|
| 100 | "-full_xios") full_xios="--full" ; shift ;; # Note only full_xios is using double dash: --full |
---|
| 101 | "-full_lmdz") full_lmdz="-full" ; shift ;; |
---|
| 102 | "-full_orch") full_orch="-full" ; shift ;; |
---|
| 103 | "-full_dyna") full_dyna="-full" ; shift ;; |
---|
[5958] | 104 | "-ico_only") ico_only=yes ; shift ;; |
---|
| 105 | "-reg_only") reg_only=yes ; shift ;; |
---|
[6083] | 106 | "-ce0l_only") ce0l=yes ; shift ;; |
---|
[5586] | 107 | "-netcdf_lib_seq") netcdf_lib="--netcdf_lib netcdf4_seq"; shift ;; |
---|
| 108 | "-chimie") optchimie=$2; shift ; shift;; |
---|
| 109 | |
---|
| 110 | *) echo "unknown option "$1" , exiting..." ; exit |
---|
| 111 | esac |
---|
| 112 | done |
---|
| 113 | |
---|
| 114 | echo "Following options are set in current compiling:" >> $outfile |
---|
[6083] | 115 | echo " chemistry=${optchimie}">> $outfile |
---|
| 116 | echo " ico_only=${ico_only}, reg_only=${reg_only}, ce0l_only=${ce0l_only}" >> $outfile |
---|
| 117 | echo " regular_latlon=${resol_atm} (use to create executable on regular grid)" >> $outfile |
---|
[5586] | 118 | echo " optmode = $optmode, parallel = $parallel, fcm_arch = $fcm_arch " >> $outfile |
---|
| 119 | echo " full_flag=$full_flag, full_xios=$full_xios, full_lmdz=$full_lmdz, full_orch=$full_orch, full_dyna=$full_dyna" >> $outfile |
---|
| 120 | echo >> $outfile |
---|
| 121 | |
---|
[6083] | 122 | |
---|
[5586] | 123 | ### Read host dependent default values |
---|
| 124 | ### These variables will not be changed if they were set as argument |
---|
| 125 | ###./host.sh $host |
---|
| 126 | # Later : Following lines should be set in host.sh file |
---|
| 127 | # begin host.sh |
---|
| 128 | if [ $fcm_arch == default ] ; then |
---|
| 129 | # Find out current host and source specific paths and commands for the host |
---|
| 130 | case $( hostname -s ) in |
---|
| 131 | jean-zay*) |
---|
| 132 | fcm_arch=X64_JEANZAY;; |
---|
| 133 | irene170|irene171|irene190|irene191|irene192|irene193) |
---|
| 134 | fcm_arch=X64_IRENE;; |
---|
| 135 | irene172|irene173|irene194|irene195) |
---|
| 136 | fcm_arch=X64_IRENE-AMD;; |
---|
| 137 | asterix*|obelix*) |
---|
| 138 | fcm_arch=ifort_LSCE |
---|
| 139 | if [ "${parallel}" == "mpi_omp" ] ; then |
---|
| 140 | echo "Warning!! Currently at Obelix hybrid mode is not possible." |
---|
| 141 | echo " Option -parallel mpi_omp is now changed to -parallel mpi" |
---|
| 142 | echo "" |
---|
| 143 | parallel=mpi |
---|
| 144 | else |
---|
| 145 | echo "You used -parallel" $parallel |
---|
| 146 | fi ;; |
---|
| 147 | ciclad*|climserv*|loholt*|camelot*) |
---|
| 148 | fcm_arch=ifort_CICLAD;; |
---|
| 149 | *) |
---|
| 150 | echo Current host is not known. You must use option -arch to specify which architecuture files to use. |
---|
| 151 | echo Exit now. |
---|
| 152 | exit |
---|
| 153 | esac |
---|
| 154 | fi |
---|
| 155 | |
---|
| 156 | # Set a link to arch.env if arch-${fcm_arch}.env file exist for current fcm_arch. |
---|
| 157 | # The link arch.env is also set in config.card and will be used by libIGCM to ensure the same running environnement. |
---|
| 158 | if [ -f ARCH/arch-${fcm_arch}.env ] ; then |
---|
| 159 | echo >> $outfile |
---|
| 160 | echo "The file ARCH/arch-${fcm_arch}.env will now be sourced with modules needed for compilation for all components." |
---|
| 161 | echo "Note that this new environement might be kept after compilation." |
---|
| 162 | echo "If this is the case, source again your personal environment after compilation." |
---|
| 163 | echo " Personal module list before sourcing of ARCH/arch.env file:" >> $outfile |
---|
| 164 | module list >> $outfile 2>&1 |
---|
| 165 | |
---|
| 166 | # Make a link to this file, to be used also in config.card |
---|
| 167 | rm -f ARCH/arch.env |
---|
| 168 | ln -s arch-${fcm_arch}.env ARCH/arch.env |
---|
| 169 | |
---|
| 170 | # Source the file |
---|
| 171 | source ARCH/arch.env >> $outfile 2>&1 |
---|
| 172 | |
---|
| 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 | echo ./makeioipsl_fcm -$optmode -parallel -arch ${fcm_arch} -arch_path $arch_path -j 8 $full_flag >> $outfile |
---|
| 185 | ./makeioipsl_fcm -$optmode -parallel -arch ${fcm_arch} -arch_path $arch_path -j 8 $full_flag >> $outfile 2>&1 |
---|
| 186 | # Test if compiling succeded |
---|
| 187 | if [[ $? != 0 ]] ; then |
---|
| 188 | echo "THERE IS A PROBLEM IN IOIPSL COMPILATION - STOP" |
---|
| 189 | echo "ALL INFORMATION IN FILE $outfile" |
---|
| 190 | exit |
---|
| 191 | fi |
---|
| 192 | |
---|
| 193 | ## 2.2 Compile xios |
---|
| 194 | cd $modipsl/modeles/XIOS |
---|
| 195 | echo; echo "NOW COMPILE XIOS" |
---|
| 196 | echo >> $outfile ; echo " NOW COMPILE XIOS" >> $outfile |
---|
| 197 | echo ./make_xios --$optmode --arch $fcm_arch --arch_path $arch_path ${netcdf_lib} --job 4 $full_xios >> $outfile |
---|
| 198 | ./make_xios --$optmode --arch $fcm_arch --arch_path $arch_path ${netcdf_lib} --job 4 $full_xios >> $outfile 2>&1 |
---|
| 199 | # Test if compiling succeded |
---|
| 200 | if [[ $? != 0 ]] ; then |
---|
| 201 | echo "THERE IS A PROBLEM IN XIOS COMPILATION - STOP" |
---|
| 202 | echo "ALL INFORMATION IN FILE $outfile" |
---|
| 203 | exit |
---|
| 204 | fi |
---|
| 205 | # Move executables to modipsl/bin |
---|
| 206 | if [ -f $modipsl/modeles/XIOS/bin/xios_server.exe ] ; then |
---|
| 207 | mv $modipsl/modeles/XIOS/bin/xios_server.exe $modipsl/bin/xios_server_${optmode}.exe |
---|
| 208 | else |
---|
| 209 | echo "THERE IS A PROBLEM IN XIOS COMPILATION EXECUTABLE MISSING - STOP" |
---|
| 210 | echo "ALL INFORMATION IN FILE $outfile" |
---|
| 211 | exit |
---|
| 212 | fi |
---|
| 213 | |
---|
| 214 | |
---|
| 215 | ## 2.3 Compile orchidee |
---|
| 216 | cd $modipsl/modeles/ORCHIDEE |
---|
| 217 | echo; echo "NOW COMPILE ORCHIDEE" |
---|
| 218 | echo >> $outfile ; echo " NOW COMPILE ORCHIDEE" >> $outfile |
---|
| 219 | |
---|
| 220 | # Check if the compilation of ORCHIDEE was previsouly interupted prematured. |
---|
| 221 | # In that case, the files fcm.bld.lock exist. If the file exist, it is here removed to avoid makeorchidee_fcm |
---|
| 222 | # to ask question and wait for interactivly answer from the user. |
---|
| 223 | if [ -f build/fcm.bld.lock ] ; then |
---|
| 224 | echo >> $outfile |
---|
| 225 | echo " WARNING!! The file ORCHIDEE/build/fcm.bld.lock exist. " >> $outfile |
---|
| 226 | echo " This means that the compilation is either currently on going in another terminal was previous interupted before the end." >> $outfile |
---|
| 227 | echo " The file will now be removed. " >> $outfile |
---|
| 228 | echo >> $outfile |
---|
| 229 | rm -f build/fcm.bld.lock |
---|
| 230 | fi |
---|
| 231 | |
---|
| 232 | echo ./makeorchidee_fcm -j 8 -xios -parallel $parallel -$optmode -arch ${fcm_arch} -arch_path $arch_path $full_orch >> $outfile |
---|
| 233 | ./makeorchidee_fcm -j 8 -xios -parallel $parallel -$optmode -arch ${fcm_arch} -arch_path $arch_path $full_orch >> $outfile 2>&1 |
---|
| 234 | # Test if compiling finished |
---|
| 235 | if [[ $? != 0 ]] ; then |
---|
| 236 | echo "THERE IS A PROBLEM IN ORCHIDEE COMPILATION - STOP" |
---|
| 237 | echo "ALL INFORMATION IN FILE $outfile" |
---|
| 238 | exit |
---|
| 239 | fi |
---|
| 240 | |
---|
| 241 | # If orchide driver executables have been compiled (option -driver), then rename executables to contain $optmode |
---|
| 242 | if [ -f $modipsl/bin/orchidee_ol ] ; then mv $modipsl/bin/orchidee_ol $modipsl/bin/orchidee_ol_${optmode} ; fi |
---|
| 243 | if [ -f $modipsl/bin/orchideedriver ] ; then mv $modipsl/bin/orchideedriver $modipsl/bin/orchideedriver_${optmode} ; fi |
---|
| 244 | |
---|
| 245 | |
---|
| 246 | ## ajout compile inca Anne |
---|
| 247 | cd $modipsl/modeles/INCA |
---|
[5705] | 248 | |
---|
| 249 | echo; echo "NOW COMPILE INCA ${optchimie}" |
---|
[5591] | 250 | echo ./makeinca_fcm -chimie ${optchimie} -$optmode -xios -parallel mpi_omp -j 8 -arch ${fcm_arch} -arch_path $arch_path $full_flag >> $outfile |
---|
| 251 | ./makeinca_fcm -chimie ${optchimie} -$optmode -xios -parallel mpi_omp -j 8 -arch ${fcm_arch} -arch_path $arch_path $full_flag >> $outfile 2>&1 |
---|
[5586] | 252 | |
---|
| 253 | # Test if compiling finished |
---|
| 254 | if [[ $? != 0 ]] ; then |
---|
| 255 | echo "THERE IS A PROBLEM IN INCA COMPILATION - STOP" |
---|
| 256 | echo "ALL INFORMATION IN FILE $outfile" |
---|
| 257 | exit |
---|
| 258 | fi |
---|
| 259 | |
---|
| 260 | |
---|
| 261 | |
---|
| 262 | echo "Move inca.dat modipsl/bin" |
---|
| 263 | if [[ -f $modipsl/modeles/INCA/SIMULATIONS/${optchimie}/inca.dat ]] ; then |
---|
| 264 | mv $modipsl/modeles/INCA/SIMULATIONS/${optchimie}/inca.dat $modipsl/bin/inca_${optmode}_${optchimie}.dat ; |
---|
| 265 | else |
---|
| 266 | echo "THERE IS A PROBLEM IN INCA COMPILATION - STOP" |
---|
| 267 | echo "ALL INFORMATION IN FILE $outfile" |
---|
| 268 | exit |
---|
| 269 | fi |
---|
| 270 | |
---|
[5705] | 271 | echo "Move tracer.def to modipsl/bin" |
---|
| 272 | if [[ -f $modipsl/modeles/INCA/tracer.def ]] ; then |
---|
| 273 | mv $modipsl/modeles/INCA/tracer.def $modipsl/bin/tracer_${optmode}_${optchimie}.def ; |
---|
| 274 | fi |
---|
[5586] | 275 | |
---|
| 276 | |
---|
| 277 | ## 2.4 Compile lmdz |
---|
| 278 | |
---|
[6083] | 279 | if [ $reg_only = no ] && [ $ce0l_only = no ]; then |
---|
[5586] | 280 | |
---|
[6083] | 281 | cd $modipsl/modeles/LMDZ |
---|
| 282 | |
---|
[5958] | 283 | # Compile LMDZ as library to couple to DYNAMICO |
---|
| 284 | echo; echo "NOW COMPILE LMDZ FOR COUPLING TO DYNAMICO" |
---|
| 285 | echo >> $outfile ; echo " NOW COMPILE LMDZ FOR COUPLING TO DYNAMICO" >> $outfile |
---|
[5586] | 286 | |
---|
[5958] | 287 | # Check if the compilation of LMDZ was previsouly interupted prematured. |
---|
| 288 | # In that case, the files dimension.h and .lock exist. If the files exist, they are here removed to avoid makelmdz_fcm |
---|
| 289 | # to ask question and wait for interactivly answer from the user. |
---|
| 290 | if [ -f libf/grid/dimensions.h ] || [ -f .lock ] ; then |
---|
| 291 | echo >> $outfile |
---|
| 292 | echo " WARNING!! The file LMDZ/libf/grid/dimension.h and/or the LMDZ/.lock exist. " >> $outfile |
---|
| 293 | echo " This means that the compilation is either currently on going in another terminal was previous interupted before the end." >> $outfile |
---|
| 294 | echo " The files dimension.h and .lock will now be removed. " >> $outfile |
---|
| 295 | echo >> $outfile |
---|
| 296 | rm -f libf/grid/dimensions.h |
---|
| 297 | rm -f .lock |
---|
| 298 | fi |
---|
[5586] | 299 | |
---|
[5958] | 300 | echo ./makelmdz_fcm -p lmd -rrtm true -cosp true -$optmode -mem -parallel $parallel -libphy -v orchidee2.1 -chimie INCA -io xios -arch $fcm_arch -j 8 $full_lmdz >> $outfile |
---|
| 301 | ./makelmdz_fcm -p lmd -rrtm true -cosp true -$optmode -mem -parallel $parallel -libphy -v orchidee2.1 -chimie INCA -io xios -arch $fcm_arch -j 8 $full_lmdz >> $outfile 2>&1 |
---|
| 302 | # Test if compiling finished |
---|
| 303 | if [[ $? != 0 ]] ; then |
---|
| 304 | echo "THERE IS A PROBLEM IN LMDZ PHYSICS COMPILATION - STOP" |
---|
| 305 | echo "ALL INFORMATION IN FILE $outfile" |
---|
| 306 | exit |
---|
| 307 | fi |
---|
| 308 | |
---|
| 309 | |
---|
[5586] | 310 | ## 2.5 Compile DYNAMICO |
---|
[5958] | 311 | cd $modipsl/modeles/DYNAMICO |
---|
| 312 | echo; echo "NOW COMPILE DYNAMICO " |
---|
| 313 | echo >> $outfile ; echo " NOW COMPILE DYNAMICO" >> $outfile |
---|
[5586] | 314 | |
---|
[5958] | 315 | echo ./make_icosa -$optmode -parallel $parallel -external_ioipsl -with_xios -arch $fcm_arch -arch_path $arch_path -job 8 $full_dyna >> $outfile |
---|
| 316 | ./make_icosa -$optmode -parallel $parallel -external_ioipsl -with_xios -arch $fcm_arch -arch_path $arch_path -job 8 $full_dyna >> $outfile 2>&1 |
---|
| 317 | # Test if compiling finished |
---|
| 318 | if [[ $? != 0 ]] ; then |
---|
| 319 | echo "THERE IS A PROBLEM IN DYNAMICO COMPILATION - STOP" |
---|
| 320 | echo "ALL INFORMATION IN FILE $outfile" |
---|
| 321 | exit |
---|
| 322 | fi |
---|
[5586] | 323 | |
---|
[5958] | 324 | ## 2.6 Compile interface ICOSA_LMDZ |
---|
| 325 | cd $modipsl/modeles/ICOSA_LMDZ |
---|
| 326 | echo; echo "NOW COMPILE ICOSA_LMDZ " |
---|
| 327 | echo >> $outfile ; echo " NOW COMPILE ICOSA_LMDZ" >> $outfile |
---|
[5586] | 328 | |
---|
[5958] | 329 | echo ./make_icosa_lmdz -nodeps -p lmd -$optmode -parallel $parallel -with_orchidee -with_inca -arch ${fcm_arch} -arch_path ${arch_path} -job 8 $full_dyna >> $outfile |
---|
| 330 | ./make_icosa_lmdz -nodeps -p lmd -$optmode -parallel $parallel -with_orchidee -with_inca -arch ${fcm_arch} -arch_path ${arch_path} -job 8 $full_dyna >> $outfile 2>&1 |
---|
| 331 | # Test if compiling finished |
---|
| 332 | if [[ $? != 0 ]] ; then |
---|
| 333 | echo "THERE IS A PROBLEM IN ICOSA_LMDZ COMPILATION - STOP" |
---|
| 334 | echo "ALL INFORMATION IN FILE $outfile" |
---|
| 335 | exit |
---|
| 336 | fi |
---|
| 337 | # Move executables to modipsl/bin |
---|
| 338 | if [ $modipsl/modeles/ICOSA_LMDZ/bin/icosa_lmdz.exe ] ; then |
---|
| 339 | mv $modipsl/modeles/ICOSA_LMDZ/bin/icosa_lmdz.exe $modipsl/bin/icosa_lmdz_${optmode}_${optchimie}.exe |
---|
| 340 | else |
---|
| 341 | echo "THERE IS A PROBLEM IN ICOSA_LMDZ COMPILATION EXECUTABLE MISSING - STOP" |
---|
| 342 | echo "ALL INFORMATION IN FILE $outfile" |
---|
| 343 | exit |
---|
| 344 | fi |
---|
| 345 | fi |
---|
[5586] | 346 | |
---|
| 347 | |
---|
| 348 | ## 2.7 Compile LMDZ for regular latlon configuration |
---|
| 349 | |
---|
[6083] | 350 | # Find executable suffix |
---|
| 351 | if [ $parallel == seq ] || [ $parallel == none ] ; then |
---|
| 352 | suffix=_${resol_atm}_phylmd_seq_orch_inca.e |
---|
| 353 | else |
---|
| 354 | suffix=_${resol_atm}_phylmd_para_mem_orch_inca.e |
---|
| 355 | fi |
---|
| 356 | echo gcm suffix = $suffix |
---|
| 357 | |
---|
| 358 | if [ $ico_only = no ] && [ $ce0l_only = no ]; then |
---|
| 359 | |
---|
[5958] | 360 | cd $modipsl/modeles/LMDZ |
---|
| 361 | # Compile LMDZ regular lat-lon exectuable |
---|
| 362 | echo; echo "NOW COMPILE LMDZ REGULAR LAT-LON MODE. Resolution = ${resol_atm}" |
---|
| 363 | echo >> $outfile ; echo " NOW COMPILE LMDZ REGULAR LAT-LON MODE. Resolution = ${resol_atm}" >> $outfile |
---|
| 364 | |
---|
| 365 | # Check if the compilation of LMDZ was previsouly interupted prematured. |
---|
| 366 | # In that case, the files dimension.h and .lock exist. If the files exist, they are here removed to avoid makelmdz_fcm |
---|
| 367 | # to ask question and wait for interactivly answer from the user. |
---|
| 368 | if [ -f libf/grid/dimensions.h ] || [ -f .lock ] ; then |
---|
| 369 | echo >> $outfile |
---|
| 370 | echo " WARNING!! The file LMDZ/libf/grid/dimension.h and/or the LMDZ/.lock exist. " >> $outfile |
---|
| 371 | echo " This means that the compilation is either currently on going in another terminal was previous interupted before the end." >> $outfile |
---|
| 372 | echo " The files dimension.h and .lock will now be removed. " >> $outfile |
---|
| 373 | echo >> $outfile |
---|
| 374 | rm -f libf/grid/dimensions.h |
---|
| 375 | rm -f .lock |
---|
| 376 | fi |
---|
| 377 | echo ./makelmdz_fcm -d ${resol_atm} -p lmd -rrtm true -$optmode -mem -parallel $parallel -io xios -v orchidee2.1 -chimie INCA -arch $fcm_arch -j 8 $full_lmdz gcm >> $outfile |
---|
| 378 | ./makelmdz_fcm -d ${resol_atm} -p lmd -rrtm true -$optmode -mem -parallel $parallel -io xios -v orchidee2.1 -chimie INCA -arch $fcm_arch -j 8 $full_lmdz gcm >> $outfile 2>&1 |
---|
| 379 | # Test if compiling finished |
---|
| 380 | if [[ $? != 0 ]] ; then |
---|
| 381 | echo "THERE IS A PROBLEM IN LMDZ REGULAR LATLON COMPILATION - STOP" |
---|
| 382 | echo "ALL INFORMATION IN FILE $outfile" |
---|
| 383 | exit |
---|
| 384 | fi |
---|
[6083] | 385 | |
---|
| 386 | |
---|
| 387 | # Move executables to modipsl/bin folder |
---|
| 388 | echo "Move gcm.e and ce0l executable to modipsl/bin" |
---|
| 389 | if [ -f $modipsl/modeles/LMDZ/bin/gcm${suffix} ] ; then |
---|
| 390 | mv $modipsl/modeles/LMDZ/bin/gcm${suffix} $modipsl/bin/gcm_${resol_atm}_${optmode}_${optchimie}.e |
---|
| 391 | else |
---|
| 392 | echo "ERROR gcm${suffix} executable does not exist." |
---|
| 393 | echo "THERE IS A PROBLEM TO MOVE LMDZ REGULAR LATLON EXECUTABLE - STOP" |
---|
| 394 | echo "ALL INFORMATION IN FILE $outfile" |
---|
| 395 | exit |
---|
| 396 | fi |
---|
| 397 | |
---|
[5958] | 398 | fi |
---|
[5586] | 399 | |
---|
| 400 | |
---|
[6083] | 401 | if [ $ce0l = yes ] || [ $ico_only = no ] && [ $reg_only = no ] ; then |
---|
| 402 | |
---|
| 403 | cd $modipsl/modeles/LMDZ |
---|
| 404 | |
---|
[5958] | 405 | # Compile ce0l initialization program for LMDZ regular lat-lon exectuable |
---|
| 406 | echo; echo "NOW COMPILE CE0L OF LMDZ. Resolution = ${resol_atm}" |
---|
| 407 | echo >> $outfile ; echo " NOW COMPILE CE0L OF LMDZ. Resolution = ${resol_atm}" >> $outfile |
---|
| 408 | |
---|
| 409 | echo ./makelmdz_fcm -d ${resol_atm} -p lmd -rrtm true -$optmode -mem -parallel $parallel -io xios -v orchidee2.1 -chimie INCA -arch $fcm_arch -j 8 $full_lmdz ce0l >> $outfile |
---|
| 410 | ./makelmdz_fcm -d ${resol_atm} -p lmd -rrtm true -$optmode -mem -parallel $parallel -io xios -v orchidee2.1 -chimie INCA -arch $fcm_arch -j 8 $full_lmdz ce0l >> $outfile 2>&1 |
---|
| 411 | # Test if compiling finished |
---|
| 412 | if [[ $? != 0 ]] ; then |
---|
| 413 | echo "THERE IS A PROBLEM IN CE0L (LMDZ) REGULAR LATLON COMPILATION - STOP" |
---|
| 414 | echo "ALL INFORMATION IN FILE $outfile" |
---|
| 415 | exit |
---|
| 416 | fi |
---|
[5586] | 417 | |
---|
[5961] | 418 | if [ -f $modipsl/modeles/LMDZ/bin/ce0l${suffix} ] ; then |
---|
| 419 | mv $modipsl/modeles/LMDZ/bin/ce0l${suffix} $modipsl/bin/ce0l_${resol_atm}_${optmode}_${optchimie}.e |
---|
| 420 | else |
---|
| 421 | echo "ERROR ce0l${suffix} executable does not exist." |
---|
| 422 | echo "THERE IS A PROBLEM IN LMDZ REGULAR LATLON COMPILATION - STOP" |
---|
| 423 | echo "ALL INFORMATION IN FILE $outfile" |
---|
| 424 | exit |
---|
| 425 | fi |
---|
[6083] | 426 | |
---|
| 427 | |
---|
[5961] | 428 | fi |
---|
[5907] | 429 | |
---|
[5586] | 430 | echo >>$outfile ; echo "ALL COMPILING FINISHED" >> $outfile |
---|
| 431 | echo ls -lrt modipsl/bin >> $outfile |
---|
| 432 | ls -lrt $modipsl/bin >> $outfile |
---|
| 433 | |
---|
| 434 | echo; echo "ALL COMPILING FINISHED" ; echo |
---|
| 435 | echo "Executables are found in modipsl/bin" |
---|
| 436 | echo "Check that executable names correspond with the name set in config.card before launching the job" |
---|
| 437 | echo ls -lrt modipsl/bin |
---|
| 438 | ls -lrt $modipsl/bin |
---|
| 439 | |
---|
| 440 | date |
---|
| 441 | exit |
---|
| 442 | |
---|
| 443 | |
---|