source: BOL/LMDZ_Setup/main.sh @ 5785

Last change on this file since 5785 was 5604, checked in by fhourdin, 8 months ago

Nouvelle testing et calcul omp

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