source: trunk/libIGCM/AA_monitoring @ 1572

Last change on this file since 1572 was 1568, checked in by jgipsl, 17 months ago

Change the variable SYSTEM=lxiv8 into SYSTEM=obelix. This is done to make the connexion easier between the variable SYSTEM and the file libIGCM_sys_XXXX.ksh which now always should be libIGCM_sys_${SYSTEM}.ksh

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