Changeset 5438 for BOL/LMDZ_Setup/setup.sh
- Timestamp:
- Dec 20, 2024, 5:26:29 PM (36 hours ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
BOL/LMDZ_Setup/setup.sh
r5432 r5438 4 4 5 5 set -eu 6 set -vx 7 8 # EXPERT-LEVEL CHOICES, only available in setup.sh, not in main.sh : 9 #################################################################### 10 function define_expert_options() { 11 # optim: either "" or "-debug" to compile in debug mode (slower but better diagnosis of segfaults) 6 7 #--------------------------------------------------------------------------- 8 function define_expert_options() { # Expert-level choices 9 #--------------------------------------------------------------------------- 10 11 # optim: either "" or "-debug" to compile in debug mode 12 # (slower but better diagnosis of segfaults) 12 13 optim="" 13 14 14 # "n" or "y". If testmode="y", then simulations run for a single day per period. 15 # "n" or "y". If testmode="y", then simulations run for a single day 16 # per period. 15 17 # NOTE: you must set mthend accordingly ! 16 18 testmode="n" … … 19 21 rad="rrtm" 20 22 21 # !!! STRONG recommendation : experiments with DIFFERENT Orchidee or aerosol options should be performed in DIFFERENT LMDZ_Setup folders 23 # !!! STRONG recommendation : experiments with DIFFERENT Orchidee or 24 # aerosol options should be performed in DIFFERENT LMDZ_Setup folders 22 25 # !!! (especially as they may need different initial files) 23 26 24 # AEROSOLS : "n" (=no) / "clim" (=average 1995-2014) / "spla" (interactive dust and sea salt) 25 # (WARNING : if you first run the scripts with aerosols=n, then you want to change to =clim , 26 # you'll need to remove the INIT and LIMIT folders that have been created, then run main.sh with init=1 27 # in order to re-run the initialisation job, which downloads the aerosol files and interpolates them) 27 # AEROSOLS : "n" (=no)/"clim" (=average 1995-2014) / "spla" (interactive) 28 # (WARNING : if you first run the scripts with aerosols=n, then you want 29 # to change to =clim, you must remove the INIT and LIMIT folders and 30 # rerun main.sh with init=1 in order to create aerosol files 31 28 32 aerosols="clim" 29 33 30 34 # SURFACE/VEGETATION SCHEME 31 # - "none" (bucket scheme) / "CMIP6" (orchidee version used in CMIP exercise) / "7983" (orch2.2) / "7994" (trunk) 32 # If you need other orch versions, and also require XIOS, you'll need to create the appropriate files in DEF/XMLfilesOR... 35 # - "none" : bucket scheme 36 # CMIP6 : orchidee CMIP6 version 37 # 7983/7994 : orchidee svn release 7983 (orch2.2) and 7994 (last tested) 38 # If you need other orch versions, and also require XIOS, you'll need 39 # to create the appropriate files in DEF/XMLfilesOR... 33 40 veget="CMIP6" 34 41 35 42 # New snow scheme INLANDSIS! "y" / "n" 36 # This flag activates INLANDSIS compilation; not yet done : treatment of specific restart and def file 43 # Activates INLANDSIS compilation 44 # to be done : treatment of specific restart and def file 37 45 inlandsis="n" 38 46 … … 40 48 netcdf=0 41 49 42 # --->>> ALSO PAY ATTENTION TO OUTPUT files, frequency, level ------------ -43 # With IOIPSL : Choose your config.def among theversions available in DEF,50 # --->>> ALSO PAY ATTENTION TO OUTPUT files, frequency, level ------------ 51 # With IOIPSL : Choose your config.def among versions available in DEF, 44 52 # copy it as config.def (the copy is done automatically for "iso"), 45 53 # edit it and set up output files, frequencies and levels. 46 # NB : For aerosols=spla, output level minimum 4 is required to output the specific variables. 47 # For aerosols=n, the corresponding flags will automatically be set to "n". 54 # NB : For aerosols=spla, output level minimum 4 is required to outpu 55 # the specific variables. 56 # For aerosols=n, aerosol flags will automatically be set to "n". 48 57 # With XIOS : adjust DEF/XMLfiles*/file*xml 49 58 } 50 59 51 # /!\ DO NOT EDIT BELOW UNLESS YOU KNOW WHAT YOU ARE DOING /!\ 52 53 54 function enable_platform() { # In job scripts, sed platform-specific headers 60 61 #--------------------------------------------------------------------------- 62 function enable_platform() { # Sed platform-specific headers 63 #--------------------------------------------------------------------------- 55 64 local file="$1" 56 65 local platform … … 66 75 } 67 76 68 function load_install_lib() { 69 # Fetch and source install_lmdz.sh to get `myget` 77 #--------------------------------------------------------------------------- 78 function load_install_lib() { #Fetch and source install_lmdz.sh to get myget 79 #--------------------------------------------------------------------------- 70 80 if [[ ! -f "install_lmdz.sh" ]]; then 71 81 wget --no-cache "http://svn.lmd.jussieu.fr/LMDZ/BOL/script_install/install_lmdz.sh" … … 76 86 } 77 87 78 function set_default_params() { 79 # Default value of script parameters 88 #--------------------------------------------------------------------------- 89 function set_default_params() { # Default value of script parameters 90 #--------------------------------------------------------------------------- 91 80 92 SIM=$(basename "$local")CTL # name 81 93 phylmd="lmd" #option -p $phylmd for makelmdz … … 104 116 } 105 117 118 #--------------------------------------------------------------------------- 106 119 function read_cmdline_args() { 120 #--------------------------------------------------------------------------- 107 121 while (($# > 0)); do 108 122 case $1 in … … 181 195 # Choix du nombre de processeurs 182 196 # NOTES : 183 # omp=8 by default (for Jean-Zay must be a divisor of 40 procs/node) , but we need184 # omp=1 for SPLA (only MPI parallelisation)185 # 197 # omp=8 by default (for Jean-Zay must be a divisor of 40 procs/node) 198 # omp=1 : required for SPLA (omp parallelism not ready) 199 # omp=2 for veget=CMIP6+XIOS beacause of a bug in ORCHIDEE/src_xml/xios_orchidee.f90 186 200 ###################################################################### 187 201 (( mpi = ( jm + 1 ) / 2 )) … … 204 218 } 205 219 220 #--------------------------------------------------------------------------- 206 221 function ensure_correct_option_combinations() { 207 222 # AVOID COMBINATIONS OF OPTIONS THAT DON'T WORK in user choices 223 #--------------------------------------------------------------------------- 208 224 if [[ $ok_guide = y && $climato = 1 ]]; then 209 225 echo "STOP: Running nudged simulations with climatological SSTs is not planned. Change <climato> to <0> or modify the setup (experts)"; exit 1 … … 218 234 # (Temporary) Constraints for aerosols=spla : 219 235 # --> resolution 128x88x79 and rad=rrtm 220 if [[ $aerosols = "spla" && ${im}x${jm} != "128x88" ]]; then 221 echo 'STOP: For now, <aerosols=spla> requires <resol=128x88x79>, and uses the zoomed grid from gcm.def_zNAfrica_BiJe, for which forcing & initial files are available' 236 if [[ $aerosols = "spla" && ( ${im}x${jm} != "128x88" || $freq != mo ) ]]; then 237 echo 'STOP: For now, <aerosols=spla> requires <resol=128x88x79>,' 238 echo 'and uses the zoomed grid from gcm.def_zNAfrica_BiJe,' 239 echo 'for which forcing & initial files are available' 222 240 echo "Right now resol=<$resol>" 241 echo 'Should be run in monthly mode' 223 242 exit 1 224 243 fi … … 229 248 } 230 249 250 #--------------------------------------------------------------------------- 231 251 function install_model() { 252 #--------------------------------------------------------------------------- 232 253 mkdir -p "$LMDZD" 233 254 … … 265 286 } 266 287 267 function setup_def() { # modify various .def in ./DEF (+ xios xml as needed) 288 #--------------------------------------------------------------------------- 289 function setup_def() { # modify various .def in ./DEF (+ xios xml ) 290 #--------------------------------------------------------------------------- 268 291 cd "$local" 269 292 … … 304 327 # TEMPORAIREMENT pour spla on force l'utilisation de gcm.def_zNAfrica_BiJe (avec resolution 128x88x79) 305 328 #---------------------------------------------------------------------- 306 if [[ $aerosols = "spla" ]]; then cp DEF/gcm.def_zNAfrica_BiJe DEF/gcm.def; fi 329 if [[ $aerosols = "spla" ]]; then 330 cp DEF/gcm.def_zNAfrica_BiJe DEF/gcm.def; fi 307 331 308 332 # Inscription du choix ok_guide dans DEF/guide.def … … 323 347 sed -i'' -e 's/VEGET=.*.$/VEGET='$VEGET'/' DEF/config.def 324 348 325 if [[ $aerosols = "n" ]]; then 326 # set flag_aerosols=0 and flags ok_ade&co=n 327 sed -i'' -e 's/^ok_cdnc=.*.$/ok_cdnc=n/' -e 's/^ok_ade=.*.$/ok_ade=n/' -e 's/^ok_aie=.*.$/ok_aie=n/' -e 's/^ok_alw=.*.$/ok_alw=n/' -e 's/^flag_aerosol=.*.$/flag_aerosol=0/' DEF/config.def 328 fi 349 ok_cdnc=y ; ok_ade=y ; ok_aie=y ; ok_alw=y 350 case $aerosols in 351 clim) flag_aerosol=6 ;; 352 spla) flag_aerosol=1 ;; 353 n) flag_aerosol=0 ; ok_cdnc=n ; ok_ade=n ; ok_aie=n ; ok_alw=n ;; 354 *) echo Option aerosols=$aerosols not available ; exit 1 355 esac 356 sed -i'' -e 's/^ok_cdnc=.*.$/ok_cdnc='$ok_cdnc'/' \ 357 -e 's/^ok_ade=.*.$/ok_ade='$ok_ade'/' \ 358 -e 's/^ok_aie=.*.$/ok_aie='$ok_aie'/' \ 359 -e 's/^ok_alw=.*.$/ok_alw='$ok_alw'/' \ 360 -e 's/^flag_aerosol=.*.$/flag_aerosol='$flag_aerosol'/' DEF/config.def 361 pwd 329 362 330 363 # COSP : ok_cosp desactive COSP si on a compile avec; il ne l'active pas si on a compile sans … … 374 407 } 375 408 409 #--------------------------------------------------------------------------- 376 410 function setup_ce0l() { # Verification de l'existance de l'état initial, compilation eventuelle pour sa creation 411 #--------------------------------------------------------------------------- 377 412 if [[ ! -d $INIT ]]; then 378 413 if [[ $init = 0 ]]; then … … 394 429 } 395 430 431 #--------------------------------------------------------------------------- 396 432 function setup_simu() { 433 #--------------------------------------------------------------------------- 397 434 #SIMRUNTOPDIR="$SIMRUNBASEDIR/$(basename "$local")" 398 435 SIMRUNTOPDIR="$SIMRUNBASEDIR" … … 488 525 489 526 # Files for aerosols and chemistry 490 if [[ $aerosols = "clim" ]]; then get_input_files wget_pub AerChem ; fi 527 if [[ $aerosols = "clim" ]]; then 528 get_input_files wget_pub AerChem ; fi 491 529 492 530 # Files for SPLA 493 if [[ $aerosols = "spla" ]]; then get_input_files wget_pub SPLA_WA/emissions ; fi 531 if [[ $aerosols = "spla" ]]; then 532 get_input_files wget_pub SPLA_WA/emissions 533 for mo_ in $( seq $mthini $mthend ) ; do 534 for var in u10m v10m u v ; do 535 yr__=$( echo $mo_ | cut -c 1-4 ) 536 mo__=$( echo $mo_ | cut -c 5-6 ) 537 echo wget_pub 3DInputData/SPLA_WA/ERA5/$yr__/$mo__ $var.nc 538 wget_pub 3DInputData/SPLA_WA/ERA5/$yr__/$mo__ $var.nc 539 done 540 done 541 fi 494 542 } 495 543 … … 639 687 ...eod 640 688 enable_platform tmp 641 echo "################################################################# ##############"689 echo "#################################################################" 642 690 #echo "Submitting initialisation job <$SUBMITCMD tmp> from $(pwd)" 643 691 echo "Submitting initialisation job <submitcmd tmp> from $(pwd)" … … 645 693 #$SUBMITCMD tmp 646 694 submitcmd tmp 647 echo "################################################################# ##############"695 echo "#################################################################" 648 696 649 697 else #case [ $init != 1 ] 650 698 cd "$SIMRUNDIR" 651 echo "################################################################ ###############"699 echo "################################################################" 652 700 echo "Submitting job tmp_$SIM" 653 701 #echo "$SUBMITCMD tmp_$SIM" … … 655 703 echo "submitcmd tmp_$SIM" 656 704 submitcmd "tmp_$SIM" 657 echo '###############################################################################' 658 fi 659 } 660 705 echo '################################################################' 706 fi 707 } 708 709 #--------------------------------------------------------------------------- 661 710 function message_post_submit() { 711 #--------------------------------------------------------------------------- 662 712 if [[ $ok_guide = "y" && $init = 1 ]]; then 663 713 cd "$local" … … 675 725 } 676 726 727 #--------------------------------------------------------------------------- 677 728 function setup_and_load_lmdz_env() { 729 #--------------------------------------------------------------------------- 678 730 if [[ ! -f .lmdz_setup_root_dir ]]; then echo "STOP: setup.sh is not located in the root dir ??!!"; exit 1; fi 679 731 # sed root_dir in lmdz_env.sh
Note: See TracChangeset
for help on using the changeset viewer.