source: BOL/LMDZ_Setup/main.sh @ 5434

Last change on this file since 5434 was 5432, checked in by fhourdin, 41 hours ago

Minor improvements

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