source: BOL/LMDZ_Setup/main.sh @ 5575

Last change on this file since 5575 was 5564, checked in by Laurent Fairhead, 11 months ago

Changed the revision used for recent ORCHIDEE version so that it corresponds to r8758 which is the one
used in the IPSLCM7_work configuration (as of february 2025). Also got rid of the deletion of the sechiba_history files
as they got erased before they were rebuilt in the case of IOIPSL outputs.

File size: 5.5 KB
Line 
1#!/bin/bash
2
3set -eu
4. lmdz_env.sh
5
6#####################################################################
7# Authors :
8# F. Hourdin, frederic.hourdin@lmd.ipsl.fr
9# Modified A. Sima, adriana.sima@lmd.ipsl.fr
10# Rewritten 2024 A. Barral
11#
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>.
15#
16#####################################################################
17
18#===========================================================
19# 1. Model setup
20#===========================================================
21
22# Version of the tar file on https://lmdz.lmd.jussieu.fr/pub/src
23# Last "testing" version, thoroughly checked by the LMDZ team : contains LMDZ rev 4729 (2023-10-22)
24version="20250210.trunk -unstable" # Last unstable version tested
25version="20241018.trunk"           # Preferencially use a "testing" version available
26                                   # on https://lmdz.lmd.jussieu.fr/pub/src_archives/testing/
27
28svn="" 
29# CONTACT LMDZ Team :
30#       email: poihl@listes.lmd.ipsl.fr
31#       Mattermost: https://mattermost.lmd.ipsl.fr/lmdz/channels/installation-et-tutoriels
32
33# Grid number of points IMxJMxLM
34resol="144x142x79"
35
36## Using XIOS for IOs: "-xios" (enabled) / "" (disabled)
37xios=""
38
39# Using or not the Cosp simulator: "-cosp" (enabled) / "" (disabled)
40cosp=""
41
42# Choice of physics: "lmd" (phylmd) / "new" (phynew) / "lmdiso" (isotopes)
43lmd_phys="lmd"
44
45#===========================================================
46# 2. Simulation setup
47#===========================================================
48
49# Initial state and Boundary conditions
50# init=   1: to create a new start in INIT
51#         0: to read start files in INIT
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)
54init=1
55
56# climato=1 : Climatological SSTs with 360-day calendar
57#        =0 : interannual SSTs with true (ie gregorian) calendar
58climato=1
59
60# Nudging: Can only be activated with climato=0 and freq=mo
61# "-nudging" (enabled) / "" (disabled)
62nudging=""
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)
68freq="yr"
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")
74mthini=200001
75mthend=200501
76
77# Expert options passed to setup.sh
78rad=rrtm        # Radiation oldrad/rrtm/ecrad
79netcdf=0        # netcddf 0(from system)/1 reinstall/dir. containing nectdf*
80aerosols=clim   # n (no) / clim
81veget=CMIP6     # Orchidee version : CMIP6 / 7983 (orch2.2 ) / 8758 (orch4)
82save_pub=$LMDZD # Will save files downloaded by wget on $LMDZD (could be 0 or 1)
83
84# For rapid tests
85# resol=32x32x39 ; veget=none ; aerosols=n ; rad=oldrad ; freq=mo ; mthend=200101
86
87#-----------------------------------------------------------
88# Output files, frequencies, levels
89#   If you use IOIPSL (option xios=""), you may want to choose and customize DEF/config.def.
90#     A few versions are available as DEF/config.def_*; config.def is a copy of config.def_default
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
97#   A few versions are available as DEF/gcm.def_*;
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
108physics="NPv6.3"
109if [[ $lmd_phys = "lmdiso" ]]; then physics="NPiso"; fi
110
111if [[ $(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
113for phys in $physics; do
114  deffile="DEF/PHYS/physiq.def_$phys"
115  if [[ -f $deffile ]]; then
116     cp -p $deffile DEF/physiq.def
117
118    # name of simulation : can be changed to user's convenience
119    # (Default: name=$phys to loop on different physics)
120    name="$phys"
121
122    # launching setup.sh with the options defined in this main.sh.
123    # Remember: some other options are only available in lmdz_env.sh and setup.sh.
124    # shellcheck disable=SC2086
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
126  else
127    echo "File $deffile inexistent"; exit 1
128  fi
129done
130
Note: See TracBrowser for help on using the repository browser.