source: BOL/LMDZ_Setup/main.sh @ 5537

Last change on this file since 5537 was 5535, checked in by fhourdin, 43 hours ago

Details on LMDZ_Setup

File size: 5.4 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="20250210.trunk -unstable" # Last unstable version tested
24version="20241018.trunk"           # Preferencially use a "testing" version available
25                                   # on https://lmdz.lmd.jussieu.fr/pub/src_archives/testing/
26
27svn="" 
28# CONTACT LMDZ Team :
29#       email: poihl@listes.lmd.ipsl.fr
30#       Mattermost: https://mattermost.lmd.ipsl.fr/lmdz/channels/installation-et-tutoriels
31
32# Grid number of points IMxJMxLM
33resol="144x142x79"
34
35## Using XIOS for IOs: "-xios" (enabled) / "" (disabled)
36xios=""
37
38# Using or not the Cosp simulator: "-cosp" (enabled) / "" (disabled)
39cosp=""
40
41# Choice of physics: "lmd" (phylmd) / "new" (phynew) / "lmdiso" (isotopes)
42lmd_phys="lmd"
43
44#===========================================================
45# 2. Simulation setup
46#===========================================================
47
48# Initial state and Boundary conditions
49# init=   1: to create a new start in INIT
50#         0: to read start files in INIT
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)
53init=1
54
55# climato=1 : Climatological SSTs with 360-day calendar
56#        =0 : interannual SSTs with true (ie gregorian) calendar
57climato=1
58
59# Nudging: Can only be activated with climato=0 and freq=mo
60# "-nudging" (enabled) / "" (disabled)
61nudging=""
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)
67freq="yr"
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")
73mthini=200001
74mthend=200501
75
76# Expert options passed to setup.sh
77rad=rrtm       # Radiation oldrad/rrtm/ecrad
78netcdf=0       # netcddf 0 (from system) / 1 reinstall / directory containing nectdf*
79aerosols=clim  # n (no) / clim
80veget=CMIP6    # Orchidee version : CMIP6 / 7983 (orch2.2 ) / more recent svn
81
82# For rapid tests
83# resol=32x32x39 ; veget=none ; aerosols=n ; rad=oldrad ; freq=mo ; mthend=200101
84
85#-----------------------------------------------------------
86# Output files, frequencies, levels
87#   If you use IOIPSL (option xios=""), you may want to choose and customize DEF/config.def.
88#     A few versions are available as DEF/config.def_*; config.def is a copy of config.def_default
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
95#   A few versions are available as DEF/gcm.def_*;
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
106physics="NPv6.3"
107if [[ $lmd_phys = "lmdiso" ]]; then physics="NPiso"; fi
108
109if [[ $(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
111for phys in $physics; do
112  deffile="DEF/PHYS/physiq.def_$phys"
113  if [[ -f $deffile ]]; then
114     cp -p $deffile DEF/physiq.def
115
116    # name of simulation : can be changed to user's convenience
117    # (Default: name=$phys to loop on different physics)
118    name="$phys"
119
120    # launching setup.sh with the options defined in this main.sh.
121    # Remember: some other options are only available in lmdz_env.sh and setup.sh.
122    # shellcheck disable=SC2086
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
124  else
125    echo "File $deffile inexistent"; exit 1
126  fi
127done
128
Note: See TracBrowser for help on using the repository browser.