source: BOL/LMDZ_Setup_amaury/main.sh @ 4980

Last change on this file since 4980 was 4980, checked in by abarral, 3 weeks ago

(WIP) update spirit arch
update script_SIMU env
fix setup.sh, add netcdf option
fix aerosols detection

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