source: branches/libIGCM_CESMEP/AA_monitoring

Last change on this file was 1585, checked in by ssenesi, 12 months ago

merge branch libIGCM_CESMEP with trunk that handles RedHat8 on Irene

  • 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: 12.4 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- obelix ######################
76#-Q- obelix ## OBELIX      LSCE ##
77#-Q- obelix ######################
78#-Q- obelix #PBS -N MONITORING
79#-Q- obelix #PBS -m a
80#-Q- obelix #PBS -j oe
81#-Q- obelix #PBS -q medium
82#-Q- obelix #PBS -o MONITORING.$$
83#-Q- obelix #PBS -S /bin/ksh
84#-Q- mesoipsl #!/bin/ksh
85#-Q- mesoipsl ######################
86#-Q- mesoipsl ## MESO ESPRI IPSL  ##
87#-Q- mesoipsl ######################
88#-Q- mesoipsl #SBATCH --job-name=MONITORING         # Job Name
89#-Q- mesoipsl #SBATCH --output=MONITORING.out_%J    # standard output
90#-Q- mesoipsl #SBATCH --error=MONITORING.out_%J     # error output
91#-Q- mesoipsl #SBATCH --ntasks=1                    # Number of core
92#-Q- mesoipsl #SBATCH --hint=nomultithread          # 1 processus MPI par coeur physique (pas d'hyperthreading)
93#-Q- mesoipsl #SBATCH --time=10:00:00               # Wall clock limit (seconds)
94#-Q- mesoipsl set +x
95#-Q- mesoipsl exit
96#-Q- ifort_CICLAD ######################
97#-Q- ifort_CICLAD ##   CICLAD    IPSL ##
98#-Q- ifort_CICLAD ######################
99#-Q- ifort_CICLAD #PBS -N MONITORING
100#-Q- ifort_CICLAD #PBS -m a
101#-Q- ifort_CICLAD #PBS -j oe
102#-Q- ifort_CICLAD #PBS -q std
103#-Q- ifort_CICLAD #PBS -S /bin/ksh
104#-Q- default #!/bin/ksh
105#-Q- default ##################
106#-Q- default ## DEFAULT HOST ##
107#-Q- default ##################
108
109#**************************************************************
110# Author: Sebastien Denvil
111# Contact: Sebastien.Denvil__at__ipsl.jussieu.fr
112# $Revision::                                          $ Revision of last commit
113# $Author::                                            $ Author of last commit
114# $Date::                                              $ Date of last commit
115# IPSL (2006)
116#  This software is governed by the CeCILL licence see libIGCM/libIGCM_CeCILL.LIC
117#
118#**************************************************************
119
120#set -eu
121#set -vx
122
123date
124
125#-Q- ada export OMP_NUM_THREADS=1
126
127#D- Task type DO NOT CHANGE (computing, post-processing or checking)
128TaskType=post-processing
129
130########################################################################
131
132#D- Flag to determine if this job in a standalone mode
133#D- Default : value from AA_job if any
134StandAlone=${StandAlone:=true}
135
136#D- Path to libIGCM
137#D- Default : value from AA_job if any
138# WARNING For StandAlone use : To run this script on some machine (ada and cesium)
139# WARNING you must check MirrorlibIGCM variable in sys library.
140# WARNING If this variable is true, you must use libIGCM_POST path instead
141# WARNING of your running libIGCM directory.
142libIGCM=${libIGCM:=::modipsl::/libIGCM}
143
144#D- Increased verbosity (1, 2, 3)
145#D- Default : value from AA_job if any
146Verbosity=${Verbosity:=3}
147
148#D- Low level debug : to bypass lib test checks and stack construction
149#D- Default : value from AA_job if any
150DEBUG_debug=${DEBUG_debug:=false}
151
152#D- TEMPORARY Flag to determine atmospheric resolution
153#D- Default : value from atmospheric driver if any
154RESOL_ATM=${RESOL_ATM:=ALL}
155
156#D- Flag to determine surface resolution
157#D- Default : value from surface driver if any
158RESOL_SRF=${RESOL_SRF:=ALL}
159
160#D- Flag to determine surface resolution
161#D- Default : value from surface driver if any
162RESOL_SBG=${RESOL_SBG:=ALL}
163
164#D- TEMPORARY Flag to determine ocean resolution
165#D- Default : value from ocean driver if any
166RESOL_OCE=${RESOL_OCE:=ORCA2}
167
168#D- TEMPORARY Flag to determine ice resolution
169#D- Default : value from ice driver if any
170RESOL_ICE=${RESOL_OCE:=ORCA2}
171
172#D- TEMPORARY Flag to determine marine biogeochemistry resolution
173#D- Default : value from ice driver if any
174RESOL_MBG=${RESOL_OCE:=ORCA2}
175
176######################################################################
177
178. ${libIGCM}/libIGCM_debug/libIGCM_debug.ksh
179. ${libIGCM}/libIGCM_card/libIGCM_card.ksh
180. ${libIGCM}/libIGCM_date/libIGCM_date.ksh
181#-------
182. ${libIGCM}/libIGCM_sys/libIGCM_sys.ksh
183. ${libIGCM}/libIGCM_config/libIGCM_config.ksh
184#-------
185RUN_DIR=${RUN_DIR_PATH}
186IGCM_sys_MkdirWork ${RUN_DIR}
187IGCM_sys_Cd ${RUN_DIR}
188#-------
189( ${DEBUG_debug} ) && IGCM_debug_Check
190( ${DEBUG_debug} ) && IGCM_card_Check
191( ${DEBUG_debug} ) && IGCM_date_Check
192
193######################################################################
194
195#set -vx
196
197# ------------------------------------------------------------------
198# Test if all was right before proceeding further
199# ------------------------------------------------------------------
200IGCM_debug_Verif_Exit
201
202if [ ${StandAlone} = true ] ; then
203  CARD_DIR=${SUBMIT_DIR}
204else
205  CARD_DIR=${RUN_DIR}
206  IGCM_sys_Get_Master ${SUBMIT_DIR}/config.card ${RUN_DIR_PATH}
207  IGCM_sys_Get_Master ${SUBMIT_DIR}/run.card    ${RUN_DIR_PATH}
208  IGCM_sys_Get_Master ${SUBMIT_DIR}/COMP        ${RUN_DIR_PATH}
209  IGCM_sys_Get_Master ${SUBMIT_DIR}/POST        ${RUN_DIR_PATH}
210fi
211
212#==================================
213# First of all
214#
215# Read libIGCM compatibility version in config.card
216# Read UserChoices section
217# Read Ensemble section
218# Read Post section
219# Define all netcdf output directories
220#==================================
221IGCM_config_CommonConfiguration ${CARD_DIR}/config.card
222
223# ------------------------------------------------------------------
224# Activate BigBrother so as to supervise this job
225# ------------------------------------------------------------------
226IGCM_debug_BigBro_Initialize
227
228#==================================
229# Read ListOfComponents section:
230IGCM_card_DefineArrayFromSection ${CARD_DIR}/config.card ListOfComponents
231
232# Create R_FIGR that has been defined by IGCM_config_CommonConfiguration
233IGCM_sys_MkdirArchive ${R_FIGR}
234#
235IGCM_sys_TestDirArchive ${R_FIGR}/MONITORING
236if [ $? = 0 ] ; then
237  IGCM_debug_Print 1 "Get MONITORING directory from archive"
238  IGCM_sys_Get_Dir ${R_FIGR}/MONITORING ${RUN_DIR}
239else
240  IGCM_debug_Print 1 "MONITORING first pass. Nothing has been done before"
241fi
242# --------------------------------------------
243# Insert your commands between III...III lines
244# and precise produced directories to save
245# IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
246
247for comp in ${config_ListOfComponents[*]} ; do
248  IGCM_debug_Print 1 "################## Component: ${comp} ######################"
249  liste_file_monitoring=""
250  IGCM_card_DefineArrayFromOption ${CARD_DIR}/config.card ListOfComponents ${comp}
251  eval compname=\${config_ListOfComponents_${comp}[0]}                > /dev/null 2>&1
252
253  PATH_monitoring_file=""
254  eval monitoring_file=monitoring01_${compname}_\${RESOL_${comp}}.cfg > /dev/null 2>&1
255  if [[ -d ${CARD_DIR}/POST && -f ${CARD_DIR}/POST/${monitoring_file} ]] ; then
256    PATH_monitoring_file=${CARD_DIR}/POST/${monitoring_file}
257  elif [[ -d ${CARD_DIR}/POST && -f ${CARD_DIR}/POST/monitoring01_${compname}.cfg ]] ; then
258    PATH_monitoring_file=${CARD_DIR}/POST/monitoring01_${compname}.cfg
259  elif [ -f ${FER_ATLAS}/${monitoring_file} ] ; then
260    PATH_monitoring_file=${FER_ATLAS}/${monitoring_file}
261  else
262    IGCM_debug_Print 1 "No monitoring file found for this component. Was expecting ${monitoring_file}"
263    IGCM_debug_Print 1 "Step to next component"
264    continue
265  fi
266  #
267  if [ X${PATH_monitoring_file} != X"" ] ; then
268    IGCM_debug_Print 1 "Monitoring file used : ${PATH_monitoring_file}"
269    IGCM_debug_Print 1 "Determine which frequency of time series to be used."
270
271    FreqTS=$( grep FreqTS ${PATH_monitoring_file} | grep -v \# | awk -F "=" '{print $2}' )
272    if [ X${FreqTS} = X ] ; then
273      # Default frequency is MO
274      FreqTS=MO
275    fi
276
277    IGCM_debug_Print 1 "Times series frequency to be used is ${FreqTS}"
278    IGCM_debug_Print 1 "Determine which files we need."
279    . monitoring01 -l2 --listcommand 'IGCM_sys_RshArchive_NoError ls' ${PATH_monitoring_file} ${R_SAVE}/${comp}/Analyse/TS_${FreqTS}
280    liste_file_monitoring=$( . monitoring01 -q -l2 --listcommand 'IGCM_sys_RshArchive_NoError ls' ${PATH_monitoring_file} ${R_SAVE}/${comp}/Analyse/TS_${FreqTS} )
281  fi
282  #
283  if [ ! "X${liste_file_monitoring}" = X ] ; then
284    IGCM_sys_Get /l liste_file_monitoring ${RUN_DIR}
285    IGCM_debug_Print 1 "monitoring01 -c ${CARD_DIR} -p ${comp} --time -t \"${config_UserChoices_JobName} monitoring\" -o ${RUN_DIR}/MONITORING ${PATH_monitoring_file} ."
286    IGCM_debug_Print 1 "monitoring01 starts ................................................."
287    monitoring01 -c ${CARD_DIR} -p ${comp} --time -t "${config_UserChoices_JobName} monitoring" -o ${RUN_DIR}/MONITORING ${PATH_monitoring_file} .
288  else
289    IGCM_debug_Print 1 "No time series detected by this command :"
290    IGCM_debug_Print 1 "monitoring01 -l2 --listcommand 'IGCM_sys_RshArchive_NoError ls' ${PATH_monitoring_file} ${R_SAVE}/${comp}/Analyse/TS_${FreqTS}"
291    . monitoring01 -l2 --listcommand 'IGCM_sys_RshArchive_NoError ls' ${PATH_monitoring_file} ${R_SAVE}/${comp}/Analyse/TS_${FreqTS}
292  fi
293
294  # Now do cleaning before starting with next component
295  rm -f ${RUN_DIR}/*nc
296
297done
298
299# IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
300
301# Save files
302IGCM_sys_Put_Dir MONITORING ${R_FIGR}
303
304# Dods copy
305if [ X${config_Post_DodsCopy} = XTRUE ]  ; then
306  IGCM_sys_Put_Dods MONITORING
307fi
308
309# Clean RUN_DIR_PATH (necessary for cesium and titane only)
310IGCM_sys_RmRunDir -Rf ${RUN_DIR_PATH}
311
312# ------------------------------------------------------------------
313# Finalize BigBrother to inform that the jobs end
314# ------------------------------------------------------------------
315IGCM_debug_BigBro_Finalize
Note: See TracBrowser for help on using the repository browser.