source: trunk/libIGCM/AA_monitoring @ 1188

Last change on this file since 1188 was 1184, checked in by sdipsl, 9 years ago

Add ciclad to the system. Episode II

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