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