source: BOL/LMDZ_Setup_amaury/main.sh @ 4969

Last change on this file since 4969 was 4954, checked in by abarral, 3 months ago

(WIP) modify .def, compile ce0l

File size: 6.0 KB
Line 
1#!/bin/bash
2
3set -eu
4
5#####################################################################
6# This script manages the call to setup.sh
7#
8# Authors :
9# F. Hourdin, frederic.hourdin@lmd.ipsl.fr
10# Modified A. Sima, adriana.sima@lmd.ipsl.fr
11#
12# Some options can only be changed directly in lmdz_env.sh or setup.sh
13# --> In setup.sh :
14# * Orchidee version, to be defined through "veget" option
15#   default : OR-CMIP6
16# * Aerosol forcing, to be defined through "aerosols" option :
17#   n (no, default) / clim (an2000)/ spla (interactive dust and sea salt)
18#   !!! STRONG recommendation : experiments with DIFFERENT Orchidee or aerosol options
19#   !!!   should be performed in DIFFERENT TEST_PROD folders
20#   !!!  (especially as they may need different initial files)
21#  * Use or not of the RRTM radiation code : rrtm=true/false
22#  * Compiling options : debug, use or not of the fcm makefile
23#
24# --> In lmdz_env.sh :
25# * Model & configuration setup
26#    If you install the present tutorial_prod package in $STORE/your_folder instead of $STORE
27#       modify STORED variable accordingly
28#    The model will be installed in $LMDZD directory defined in lmdz_env.sh
29#      Default : LMDZD=$WORK; can be changed in LMDZD=$WORK/Your_directory
30#    To use a model already installed (and compiled), by you or someone else (check the acces!):
31#       set LMDZD=path_to_model_to_use
32#       You'll also need to (re)define "LMDZname" accordingly, in setup.sh
33#####################################################################
34
35#===========================================================
36# 1. Model setup
37#===========================================================
38
39# Version of the tar file on https://lmdz.lmd.jussieu.fr/pub/src
40# Last "testing" version, thoroughly checked by the LMDZ team : contains LMDZ rev 4729 (2023-10-22)
41# TODO move to expert-level settings ?
42version="20240308.trunk" #!! DON'T CHANGE IT WITHOUT CHECKING WITH LMDZ TEAM !!
43svn=""                   #!! DON'T CHANGE IT WITHOUT CHECKING WITH LMDZ TEAM !!
44        # CONTACT LMDZ Team :
45        #       email: poihl@listes.lmd.ipsl.fr
46        #       Mattermost: https://mattermost.lmd.ipsl.fr/lmdz/channels/installation-et-tutoriels
47
48# Grid number of points IMxJMxLM
49resol="144x142x79"
50
51# Using XIOS for IOs: "-xios" for enabled, else ""
52xios=""
53# TODO Amaury: je pensais que l'idée de main.sh c'était de mettre des paramètres qu'on peut changer en recompilant uniquement lmdz. Or ce n'est pas le cas d'XIOS...
54
55# Using or not the Cosp simulator: "-cosp" for enabled, else ""
56cosp=""
57
58# Choice of physics (default : "lmd" for "phylmd" )
59#   Examples : lmd_phys="new" to compile with phynew instead of phylmd,
60#              lmd_phys="lmdiso" to run with Isotopes
61lmd_phys="lmd"
62
63#===========================================================
64# 2. Simulation setup
65#===========================================================
66
67# Initial state and Boundary conditions
68# init=   1: to create a new start in INIT
69#         0: to read start files in INIT
70#       SIM: to read start files from previous simulation SIM0, /!\ SIM0 must be in the same folder as the new SIM
71# (limit.nc and aerosols forcing are put in ./LIMIT)
72init=1
73
74# climato=1 : Climatological SSTs with 360-day calendar
75#        =0 : interannual SSTs with true (ie gregorian) calendar
76climato=1
77
78# Nudging: Can only be activated with climato=0 and freq=mo
79# ="-nudging" for enabled, else ""
80nudging=""
81#If using nudging, then check DEF/guide.def :
82#  - ok_guide will be automatically set to "y" by setup.sh
83#  - You may want to check/customize the nudging parameters
84
85# Length of elementary simulations yr (year) or mo (month)
86freq="yr"
87
88# Initial/final month for simulation
89# If $init=1, the INIT file will be called start.200001.nc,
90# but the data correspond in fact to another day.
91# NB : the run stops in the BEGINNING of mthend (test "next=stopsim")
92mthini=200001
93mthend=200501
94
95#-----------------------------------------------------------
96# Output files, frequencies, levels
97#   If you use IOIPSL (option xios=""), you may want to choose and customize DEF/config.def.
98#     A few versions are available as DEF/config.def_*; config.def is a copy of config.def_default
99#     See phys_out_filekeys, phys_out_filelevels, phys_out_filetimesteps, and supplementary variables
100#   If you use XIOS (option xios="-xios"), check/modify DEF/XMLfiles*/file*xml
101#   In both cases, the default output is "histday".
102#-----------------------------------------------------------
103# Grid characteristics (regular, zoomed)
104#   You may want to choose and customize DEF/gcm.def
105#   A few versions are available as DEF/gcm.def_*;
106#      The default, for regular grid 144x142x79, corresponds to _iperiod7
107#      (Expert : TEMPORARILY : setup.sh forces use of gcm.def_zNAfrica_BiJe for aerosols=spla)
108
109#===========================================================
110# 3. Example of calling setup.sh in loop
111#===========================================================
112
113# By default, the series is done on one or more of the various versions of physiq.def
114# to be chosen among DEF/PHYS/physiq.def_* , and listed in "physics" :
115# NOTE : automatically choosing DEF/PHYS/physiq.def_NPiso for isotopes
116physics="NPv6.3"
117if [[ $lmd_phys = "lmdiso" ]]; then physics="NPiso"; fi
118
119if [[ $(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
120
121for phys in $physics; do
122  deffile="DEF/PHYS/physiq.def_$phys"
123  if [[ -f $deffile ]]; then
124     cp -p $deffile DEF/physiq.def
125
126    # name of simulation : can be changed to user's convenience
127    # (Default: name=$phys to loop on different physics)
128    name="$phys"
129
130    # launching setup.sh with the options defined in this main.sh.
131    # Remember: some other options are only available in lmdz_env.sh and setup.sh.
132    # shellcheck disable=SC2086
133    ./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
134  else
135    echo "File $deffile inexistent"; exit 1
136  fi
137done
138
Note: See TracBrowser for help on using the repository browser.