source: BOL/LMDZ_Setup_amaury/main.sh @ 4948

Last change on this file since 4948 was 4940, checked in by abarral, 4 months ago

(WIP)
move compile-relevant args to install_lmdz

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