[4615] | 1 | #!/bin/bash |
---|
| 2 | |
---|
[5415] | 3 | set -eu |
---|
[5539] | 4 | . lmdz_env.sh |
---|
[5415] | 5 | |
---|
[4615] | 6 | ##################################################################### |
---|
| 7 | # Authors : |
---|
| 8 | # F. Hourdin, frederic.hourdin@lmd.ipsl.fr |
---|
| 9 | # Modified A. Sima, adriana.sima@lmd.ipsl.fr |
---|
[5415] | 10 | # Rewritten 2024 A. Barral |
---|
[4615] | 11 | # |
---|
[5415] | 12 | # This is the main user script of LMDZ_Setup. It defines basic options for the simulations, and runs setup.sh. |
---|
| 13 | # Settings such as model and simulation paths are set in lmdz_env.sh. You must modify it to set the current LMDZ_Setup path as <root_dir>. |
---|
| 14 | # Expert options are set directly in setup.sh via <define_expert_options>. |
---|
[4615] | 15 | # |
---|
| 16 | ##################################################################### |
---|
| 17 | |
---|
| 18 | #=========================================================== |
---|
| 19 | # 1. Model setup |
---|
| 20 | #=========================================================== |
---|
| 21 | |
---|
| 22 | # Version of the tar file on https://lmdz.lmd.jussieu.fr/pub/src |
---|
[5415] | 23 | # Last "testing" version, thoroughly checked by the LMDZ team : contains LMDZ rev 4729 (2023-10-22) |
---|
[5535] | 24 | version="20250210.trunk -unstable" # Last unstable version tested |
---|
| 25 | version="20241018.trunk" # Preferencially use a "testing" version available |
---|
| 26 | # on https://lmdz.lmd.jussieu.fr/pub/src_archives/testing/ |
---|
| 27 | |
---|
[5432] | 28 | svn="" |
---|
[5415] | 29 | # CONTACT LMDZ Team : |
---|
| 30 | # email: poihl@listes.lmd.ipsl.fr |
---|
| 31 | # Mattermost: https://mattermost.lmd.ipsl.fr/lmdz/channels/installation-et-tutoriels |
---|
[4615] | 32 | |
---|
| 33 | # Grid number of points IMxJMxLM |
---|
[5415] | 34 | resol="144x142x79" |
---|
[4615] | 35 | |
---|
[5415] | 36 | ## Using XIOS for IOs: "-xios" (enabled) / "" (disabled) |
---|
[4615] | 37 | xios="" |
---|
| 38 | |
---|
[5415] | 39 | # Using or not the Cosp simulator: "-cosp" (enabled) / "" (disabled) |
---|
[4615] | 40 | cosp="" |
---|
| 41 | |
---|
[5415] | 42 | # Choice of physics: "lmd" (phylmd) / "new" (phynew) / "lmdiso" (isotopes) |
---|
[4615] | 43 | lmd_phys="lmd" |
---|
| 44 | |
---|
| 45 | #=========================================================== |
---|
| 46 | # 2. Simulation setup |
---|
| 47 | #=========================================================== |
---|
| 48 | |
---|
| 49 | # Initial state and Boundary conditions |
---|
[5415] | 50 | # init= 1: to create a new start in INIT |
---|
[4615] | 51 | # 0: to read start files in INIT |
---|
[5415] | 52 | # SIM: to read start files from previous simulation SIM0, /!\ SIM0 must be in the same folder as the new SIM |
---|
| 53 | # (limit.nc and aerosols forcing are put in ./LIMIT) |
---|
[4615] | 54 | init=1 |
---|
| 55 | |
---|
[5415] | 56 | # climato=1 : Climatological SSTs with 360-day calendar |
---|
[4615] | 57 | # =0 : interannual SSTs with true (ie gregorian) calendar |
---|
| 58 | climato=1 |
---|
| 59 | |
---|
| 60 | # Nudging: Can only be activated with climato=0 and freq=mo |
---|
[5415] | 61 | # "-nudging" (enabled) / "" (disabled) |
---|
[4615] | 62 | nudging="" |
---|
| 63 | #If using nudging, then check DEF/guide.def : |
---|
| 64 | # - ok_guide will be automatically set to "y" by setup.sh |
---|
| 65 | # - You may want to check/customize the nudging parameters |
---|
| 66 | |
---|
| 67 | # Length of elementary simulations yr (year) or mo (month) |
---|
[5415] | 68 | freq="yr" |
---|
[4615] | 69 | |
---|
| 70 | # Initial/final month for simulation |
---|
| 71 | # If $init=1, the INIT file will be called start.200001.nc, |
---|
| 72 | # but the data correspond in fact to another day. |
---|
| 73 | # NB : the run stops in the BEGINNING of mthend (test "next=stopsim") |
---|
| 74 | mthini=200001 |
---|
| 75 | mthend=200501 |
---|
| 76 | |
---|
[5428] | 77 | # Expert options passed to setup.sh |
---|
[5539] | 78 | rad=rrtm # Radiation oldrad/rrtm/ecrad |
---|
| 79 | netcdf=0 # netcddf 0(from system)/1 reinstall/dir. containing nectdf* |
---|
| 80 | aerosols=clim # n (no) / clim |
---|
| 81 | veget=CMIP6 # Orchidee version : CMIP6 / 7983 (orch2.2 ) / more recent svn |
---|
| 82 | save_pub=$LMDZD # Will save files downloaded by wget on $LMDZD (could be 0 or 1) |
---|
[5428] | 83 | |
---|
[5465] | 84 | # For rapid tests |
---|
| 85 | # resol=32x32x39 ; veget=none ; aerosols=n ; rad=oldrad ; freq=mo ; mthend=200101 |
---|
[5428] | 86 | |
---|
[4615] | 87 | #----------------------------------------------------------- |
---|
| 88 | # Output files, frequencies, levels |
---|
| 89 | # If you use IOIPSL (option xios=""), you may want to choose and customize DEF/config.def. |
---|
[5415] | 90 | # A few versions are available as DEF/config.def_*; config.def is a copy of config.def_default |
---|
[4615] | 91 | # See phys_out_filekeys, phys_out_filelevels, phys_out_filetimesteps, and supplementary variables |
---|
| 92 | # If you use XIOS (option xios="-xios"), check/modify DEF/XMLfiles*/file*xml |
---|
| 93 | # In both cases, the default output is "histday". |
---|
| 94 | #----------------------------------------------------------- |
---|
| 95 | # Grid characteristics (regular, zoomed) |
---|
| 96 | # You may want to choose and customize DEF/gcm.def |
---|
[5415] | 97 | # A few versions are available as DEF/gcm.def_*; |
---|
[4615] | 98 | # The default, for regular grid 144x142x79, corresponds to _iperiod7 |
---|
| 99 | # (Expert : TEMPORARILY : setup.sh forces use of gcm.def_zNAfrica_BiJe for aerosols=spla) |
---|
| 100 | |
---|
| 101 | #=========================================================== |
---|
| 102 | # 3. Example of calling setup.sh in loop |
---|
| 103 | #=========================================================== |
---|
| 104 | |
---|
| 105 | # By default, the series is done on one or more of the various versions of physiq.def |
---|
| 106 | # to be chosen among DEF/PHYS/physiq.def_* , and listed in "physics" : |
---|
| 107 | # NOTE : automatically choosing DEF/PHYS/physiq.def_NPiso for isotopes |
---|
| 108 | physics="NPv6.3" |
---|
[5415] | 109 | if [[ $lmd_phys = "lmdiso" ]]; then physics="NPiso"; fi |
---|
[4615] | 110 | |
---|
[5415] | 111 | if [[ $(echo "$physics" |wc -w) -gt 1 && $init = 1 ]]; then echo "!=!=! TO LOOP OVER MULTIPLE physics [$physics], YOU NEED init =/= 1 AND start* + limit* files ALREADY AVAILABLE IN THIS FOLDER !=!=!"; exit 1; fi |
---|
| 112 | |
---|
| 113 | for phys in $physics; do |
---|
| 114 | deffile="DEF/PHYS/physiq.def_$phys" |
---|
| 115 | if [[ -f $deffile ]]; then |
---|
[4615] | 116 | cp -p $deffile DEF/physiq.def |
---|
| 117 | |
---|
| 118 | # name of simulation : can be changed to user's convenience |
---|
[5415] | 119 | # (Default: name=$phys to loop on different physics) |
---|
| 120 | name="$phys" |
---|
[4615] | 121 | |
---|
| 122 | # launching setup.sh with the options defined in this main.sh. |
---|
[5415] | 123 | # Remember: some other options are only available in lmdz_env.sh and setup.sh. |
---|
| 124 | # shellcheck disable=SC2086 |
---|
[5539] | 125 | ./setup.sh -v "$version" -d "$resol" -mthini "$mthini" -mthend "$mthend" -init "$init" -climato "$climato" -f "$freq" -p "$lmd_phys" -name "$name" $cosp $xios $nudging -r "$svn" -rad $rad -netcdf $netcdf -aerosols $aerosols -veget $veget -save_pub $save_pub |
---|
[5415] | 126 | else |
---|
| 127 | echo "File $deffile inexistent"; exit 1 |
---|
| 128 | fi |
---|
[4615] | 129 | done |
---|
| 130 | |
---|