[11] | 1 | #! /bin/bash |
---|
| 2 | |
---|
| 3 | |
---|
| 4 | ################################## |
---|
| 5 | # makemeso allows you to compile # |
---|
| 6 | # WRF with modified LMD physics # |
---|
| 7 | ################################## |
---|
| 8 | |
---|
| 9 | ############################## |
---|
| 10 | # Author: A. Spiga # |
---|
| 11 | # New version : October 2008 # |
---|
| 12 | # Last update : January 2009 # |
---|
| 13 | # November 09 # |
---|
[29] | 14 | # January 11 # |
---|
[11] | 15 | ############################## |
---|
| 16 | |
---|
[68] | 17 | ############################### |
---|
| 18 | #### Type makemeso -h for help |
---|
| 19 | ############################### |
---|
[11] | 20 | |
---|
| 21 | |
---|
| 22 | |
---|
| 23 | ############################################################################################## |
---|
| 24 | ############################################################################################## |
---|
| 25 | ############################################################################################## |
---|
| 26 | ############################################################################################## |
---|
| 27 | |
---|
| 28 | donotcompile=0 |
---|
| 29 | donotallow=0 |
---|
[142] | 30 | config='' |
---|
[11] | 31 | donotcompilephys=0 |
---|
| 32 | justphys=0 |
---|
| 33 | debug=0 |
---|
[54] | 34 | fresh_start=0 |
---|
[29] | 35 | phys="" |
---|
[118] | 36 | scenario="" |
---|
[674] | 37 | while getopts "drc:njhgbpfs:x" options; do |
---|
[11] | 38 | case $options in |
---|
[118] | 39 | d ) donotcompile=1;; ## just to check the compile folder |
---|
| 40 | r ) donotallow=1;; ## allow only known config (useful with 'makemeso < last') |
---|
| 41 | c ) config="${OPTARG}";; ## idealized cases |
---|
| 42 | n ) donotcompilephys=1;; ## do not recompile physics |
---|
| 43 | j ) justphys=1;; ## just compile LMD physics |
---|
| 44 | g ) debug=1;; ## debug mode |
---|
| 45 | p ) phys="newphys_";; ## with new physics |
---|
| 46 | f ) fresh_start=1;; ## a fresh start |
---|
| 47 | s ) scenario="${OPTARG}";; ## a specific scenario, you need a corresponding "mars_lmd_..." |
---|
[157] | 48 | x ) donotcompile=1;phys="nophys_";donotcompilephys=1;; ## a case with no LMD physics included |
---|
[11] | 49 | h ) echo " |
---|
| 50 | # Use: |
---|
| 51 | # |
---|
[142] | 52 | # makemeso ## basic use (real-case configuration) |
---|
[11] | 53 | # |
---|
| 54 | # makemeso -d ## no compilation, just check the name of the compile folder |
---|
| 55 | # |
---|
[68] | 56 | # makemeso -c ideal ## idealized mode (convective cell, mountain wave, etc...) |
---|
[142] | 57 | # makemeso -c les ## large-eddy simulations mode based on WRFV3 |
---|
[11] | 58 | # |
---|
[70] | 59 | # makemeso -n ## do not recompile LMD physics (must have been compiled before) |
---|
[68] | 60 | # |
---|
[11] | 61 | # makemeso < last ## basic use + skip questions [! script must have been executed at least once] |
---|
| 62 | # makemeso -r < last ## basic use + skip questions + only known config |
---|
| 63 | # makemeso -nr < last ## basic use + skip questions + only known config + no LMD phys recompile |
---|
| 64 | # |
---|
| 65 | # makemeso -j ## just compile the LMD physics |
---|
| 66 | # |
---|
| 67 | # makemeso -g ## debug mode |
---|
| 68 | # |
---|
| 69 | # makemeso -h ## display options |
---|
[29] | 70 | # |
---|
| 71 | # makemeso -p ## with new LMD physics |
---|
[54] | 72 | # |
---|
| 73 | # makemeso -f ## fresh start [clean -a] |
---|
[118] | 74 | # |
---|
| 75 | # makemeso -s storm ## a specific scenario, you need a corresponding mars_lmd_... (only for newphys) |
---|
[156] | 76 | # |
---|
| 77 | # makemeso -x ## a case with no LMD physics included |
---|
[11] | 78 | " ; exit ;; |
---|
| 79 | esac |
---|
| 80 | done |
---|
| 81 | |
---|
| 82 | #-------------- |
---|
| 83 | # talk w/ user |
---|
| 84 | #-------------- |
---|
| 85 | echo '****************************************' |
---|
| 86 | echo ' LMD Mesoscale Model Compiler. Welcome.' |
---|
| 87 | echo '****************************************' |
---|
[29] | 88 | if [[ "${phys}" == "newphys_" ]] |
---|
| 89 | then |
---|
| 90 | echo '***********with new physics*************' |
---|
| 91 | echo '****************************************' |
---|
| 92 | fi |
---|
[11] | 93 | # computer |
---|
| 94 | uname -a | grep x86_64 > /dev/null |
---|
| 95 | if [[ "$?" == 0 ]] |
---|
| 96 | then |
---|
| 97 | machine='64' |
---|
| 98 | else |
---|
| 99 | machine='32' |
---|
| 100 | fi |
---|
| 101 | # compiler |
---|
| 102 | echo "Supported compiler options are " |
---|
| 103 | echo " <1> pgf90" |
---|
| 104 | echo " <2> g95" |
---|
| 105 | echo " <3> pgf90 + mpi" |
---|
| 106 | echo " <4> ifort" |
---|
| 107 | echo " <5> ifort + mpi" |
---|
| 108 | echo " <7> xlf + mpi (IBM AIX)" |
---|
| 109 | echo "Your choice ?" ; read reply |
---|
| 110 | case ${reply} in |
---|
| 111 | 1) compilo='pgf' ; numproc=1 ;; |
---|
| 112 | 2) compilo='g95' ; numproc=1 ;; |
---|
| 113 | 3) compilo='mpi' |
---|
| 114 | if [[ "${WHERE_MPI}" = "" ]] |
---|
| 115 | then |
---|
| 116 | echo Please initialize the variable WHERE_MPI in your environnement |
---|
| 117 | exit |
---|
| 118 | fi |
---|
[111] | 119 | echo How many processors ? e.g. 1, 2, 4, 6, 8, 12, 16, 20, 24, 32, 64, 128 ; read numproc ;; |
---|
[11] | 120 | 4) compilo='ifort' ; numproc=1 ;; |
---|
[111] | 121 | 5) compilo='mpifort' ; echo How many processors ? e.g. 1, 2, 4, 6, 8, 12, 16, 20, 24, 32, 64, 128 ; read numproc ;; |
---|
| 122 | 7) compilo='mpixlf' ; echo How many processors ? e.g. 1, 2, 4, 6, 8, 12, 16, 20, 24, 32, 64, 128 ; read numproc ;; |
---|
[11] | 123 | ### for tests |
---|
| 124 | 99) compilo='gnu' ; numproc=1 ;; |
---|
| 125 | *) echo not supported by this script ; exit ;; |
---|
| 126 | esac |
---|
| 127 | # dimensions |
---|
| 128 | if [ ${donotcompile} -eq 0 ] |
---|
| 129 | then |
---|
| 130 | echo Grid points in longitude ? ; read lon |
---|
| 131 | echo Grid points in latitude ? ; read lat |
---|
| 132 | echo Number of vertical levels ? ; read level |
---|
| 133 | fi |
---|
| 134 | echo Number of domains ? ; read dom |
---|
| 135 | |
---|
| 136 | ###PB lecture dom si < last |
---|
| 137 | |
---|
| 138 | case ${dom} in |
---|
| 139 | 1) single='_single' ;; |
---|
| 140 | *) single='_nest' ;; |
---|
| 141 | esac |
---|
| 142 | if [ "${compilo}" = "mpi" -o "${compilo}" = "mpifort" -o "${compilo}" = "mpixlf" ] |
---|
| 143 | then |
---|
| 144 | single='' |
---|
| 145 | fi |
---|
| 146 | |
---|
| 147 | testflag='' |
---|
| 148 | #### |
---|
| 149 | #testflag='_test' |
---|
| 150 | #### |
---|
| 151 | |
---|
[142] | 152 | conf_wrf="${config}${scenario}${phys}${compilo}_${machine}${single}${testflag}" |
---|
[11] | 153 | \rm what_folder 2> /dev/null |
---|
| 154 | echo ${conf_wrf} > what_folder |
---|
| 155 | if [ ${donotcompile} -eq 1 ] |
---|
| 156 | then |
---|
| 157 | #\rm what_folder 2> /dev/null |
---|
| 158 | #echo '**********************' |
---|
| 159 | #echo '*** Your folder is ...' |
---|
| 160 | #echo '**********************' |
---|
| 161 | #echo ${conf_wrf} | tee what_folder |
---|
| 162 | #cat what_folder |
---|
| 163 | #echo ${conf_wrf} > what_folder |
---|
| 164 | #echo ${reply} > what_compilo |
---|
| 165 | #echo ${numproc} > what_numproc |
---|
[157] | 166 | if [[ "${phys}" != "nophys_" ]] |
---|
| 167 | then |
---|
| 168 | exit |
---|
| 169 | fi |
---|
| 170 | else |
---|
| 171 | echo Number of tracers ? ; read tra |
---|
| 172 | if [ ${tra} -eq 0 ] |
---|
| 173 | then |
---|
| 174 | tra=1 |
---|
| 175 | fi |
---|
[207] | 176 | if [[ "${phys}" == "newphys_" ]] |
---|
| 177 | then |
---|
| 178 | echo "How many types of scatterer are you using ? 1 [dust] or 2 [dust + water ice]" ; read scat |
---|
| 179 | else |
---|
| 180 | scat=1 ## dummy stuff |
---|
| 181 | fi |
---|
[11] | 182 | fi |
---|
| 183 | # folder |
---|
| 184 | mkdir ${conf_wrf} 2> /dev/null |
---|
| 185 | if [[ "$?" == 0 ]] |
---|
| 186 | then |
---|
| 187 | echo new folder ... link sources |
---|
[29] | 188 | if [[ "${phys}" == "newphys_" ]] |
---|
| 189 | then |
---|
[247] | 190 | \rm copy_model_tmp > /dev/null 2> /dev/null |
---|
[118] | 191 | if [[ "${scenario}" == "" ]] |
---|
| 192 | then |
---|
[216] | 193 | sed s+"mars_lmd"+"mars_lmd_new"+g SRC/SCRIPTS/copy_model > copy_model_tmp |
---|
[118] | 194 | else |
---|
[147] | 195 | echo SCENARIO ${scenario} DID YOU INCLUDE THE SPECIFIC folder ? ; read dummy |
---|
[216] | 196 | sed s+"mars_lmd"+"mars_lmd_new_${scenario}"+g SRC/SCRIPTS/copy_model > copy_model_tmp |
---|
[142] | 197 | if [[ "${config}" == "les" ]] |
---|
| 198 | then |
---|
| 199 | echo "NOT SUPPORTED, check options" |
---|
[147] | 200 | exit |
---|
[142] | 201 | fi |
---|
[118] | 202 | fi |
---|
[142] | 203 | if [[ "${config}" == "les" ]] |
---|
| 204 | then |
---|
| 205 | sed s+"PWD/SRC/"+"PWD/SRC/LES/"+g copy_model_tmp > yeah |
---|
| 206 | mv yeah copy_model_tmp |
---|
| 207 | fi |
---|
[54] | 208 | chmod 755 copy_model_tmp |
---|
| 209 | ./copy_model_tmp |
---|
| 210 | \rm copy_model_tmp |
---|
[215] | 211 | mv zeWRFV2 ${conf_wrf}/WRFV2 |
---|
[54] | 212 | cd ${conf_wrf}/WRFV2 |
---|
[118] | 213 | if [[ "${scenario}" == "" ]] |
---|
| 214 | then |
---|
| 215 | ln -sf mars_lmd_new mars_lmd |
---|
| 216 | else |
---|
| 217 | ln -sf mars_lmd_new_${scenario} mars_lmd |
---|
| 218 | cp ../../SRC/WRFV2/mars_lmd_new_${scenario}/Registry.EM mars_lmd_new_${scenario}/ |
---|
| 219 | cp ../../SRC/WRFV2/mars_lmd_new_${scenario}/*.inc mars_lmd_new_${scenario}/ |
---|
| 220 | cd Registry ; ln -sf ../mars_lmd_new_${scenario}/Registry.EM . ; cd .. |
---|
| 221 | fi |
---|
[226] | 222 | #ln -sf meso_callkeys_newphys.h meso_callkeys.h |
---|
[54] | 223 | cd Registry ; Registry.bash ; cd .. |
---|
[29] | 224 | else |
---|
[142] | 225 | if [[ "${config}" == "les" ]] |
---|
| 226 | then |
---|
[156] | 227 | ### NB: With physics: LES folder // Without physics : LESnophys_ folder |
---|
| 228 | ### ---- because differences in 'modif' folder ---- |
---|
[216] | 229 | sed s+"PWD/SRC/"+"PWD/SRC/LES$phys/"+g SRC/SCRIPTS/copy_model > copy_model_tmp |
---|
[142] | 230 | else |
---|
[216] | 231 | cp SRC/SCRIPTS/copy_model copy_model_tmp |
---|
[142] | 232 | fi |
---|
| 233 | chmod 755 copy_model_tmp |
---|
| 234 | ./copy_model_tmp |
---|
| 235 | \rm copy_model_tmp |
---|
[235] | 236 | mv zeWRFV2 ${conf_wrf}/WRFV2 |
---|
[54] | 237 | cd ${conf_wrf}/WRFV2 |
---|
| 238 | cd Registry ; Registry.bash ; cd .. |
---|
| 239 | fi |
---|
[142] | 240 | #### sparadrap consequent a l'utilisation de copy_model pour les liens |
---|
| 241 | #### -- car alors il manque fftpack |
---|
| 242 | if [[ "${config}" == "les" ]] |
---|
[158] | 243 | then |
---|
[167] | 244 | if [[ "${phys}" == "nophys_" ]] |
---|
| 245 | then |
---|
| 246 | ## voir ci-dessus pour le folder |
---|
| 247 | cp ../../SRC/LES$phys/correcfft ./ |
---|
| 248 | else |
---|
| 249 | cp ../../SRC/LES/correcfft ./ |
---|
| 250 | fi |
---|
[142] | 251 | ./correcfft |
---|
| 252 | \rm correcfft |
---|
| 253 | fi |
---|
[11] | 254 | else |
---|
| 255 | cd ${conf_wrf}/WRFV2 |
---|
[54] | 256 | if [ ${fresh_start} -eq 1 ] |
---|
| 257 | then |
---|
| 258 | echo '*** FRESH START, I clean everything' |
---|
[318] | 259 | ### clean the whole place |
---|
[54] | 260 | clean -a > /dev/null 2> /dev/null |
---|
[318] | 261 | ### get a possibly modified registry ! |
---|
[333] | 262 | if [[ "${scenario}" == "" ]] |
---|
| 263 | then |
---|
| 264 | cp ../../SRC/WRFV2/Registry/Registry.EM Registry/ |
---|
| 265 | fi |
---|
[341] | 266 | if [[ "${config}" == "les" ]] |
---|
| 267 | then |
---|
| 268 | cp ../../SRC/LES/WRFV2/Registry/Registry.EM Registry/ |
---|
| 269 | fi |
---|
[318] | 270 | ### ensure the model will be recompiled from scratch with correct registry |
---|
[54] | 271 | cd Registry ; mv Registry Registry.bak ; Registry.bash ; cd .. |
---|
[262] | 272 | # answer='y' ## a voir... pas si sur |
---|
| 273 | # else |
---|
| 274 | # if [[ "${phys}" != "nophys_" ]] |
---|
| 275 | # then |
---|
| 276 | # echo Did you modify anything in the Registry or clean ? y for yes, any key for no ; read answer |
---|
| 277 | # case ${answer} in |
---|
| 278 | # y) cd Registry ; mv Registry Registry.bak ; Registry.bash ; cd .. ;; |
---|
| 279 | # *) answer='no' ;; |
---|
| 280 | # esac |
---|
| 281 | # fi |
---|
[54] | 282 | fi |
---|
[11] | 283 | fi |
---|
[153] | 284 | |
---|
[11] | 285 | # summary |
---|
| 286 | echo '**********************' |
---|
| 287 | echo '*** Your folder is ...' |
---|
| 288 | echo '**********************' |
---|
| 289 | echo ${conf_wrf} |
---|
| 290 | echo '**********************' |
---|
| 291 | echo '****************************************' |
---|
| 292 | echo so ... |
---|
| 293 | echo your computer is ${machine} bits |
---|
| 294 | echo ${compilo} is your compiler |
---|
| 295 | if [[ "${compilo}" = "mpi" ]] |
---|
| 296 | then |
---|
| 297 | echo MPICH is in ${WHERE_MPI} |
---|
| 298 | fi |
---|
| 299 | echo you will use ${numproc} processors |
---|
| 300 | echo you have ${lon} x points |
---|
| 301 | echo ' '${lat} y points |
---|
| 302 | echo ' '${level} z points |
---|
| 303 | echo ' '${dom} domains |
---|
| 304 | echo ' '${tra} tracers |
---|
[153] | 305 | if [[ "${phys}" == "newphys_" ]] |
---|
| 306 | then |
---|
| 307 | echo ' '${scat} scatterers |
---|
| 308 | fi |
---|
[11] | 309 | echo '****************************************' |
---|
| 310 | # save answer |
---|
| 311 | \rm last 2> /dev/null |
---|
| 312 | touch last |
---|
| 313 | echo ${reply} >> last |
---|
| 314 | if [ "${compilo}" = "mpi" -o "${compilo}" = "mpifort" -o "${compilo}" = "mpixlf" ] |
---|
| 315 | then |
---|
| 316 | echo ${numproc} >> last |
---|
| 317 | fi |
---|
| 318 | echo ${lon} >> last |
---|
| 319 | echo ${lat} >> last |
---|
| 320 | echo ${level} >> last |
---|
| 321 | echo ${dom} >> last |
---|
| 322 | echo ${tra} >> last |
---|
[226] | 323 | echo ${scat} >> last |
---|
[262] | 324 | #echo ${answer} >> last |
---|
[11] | 325 | |
---|
| 326 | #------------ |
---|
| 327 | # log files |
---|
| 328 | #------------ |
---|
| 329 | \rm log_compile 2> /dev/null |
---|
| 330 | \rm log_error 2> /dev/null |
---|
| 331 | |
---|
| 332 | #----------------- |
---|
| 333 | # configure WRF |
---|
| 334 | #----------------- |
---|
| 335 | mv configure.wrf configure.wrf.bak 2> /dev/null |
---|
| 336 | ######################## |
---|
[30] | 337 | conf_wrf_forall="${compilo}_${machine}${single}${testflag}" |
---|
[142] | 338 | |
---|
| 339 | #### in this case options are different because for LES, WRFV3 is used |
---|
| 340 | if [[ "${config}" == "les" ]] |
---|
| 341 | then |
---|
| 342 | conf_wrf_forall="${config}${compilo}_${machine}${single}${testflag}" |
---|
| 343 | fi |
---|
| 344 | |
---|
[30] | 345 | case ${conf_wrf_forall} in |
---|
[142] | 346 | |
---|
| 347 | #######LES-specific (WRFV3-based) -- previously in 'makeles' |
---|
| 348 | ####### |
---|
| 349 | |
---|
| 350 | lesmpi_64) ## MPI (dm) 64 bits [PS: remplacer 3 par 4 pour openMP] |
---|
| 351 | \rm conf > /dev/null 2> /dev/null ; touch conf ; echo 3 >> conf ; echo 1 >> conf |
---|
| 352 | \rm configure.wrf > /dev/null 2> /dev/null ; ./configure < conf > /dev/null 2> /dev/null |
---|
| 353 | sed s+"-lnetcdf"+"-lnetcdf -L../mars_lmd/libo -llmd"+g configure.wrf > yeah ; mv -f yeah configure.wrf |
---|
| 354 | if [[ "$(hostname)" == "ciclad1.ipsl.jussieu.fr" ]] |
---|
| 355 | then |
---|
| 356 | echo "SPECIFIC CHANGES FOR CICLAD CLUSTER. EDIT makemeso IF YOU ENCOUNTER PROBLEMS." |
---|
| 357 | #sed s+"mpif90 -f90=$(SFC)"+"/usr/lib64/openmpi/1.4.2-pgf/bin/mpif90"+g configure.wrf > yeah ; mv -f yeah configure.wrf |
---|
| 358 | #sed s+"mpicc -cc=$(SCC)"+"/usr/lib64/openmpi/1.4.2-gfortran/bin/mpicc -DMPI2_SUPPORT"+g configure.wrf > yeah ; mv -f yeah configure.wrf |
---|
[158] | 359 | sed s+"mpif90 -f90=\$(SFC)"+"/usr/lib64/openmpi/1.4.3-pgfgcc/bin/mpif90"+g configure.wrf > yeah ; mv -f yeah configure.wrf |
---|
| 360 | sed s+"mpicc -cc=\$(SCC)"+"/usr/lib64/openmpi/1.4.3-pgfgcc/bin/mpicc -DMPI2_SUPPORT"+g configure.wrf > yeah ; mv -f yeah configure.wrf |
---|
[142] | 361 | else |
---|
[390] | 362 | #sed s+"mpif90"+"$WHERE_MPI/mpif90"+g configure.wrf > yeah ; mv -f yeah configure.wrf |
---|
| 363 | #sed s+"mpicc"+"$WHERE_MPI/mpicc -DMPI2_SUPPORT"+g configure.wrf > yeah ; mv -f yeah configure.wrf |
---|
| 364 | #### OPENMPI |
---|
| 365 | sed s+"mpif90 -f90=\$(SFC)"+"$WHERE_MPI/mpif90"+g configure.wrf > yeah ; mv -f yeah configure.wrf |
---|
| 366 | sed s+"mpicc -cc=\$(SCC)"+"$WHERE_MPI/mpicc -DMPI2_SUPPORT"+g configure.wrf > yeah ; mv -f yeah configure.wrf |
---|
[142] | 367 | fi |
---|
| 368 | sed s+"-fastsse"+" "+g configure.wrf > yeah ; mv -f yeah configure.wrf |
---|
| 369 | ### pas forcement necessaire ici mais OK |
---|
| 370 | sed s+"-llmd"+"-llmd $NETCDF/lib/libnetcdf.a"+g configure.wrf > yeah ; mv -f yeah configure.wrf |
---|
| 371 | \rm conf > /dev/null ;; |
---|
| 372 | |
---|
| 373 | lesmpifort_64) ## MPI (dm) 64 bits IFORT |
---|
| 374 | \rm conf > /dev/null 2> /dev/null ; touch conf ; echo 7 >> conf ; echo 1 >> conf |
---|
| 375 | \rm configure.wrf > /dev/null 2> /dev/null ; ./configure < conf > /dev/null 2> /dev/null |
---|
| 376 | sed s+"-lnetcdf"+"-lnetcdf -L../mars_lmd/libo -llmd"+g configure.wrf > yeah ; mv -f yeah configure.wrf |
---|
| 377 | sed s+"mpif90"+"$WHERE_MPI/mpif90"+g configure.wrf > yeah ; mv -f yeah configure.wrf |
---|
| 378 | sed s+"mpicc"+"$WHERE_MPI/mpicc -DMPI2_SUPPORT"+g configure.wrf > yeah ; mv -f yeah configure.wrf |
---|
| 379 | sed s+"-fastsse"+" "+g configure.wrf > yeah ; mv -f yeah configure.wrf |
---|
[666] | 380 | sed s+"O3"+"O3 -mcmodel=large -shared-intel"+g configure.wrf > yeah ; mv -f yeah configure.wrf |
---|
[142] | 381 | sed s+"-llmd"+"-llmd $NETCDF/lib/libnetcdf.a"+g configure.wrf > yeah ; mv -f yeah configure.wrf |
---|
[674] | 382 | if [ ${debug} -ne 0 ] # not working for xlf! |
---|
| 383 | then |
---|
| 384 | echo 'DEBUG DEBUG DEBUG DEBUG' |
---|
| 385 | sed s+"#-g"+" -g -no-ftz -traceback -ftrapuv -fp-stack-check -check"+g configure.wrf > yeah |
---|
| 386 | mv -f yeah configure.wrf |
---|
| 387 | fi |
---|
[142] | 388 | \rm conf > /dev/null ;; |
---|
| 389 | |
---|
| 390 | ####### |
---|
| 391 | #######LES-specific (WRFV3-based) -- previously in 'makeles' |
---|
| 392 | |
---|
[11] | 393 | #######TEST TEST |
---|
| 394 | # GFORTRAN, 64 bits, no nesting |
---|
| 395 | gnu_64_single) cd arch ; ln -sf ../configure.defaults.gfortran64 configure.defaults ; cd .. |
---|
| 396 | echo 15 | configure > log_compile 2> log_error |
---|
| 397 | sed -f mars.sed configure.wrf > yeah ; mv -f yeah configure.wrf |
---|
| 398 | sed s+"-L../mars_lmd/libo -llmd"+"-L../mars_lmd/libo -llmd $NETCDF/lib/libnetcdf.a"+g configure.wrf > yeah ; mv -f yeah configure.wrf ;; |
---|
| 399 | #######TEST TEST |
---|
| 400 | # PGF90, 32 bits, no nesting |
---|
| 401 | pgf_32_single) echo 1 | configure > log_compile 2> log_error |
---|
| 402 | sed -f mars.sed configure.wrf > yeah ; mv -f yeah configure.wrf ;; |
---|
| 403 | # PGF90, 32 bits, nesting |
---|
| 404 | pgf_32_nest) echo 2 | configure > log_compile 2> log_error |
---|
| 405 | sed -f mars.sed configure.wrf > yeah ; mv -f yeah configure.wrf ;; |
---|
| 406 | # PGF90, 64 bits, no nesting |
---|
| 407 | pgf_64_single) echo 1 | configure > log_compile 2> log_error |
---|
[330] | 408 | #### the following line is necessary because readtesassim has a line "use netcdf" in it! |
---|
| 409 | #sed s+"-L../mars_lmd/libo -llmd"+"-L../mars_lmd/libo -llmd $NETCDF/lib/libnetcdf.a"+g configure.wrf > yeah ; mv -f yeah configure.wrf |
---|
[11] | 410 | sed -f mars.sed configure.wrf > yeah ; mv -f yeah configure.wrf ;; |
---|
| 411 | # PGF90, 64 bits, nesting |
---|
| 412 | pgf_64_nest) cd arch ; ln -sf ../configure.defaults.fix64nest configure.defaults ; cd .. |
---|
| 413 | echo 4 | configure > log_compile 2> log_error |
---|
| 414 | sed -f mars.sed configure.wrf > yeah ; mv -f yeah configure.wrf ;; |
---|
| 415 | # G95, 32 bits, no nesting |
---|
| 416 | g95_32_single) echo 13 | configure > log_compile 2> log_error |
---|
| 417 | sed -f mars.sed configure.wrf > yeah ; mv -f yeah configure.wrf ;; |
---|
[24] | 418 | # G95, 64 bits, no nesting ### we modify configure.defaults to add x86_64 next to g95 in the header comment |
---|
| 419 | g95_64_single) cd arch ; sed s/"PC Linux i486 i586 i686, g95 compiler"/"PC Linux i486 i586 i686 x86_64, g95 compiler"/g configure.defaults > yeahyeahyeah ; rm configure.defaults ; mv yeahyeahyeah configure.defaults ; cd .. |
---|
| 420 | echo 14 | configure > log_compile 2> log_error |
---|
[330] | 421 | ##### marche pas .... |
---|
| 422 | #sed s+"-fno-second-underscore"+""+g configure.wrf > yeah ; mv -f yeah configure.wrf |
---|
| 423 | #sed -f mars.sed configure.wrf > yeah ; mv -f yeah configure.wrf |
---|
| 424 | #sed s+"-L../mars_lmd/libo -llmd"+"-L../mars_lmd/libo -llmd $NETCDF/lib/libnetcdf.a"+g configure.wrf > yeah ; mv -f yeah configure.wrf ;; |
---|
[24] | 425 | sed -f mars.sed configure.wrf > yeah ; mv -f yeah configure.wrf ;; |
---|
| 426 | #sed s+"= g95"+"= /home/physastro/aspiga/mysoft/g95/g95-install/bin/x86_64-unknown-linux-gnu-g95"+g configure.wrf > yeah ; mv -f yeah configure.wrf;; |
---|
[11] | 427 | # IFORT, 64 bits, no nesting |
---|
| 428 | ifort_64_single) echo 5 | configure > log_compile 2> log_error |
---|
| 429 | sed s+"-DIFORT_KLUDGE"+" "+g configure.wrf > yeah ; mv -f yeah configure.wrf |
---|
[674] | 430 | if [ ${debug} -ne 0 ] # not working for xlf! |
---|
| 431 | then |
---|
| 432 | echo 'DEBUG DEBUG DEBUG DEBUG' |
---|
| 433 | sed s+"#-g"+" -g -no-ftz -traceback -ftrapuv -fp-stack-check -check"+g configure.wrf > yeah |
---|
| 434 | mv -f yeah configure.wrf |
---|
| 435 | fi |
---|
[11] | 436 | ## !!! NETCDF must be defined |
---|
| 437 | sed s+"lio_grib_share"+"lio_grib_share -L../mars_lmd/libo -llmd $NETCDF/lib/libnetcdf.a"+g configure.wrf > yeah |
---|
| 438 | mv -f yeah configure.wrf ;; |
---|
| 439 | mpifort_64) # MPI+IFORT, 64 bits, no nesting / nesting |
---|
| 440 | echo 9 | configure > log_compile 2> log_error |
---|
| 441 | sed -f mars.sed configure.wrf > yeah ; mv -f yeah configure.wrf |
---|
| 442 | sed s+"-f90=ifort"+" "+g configure.wrf > yeah ; mv -f yeah configure.wrf |
---|
| 443 | sed s+"-cc=icc"+" "+g configure.wrf > yeah ; mv -f yeah configure.wrf |
---|
| 444 | sed s+"-DIFORT_KLUDGE"+" "+g configure.wrf > yeah ; mv -f yeah configure.wrf |
---|
[674] | 445 | if [ ${debug} -ne 0 ] # not working for xlf! |
---|
| 446 | then |
---|
| 447 | echo 'DEBUG DEBUG DEBUG DEBUG' |
---|
| 448 | sed s+"#-g"+" -g -no-ftz -traceback -ftrapuv -fp-stack-check -check"+g configure.wrf > yeah |
---|
| 449 | mv -f yeah configure.wrf |
---|
| 450 | fi |
---|
[11] | 451 | sed s+"O3"+"O2"+g configure.wrf > yeah ; mv -f yeah configure.wrf |
---|
| 452 | #sed s+"O3"+"O0"+g configure.wrf > yeah ; mv -f yeah configure.wrf ### pour compilation rapide |
---|
| 453 | #-w -ftz -align all -fno-alias -fp-model precise >>> options indiquees dans WRF3 |
---|
| 454 | #http://software.intel.com/en-us/articles/performance-tools-for-software-developers-building-wrf-with-the-intel-compilers/ |
---|
| 455 | #### NB: RSL is replaced by RSL_LITE, better memory capacity, less seg fault |
---|
| 456 | sed s+"../external/RSL/RSL"+"../external/RSL_LITE"+g configure.wrf > yeah ; mv -f yeah configure.wrf |
---|
| 457 | sed s+"-DWRF_RSL_IO"+" "+g configure.wrf > yeah ; mv -f yeah configure.wrf |
---|
| 458 | sed s+"-DRSL"+" "+g configure.wrf > yeah ; mv -f yeah configure.wrf |
---|
| 459 | sed s+"librsl.a"+"librsl_lite.a"+g configure.wrf > yeah ; mv -f yeah configure.wrf |
---|
| 460 | sed s+"../external/RSL/gen"+"../external/RSL_LITE/gen"+g configure.wrf > yeah ; mv -f yeah configure.wrf |
---|
| 461 | sed s+"../external/RSL/module"+"../external/RSL_LITE/module"+g configure.wrf > yeah ; mv -f yeah configure.wrf |
---|
| 462 | sed s+"-lrsl"+"-lrsl_lite"+g configure.wrf > yeah ; mv -f yeah configure.wrf |
---|
| 463 | sed s+"linux"+" "+g configure.wrf > yeah ; mv -f yeah configure.wrf |
---|
| 464 | ### necessary even if mpi-selector is used (no need in makegcm though) |
---|
| 465 | sed s+"mpif90"+"${WHERE_MPI}/mpif90"+g configure.wrf | sed s+"mpicc"+"${WHERE_MPI}/mpicc"+g > yeah ; mv -f yeah configure.wrf |
---|
| 466 | sed s+"mpicc"+"mpicc -DMPI2_SUPPORT"+g configure.wrf > yeah ; mv -f yeah configure.wrf |
---|
| 467 | ## !!! NETCDF must be defined |
---|
| 468 | sed s+"-L../mars_lmd/libo -llmd"+"-L../mars_lmd/libo -llmd $NETCDF/lib/libnetcdf.a"+g configure.wrf > yeah |
---|
[70] | 469 | mv -f yeah configure.wrf |
---|
| 470 | #### POUR LE TRAITEMENT PARTICULIERS des NESTS sur iDATAPLEX [cf. module_lmd_driver] |
---|
[71] | 471 | sed s+"ARCHFLAGS = "+"ARCHFLAGS = -DSPECIAL_NEST_SAVE "+g configure.wrf > yeah |
---|
[11] | 472 | mv -f yeah configure.wrf ;; |
---|
| 473 | # MPICH, 64 bits, no nesting / nesting |
---|
| 474 | mpi_64) cd arch ; ln -sf ../configure.defaults.fix64nest configure.defaults ; cd .. |
---|
| 475 | echo 3 | configure > log_compile 2> log_error |
---|
| 476 | sed -f mars.sed configure.wrf > yeah ; mv -f yeah configure.wrf |
---|
[227] | 477 | ### the following line is necessary because readtesassim has a line "use netcdf" in it! |
---|
| 478 | sed s+"-L../mars_lmd/libo -llmd"+"-L../mars_lmd/libo -llmd $NETCDF/lib/libnetcdf.a"+g configure.wrf > yeah ; mv -f yeah configure.wrf |
---|
[11] | 479 | sed s+"mpif90"+"${WHERE_MPI}/mpif90"+g configure.wrf | sed s+"mpicc"+"${WHERE_MPI}/mpicc"+g | sed s+"mpicc"+"mpicc -DMPI2_SUPPORT"+g > yeah |
---|
[341] | 480 | #sed s+"mpif90"+"${WHERE_MPI}/mpif90"+g configure.wrf | sed s+"mpicc"+"${WHERE_MPI}/mpicc"+g | sed s+"mpicc"+"mpicc -DMPI2_SUPPORT -w -O3"+g > yeah |
---|
[11] | 481 | #| sed s+"fastsse"+"fast"+g > yeah |
---|
[341] | 482 | mv -f yeah configure.wrf ;; |
---|
[335] | 483 | # #sed s+"-fastsse"+"-O2 -Munroll -Mcache_align"+g configure.wrf > yeah |
---|
| 484 | # ##sed s+"-fastsse"+"-O2 -fpic"+g configure.wrf > yeah ## marche pas, ILM problem |
---|
| 485 | # ##sed s+"-fastsse"+"-mcmodel=medium -Mlarge_arrays"+g configure.wrf > yeah ## marche pas, ILM problem |
---|
| 486 | #sed s+"-fastsse"+"-O3 -tp=nehalem-64 -fastsse -Mscalarsse -Mvect=sse -Mipa=fast"+g configure.wrf > yeah |
---|
| 487 | #sed s+"-fastsse"+"-O2 -Munroll -Mcache_align"+g configure.wrf > yeah |
---|
[341] | 488 | #sed s+"-fastsse"+""+g configure.wrf > yeah |
---|
| 489 | #sed s+"-fastsse"+"-fast"+g configure.wrf > yeah |
---|
| 490 | #sed s+"-fastsse"+"-Mvect=noaltcode -Msmartalloc -Mprefetch=distance:8 -Mfprelaxed"+g configure.wrf > yeah |
---|
| 491 | #mv -f yeah configure.wrf ;; |
---|
[11] | 492 | # MPICH, 64 bits, OK with periodic BC but no positive definite |
---|
| 493 | mpi_64_test) cd arch ; ln -sf ../configure.defaults.fix64nest configure.defaults ; cd .. |
---|
| 494 | echo 2 | configure > log_compile 2> log_error |
---|
| 495 | sed -f mars.sed configure.wrf > yeah ; mv -f yeah configure.wrf |
---|
| 496 | sed s+"mpif90"+"${WHERE_MPI}/mpif90"+g configure.wrf | sed s+"mpicc"+"${WHERE_MPI}/mpicc"+g | sed s+"mpicc"+"mpicc -DMPI2_SUPPORT"+g > yeah |
---|
| 497 | mv -f yeah configure.wrf ;; |
---|
| 498 | # XLF+MPICH on AIX machine (64 bits) with nesting, NB: the 32bits notice is not to be considered |
---|
| 499 | mpixlf_32) cd arch ; ln -sf ../configure.defaults.fix64nest configure.defaults ; cd .. |
---|
| 500 | echo 3 | configure > log_compile 2> log_error |
---|
| 501 | sed -f mars.sed configure.wrf > yeah |
---|
| 502 | mv -f yeah configure.wrf ;; |
---|
| 503 | # ANYTHING ELSE |
---|
| 504 | *) echo NO PRESETS ... |
---|
| 505 | if [ ${donotallow} -eq 0 ] |
---|
| 506 | then |
---|
| 507 | configure |
---|
| 508 | else |
---|
| 509 | # problem when an input file is used |
---|
| 510 | echo 'please cd to '$PWD' and type ./configure' |
---|
| 511 | exit |
---|
| 512 | fi ;; |
---|
| 513 | esac |
---|
| 514 | ######################## |
---|
| 515 | |
---|
[142] | 516 | |
---|
[156] | 517 | ### here a case structure would be great |
---|
| 518 | |
---|
[29] | 519 | if [[ "${phys}" == "newphys_" ]] |
---|
| 520 | then |
---|
[142] | 521 | if [[ "${config}" == "les" ]] ### LES is different because of WRFV3 |
---|
| 522 | then |
---|
| 523 | sed s+"ARCH_LOCAL = "+"ARCH_LOCAL = -DNEWPHYS "+g configure.wrf > yeah |
---|
| 524 | else |
---|
| 525 | sed s+"ARCHFLAGS = "+"ARCHFLAGS = -DNEWPHYS "+g configure.wrf > yeah |
---|
| 526 | fi |
---|
[29] | 527 | mv -f yeah configure.wrf |
---|
| 528 | fi |
---|
[11] | 529 | |
---|
[142] | 530 | if [[ ! ("${scenario}" == "") ]] ### not supported with LES for the moment |
---|
[118] | 531 | then |
---|
| 532 | sed s+"ARCHFLAGS = "+"ARCHFLAGS = -D${scenario} "+g configure.wrf > yeah |
---|
| 533 | mv -f yeah configure.wrf |
---|
| 534 | fi |
---|
| 535 | |
---|
[156] | 536 | ################ |
---|
| 537 | if [[ "${phys}" == "nophys_" ]] |
---|
| 538 | then |
---|
| 539 | if [[ "${config}" == "les" ]] ### LES is different because of WRFV3 |
---|
| 540 | then |
---|
| 541 | sed s+"ARCH_LOCAL = "+"ARCH_LOCAL = -DNOPHYS "+g configure.wrf > yeah ; mv -f yeah configure.wrf |
---|
| 542 | sed s+"-L../mars_lmd/libo -llmd"+""+g configure.wrf > yeah ; mv -f yeah configure.wrf |
---|
| 543 | else |
---|
| 544 | ### not tested yet but should be working |
---|
| 545 | echo CAUTION CAUTION CAUTION NOT FULLY TESTED |
---|
| 546 | sed s+"ARCHFLAGS = "+"ARCHFLAGS = -DNOPHYS "+g configure.wrf > yeah ; mv -f yeah configure.wrf |
---|
| 547 | sed s+"-L../mars_lmd/libo -llmd"+""+g configure.wrf > yeah ; mv -f yeah configure.wrf |
---|
| 548 | fi |
---|
| 549 | fi |
---|
| 550 | ################ |
---|
| 551 | |
---|
[11] | 552 | if [ ${debug} -ne 0 ] # not working for xlf! |
---|
| 553 | then |
---|
| 554 | echo 'DEBUG DEBUG DEBUG DEBUG' |
---|
[674] | 555 | sed s+"#-g"+" -g -no-ftz -traceback -ftrapuv -fp-stack-check -check"+g configure.wrf > yeah |
---|
[341] | 556 | #sed s+"#-g"+"-g"+g configure.wrf > yeah |
---|
[11] | 557 | mv -f yeah configure.wrf |
---|
| 558 | fi |
---|
| 559 | |
---|
| 560 | |
---|
| 561 | ################################################## |
---|
| 562 | # compile physics |
---|
| 563 | ################################################## |
---|
| 564 | if [ ${donotcompilephys} -eq 0 ] |
---|
| 565 | then |
---|
| 566 | |
---|
| 567 | cd mars_lmd/ |
---|
| 568 | |
---|
| 569 | # required size |
---|
| 570 | #---------------- |
---|
| 571 | case ${numproc} in |
---|
[239] | 572 | 1) divx=1 ; divy=1 ;; |
---|
| 573 | 2) divx=1 ; divy=2 ;; |
---|
| 574 | 4) divx=2 ; divy=2 ;; |
---|
| 575 | 6) divx=2 ; divy=3 ;; |
---|
| 576 | 8) divx=2 ; divy=4 ;; |
---|
| 577 | 12) divx=3 ; divy=4 ;; |
---|
| 578 | 16) divx=4 ; divy=4 ;; |
---|
| 579 | 20) divx=4 ; divy=5 ;; |
---|
| 580 | 24) divx=4 ; divy=6 ;; |
---|
| 581 | 32) divx=4 ; divy=8 ;; |
---|
| 582 | 64) divx=8 ; divy=8 ;; |
---|
| 583 | 128) divx=8 ; divy=16 ;; |
---|
| 584 | *) echo not yet supported ; exit ;; |
---|
[11] | 585 | esac |
---|
[240] | 586 | physx=$(expr ${lon} - 1) |
---|
| 587 | restex=$(expr ${physx} \% ${divx}) |
---|
| 588 | physy=$(expr ${lat} - 1) |
---|
| 589 | restey=$(expr ${physy} \% ${divy}) |
---|
[239] | 590 | if [[ ${restex} != 0 || ${restey} != 0 ]] |
---|
| 591 | then |
---|
| 592 | echo nx-1 shall be divided by ${divx} |
---|
| 593 | echo ny-1 shall be divided by ${divy} |
---|
| 594 | exit |
---|
| 595 | fi |
---|
[240] | 596 | physx=$(expr ${physx} \/ ${divx}) |
---|
| 597 | physy=$(expr ${physy} \/ ${divy}) |
---|
[239] | 598 | physz=$(expr ${level} - 1) |
---|
[11] | 599 | |
---|
| 600 | # change this if you change num_soil_layers in WRF |
---|
| 601 | # -- default is 10 |
---|
[30] | 602 | if [[ "${phys}" == "newphys_" ]] |
---|
| 603 | then |
---|
| 604 | soilsize=18 ## nouvelle physique |
---|
| 605 | else |
---|
| 606 | soilsize=10 |
---|
| 607 | fi |
---|
[11] | 608 | |
---|
| 609 | # GCM environment variables |
---|
| 610 | #-------------------------- |
---|
| 611 | export LMDGCM=$PWD |
---|
| 612 | export LIBOGCM=$PWD/libo |
---|
| 613 | |
---|
| 614 | # generate the appropriate dimphys |
---|
| 615 | #--------------------------------- |
---|
| 616 | cd libf/phymars |
---|
| 617 | \rm dimphys.h 2> /dev/null |
---|
[235] | 618 | if [[ "${phys}" == "newphys_" ]] |
---|
| 619 | then |
---|
| 620 | ln -sf meso_inc/meso_dimphys.h_ref . |
---|
| 621 | fi |
---|
[11] | 622 | physize=$(expr ${physx} \* ${physy}) |
---|
[235] | 623 | sed s/--xsize--/${physx}/g meso_dimphys.h_ref | sed s/--ysize--/${physy}/g | sed s/--physize--/${physize}/g | sed s/--zsize--/${physz}/g | sed s/--soilsize--/${soilsize}/g > dimphys.h |
---|
[11] | 624 | head -15 dimphys.h |
---|
[42] | 625 | ### TEST new new phys |
---|
| 626 | if [[ "${phys}" == "newphys_" ]] |
---|
| 627 | then |
---|
[50] | 628 | touch gr_fi_dyn.F.lien |
---|
[227] | 629 | ln -sf ../dyn3d/gr_fi_dyn.F . ## dommage, a corriger |
---|
[153] | 630 | ############################### |
---|
| 631 | \rm scatterers.h |
---|
| 632 | cat << EOF > scatterers.h |
---|
| 633 | !----------------------------------------------------------------------- |
---|
| 634 | ! INCLUDE 'scatterers.h' |
---|
| 635 | ! |
---|
| 636 | ! Number of kind of tracer radiative properties |
---|
| 637 | ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 638 | ! (ex: naerkind=1 if you use one dust mode without ice ...) |
---|
| 639 | ! (ex: naerkind=2 if you use one dust mode and active ice ...) |
---|
| 640 | !----------------------------------------------------------------------- |
---|
| 641 | |
---|
| 642 | integer, parameter :: naerkind=${scat} |
---|
| 643 | |
---|
| 644 | !----------------------------------------------------------------------- |
---|
| 645 | EOF |
---|
| 646 | ############################### |
---|
| 647 | ############################### |
---|
[42] | 648 | fi |
---|
| 649 | ### |
---|
| 650 | ### |
---|
[11] | 651 | cd ../.. |
---|
| 652 | |
---|
| 653 | # prepare for nesting |
---|
| 654 | #--------------------- |
---|
| 655 | cd libf |
---|
| 656 | duplicate${dom} 2> /dev/null |
---|
| 657 | cd .. |
---|
| 658 | |
---|
| 659 | # compile physics |
---|
| 660 | #-------------------------- |
---|
| 661 | \rm libf/grid/dimensions.h 2> /dev/null |
---|
| 662 | \rm -rf libo/* 2> /dev/null |
---|
| 663 | echo 1. compiling LMD physics ... |
---|
| 664 | echo compilation info in: |
---|
| 665 | echo $PWD/libo/log_compile_phys |
---|
| 666 | |
---|
| 667 | if [ ${debug} -ne 0 ] |
---|
| 668 | then |
---|
| 669 | echo 'DEBUG DEBUG DEBUG DEBUG' |
---|
[86] | 670 | nohup makegcm_${compilo} -debug -t ${tra} -p mars -d ${physz} testphys1d | tee libo/log_compile_phys | grep 'warnings' >> libo/log_compile_phys |
---|
[11] | 671 | else |
---|
[86] | 672 | nohup makegcm_${compilo} -t ${tra} -p mars -d ${physz} testphys1d | tee libo/log_compile_phys | grep 'warnings' >> libo/log_compile_phys |
---|
[11] | 673 | fi |
---|
| 674 | echo ... done |
---|
| 675 | # clean the duplicate routines |
---|
| 676 | cd libf |
---|
| 677 | duplicate1 2> /dev/null |
---|
| 678 | cd .. |
---|
| 679 | |
---|
| 680 | # merge LMD executables in one lib |
---|
| 681 | #-------------------------------------- |
---|
| 682 | cd libo |
---|
| 683 | mkdir temp |
---|
| 684 | #cp -f LINUXfastI._${physz}_t${tra}_reg/*.a temp |
---|
| 685 | cp -f LINUX*/*.a temp |
---|
| 686 | cd temp |
---|
| 687 | ar x libbibio.a |
---|
| 688 | ar x libphymars.a |
---|
| 689 | ar x libaeronomars.a |
---|
| 690 | \rm *.a |
---|
| 691 | ar r liblmd.a * |
---|
| 692 | cp -f liblmd.a .. |
---|
| 693 | cd .. |
---|
| 694 | \rm -r temp |
---|
| 695 | nm liblmd.a > liblmd_content |
---|
| 696 | # finish merge |
---|
| 697 | cd .. |
---|
| 698 | |
---|
| 699 | # save a copy |
---|
| 700 | #-------------- |
---|
[153] | 701 | cp -f libo/liblmd.a libo/liblmd.a_${lon}_${lat}_${level}_${dom}_${tra}_${scat} |
---|
[11] | 702 | echo '****************************************' |
---|
| 703 | |
---|
| 704 | # ok |
---|
| 705 | #---- |
---|
| 706 | cd .. |
---|
| 707 | |
---|
| 708 | # manage nest includes in module_lmd_driver.F |
---|
| 709 | #---- |
---|
| 710 | cp call_meso_inifis$dom.inc call_meso_inifis.inc |
---|
| 711 | cp call_meso_physiq$dom.inc call_meso_physiq.inc |
---|
| 712 | |
---|
| 713 | |
---|
| 714 | fi |
---|
| 715 | ################################################## |
---|
| 716 | # END compile physics |
---|
| 717 | ################################################## |
---|
| 718 | |
---|
| 719 | #------------------ |
---|
| 720 | # compile WRF |
---|
| 721 | #------------------ |
---|
| 722 | if [ ${justphys} -eq 0 ] |
---|
| 723 | then |
---|
| 724 | |
---|
| 725 | echo 2. compiling WRF dynamical core ... |
---|
| 726 | |
---|
[156] | 727 | if [[ "${phys}" == "nophys_" ]] |
---|
[11] | 728 | then |
---|
[156] | 729 | echo 'NO LMD PHYSICS included' |
---|
| 730 | else |
---|
| 731 | if [[ ! ( -f "call_meso_physiq.inc" ) ]] |
---|
| 732 | then |
---|
| 733 | echo 'did you compile the physics ? no call_meso_physiq.inc !' |
---|
| 734 | exit |
---|
| 735 | fi |
---|
[11] | 736 | fi |
---|
| 737 | |
---|
| 738 | # be sure to compile with the most recent physics |
---|
| 739 | touch phys/module_lmd_driver.F |
---|
| 740 | |
---|
| 741 | # talk to user |
---|
| 742 | echo '>>> compiling ... this may be long ... <<<' |
---|
| 743 | echo check progress in: |
---|
| 744 | echo $PWD/log_compile |
---|
| 745 | echo check possible errors in: |
---|
| 746 | echo $PWD/log_error |
---|
| 747 | |
---|
| 748 | # compile ... |
---|
| 749 | case ${config} in |
---|
[421] | 750 | '') ./compile em_real > log_compile 2> log_error |
---|
[11] | 751 | # save executables |
---|
| 752 | cd main |
---|
[68] | 753 | if [[ -f real.exe ]] |
---|
| 754 | then |
---|
| 755 | echo 'Looks good ! real.exe is here...' |
---|
| 756 | fi |
---|
[11] | 757 | if [[ -f wrf.exe ]] |
---|
| 758 | then |
---|
| 759 | echo 'Looks good ! wrf.exe is here...' |
---|
| 760 | fi |
---|
[153] | 761 | cp -f real.exe ../../real_x${lon}_y${lat}_z${level}_d${dom}_t${tra}_p${numproc}_s${scat}.exe |
---|
| 762 | cp -f wrf.exe ../../wrf_x${lon}_y${lat}_z${level}_d${dom}_t${tra}_p${numproc}_s${scat}.exe |
---|
[11] | 763 | cd .. ;; |
---|
[68] | 764 | 'ideal') #mkdir 'test/em_quarter_ss' 2> /dev/null |
---|
[142] | 765 | echo '>>> YOUR CONFIG IS : '${config} |
---|
[421] | 766 | ./compile em_quarter_ss > log_compile 2> log_error |
---|
[11] | 767 | # save executables |
---|
| 768 | cd main |
---|
[68] | 769 | if [[ -f ideal.exe ]] |
---|
| 770 | then |
---|
| 771 | echo 'Looks good ! ideal.exe is here...' |
---|
| 772 | fi |
---|
[11] | 773 | if [[ -f wrf.exe ]] |
---|
| 774 | then |
---|
| 775 | echo 'Looks good ! wrf.exe is here...' |
---|
| 776 | fi |
---|
[153] | 777 | cp -f ideal.exe ../../ideal_x${lon}_y${lat}_z${level}_d${dom}_t${tra}_p${numproc}_s${scat}.exe |
---|
| 778 | cp -f wrf.exe ../../wrf_x${lon}_y${lat}_z${level}_d${dom}_t${tra}_p${numproc}_s${scat}.exe |
---|
[11] | 779 | cd .. ;; |
---|
[142] | 780 | 'les') echo '>>> YOUR CONFIG IS : '${config} |
---|
| 781 | mkdir 'test/em_les' 2> /dev/null |
---|
[421] | 782 | ./compile em_les > log_compile 2> log_error |
---|
[142] | 783 | # save executables |
---|
| 784 | cd main |
---|
| 785 | if [[ -f ideal.exe ]] |
---|
| 786 | then |
---|
| 787 | echo 'Looks good ! ideal.exe is here...' |
---|
| 788 | fi |
---|
| 789 | if [[ -f wrf.exe ]] |
---|
| 790 | then |
---|
| 791 | echo 'Looks good ! wrf.exe is here...' |
---|
| 792 | fi |
---|
[153] | 793 | cp -f ideal.exe ../../ideal_x${lon}_y${lat}_z${level}_d${dom}_t${tra}_p${numproc}_s${scat}.exe |
---|
| 794 | cp -f wrf.exe ../../wrf_x${lon}_y${lat}_z${level}_d${dom}_t${tra}_p${numproc}_s${scat}.exe |
---|
[142] | 795 | cd .. ;; |
---|
| 796 | *) echo not supported... please use ; echo ideal les ; exit ;; |
---|
[11] | 797 | esac |
---|
| 798 | echo '*******last lines from log_error*********' |
---|
| 799 | tail -n 20 log_error |
---|
| 800 | fi |
---|
| 801 | |
---|
| 802 | # the end |
---|
| 803 | echo '****************************************' |
---|
| 804 | echo 'done.' |
---|
| 805 | echo '****************************************' |
---|
[153] | 806 | cp last ../makemeso_x${lon}_y${lat}_z${level}_d${dom}_t${tra}_p${numproc}_s${scat} |
---|
[11] | 807 | mv last ../../ |
---|
| 808 | |
---|
| 809 | # add here specific messages |
---|
| 810 | if [[ "${dom}" != "1" ]] |
---|
| 811 | then |
---|
| 812 | nest=$(expr ${lon} + 4) |
---|
| 813 | echo NB: in namelist.input, please set: |
---|
| 814 | echo ' |
---|
| 815 | max_dom = '$dom' |
---|
| 816 | s_we = 1,1, |
---|
| 817 | e_we = '$lon','$nest', |
---|
| 818 | s_sn = 1,1, |
---|
| 819 | e_sn = '$lat','$nest', |
---|
| 820 | s_vert = 1,1, |
---|
| 821 | e_vert = '$level','$level',' |
---|
| 822 | fi |
---|
| 823 | |
---|