source: trunk/libIGCM/AA_monitoring @ 1378

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