-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_archive_esm.sh
executable file
·263 lines (251 loc) · 8.55 KB
/
run_archive_esm.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
#!/bin/bash
#
###########################################################################
# File: run_archive_esm.sh
#
# This script is used to call the archive script for mpiesm coupled model
# data archive_esm.sh with a setup spezified by the user.
#
# Interactive usage:
# ------------------
# ./run_archive_esm.sh
#
# Batch job usage on mistral:
# ---------------------------
# sbatch run_archive_esm.sh
#
###########################################################################
#
###########################################################################
# Batch job setup for mistral (SLURM)
# Please set required resources
#
#SBATCH --job-name=archive_esm
#SBATCH --partition=shared
#SBATCH --ntasks=1
#SBATCH --time=10:00:00
#SBATCH --output=archive_esm.o%j
#SBATCH --error=archive_esm.o%j
#SBATCH --mail-type=FAIL
#SBATCH --account=bm0948
##SBATCH --cpus-per-task=1
##SBATCH --mem-per-cpu=1280
##SBATCH --partition=compute
##SBATCH --exclusive
##SBATCH --nodes=1
##SBATCH --tasks-per-node=1
ulimit -s unlimited
module unload cdo
module load cdo/1.7.1-magicsxx-gcc48
###########################################################################
###########################################################################
# Setup for the archiving script
# Please set mandatory arguments and required options, if they differ from
# default
#
# ---- Mandatory overall setup ------------------------------------------#
# Please edit
#
# Path to archiving script
script=/home/zmaw/${USER}/Apps/ghb/archive_esm.sh
#
# Start up and last year to process (archiving, climatologies, ...)
firstyear=FIRST_YEAR
lastyear=LAST_YEAR
#
# ID of the experiment to process
# used for default paths to the temporary, experiment's, climatologies,
# local and remote archive data, and for the file patterns to select the
# data files for processing
experiment_id=EXPERIMENT_ID
echo $experiment_id $firstyear $lastyear
#-------------------------------------------------------------------------#
#
# ---- Mandatory setup for default directories ---------------------------#
# Project ID and MPIESM ID of the experiment to process
# used for default paths to the experiment's, climatologies, local and
# remote archive data (see bullet point root directories).
# Please edit, if directories differ from default
project_id="bm0948"
mpiesm_id="mpiesm-flo-dev"
#-------------------------------------------------------------------------#
# ---- Environment -------------------------------------------------------#
# Please edit, if environment differ from default
#
# Path to temporary data and processing
# default: "/scratch/m/${USER}/tmp/${experiment_id}_${firstyear}_${lastyear}_$$"
#tmp_path=""
#
# Path to experiment's root directory
# default: "/work/${project_id}/${USER}/${mpiesm_id}/experiments/${experiment_id}"}
experiment_path="/work/${project_id}/${USER}/${mpiesm_id}/experiments/${experiment_id}"
#
# Path to root directory of local tarballs
# default: "/work/${project_id}/${USER}/${mpiesm_id}/experiments/tars/${experiment_id}"}
local_archive_path="/scratch/m/${USER}/tmp/${mpiesm_id}/experiments/tars/${experiment_id}"
#
# Path to root directory of tarballs on archive
# default: "${project_id}/${USER}/${mpiesm_id}/${experiment_id}"
#remote_archive_path="bm0948/${USER}/${mpiesm_id}/${experiment_id}"
#
# Path to root directory to store climatologies
# default: "/work/${project_id}/${USER}/${mpiesm_id}/experiments/means/${experiment_id}"}
climatologies_path="/work/${project_id}/${USER}/means/${experiment_id}"
# "/scratch/m/${USER}/tmp/${mpiesm_id}/experiments/means/${experiment_id}"
#-------------------------------------------------------------------------#
# ---- Processing setup --------------------------------------------------#
# Please edit, if setup differ from default
#
# Enable verbose log
# default: 0 (disabled) 2 is verbose
verbose=0
#
# Enable profiling
# default: false
lprofiling=false
#
# Increment of time period
# default: 1
incrementyear=1
#
# Enable climatologies
# default: true
lclimatologies=true
# Enable archiving raw data and climatologies
# default: true
larchive_data=true
# Enable archiving restart data
# default: true
larchive_restart=true
# Enable archiving logging data
# default: true
larchive_log=true
#
# Enable processing of atmosphere/ECHAM data
# default: true
latmosphere=true
# Enable processing of land/JSBACH data
# default: true
lland=true
# Enable processing of ocean/MPIOM data
# default: true
locean=true
# Enabel processing ocean's biogeochemical/HAMOCC data
# default: true
logbc=true
# Enabel processing coupler data
# default: true
lcoupler=true
# Enabel processing logging data
# default: true
llogg=true
#
# Enable tidying up: mv/cp data files from temporary directory
# to where they come from
# needs processing's configuration
# default: false
ltidying=false
#-------------------------------------------------------------------------#
# ---- Experiment's raw data types for processing climatologies ----------#
# Please don't edit
#
# Data given by
# daily means
declare -r dm="dm"
# monthly means
declare -r mm="mm"
# yearly means
declare -r ym="ym"
# no processing desired
declare -r no="none"
#-------------------------------------------------------------------------#
# ---- Data indicators of file patterns to select raw and restart data ---#
# and data types of raw data for processing climatologies #
# Please edit, if different from default
#
# Atmosphere
# default:
#atmosphere_data_pat="accw_ ATM_mm_ BOT_mm_ co2_ co2_mm_ echam_"
#atmosphere_restart_data_pat="accw_ co2_ echam_"
#atmosphere_data_type="${mm} ${mm} ${mm} ${no} ${mm} ${no}"
#
# Land
# default:
#land_data_pat="jsbach_ jsbach_mm_ land_ land_mm_ surf_ surf_mm_ \
# veg_ veg_mm_ yasso_ yasso_mm_"
#land_restart_data_pat="hd_ jsbach_ surf_ veg_ yasso_"
#land_dat_type="${no} ${mm} ${no} ${mm} ${no} ${mm} \
# ${no} ${mm} ${no} ${mm}"
#
# Ocean
# default:
#ocean_data_pat="data_2d_mm_ data_3d_mm_ data_moc_mm_ monitoring_ym_ \
# timeser_mm_"
#ocean_restart_data_pat="mpiom_"
#ocean_dat_type="${mm} ${mm} ${mm} ${ym} ${mm}"
#
# Ocean's biogeochemistry
# default:
#obgc_data_pat="co2_ data_2d_mm_ data_3d_ym_ data_eu_mm_ data_sedi_ym_ \
# monitoring_ym_"
#obgc_restart_data_pat="hamocc_"
#obgs_dat_type="${dm} ${mm} ${ym} ${mm} ${ym} ${ym}"
#-------------------------------------------------------------------------#
# ---- Data indicators of file patterns to select coupling restart data --#
# Please edit, if different from default
#
# default:
#coupler_restart_data_pat="flxatmos_ sstocean_"
#-------------------------------------------------------------------------#
# ---- Data indicators of file patterns to select logging data -----------#
# Please edit, if different from default
#
# default:
#log_data_pat="run_ store_"
#if latmosphere log_data_pat + " echam6_atmout_"
#if locean log_data_pat + " mpiom_oceout_"
#if lobgc log_data_pat + " hamocc_bgcout_"
#-------------------------------------------------------------------------#
# ---- Run processing ----------------------------------------------------#
# Please don't edit
#
${script} \
--project_id ${project_id} \
--mpiesm_id ${mpiesm_id} \
--experiment_id ${experiment_id} \
--firstyear ${firstyear} \
--lastyear ${lastyear} \
--incrementyear ${incrementyear} \
--lclimatologies ${lclimatologies} \
--larchive_data ${larchive_data} \
--larchive_restart ${larchive_restart} \
--larchive_log ${larchive_log} \
--latmosphere ${latmosphere} \
--lland ${lland} \
--locean ${locean} \
--lobgc ${logbc} \
--lcoupler ${lcoupler} \
--llog ${llogg} \
--ltidying ${ltidying} \
--atmosphere_data_pat ${atmosphere_data_pat} \
--atmosphere_data_type ${atmosphere_data_type} \
--atmosphere_restart_data_pat ${atmosphere_restart_data_pat} \
--land_data_pat ${land_data_pat} \
--land_data_type ${land_dat_type} \
--land_restart_data_pat ${land_restart_data_pat} \
--ocean_data_pat ${ocean_data_pat} \
--ocean_data_type ${ocean_dat_type} \
--ocean_restart_data_pat ${ocean_restart_data_pat} \
--obgc_data_pat ${obgc_data_pat} \
--obgc_data_type ${obgs_dat_type} \
--obgc_restart_data_pat ${obgc_restart_data_pat} \
--coupler_restart_data_pat ${coupler_restart_data_pat} \
--log_data_pat ${log_data_pat} \
--tmp_path ${tmp_path} \
--experiment_path ${experiment_path} \
--local_archive_path ${local_archive_path} \
--remote_archive_path ${remote_archive_path} \
--climatologies_path ${climatologies_path} \
--lprofiling ${lprofiling} \
--verbose ${verbose}
#-------------------------------------------------------------------------#