source: BOL/LMDZ_Setup_amaury/main.sh @ 4999

Last change on this file since 4999 was 4991, checked in by abarral, 2 weeks ago

Improve docs
Fix bug on sequential sim when running locally
Fix crash when running init without slurm (ce0l w/o OMP_NUM_THREADS=1)
Fix crash for climato=0 due to missing limit.nc

File size: 5.1 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# 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)
20#####################################################################
21
22#===========================================================
23# 1. Model setup
24#===========================================================
25
26# Version of the tar file on https://lmdz.lmd.jussieu.fr/pub/src
27# Last "testing" version, thoroughly checked by the LMDZ team : contains LMDZ rev 4729 (2023-10-22)
28version="20240308.trunk" #!! DON'T CHANGE IT WITHOUT CHECKING WITH LMDZ TEAM !!
29svn=""                   #!! DON'T CHANGE IT WITHOUT CHECKING WITH LMDZ TEAM !!
30# CONTACT LMDZ Team :
31#       email: poihl@listes.lmd.ipsl.fr
32#       Mattermost: https://mattermost.lmd.ipsl.fr/lmdz/channels/installation-et-tutoriels
33
34# Grid number of points IMxJMxLM
35resol="144x142x79"
36resol="32x32x39"  # TODO TEMP
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#-----------------------------------------------------------
80# Output files, frequencies, levels
81#   If you use IOIPSL (option xios=""), you may want to choose and customize DEF/config.def.
82#     A few versions are available as DEF/config.def_*; config.def is a copy of config.def_default
83#     See phys_out_filekeys, phys_out_filelevels, phys_out_filetimesteps, and supplementary variables
84#   If you use XIOS (option xios="-xios"), check/modify DEF/XMLfiles*/file*xml
85#   In both cases, the default output is "histday".
86#-----------------------------------------------------------
87# Grid characteristics (regular, zoomed)
88#   You may want to choose and customize DEF/gcm.def
89#   A few versions are available as DEF/gcm.def_*;
90#      The default, for regular grid 144x142x79, corresponds to _iperiod7
91#      (Expert : TEMPORARILY : setup.sh forces use of gcm.def_zNAfrica_BiJe for aerosols=spla)
92
93#===========================================================
94# 3. Example of calling setup.sh in loop
95#===========================================================
96
97# By default, the series is done on one or more of the various versions of physiq.def
98# to be chosen among DEF/PHYS/physiq.def_* , and listed in "physics" :
99# NOTE : automatically choosing DEF/PHYS/physiq.def_NPiso for isotopes
100physics="NPv6.3"
101if [[ $lmd_phys = "lmdiso" ]]; then physics="NPiso"; fi
102
103if [[ $(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
104
105for phys in $physics; do
106  deffile="DEF/PHYS/physiq.def_$phys"
107  if [[ -f $deffile ]]; then
108     cp -p $deffile DEF/physiq.def
109
110    # name of simulation : can be changed to user's convenience
111    # (Default: name=$phys to loop on different physics)
112    name="$phys"
113
114    # launching setup.sh with the options defined in this main.sh.
115    # Remember: some other options are only available in lmdz_env.sh and setup.sh.
116    # shellcheck disable=SC2086
117    ./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
118  else
119    echo "File $deffile inexistent"; exit 1
120  fi
121done
122
Note: See TracBrowser for help on using the repository browser.