Changeset 4991 for BOL/LMDZ_Setup_amaury/setup.sh
- Timestamp:
- Jun 20, 2024, 7:22:04 PM (2 weeks ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
BOL/LMDZ_Setup_amaury/setup.sh
r4986 r4991 8 8 #################################################################### 9 9 function define_expert_options { 10 #NOTE : $optim is part of $LMDZname (see definition of LMDZname below), 11 # so that running with "-debug" needs to (re)install the model (install=-install in main.sh) 12 # If you have already installed the model, and only want to recompile the gcm in debug mode, 13 # add "-debug" to the compilation options in the compile.sh script created in the present folder, and run it (./compile.sh gcm) 14 # ALTERNATIVELY : you can remove $optim in the definition of "LMDZname" below 15 #optim="" 16 optim="-debug" # TODO temp 17 18 #NOTE : "testmode=y" is for running in test mode : 19 # the simulation job "tmp_$SIM" (created on $SCRATCHDIR) is automatically changed for a short run, 20 # and submitted to the Jean-Zay "test" queue : 21 # a/ time=00:10:00 (run time limit = 10 min; for test queue, it must be 30 min maximum) 22 # b/ nday=1 (this line, forcing nday to 1 day, is "hidden" in script_SIMU, by default it is commented out) 23 # c/ #SBATCH --qos=qos_cpu-dev (this line is in script_SIMU, by default it is commented out) 24 #If you want to change "time", or "nday", but still run in "test" mode, modify the "if [ $debug = 1 ]...; fi" further below. 25 testmode="y" # TODO revert 26 27 # Radiative code : "oldrad" or "rrtm" or "ecrad" 10 # optim: either "" or "-debug" to compile in debug mode (slower but better diagnosis of segfaults) 11 optim="" 12 13 # "n" or "y". If testmode="y", then simulations run for a single day per period. 14 # NOTE: you must set mthend accordingly ! 15 testmode="n" 16 17 # Radiative code: "oldrad" / "rrtm" / "ecrad" 28 18 rad="rrtm" 29 19 30 # AEROSOLS : n (=no) / clim (=average 1995-2014) / spla (interactive dust and sea salt) 20 # !!! STRONG recommendation : experiments with DIFFERENT Orchidee or aerosol options should be performed in DIFFERENT LMDZ_Setup folders 21 # !!! (especially as they may need different initial files) 22 23 # AEROSOLS : "n" (=no) / "clim" (=average 1995-2014) / "spla" (interactive dust and sea salt) 31 24 # (WARNING : if you first run the scripts with aerosols=n, then you want to change to =clim , 32 25 # you'll need to remove the INIT and LIMIT folders that have been created, then run main.sh with init=1 33 26 # in order to re-run the initialisation job, which downloads the aerosol files and interpolates them) 34 27 aerosols="clim" 35 aerosols="n" # TODO revert when we fix/investigate the aerosols issue28 aerosols="n" # TODO TEMP 36 29 37 30 # SURFACE/VEGETATION SCHEME 38 # It is controlled by the single variable "veget" which can have the following values 39 # - "none": bucket scheme 40 # - "CMIP6" or "orch2.0": orchidee version used in CMIP exercise, rev 5661 41 # - "orch2.2": orchidee version used in IPSLCM7 configuration 42 # - number: orchidee version number : only rev 7983 on branch _2_2, and 7994 on trunk, are available 31 # - "none" (bucket scheme) / "CMIP6" or "orch2.0" (orchidee version used in CMIP exercise) / "orch2.2" (orchidee version used in IPSLCM7 configuration) / number (orchidee version number - only rev 7983 on branch _2_2, and 7994 on trunk, are available) 32 # TODO check w/ Adriana why only 7983 & 7994, see if still relevant - is it a compilation issue ? Or an INIT issue ? 43 33 veget="CMIP6" 44 45 #AS : If you have installed the model with a given "veget" option, and you want to change it : 46 # --> RECOMMENDED : re-install the model from scratch in a new TEST_PROD folder 47 # TODO Amaury: check w/ Adriana what the use case is for lmdz_setup here 48 # --> EXPERT : If you want to keep your previous installation, and not go through the install_lmdz.sh routine, 49 # you will need to (a) install the proper version of ORCHIDEE in the modipsl/modeles directory, and 50 # (b) set the "veget" options (opt_veget, orchidee_rev, suforch) to their proper values 51 # in the file $LMDZD/modipsl/modeles/surface_env 52 # (NB : no need to initialise these vars here: 53 # surface_env is either (re)created when (re)installing the model (run with install=-install), 54 # or it already exists (install=""). 55 56 # New snow scheme INLANDSIS (y/n) 57 # (this flag activates INLANDSIS compilation; 58 # not yet done : treatment of specific restart and def file) 34 # veget="6592" # TODO correct bug in install_lmdz where we don't know which fcm arg to fwd if we only give the rev... see w/ Laurent (choice in ols install_lmdz: only support >2.0) 35 36 # New snow scheme INLANDSIS! "y" / "n" 37 # This flag activates INLANDSIS compilation; not yet done : treatment of specific restart and def file 59 38 inlandsis="n" 39 40 # netcdf: 0 (use existing library) / 1 (recompile netcdf, slow) 41 netcdf=0 60 42 61 43 # --->>> ALSO PAY ATTENTION TO OUTPUT files, frequency, level ------------- … … 66 48 # For aerosols=n, the corresponding flags will automatically be set to "n". 67 49 # With XIOS : adjust DEF/XMLfiles*/file*xml 68 69 netcdf=070 50 } 71 51 72 52 # /!\ DO NOT EDIT BELOW UNLESS YOU KNOW WHAT YOU ARE DOING /!\ 73 53 74 function enable_ groupe{ # In job scripts, sed platform-specific headers54 function enable_platform { # In job scripts, sed platform-specific headers 75 55 local file="$1" 76 56 local platform … … 205 185 fi 206 186 207 if [[ $climato = 0 && $freq = yr]]; then187 if [[ $climato = 0 && $freq = "yr" ]]; then 208 188 echo "STOP: Running simulations with interannual SSTs is possible only month by month and a true calendar." 209 189 echo "Change <climato> to <1> or <freq> to <mo> or modify setup.sh (experts)"; exit 1 … … 397 377 cp reb.sh "$local/$SIM/reb.sh"; chmod +x "$local/$SIM/reb.sh" 398 378 sed -i'' -e "s:^rebuild=.*.$:rebuild=$LMDZD/$LMDZname/modipsl/bin/rebuild:" "$local/$SIM/reb.sh" 399 enable_ groupe"$local/$SIM/reb.sh"379 enable_platform "$local/$SIM/reb.sh" 400 380 401 381 # Copy .def … … 454 434 "$local/script_SIMU" >| "$SIMRUNDIR/tmp_$SIM" 455 435 456 enable_ groupe"$SIMRUNDIR/tmp_$SIM"436 enable_platform "$SIMRUNDIR/tmp_$SIM" 457 437 458 438 if [[ $testmode = "y" ]]; then … … 539 519 done 540 520 cd - > /dev/null 521 522 if [[ $rad = "ecrad" && ! -d ecrad_data ]]; then 523 cd "$local"; wget https://lmdz.lmd.jussieu.fr/pub/3DInputData/ecrad/ecrad_data.tar; tar xvf ecrad_data.tar; cd - > /dev/null 524 fi 541 525 } 542 526 … … 648 632 sed -e 's/anneeref=.*.$/anneeref='\$yr'/' DEF/run.def >| run.def 649 633 echo Starting initialisation 650 $RUNCMD 1 $ce0l634 OMP_NUM_THREADS=1 $RUNCMD 1 $ce0l # ce0l requires MPI=OMP=1 651 635 if [ $climato = 0 ]; then mv limit.nc limit.\$yr.nc; fi 652 636 done … … 672 656 673 657 # Copy initial and forcing files in $local/$INIT and $local/$LIMIT; also in $local/INPUT_SPLA if $aerosols=spla 674 for f in sta* limit.nc gri*nc; do cp \$f $local/$INIT/\$f; done 658 for f in sta* gri*nc; do cp \$f $local/$INIT/\$f; done 659 if [[ $climato = 1 ]]; then cp limit.nc $local/$INIT/limit.nc; fi 675 660 mkdir -p $local/$LIMIT 676 661 for f in limit*.nc ; do cp \$f $local/$LIMIT/\$f; done … … 691 676 # ANCIEN MULTI STEP esac 692 677 ...eod 693 enable_ groupetmp678 enable_platform tmp 694 679 echo "###############################################################################" 695 680 echo "Submitting initialisation job <$SUBMITCMD tmp> from $(pwd)" … … 705 690 $SUBMITCMD "tmp_$SIM" 706 691 echo '###############################################################################' 692 fi 693 } 694 695 function message_post_submit { 696 if [[ $ok_guide = "y" && $init = 1 ]]; then 697 echo "Once initialisation is finished, you have to create nudging files" 698 echo "Edit era2gcm.sh and set the desired parameters in section <User choices>" 699 echo "Make sure you have acces to the chosen ERA files, and the required modules are loaded, then run : ./era2gcm.sh" 700 if [[ $aerosols = "spla" ]]; then 701 echo "Your aerosol choice is <spla>, so you need ERA 10m-winds interpolated on LMDZ grid. Use script era2gcm_uv10m.sh" 702 fi 703 else 704 echo "Si tout se passe bien, vous avez initialisé et lancé automatiquement la simulation." 705 echo "Le job qui a été lancé se trouve sur $SIMRUNTOPDIR/$MAINDIR/tmp_$SIM" 707 706 fi 708 707 } … … 724 723 fetch_simu_init_files 725 724 run_sim_or_init 725 message_post_submit 726 726 727 727 exit 1 … … 730 730 # COMPILATION OPTIONS depending on the user choices and LMDZ revision number $mysvn 731 731 #------------------------------------------------------- 732 if [[ $rad = "ecrad" && ! -d ecrad_data ]]; then733 cd "$local"; wget https://lmdz.lmd.jussieu.fr/pub/3DInputData/ecrad/ecrad_data.tar; tar xvf ecrad_data.tar; cd - > /dev/null734 fi735 732 736 733 if [[ $rad = "ecrad" && $aerosols != "n" && $mysvn -lt 4489 ]] ; then echo "Les aerosols tropospheriques ne sont pas pris en charge par ecrad avant LMDZ rev 4489, ici rev est $mysvn"; exit 1; fi … … 760 757 761 758 762 if [ $ok_guide = y -a $init = 1 ]; then 763 echo Once initialisation is finished, you have to create nudging files 764 echo Edit era2gcm.sh and set the desired parameters in section "User choices" 765 echo Make sure you have acces to the chosen ERA files, and the required modules are load 766 echo Then run : ./era2gcm.sh 767 if [ "$aerosols" = "spla" ]; then 768 echo Your aerosol choice is "spla", so you need ERA 10m-winds interpolated on LMDZ grid 769 echo Use script era2gcm_uv10m.sh 770 fi 771 else 772 echo Si tout se passe bien, vous avez initialise et lance automatiquement 773 echo la simulation. 774 echo Si vous voulez modifier les caracteristiques du job, comme le temps 775 echo max ou le nombre de proc, il se trouve sur 776 echo $SIMRUNTOPDIR/$MAINDIR/tmp_$SIM 777 fi 759 778 760 779 761 ###############################################################################
Note: See TracChangeset
for help on using the changeset viewer.