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