source: CONFIG_DEVT/IPSLCM6.5_work_ENSEMBLES/libIGCM/AA_monitoring @ 6031

Last change on this file since 6031 was 5899, checked in by aclsce, 3 years ago

Modified libIGCM and configuration to run XIOS ensembles.

File size: 11.7 KB
Line 
1#-Q- curie ######################
2#-Q- curie ## CURIE   TGCC/CEA ##
3#-Q- curie ######################
4#-Q- curie #MSUB -r MONITORING     # Nom du job
5#-Q- curie #MSUB -o MONITORING.out_%I
6#-Q- curie #MSUB -e MONITORING.out_%I
7#-Q- curie #MSUB -n 1              # Reservation du processus
8#-Q- curie #MSUB -T 80000          # Limite de temps elapsed du job
9#-Q- curie #MSUB -q ::default_node::
10#-Q- curie #MSUB -c ::default_core::
11#-Q- curie #MSUB -Q normal
12#-Q- curie #MSUB -A ::default_project::
13#-Q- curie set +x
14#-Q- irene ######################
15#-Q- irene ## IRENE   TGCC/CEA ##
16#-Q- irene ######################
17#-Q- irene #MSUB -r MONITORING    # Job name
18#-Q- irene #MSUB -o MONITORING.out_%I
19#-Q- irene #MSUB -e MONITORING.out_%I
20#-Q- irene #MSUB -n 1             # Number of cores
21#-Q- irene #MSUB -T 80000         # Maximum elapsed time
22#-Q- irene #MSUB -q ::default_node::
23#-Q- irene #MSUB -c ::default_core::
24#-Q- irene #MSUB -Q normal
25#-Q- irene #MSUB -A ::default_post_project::
26#-Q- irene #MSUB -m store,work,scratch
27#-Q- irene set +x
28#-Q- irene-amd ######################
29#-Q- irene-amd ## IRENE   TGCC/CEA ##
30#-Q- irene-amd ######################
31#-Q- irene-amd #MSUB -r MONITORING     # Job name
32#-Q- irene-amd #MSUB -o MONITORING.out_%I
33#-Q- irene-amd #MSUB -e MONITORING.out_%I
34#-Q- irene-amd #MSUB -n 1              # Number of cores
35#-Q- irene-amd #MSUB -T 80000          # Maximum elapsed time
36#-Q- irene-amd #MSUB -q ::default_node::
37#-Q- irene-amd #MSUB -c ::default_core::
38#-Q- irene-amd #MSUB -Q normal
39#-Q- irene-amd #MSUB -A ::default_post_project::
40#-Q- irene-amd #MSUB -m store,work,scratch
41#-Q- irene-amd set +x
42#-Q- jeanzay #!/bin/ksh
43#-Q- jeanzay ######################
44#-Q- jeanzay ## JEANZAY    IDRIS ##
45#-Q- jeanzay ######################
46#-Q- jeanzay #SBATCH --job-name=MONITORING         # Job Name
47#-Q- jeanzay #SBATCH --output=MONITORING.out_%J    # standard output
48#-Q- jeanzay #SBATCH --error=MONITORING.out_%J     # error output
49#-Q- jeanzay #SBATCH --ntasks=1                    # Number of core
50#-Q- jeanzay #SBATCH --hint=nomultithread          # 1 processus MPI par coeur physique (pas d'hyperthreading)
51#-Q- jeanzay #SBATCH --time=10:00:00               # Wall clock limit (seconds)
52#-Q- jeanzay #SBATCH --account ::default_project::@cpu
53#-Q- jeanzay #SBATCH --partition=prepost
54#-Q- jeanzay set +x
55#-Q- ada #!/bin/ksh
56#-Q- ada #######################
57#-Q- ada ## ADA         IDRIS ##
58#-Q- ada #######################
59#-Q- ada # @ job_type = mpich
60#-Q- ada # @ requirements = (Feature == "prepost")
61#-Q- ada # Temps Elapsed max. d'une requete hh:mm:ss
62#-Q- ada # @ wall_clock_limit = 4:00:00
63#-Q- ada # Memory required for ferret (_SEP _MAR variables)
64#-Q- ada # @ as_limit = 30Gb
65#-Q- ada # Nom du travail LoadLeveler
66#-Q- ada # @ job_name   = MONITORING
67#-Q- ada # Fichier de sortie standard du travail
68#-Q- ada # @ output     = $(job_name).$(jobid)
69#-Q- ada # Fichier de sortie d'erreur du travail
70#-Q- ada # @ error      =  $(job_name).$(jobid)
71#-Q- ada # pour recevoir un mail en cas de depassement du temps Elapsed (ou autre pb.)
72#-Q- ada # @ notification = error
73#-Q- ada # @ environment  = $DEBUG_debug ; $BigBrother ; $postProcessingStopLevel ; $POST_DIR ; $Script_Post_Output ; $SUBMIT_DIR ; $libIGCM ; $StandAlone ; $RESOL_ATM ; $RESOL_OCE ; $RESOL_ICE ; $RESOL_MBG ; $RESOL_SRF ; wall_clock_limit=$(wall_clock_limit)
74#-Q- ada # @ queue
75#-Q- lxiv8 ######################
76#-Q- lxiv8 ## OBELIX      LSCE ##
77#-Q- lxiv8 ######################
78#-Q- lxiv8 #PBS -N MONITORING
79#-Q- lxiv8 #PBS -m a
80#-Q- lxiv8 #PBS -j oe
81#-Q- lxiv8 #PBS -q medium
82#-Q- lxiv8 #PBS -o MONITORING.$$
83#-Q- lxiv8 #PBS -S /bin/ksh
84#-Q- ifort_CICLAD ######################
85#-Q- ifort_CICLAD ##   CICLAD    IPSL ##
86#-Q- ifort_CICLAD ######################
87#-Q- ifort_CICLAD #PBS -N MONITORING
88#-Q- ifort_CICLAD #PBS -m a
89#-Q- ifort_CICLAD #PBS -j oe
90#-Q- ifort_CICLAD #PBS -q std
91#-Q- ifort_CICLAD #PBS -S /bin/ksh
92#-Q- default #!/bin/ksh
93#-Q- default ##################
94#-Q- default ## DEFAULT HOST ##
95#-Q- default ##################
96
97#**************************************************************
98# Author: Sebastien Denvil
99# Contact: Sebastien.Denvil__at__ipsl.jussieu.fr
100# $Revision:: 1525                                     $ Revision of last commit
101# $Author:: cetlod                                     $ Author of last commit
102# $Date:: 2020-04-27 10:39:22 +0200 (Mon, 27 Apr 2020) $ Date of last commit
103# IPSL (2006)
104#  This software is governed by the CeCILL licence see libIGCM/libIGCM_CeCILL.LIC
105#
106#**************************************************************
107
108#set -eu
109#set -vx
110
111date
112
113#-Q- ada export OMP_NUM_THREADS=1
114
115#D- Task type DO NOT CHANGE (computing, post-processing or checking)
116TaskType=post-processing
117
118########################################################################
119
120#D- Flag to determine if this job in a standalone mode
121#D- Default : value from AA_job if any
122StandAlone=${StandAlone:=true}
123
124#D- Path to libIGCM
125#D- Default : value from AA_job if any
126# WARNING For StandAlone use : To run this script on some machine (ada and cesium)
127# WARNING you must check MirrorlibIGCM variable in sys library.
128# WARNING If this variable is true, you must use libIGCM_POST path instead
129# WARNING of your running libIGCM directory.
130libIGCM=${libIGCM:=::modipsl::/libIGCM}
131
132#D- Increased verbosity (1, 2, 3)
133#D- Default : value from AA_job if any
134Verbosity=${Verbosity:=3}
135
136#D- Low level debug : to bypass lib test checks and stack construction
137#D- Default : value from AA_job if any
138DEBUG_debug=${DEBUG_debug:=false}
139
140#D- TEMPORARY Flag to determine atmospheric resolution
141#D- Default : value from atmospheric driver if any
142RESOL_ATM=${RESOL_ATM:=ALL}
143
144#D- Flag to determine surface resolution
145#D- Default : value from surface driver if any
146RESOL_SRF=${RESOL_SRF:=ALL}
147
148#D- Flag to determine surface resolution
149#D- Default : value from surface driver if any
150RESOL_SBG=${RESOL_SBG:=ALL}
151
152#D- TEMPORARY Flag to determine ocean resolution
153#D- Default : value from ocean driver if any
154RESOL_OCE=${RESOL_OCE:=ORCA2}
155
156#D- TEMPORARY Flag to determine ice resolution
157#D- Default : value from ice driver if any
158RESOL_ICE=${RESOL_OCE:=ORCA2}
159
160#D- TEMPORARY Flag to determine marine biogeochemistry resolution
161#D- Default : value from ice driver if any
162RESOL_MBG=${RESOL_OCE:=ORCA2}
163
164######################################################################
165
166. ${libIGCM}/libIGCM_debug/libIGCM_debug.ksh
167. ${libIGCM}/libIGCM_card/libIGCM_card.ksh
168. ${libIGCM}/libIGCM_date/libIGCM_date.ksh
169#-------
170. ${libIGCM}/libIGCM_sys/libIGCM_sys.ksh
171. ${libIGCM}/libIGCM_config/libIGCM_config.ksh
172#-------
173RUN_DIR=${RUN_DIR_PATH}
174IGCM_sys_MkdirWork ${RUN_DIR}
175IGCM_sys_Cd ${RUN_DIR}
176#-------
177( ${DEBUG_debug} ) && IGCM_debug_Check
178( ${DEBUG_debug} ) && IGCM_card_Check
179( ${DEBUG_debug} ) && IGCM_date_Check
180
181######################################################################
182
183#set -vx
184
185# ------------------------------------------------------------------
186# Test if all was right before proceeding further
187# ------------------------------------------------------------------
188IGCM_debug_Verif_Exit
189
190if [ ${StandAlone} = true ] ; then
191  CARD_DIR=${SUBMIT_DIR}
192else
193  CARD_DIR=${RUN_DIR}
194  IGCM_sys_Get_Master ${SUBMIT_DIR}/config.card ${RUN_DIR_PATH}
195  IGCM_sys_Get_Master ${SUBMIT_DIR}/run.card    ${RUN_DIR_PATH}
196  IGCM_sys_Get_Master ${SUBMIT_DIR}/COMP        ${RUN_DIR_PATH}
197  IGCM_sys_Get_Master ${SUBMIT_DIR}/POST        ${RUN_DIR_PATH}
198fi
199
200#==================================
201# First of all
202#
203# Read libIGCM compatibility version in config.card
204# Read UserChoices section
205# Read Ensemble section
206# Read Post section
207# Define all netcdf output directories
208#==================================
209IGCM_config_CommonConfiguration ${CARD_DIR}/config.card
210
211# ------------------------------------------------------------------
212# Activate BigBrother so as to supervise this job
213# ------------------------------------------------------------------
214IGCM_debug_BigBro_Initialize
215
216#==================================
217# Read ListOfComponents section:
218IGCM_card_DefineArrayFromSection ${CARD_DIR}/config.card ListOfComponents
219
220# Create R_FIGR that has been defined by IGCM_config_CommonConfiguration
221IGCM_sys_MkdirArchive ${R_FIGR}
222#
223IGCM_sys_TestDirArchive ${R_FIGR}/MONITORING
224if [ $? = 0 ] ; then
225  IGCM_debug_Print 1 "Get MONITORING directory from archive"
226  IGCM_sys_Get_Dir ${R_FIGR}/MONITORING ${RUN_DIR}
227else
228  IGCM_debug_Print 1 "MONITORING first pass. Nothing has been done before"
229fi
230# --------------------------------------------
231# Insert your commands between III...III lines
232# and precise produced directories to save
233# IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
234
235for comp in ${config_ListOfComponents[*]} ; do
236  IGCM_debug_Print 1 "################## Component: ${comp} ######################"
237  liste_file_monitoring=""
238  IGCM_card_DefineArrayFromOption ${CARD_DIR}/config.card ListOfComponents ${comp}
239  eval compname=\${config_ListOfComponents_${comp}[0]}                > /dev/null 2>&1
240
241  PATH_monitoring_file=""
242  eval monitoring_file=monitoring01_${compname}_\${RESOL_${comp}}.cfg > /dev/null 2>&1
243  if [[ -d ${CARD_DIR}/POST && -f ${CARD_DIR}/POST/${monitoring_file} ]] ; then
244    PATH_monitoring_file=${CARD_DIR}/POST/${monitoring_file}
245  elif [[ -d ${CARD_DIR}/POST && -f ${CARD_DIR}/POST/monitoring01_${compname}.cfg ]] ; then
246    PATH_monitoring_file=${CARD_DIR}/POST/monitoring01_${compname}.cfg
247  elif [ -f ${FER_ATLAS}/${monitoring_file} ] ; then
248    PATH_monitoring_file=${FER_ATLAS}/${monitoring_file}
249  else
250    IGCM_debug_Print 1 "No monitoring file found for this component. Was expecting ${monitoring_file}"
251    IGCM_debug_Print 1 "Step to next component"
252    continue
253  fi
254  #
255  if [ X${PATH_monitoring_file} != X"" ] ; then
256    IGCM_debug_Print 1 "Monitoring file used : ${PATH_monitoring_file}"
257    IGCM_debug_Print 1 "Determine which frequency of time series to be used."
258
259    FreqTS=$( grep FreqTS ${PATH_monitoring_file} | grep -v \# | awk -F "=" '{print $2}' )
260    if [ X${FreqTS} = X ] ; then
261      # Default frequency is MO
262      FreqTS=MO
263    fi
264
265    IGCM_debug_Print 1 "Times series frequency to be used is ${FreqTS}"
266    IGCM_debug_Print 1 "Determine which files we need."
267    . monitoring01 -l2 --listcommand 'IGCM_sys_RshArchive_NoError ls' ${PATH_monitoring_file} ${R_SAVE}/${comp}/Analyse/TS_${FreqTS}
268    liste_file_monitoring=$( . monitoring01 -q -l2 --listcommand 'IGCM_sys_RshArchive_NoError ls' ${PATH_monitoring_file} ${R_SAVE}/${comp}/Analyse/TS_${FreqTS} )
269  fi
270  #
271  if [ ! "X${liste_file_monitoring}" = X ] ; then
272    IGCM_sys_Get /l liste_file_monitoring ${RUN_DIR}
273    IGCM_debug_Print 1 "monitoring01 -c ${CARD_DIR} -p ${comp} --time -t \"${config_UserChoices_JobName} monitoring\" -o ${RUN_DIR}/MONITORING ${PATH_monitoring_file} ."
274    IGCM_debug_Print 1 "monitoring01 starts ................................................."
275    monitoring01 -c ${CARD_DIR} -p ${comp} --time -t "${config_UserChoices_JobName} monitoring" -o ${RUN_DIR}/MONITORING ${PATH_monitoring_file} .
276  else
277    IGCM_debug_Print 1 "No time series detected by this command :"
278    IGCM_debug_Print 1 "monitoring01 -l2 --listcommand 'IGCM_sys_RshArchive_NoError ls' ${PATH_monitoring_file} ${R_SAVE}/${comp}/Analyse/TS_${FreqTS}"
279    . monitoring01 -l2 --listcommand 'IGCM_sys_RshArchive_NoError ls' ${PATH_monitoring_file} ${R_SAVE}/${comp}/Analyse/TS_${FreqTS}
280  fi
281
282  # Now do cleaning before starting with next component
283  rm -f ${RUN_DIR}/*nc
284
285done
286
287# IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
288
289# Save files
290IGCM_sys_Put_Dir MONITORING ${R_FIGR}
291
292# Dods copy
293if [ X${config_Post_DodsCopy} = XTRUE ]  ; then
294  IGCM_sys_Put_Dods MONITORING
295fi
296
297# Clean RUN_DIR_PATH (necessary for cesium and titane only)
298IGCM_sys_RmRunDir -Rf ${RUN_DIR_PATH}
299
300# ------------------------------------------------------------------
301# Finalize BigBrother to inform that the jobs end
302# ------------------------------------------------------------------
303IGCM_debug_BigBro_Finalize
Note: See TracBrowser for help on using the repository browser.