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