Changeset 1588 for trunk/MESOSCALE/LMD_MM_MARS/makemeso
- Timestamp:
- Aug 28, 2016, 11:28:26 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MESOSCALE/LMD_MM_MARS/makemeso
r1587 r1588 28 28 donotcompile=0 29 29 donotallow=0 30 config=' '30 config='real' 31 31 donotcompilephys=0 32 32 justphys=0 33 33 debug=0 34 34 fresh_start=0 35 phys=" "35 phys="mars_lmd" 36 36 scenario="" 37 37 from_scratch=0 38 38 39 while getopts "drc:njhgp fs:xe" options; do39 while getopts "drc:njhgp:fs:xe" options; do 40 40 case $options in 41 41 d ) donotcompile=1;; ## just to check the compile folder … … 45 45 j ) justphys=1;; ## just compile LMD physics 46 46 g ) debug=1;; ## debug mode 47 p ) phys=" newphys_";; ## with newphysics47 p ) phys="${OPTARG}";; ## choose physics 48 48 f ) fresh_start=1;; ## a fresh start 49 49 e ) from_scratch=1;; ## a fresh start with a completely new folder … … 72 72 # makemeso -h ## display options 73 73 # 74 # makemeso -p ## with new LMDphysics74 # makemeso -p mars_lmd_new ## choose physics 75 75 # 76 76 # makemeso -f ## fresh start [clean -a] … … 91 91 echo ' LMD Mesoscale Model Compiler. Welcome.' 92 92 echo '****************************************' 93 if [[ "${phys}" == "newphys_"]]94 then 95 echo '*********** with new physics*************'93 if [[ "${phys}" == *"new"* ]] 94 then 95 echo '*********** PHYSICS: ' ${phys} 96 96 echo '****************************************' 97 97 fi … … 130 130 esac 131 131 # number of processors 132 if [ "${phys}" == "newphys_" ] || [ "${phys}" == "nophys_"]132 if [[ "${phys}" == *"new"* ]] || [[ "${phys}" == "nophys_" ]] 133 133 then 134 134 numproc=999 … … 145 145 then 146 146 # ngrid: now dynamically set in newphys 03/2014 147 if [[ "${phys}" == "newphys_"]]147 if [[ "${phys}" == *"new"* ]] 148 148 then 149 149 lon=999 … … 174 174 #### 175 175 176 conf_wrf="${ config}${scenario}${phys}${compilo}_${machine}${single}${testflag}"176 conf_wrf="${phys}_${config}${scenario}_${compilo}_${machine}${single}${testflag}" 177 177 178 178 if [ ${debug} -eq 1 ] … … 200 200 else 201 201 # tracers: now dynamically set in newphys 09/2013 202 if [[ "${phys}" == "newphys_"]]202 if [[ "${phys}" == *"new"* ]] 203 203 then 204 204 tra=999 … … 218 218 fi 219 219 # folder 220 220 221 mkdir ${conf_wrf} 2> /dev/null 221 222 if [[ "$?" == 0 ]] 222 223 then 223 224 echo new folder ... link sources 224 if [[ "${phys}" == "newphys_" ]] 225 then 226 \rm copy_model_tmp > /dev/null 2> /dev/null 227 sed s+"mars_lmd"+"mars_lmd_new"+g SRC/SCRIPTS/copy_model > copy_model_tmp 228 if [[ "${config}" == "les" ]] 229 then 230 sed s+"PWD/SRC/"+"PWD/SRC/LES/"+g copy_model_tmp > yeah 231 mv yeah copy_model_tmp 232 fi 233 chmod 755 copy_model_tmp 234 ./copy_model_tmp 235 \rm copy_model_tmp 225 #if [[ "${phys}" == *"new"* ]] 226 #then 227 # \rm copy_model_tmp > /dev/null 2> /dev/null 228 # sed s+"mars_lmd"+"mars_lmd_new"+g SRC/SCRIPTS/copy_model > copy_model_tmp 229 # if [[ "${config}" == "les" ]] 230 # then 231 # sed s+"PWD/SRC/"+"PWD/SRC/LES/"+g copy_model_tmp > yeah 232 # mv yeah copy_model_tmp 233 # fi 234 #chmod 755 copy_model_tmp 235 #./copy_model_tmp 236 #\rm copy_model_tmp 237 ############################################### 238 ./SRC/SCRIPTS/copy_model -p ${phys} -c ${config} 236 239 mv zeWRFV2 ${conf_wrf}/WRFV2 237 cd ${conf_wrf}/WRFV2 238 ln -sf mars_lmd_new mars_lmd 239 if [[ "${phys}" == "newphys_" ]] 240 ############################################### 241 if [[ "${phys}" == *"new"* ]] 240 242 then 243 cd ${conf_wrf}/WRFV2 244 #ln -sf mars_lmd_new mars_lmd 241 245 if [[ "${config}" != "les" ]] 242 246 then … … 245 249 cp -L ../../SRC/LES/WRFV2/Registry/Registry.EM.newphys Registry/Registry.EM 246 250 fi 247 fi 248 cd phys 249 ln -sf module_lmd_driver.F.new module_lmd_driver.F 250 cd .. 251 cd phys 252 ln -sf module_lmd_driver.F.new module_lmd_driver.F 253 cd .. 251 254 252 255 ## remove files adapted to parallel GCM and useless for mesoscale … … 259 262 #cd .. 260 263 261 else262 263 264 265 266 267 268 269 270 271 272 273 274 275 cd ${conf_wrf}/WRFV2276 cd Registry ; ./Registry.bash ; cd ..264 else 265 # if [[ "${config}" == "les" ]] 266 # then 267 # #### NB: With physics: LES folder // Without physics : LESnophys_ folder 268 # #### ---- because differences in 'modif' folder ---- 269 # #sed s+"PWD/SRC/"+"PWD/SRC/LES$phys/"+g SRC/SCRIPTS/copy_model > copy_model_tmp 270 # sed s+"PWD/SRC/"+"PWD/SRC/LES/"+g SRC/SCRIPTS/copy_model > copy_model_tmp 271 # else 272 # cp SRC/SCRIPTS/copy_model copy_model_tmp 273 # fi 274 #chmod 755 copy_model_tmp 275 #./copy_model_tmp 276 #\rm copy_model_tmp 277 #mv zeWRFV2 ${conf_wrf}/WRFV2 278 cd ${conf_wrf}/WRFV2 279 cd Registry ; ./Registry.bash ; cd .. 277 280 fi 278 281 #### sparadrap consequent a l'utilisation de copy_model pour les liens … … 291 294 \rm correcfft 292 295 fi 293 else 296 else 294 297 cd ${conf_wrf}/WRFV2 295 298 if [ ${fresh_start} -eq 1 ] … … 299 302 clean -a > /dev/null 2> /dev/null 300 303 ### get a possibly modified registry ! 301 if [[ "${phys}" == "newphys_"]]304 if [[ "${phys}" == *"new"* ]] 302 305 then 303 306 cp ../../SRC/WRFV2/Registry/Registry.EM.newphys Registry/Registry.EM … … 339 342 fi 340 343 echo you have ${dom} domains 341 if [[ "${phys}" == "newphys_"]]344 if [[ "${phys}" == *"new"* ]] 342 345 then 343 346 echo number of processors can be changed without recompiling … … 358 361 touch last 359 362 echo ${reply} >> last 360 if [[ "${phys}" != "newphys_"]]363 if [[ "${phys}" != *"new"* ]] 361 364 then 362 365 if [ "${compilo}" = "mpi" -o "${compilo}" = "mpifort" -o "${compilo}" = "mpixlf" ] … … 369 372 fi 370 373 echo ${dom} >> last 371 if [[ "${phys}" != "newphys_"]]374 if [[ "${phys}" != **"new"* ]] 372 375 then 373 376 echo ${tra} >> last … … 401 404 \rm conf > /dev/null 2> /dev/null ; touch conf ; echo 3 >> conf ; echo 1 >> conf 402 405 \rm configure.wrf > /dev/null 2> /dev/null ; ./configure < conf > /dev/null 2> /dev/null 403 sed s+"-lnetcdf"+"-lnetcdf -L../ mars_lmd/libo -llmd"+g configure.wrf > yeah ; mv -f yeah configure.wrf406 sed s+"-lnetcdf"+"-lnetcdf -L../$phys/libo -llmd"+g configure.wrf > yeah ; mv -f yeah configure.wrf 404 407 if [[ "$(hostname)" == "ciclad1.ipsl.jussieu.fr" ]] 405 408 then … … 424 427 \rm conf > /dev/null 2> /dev/null ; touch conf ; echo 7 >> conf ; echo 1 >> conf 425 428 \rm configure.wrf > /dev/null 2> /dev/null ; ./configure < conf > /dev/null 2> /dev/null 426 sed s+"-lnetcdf"+"-lnetcdf -L../ mars_lmd/libo -llmd"+g configure.wrf > yeah ; mv -f yeah configure.wrf429 sed s+"-lnetcdf"+"-lnetcdf -L../$phys/libo -llmd"+g configure.wrf > yeah ; mv -f yeah configure.wrf 427 430 sed s+"mpif90"+"$WHERE_MPI/mpif90"+g configure.wrf > yeah ; mv -f yeah configure.wrf 428 431 sed s+"mpicc"+"$WHERE_MPI/mpicc -DMPI2_SUPPORT"+g configure.wrf > yeah ; mv -f yeah configure.wrf … … 446 449 gnu_64_single) cd arch ; ln -sf ../configure.defaults.gfortran64 configure.defaults ; cd .. 447 450 echo 15 | configure > log_compile 2> log_error 448 sed -f mars.sed configure.wrf > yeah ; mv -f yeah configure.wrf449 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 ;;451 sed -f physics.sed configure.wrf > yeah ; mv -f yeah configure.wrf 452 sed s+"-L../$phys/libo -llmd"+"-L../$phys/libo -llmd $NETCDF/lib/libnetcdf.a"+g configure.wrf > yeah ; mv -f yeah configure.wrf ;; 450 453 #######TEST TEST 451 454 # PGF90, 32 bits, no nesting 452 455 pgf_32_single) echo 1 | configure > log_compile 2> log_error 453 sed -f mars.sed configure.wrf > yeah ; mv -f yeah configure.wrf ;;456 sed -f physics.sed configure.wrf > yeah ; mv -f yeah configure.wrf ;; 454 457 # PGF90, 32 bits, nesting 455 458 pgf_32_nest) echo 2 | configure > log_compile 2> log_error 456 sed -f mars.sed configure.wrf > yeah ; mv -f yeah configure.wrf ;;459 sed -f physics.sed configure.wrf > yeah ; mv -f yeah configure.wrf ;; 457 460 # PGF90, 64 bits, no nesting 458 461 pgf_64_single) echo 1 | configure > log_compile 2> log_error 459 462 #### the following line is necessary because readtesassim has a line "use netcdf" in it! 460 #sed s+"-L../ mars_lmd/libo -llmd"+"-L../mars_lmd/libo -llmd $NETCDF/lib/libnetcdf.a"+g configure.wrf > yeah ; mv -f yeah configure.wrf461 sed -f mars.sed configure.wrf > yeah ; mv -f yeah configure.wrf ;;463 #sed s+"-L../$phys/libo -llmd"+"-L../$phys/libo -llmd $NETCDF/lib/libnetcdf.a"+g configure.wrf > yeah ; mv -f yeah configure.wrf 464 sed -f physics.sed configure.wrf > yeah ; mv -f yeah configure.wrf ;; 462 465 # PGF90, 64 bits, nesting 463 466 pgf_64_nest) cd arch ; ln -sf ../configure.defaults.fix64nest configure.defaults ; cd .. 464 467 echo 4 | configure > log_compile 2> log_error 465 sed -f mars.sed configure.wrf > yeah ; mv -f yeah configure.wrf ;;468 sed -f physics.sed configure.wrf > yeah ; mv -f yeah configure.wrf ;; 466 469 # G95, 32 bits, no nesting 467 470 g95_32_single) echo 13 | configure > log_compile 2> log_error 468 sed -f mars.sed configure.wrf > yeah ; mv -f yeah configure.wrf ;;471 sed -f physics.sed configure.wrf > yeah ; mv -f yeah configure.wrf ;; 469 472 # G95, 64 bits, no nesting ### we modify configure.defaults to add x86_64 next to g95 in the header comment 470 473 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 .. … … 472 475 ##### marche pas .... 473 476 #sed s+"-fno-second-underscore"+""+g configure.wrf > yeah ; mv -f yeah configure.wrf 474 #sed -f mars.sed configure.wrf > yeah ; mv -f yeah configure.wrf475 #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 ;;476 sed -f mars.sed configure.wrf > yeah ; mv -f yeah configure.wrf ;;477 #sed -f physics.sed configure.wrf > yeah ; mv -f yeah configure.wrf 478 #sed s+"-L../$phys/libo -llmd"+"-L../$phys/libo -llmd $NETCDF/lib/libnetcdf.a"+g configure.wrf > yeah ; mv -f yeah configure.wrf ;; 479 sed -f physics.sed configure.wrf > yeah ; mv -f yeah configure.wrf ;; 477 480 #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;; 478 481 # IFORT, 64 bits, no nesting … … 486 489 fi 487 490 ## !!! NETCDF must be defined 488 sed s+"lio_grib_share"+"lio_grib_share -L../ mars_lmd/libo -llmd $NETCDF/lib/libnetcdf.a"+g configure.wrf > yeah491 sed s+"lio_grib_share"+"lio_grib_share -L../$phys/libo -llmd $NETCDF/lib/libnetcdf.a"+g configure.wrf > yeah 489 492 mv -f yeah configure.wrf ;; 490 493 mpifort_64) # MPI+IFORT, 64 bits, no nesting / nesting 491 494 echo 9 | configure > log_compile 2> log_error 492 sed -f mars.sed configure.wrf > yeah ; mv -f yeah configure.wrf495 sed -f physics.sed configure.wrf > yeah ; mv -f yeah configure.wrf 493 496 sed s+"-f90=ifort"+" "+g configure.wrf > yeah ; mv -f yeah configure.wrf 494 497 sed s+"-cc=icc"+" "+g configure.wrf > yeah ; mv -f yeah configure.wrf … … 520 523 sed s+"mpicc"+"mpicc -DMPI2_SUPPORT"+g configure.wrf > yeah ; mv -f yeah configure.wrf 521 524 ## !!! NETCDF must be defined 522 sed s+"-L../ mars_lmd/libo -llmd"+"-L../mars_lmd/libo -llmd $NETCDF/lib/libnetcdf.a"+g configure.wrf > yeah525 sed s+"-L../$phys/libo -llmd"+"-L../$phys/libo -llmd $NETCDF/lib/libnetcdf.a"+g configure.wrf > yeah 523 526 mv -f yeah configure.wrf 524 527 #### POUR LE TRAITEMENT PARTICULIERS des NESTS sur iDATAPLEX [cf. module_lmd_driver] … … 528 531 mpi_64) cd arch ; ln -sf ../configure.defaults.fix64nest configure.defaults ; cd .. 529 532 echo 3 | configure > log_compile 2> log_error 530 sed -f mars.sed configure.wrf > yeah ; mv -f yeah configure.wrf533 sed -f physics.sed configure.wrf > yeah ; mv -f yeah configure.wrf 531 534 ### the following line is necessary because readtesassim has a line "use netcdf" in it! 532 sed s+"-L../ mars_lmd/libo -llmd"+"-L../mars_lmd/libo -llmd $NETCDF/lib/libnetcdf.a"+g configure.wrf > yeah ; mv -f yeah configure.wrf535 sed s+"-L../$phys/libo -llmd"+"-L../$phys/libo -llmd $NETCDF/lib/libnetcdf.a"+g configure.wrf > yeah ; mv -f yeah configure.wrf 533 536 sed s+"mpif90"+"${WHERE_MPI}/mpif90"+g configure.wrf | sed s+"mpicc"+"${WHERE_MPI}/mpicc"+g | sed s+"mpicc"+"mpicc -DMPI2_SUPPORT"+g > yeah 534 537 #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 … … 547 550 mpi_64_test) cd arch ; ln -sf ../configure.defaults.fix64nest configure.defaults ; cd .. 548 551 echo 2 | configure > log_compile 2> log_error 549 sed -f mars.sed configure.wrf > yeah ; mv -f yeah configure.wrf552 sed -f physics.sed configure.wrf > yeah ; mv -f yeah configure.wrf 550 553 sed s+"mpif90"+"${WHERE_MPI}/mpif90"+g configure.wrf | sed s+"mpicc"+"${WHERE_MPI}/mpicc"+g | sed s+"mpicc"+"mpicc -DMPI2_SUPPORT"+g > yeah 551 554 mv -f yeah configure.wrf ;; … … 553 556 mpixlf_32) cd arch ; ln -sf ../configure.defaults.fix64nest configure.defaults ; cd .. 554 557 echo 3 | configure > log_compile 2> log_error 555 sed -f mars.sed configure.wrf > yeah558 sed -f physics.sed configure.wrf > yeah 556 559 mv -f yeah configure.wrf ;; 557 560 # ANYTHING ELSE … … 571 574 ### here a case structure would be great 572 575 573 if [[ "${phys}" == "newphys_"]]576 if [[ "${phys}" == *"new"* ]] 574 577 then 575 578 if [[ "${config}" == "les" ]] ### LES is different because of WRFV3 … … 589 592 mv -f yeah configure.wrf 590 593 # precompiling flag in LMD part 591 cd mars_lmd594 cd $phys 592 595 cp -Lrf makegcm_${compilo} yeah 593 596 \rm makegcm_${compilo} … … 604 607 then 605 608 sed s+"ARCH_LOCAL = "+"ARCH_LOCAL = -DNOPHYS "+g configure.wrf > yeah ; mv -f yeah configure.wrf 606 sed s+"-L../ mars_lmd/libo -llmd"+""+g configure.wrf > yeah ; mv -f yeah configure.wrf609 sed s+"-L../$phys/libo -llmd"+""+g configure.wrf > yeah ; mv -f yeah configure.wrf 607 610 else 608 611 ### not tested yet but should be working 609 612 echo CAUTION CAUTION CAUTION NOT FULLY TESTED 610 613 sed s+"ARCHFLAGS = "+"ARCHFLAGS = -DNOPHYS "+g configure.wrf > yeah ; mv -f yeah configure.wrf 611 sed s+"-L../ mars_lmd/libo -llmd"+""+g configure.wrf > yeah ; mv -f yeah configure.wrf614 sed s+"-L../$phys/libo -llmd"+""+g configure.wrf > yeah ; mv -f yeah configure.wrf 612 615 fi 613 616 fi … … 623 626 fi 624 627 625 628 #exit 626 629 ################################################## 627 630 # compile physics … … 630 633 then 631 634 632 cd mars_lmd/633 634 if [[ "${phys}" == "newphys_"]]635 cd $phys/ 636 637 if [[ "${phys}" == *"new"* ]] 635 638 then 636 639 divx=1 … … 671 674 # change this if you change num_soil_layers in WRF 672 675 # -- default is 10 673 if [[ "${phys}" == "newphys_"]]676 if [[ "${phys}" == *"new"* ]] 674 677 then 675 678 soilsize=18 ## nouvelle physique. ne sert a rien ici. voir comsoil. … … 691 694 # ln -sf ../../meso_dimphys.h_ref . ## ne sert plus !! 692 695 # else 693 if [[ "${phys}" != "newphys_" ]]696 if [[ "${phys}" == "mars_lmd" ]] 694 697 then 695 698 physize=$(expr ${physx} \* ${physy}) … … 755 758 # finish merge 756 759 cd .. 757 758 if [[ "${phys}" == "newphys_" ]] 760 if [[ "${phys}" == *"new"* ]] 759 761 then 760 762 # include modules for interfacing … … 812 814 813 815 # compile ... 816 echo '>>> YOUR CONFIG IS : '${config} 814 817 case ${config} in 815 ' ') ./compile em_real > log_compile 2> log_error818 'real') ./compile em_real > log_compile 2> log_error 816 819 # save executables 817 820 cd main … … 828 831 cd .. ;; 829 832 'ideal') #mkdir 'test/em_quarter_ss' 2> /dev/null 830 echo '>>> YOUR CONFIG IS : '${config}833 #echo '>>> YOUR CONFIG IS : '${config} 831 834 ./compile em_quarter_ss > log_compile 2> log_error 832 835 # save executables … … 843 846 cp -f wrf.exe ../../wrf_x${lon}_y${lat}_z${level}_d${dom}_t${tra}_p${numproc}.exe 844 847 cd .. ;; 845 'les') echo '>>> YOUR CONFIG IS : '${config}848 'les') #echo '>>> YOUR CONFIG IS : '${config} 846 849 mkdir 'test/em_les' 2> /dev/null 847 850 ./compile em_les > log_compile 2> log_error … … 895 898 fi 896 899 900
Note: See TracChangeset
for help on using the changeset viewer.