source: trunk/libIGCM/AA_monitoring @ 1444

Last change on this file since 1444 was 1437, checked in by jgipsl, 6 years ago

For Irene:

  • ins_job now ask for project id. gch0316 for the grand challenge is the default.
  • headers for more post-processing jobs
  • Property licence set to
    The following licence information concerns ONLY the libIGCM tools
    ==================================================================

    Copyright © Centre National de la Recherche Scientifique CNRS
    Commissariat à l'Énergie Atomique CEA

    libIGCM : Library for Portable Models Computation of IGCM Group.

    IGCM Group is the french IPSL Global Climate Model Group.

    This library is a set of shell scripts and functions whose purpose is
    the management of the initialization, the launch, the transfer of
    output files, the post-processing and the monitoring of datas produce
    by any numerical program on any plateforme.

    This software is governed by the CeCILL license under French law and
    abiding by the rules of distribution of free software. You can use,
    modify and/ or redistribute the software under the terms of the CeCILL
    license as circulated by CEA, CNRS and INRIA at the following URL
    "http://www.cecill.info".

    As a counterpart to the access to the source code and rights to copy,
    modify and redistribute granted by the license, users are provided only
    with a limited warranty and the software's author, the holder of the
    economic rights, and the successive licensors have only limited
    liability.

    In this respect, the user's attention is drawn to the risks associated
    with loading, using, modifying and/or developing or reproducing the
    software by the user in light of its specific status of free software,
    that may mean that it is complicated to manipulate, and that also
    therefore means that it is reserved for developers and experienced
    professionals having in-depth computer knowledge. Users are therefore
    encouraged to load and test the software's suitability as regards their
    requirements in conditions enabling the security of their systems and/or
    data to be ensured and, more generally, to use and operate it in the
    same conditions as regards security.

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