source: BOL/LMDZ_Setup/main.sh @ 5875

Last change on this file since 5875 was 5850, checked in by fhourdin, 7 weeks ago

Improved era2gcm.sh

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