source: BOL/LMDZ_Setup/main.sh @ 5857

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

Improved era2gcm.sh

File size: 5.3 KB
RevLine 
[4615]1#!/bin/bash
2
[5415]3set -eu
[5539]4. lmdz_env.sh
[5415]5
[4615]6#####################################################################
7# Authors :
8# F. Hourdin, frederic.hourdin@lmd.ipsl.fr
9# Modified A. Sima, adriana.sima@lmd.ipsl.fr
[5415]10# Rewritten 2024 A. Barral
[4615]11#
[5415]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>.
[4615]15#
16#####################################################################
17
18#===========================================================
19# 1. Model setup
20#===========================================================
21
[5604]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"
[5850]28version="20251001.trunk -unstable"
[5535]29
[5432]30svn="" 
[5415]31# CONTACT LMDZ Team :
32#       email: poihl@listes.lmd.ipsl.fr
33#       Mattermost: https://mattermost.lmd.ipsl.fr/lmdz/channels/installation-et-tutoriels
[4615]34
35# Grid number of points IMxJMxLM
[5415]36resol="144x142x79"
[4615]37
[5415]38## Using XIOS for IOs: "-xios" (enabled) / "" (disabled)
[4615]39xios=""
40
[5415]41# Using or not the Cosp simulator: "-cosp" (enabled) / "" (disabled)
[4615]42cosp=""
43
[5415]44# Choice of physics: "lmd" (phylmd) / "new" (phynew) / "lmdiso" (isotopes)
[4615]45lmd_phys="lmd"
46
47#===========================================================
48# 2. Simulation setup
49#===========================================================
50
51# Initial state and Boundary conditions
[5415]52# init=   1: to create a new start in INIT
[4615]53#         0: to read start files in INIT
[5415]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)
[4615]56init=1
57
[5415]58# climato=1 : Climatological SSTs with 360-day calendar
[4615]59#        =0 : interannual SSTs with true (ie gregorian) calendar
60climato=1
61
62# Nudging: Can only be activated with climato=0 and freq=mo
[5415]63# "-nudging" (enabled) / "" (disabled)
[4615]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)
[5415]70freq="yr"
[4615]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
[5428]79# Expert options passed to setup.sh
[5539]80rad=rrtm        # Radiation oldrad/rrtm/ecrad
81netcdf=0        # netcddf 0(from system)/1 reinstall/dir. containing nectdf*
82aerosols=clim   # n (no) / clim
[5564]83veget=CMIP6     # Orchidee version : CMIP6 / 7983 (orch2.2 ) / 8758 (orch4)
[5539]84save_pub=$LMDZD # Will save files downloaded by wget on $LMDZD (could be 0 or 1)
[5428]85
[5465]86# For rapid tests
87# resol=32x32x39 ; veget=none ; aerosols=n ; rad=oldrad ; freq=mo ; mthend=200101
[5428]88
[4615]89#-----------------------------------------------------------
90# Output files, frequencies, levels
91#   If you use IOIPSL (option xios=""), you may want to choose and customize DEF/config.def.
[5415]92#     A few versions are available as DEF/config.def_*; config.def is a copy of config.def_default
[4615]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
[5415]99#   A few versions are available as DEF/gcm.def_*;
[4615]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"
[5415]111if [[ $lmd_phys = "lmdiso" ]]; then physics="NPiso"; fi
[4615]112
[5415]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
[4615]118     cp -p $deffile DEF/physiq.def
119
120    # name of simulation : can be changed to user's convenience
[5415]121    # (Default: name=$phys to loop on different physics)
122    name="$phys"
[4615]123
124    # launching setup.sh with the options defined in this main.sh.
[5415]125    # Remember: some other options are only available in lmdz_env.sh and setup.sh.
126    # shellcheck disable=SC2086
[5539]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
[5415]128  else
129    echo "File $deffile inexistent"; exit 1
130  fi
[4615]131done
132
Note: See TracBrowser for help on using the repository browser.