source: trunk/libIGCM/AA_create_ts @ 636

Last change on this file since 636 was 633, checked in by sdipsl, 12 years ago
  • Take into account PackDefault? to adapt post-processing behaviour
  • 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: 34.5 KB
Line 
1#-Q- cesium #!/bin/ksh
2#-Q- cesium ######################
3#-Q- cesium ## CESIUM   CEA ##
4#-Q- cesium ######################
5#-Q- cesium #MSUB -r TS             # Nom du job               
6#-Q- cesium #MSUB -N 1              # Reservation du noeud
7#-Q- cesium #MSUB -n 1              # Reservation du processus
8#-Q- cesium #MSUB -T 86400          # Limite de temps elapsed du job
9#-Q- cesium #MSUB -E "-j o"
10#-Q- cesium #MSUB -E "-S /bin/ksh"
11#-Q- curie ######################
12#-Q- curie ## CURIE   TGCC/CEA ##
13#-Q- curie ######################
14#-Q- curie #MSUB -r TS             # Nom du job               
15#-Q- curie #MSUB -eo
16#-Q- curie #MSUB -n 1              # Reservation du processus
17#-Q- curie #MSUB -T 86400          # Limite de temps elapsed du job
18#-Q- platine #!/usr/bin/ksh
19#-Q- platine ###################
20#-Q- platine ## PLATINE   CEA ##
21#-Q- platine ###################
22#-Q- platine #BSUB -J TS                     # Nom du job
23#-Q- platine #BSUB -N                        # message a la fin du job
24#-Q- platine #BSUB -n 1                      # reservation des processeurs pour le job
25#-Q- platine #BSUB -W 1:00                   # Limite temps
26#-Q- platine #BSUB -q post                   # Passage en queue post
27#-Q- platine #BSUB -L /bin/ksh
28#-Q- sx8brodie #!/bin/ksh
29#-Q- sx8brodie #######################
30#-Q- sx8brodie ## SX8BRODIE   IDRIS ##
31#-Q- sx8brodie #######################
32#-Q- sx8brodie # Temps Elapsed max. d'une requete hh:mm:ss
33#-Q- sx8brodie # @ wall_clock_limit = 20:00:00
34#-Q- sx8brodie # Nom du travail LoadLeveler
35#-Q- sx8brodie # @ job_name   = TS
36#-Q- sx8brodie # Fichier de sortie standard du travail       
37#-Q- sx8brodie # @ output     = $(job_name).$(jobid)
38#-Q- sx8brodie # Fichier de sortie d'erreur du travail
39#-Q- sx8brodie # @ error      =  $(job_name).$(jobid)
40#-Q- sx8brodie # pour recevoir un mail en cas de depassement du temps Elapsed (ou autre pb.)
41#-Q- sx8brodie # @ notification = error
42#-Q- sx8brodie # @ environment  = $DEBUG_debug ; $MODIPSL ; $libIGCM ; $libIGCM_SX ; $SUBMIT_DIR ; $REBUILD_DIR ; $RebuildFromArchive ; $POST_DIR ; $MASTER ; $RebuildFrequency ; $DateBegin ; $PeriodDateBegin ; $PeriodDateEnd ; $NbRebuildDir ; $StandAlone ; $CompletedFlag ; $TsTask ; $CompToRead ; $FlagToRead ; $RESOL_ATM ; $RESOL_OCE ; $RESOL_ICE ; $RESOL_MBG ; $RESOL_SRF ; $RESOL_SBG ; $MASTER
43#-Q- sx8brodie # @ queue
44#-Q- aix6 #!/bin/ksh
45#-Q- aix6 #######################
46#-Q- aix6 ##   VARGAS   IDRIS  ##
47#-Q- aix6 #######################
48#-Q- aix6 # Temps Elapsed max. d'une requete hh:mm:ss
49#-Q- aix6 # @ wall_clock_limit = 20:00:00
50#-Q- aix6 # Nom du travail LoadLeveler
51#-Q- aix6 # @ job_name   = TS
52#-Q- aix6 # Fichier de sortie standard du travail
53#-Q- aix6 # @ output     = $(job_name).$(jobid)
54#-Q- aix6 # Fichier de sortie d'erreur du travail
55#-Q- aix6 # @ error      =  $(job_name).$(jobid)
56#-Q- aix6 # pour recevoir un mail en cas de depassement du temps Elapsed (ou autre pb.)
57#-Q- aix6 # @ notification = error
58#-Q- aix6 # @ environment  = $DEBUG_debug ; $MODIPSL ; $libIGCM ; $libIGCM_SX ; $SUBMIT_DIR ; $REBUILD_DIR ; $RebuildFromArchive ; $POST_DIR ; $MASTER ; $RebuildFrequency ; $DateBegin ; $PeriodDateBegin ; $PeriodDateEnd ; $NbRebuildDir ; $StandAlone ; $CompletedFlag ; $TsTask ; $CompToRead ; $FlagToRead ; $RESOL_ATM ; $RESOL_OCE ; $RESOL_ICE ; $RESOL_MBG ; $RESOL_SRF ; $RESOL_SBG ; $MASTER
59#-Q- aix6 # @ queue
60#-Q- ulam #!/bin/ksh
61#-Q- ulam #######################
62#-Q- ulam ##   ULAM   IDRIS  ##
63#-Q- ulam #######################
64#-Q- ulam # Temps Elapsed max. d'une requete hh:mm:ss
65#-Q- ulam # @ wall_clock_limit = 20:00:00
66#-Q- ulam # Nom du travail LoadLeveler
67#-Q- ulam # @ job_name   = TS
68#-Q- ulam # Fichier de sortie standard du travail
69#-Q- ulam # @ output     = $(job_name).$(jobid)
70#-Q- ulam # Fichier de sortie d'erreur du travail
71#-Q- ulam # @ error      =  $(job_name).$(jobid)
72#-Q- ulam # pour recevoir un mail en cas de depassement du temps Elapsed (ou autre pb.)
73#-Q- ulam # @ notification = error
74#-Q- ulam # @ environment  = $DEBUG_debug ; $MODIPSL ; $libIGCM ; $libIGCM_SX ; $SUBMIT_DIR ; $REBUILD_DIR ; $RebuildFromArchive ; $POST_DIR ; $MASTER ; $RebuildFrequency ; $DateBegin ; $PeriodDateBegin ; $PeriodDateEnd ; $NbRebuildDir ; $StandAlone ; $CompletedFlag ; $TsTask ; $CompToRead ; $FlagToRead ; $RESOL_ATM ; $RESOL_OCE ; $RESOL_ICE ; $RESOL_MBG ; $RESOL_SRF ; $RESOL_SBG ; $MASTER
75#-Q- ulam # @ queue
76#-Q- sx8mercure #!/bin/ksh
77#-Q- sx8mercure ######################
78#-Q- sx8mercure ## SX8MERCURE   CEA ##
79#-Q- sx8mercure ######################
80#-Q- sx8mercure #PBS -N TS                   # Nom du job
81#-Q- sx8mercure #PBS -j o                    # regroupement des stdout et stderr
82#-Q- sx8mercure #PBS -S /usr/bin/ksh         # shell de soumission
83#-Q- sx8mercure #PBS -l memsz_job=1gb        # Limite memoire a 1 Go
84#-Q- sx8mercure #PBS -l cputim_job=24:00:00   # Limite temps a 2 heures
85#-Q- sx8mercure #PBS -q scalaire
86#-Q- sx9mercure #!/bin/ksh
87#-Q- sx9mercure ######################
88#-Q- sx9mercure ## SX9MERCURE  CCRT ##
89#-Q- sx9mercure ######################
90#-Q- sx9mercure #PBS -N TS                   # Nom du job
91#-Q- sx9mercure #PBS -j o                    # regroupement des stdout et stderr
92#-Q- sx9mercure #PBS -S /usr/bin/ksh         # shell de soumission
93#-Q- sx9mercure #PBS -l memsz_job=1gb        # Limite memoire a 1 Go
94#-Q- sx9mercure #PBS -l elapstim_req=24:00:00   # Limite temps a 2 heures
95#-Q- sx9mercure #PBS -q scalaire
96#-Q- titane #!/bin/ksh
97#-Q- titane ######################
98#-Q- titane ## TITANE   CEA ##
99#-Q- titane ######################
100#-Q- titane #MSUB -r TS             # Nom du job               
101#-Q- titane #MSUB -eo
102#-Q- titane #MSUB -n 1              # Reservation du processus
103#-Q- titane #MSUB -T 86400          # Limite de temps elapsed du job
104#-Q- titane #MSUB -q mono
105#-Q- lxiv8 ######################
106#-Q- lxiv8 ## OBELIX      LSCE ##
107#-Q- lxiv8 ######################
108#-Q- lxiv8 #PBS -N TS
109#-Q- lxiv8 #PBS -m a
110#-Q- lxiv8 #PBS -j oe
111#-Q- lxiv8 #PBS -q medium
112#-Q- lxiv8 #PBS -o TS.$$
113#-Q- lxiv8 #PBS -S /bin/ksh
114#-Q- default #!/bin/ksh
115#-Q- default ##################
116#-Q- default ## DEFAULT HOST ##
117#-Q- default ##################
118
119#**************************************************************
120# Author: Sebastien Denvil
121# Contact: Sebastien.Denvil__at__ipsl.jussieu.fr
122# $Revision::                                          $ Revision of last commit
123# $Author::                                            $ Author of last commit
124# $Date::                                              $ Date of last commit
125# IPSL (2006)
126#  This software is governed by the CeCILL licence see libIGCM/libIGCM_CeCILL.LIC
127#
128#**************************************************************
129
130#set -eu
131#set -vx
132
133date
134
135#-Q- sx8brodie export OMP_NUM_THREADS=1
136#-Q- aix6 export OMP_NUM_THREADS=1
137#-Q- ulam export OMP_NUM_THREADS=1
138
139########################################################################
140
141#D- Flag to determine if this job in a standalone mode
142#D- Default : value from AA_job if any
143StandAlone=${StandAlone:=true}
144
145#D- Path to libIGCM
146#D- Default : value from AA_job if any
147# WARNING For StandAlone use : To run this script on some machine (ulam and cesium)
148# WARNING you must check MirrorlibIGCM variable in sys library.
149# WARNING If this variable is true, you must use libIGCM_POST path instead
150# WARNING of your running libIGCM directory.
151libIGCM=${libIGCM:=::modipsl::/libIGCM}
152
153#D- Flag to determine allready produced time series. Empty if you start from the beginning
154#D- Default : Value from AA_job if any. Usefull in StandAlone case if you want to continue a time series
155CompletedFlag=${CompletedFlag:=}
156
157#D- Flag to determine task type this script will perform.
158#D- Possible Value : 2D, 3D, Chunck2D, Chunck3D
159#D- Default : Value from AA_job if any. Usefull in StandAlone case.
160TsTask=${TsTask:=2D}
161if [ X${TsTask} = Xempty ] ; then
162    TsTask=""
163fi
164
165#D- Flag to determine if rebuild process has been performed asynchronously
166#D- Possible value true or false.
167#D- If true raw files has allready been patched by rebuild job
168#D- If false create_ts will patch the raw files
169#D- Default : Value from AA_job if any. Usefull in StandAlone case.
170RebuildFrequency=${RebuildFrequency:=true}
171
172#D- Flag to determine job's output directory
173#D- Default : value from libIGCM_post.ksh if any
174POST_DIR=${POST_DIR:=${PBS_O_WORKDIR:=$(pwd)}}
175
176#D- Increased verbosity (1, 2, 3)
177#D- Default : value from AA_job if any
178Verbosity=${Verbosity:=3}
179
180#D- Low level debug : to bypass lib test checks and stack construction
181#D- Default : value from AA_job if any
182DEBUG_debug=${DEBUG_debug:=false}
183
184#D- TEMPORARY Flag to determine atmospheric resolution
185#D- Default : value from atmospheric driver if any
186RESOL_ATM=ALL
187
188#D- Flag to determine surface resolution
189#D- Default : value from surface driver if any
190RESOL_SRF=ALL
191
192#D- Flag to determine surface resolution
193#D- Default : value from surface driver if any
194RESOL_SBG=ALL
195
196#D- TEMPORARY Flag to determine ocean resolution
197#D- Default : value from ocean driver if any
198RESOL_OCE=${RESOL_OCE:=ORCA2}
199
200#D- TEMPORARY Flag to determine ice resolution
201#D- Default : value from ice driver if any
202RESOL_ICE=${RESOL_ICE:=ORCA2}
203
204#D- TEMPORARY Flag to determine marine biogeochemistry resolution
205#D- Default : value from ice driver if any
206RESOL_MBG=${RESOL_MBG:=ORCA2}
207
208########################################################################
209
210. ${libIGCM}/libIGCM_debug/libIGCM_debug.ksh
211      ( ${DEBUG_debug} ) && IGCM_debug_Check
212. ${libIGCM}/libIGCM_card/libIGCM_card.ksh
213     ( ${DEBUG_debug} ) && IGCM_card_Check
214. ${libIGCM}/libIGCM_date/libIGCM_date.ksh
215     ( ${DEBUG_debug} ) && IGCM_date_Check
216#-------
217. ${libIGCM}/libIGCM_sys/libIGCM_sys.ksh
218
219########################################################################
220
221#set -vx
222
223# Useful cleaning function
224MENAGE () 
225{
226    [ -f $3 ] && ( IGCM_sys_RshArchive rm -f $1/$2 ;)
227}
228
229########################################################################
230
231IGCM_sys_MkdirWork ${RUN_DIR_PATH}
232IGCM_sys_Cd ${RUN_DIR_PATH}
233
234# ------------------------------------------------------------------
235# Test if all was right before proceeding further
236# ------------------------------------------------------------------
237IGCM_debug_Verif_Exit_Post
238
239if [ ${StandAlone} = true ] ; then
240    CARD_DIR=${SUBMIT_DIR}
241else
242    CARD_DIR=${RUN_DIR_PATH}/$( basename ${SUBMIT_DIR} )
243    IGCM_sys_Get_Master ${SUBMIT_DIR} ${RUN_DIR_PATH}
244fi
245
246#==================================
247# First of all
248#
249typeset option
250
251#==================================
252# Read UserChoices section:
253IGCM_card_DefineArrayFromSection       ${CARD_DIR}/config.card UserChoices
254echo
255IGCM_debug_Print 1 "DefineArrayFromOption  : config_UserChoices"
256for option in ${config_UserChoices[*]} ; do
257    IGCM_card_DefineVariableFromOption ${CARD_DIR}/config.card UserChoices ${option}
258    eval auxprint=\${config_UserChoices_${option}}
259    IGCM_debug_Print 3 "${option} : ${auxprint}"
260done
261#
262echo
263
264#==================================
265# Read Post section:
266IGCM_card_DefineArrayFromSection ${CARD_DIR}/config.card Post
267echo
268IGCM_debug_Print 1 "DefineArrayFromOption : config_Post"
269for option in ${config_Post[*]} ; do
270  IGCM_card_DefineVariableFromOption ${CARD_DIR}/config.card Post ${option}
271  eval auxprint=\${config_Post_${option}}
272  IGCM_debug_Print 3 "${option} : ${auxprint}"
273done
274#
275echo
276
277#==================================
278# Define default value to keep compatibility with previous card: means before changes due to TGCC
279if [ X${PackDefault} = Xtrue ] ; then
280  [ X${config_Post_PackFrequency} = X ] && config_Post_PackFrequency=${config_Post_RebuildFrequency}
281else
282  config_Post_PackFrequency=NONE
283fi
284
285#==================================
286# If pack is active then PackFrequency overule the config_UserChoices_PeriodLength
287if ( [ ! X${config_Post_PackFrequency} = X${NULL_STR} ] && [ ! X${config_Post_PackFrequency} = XNONE ] ) ; then
288  config_UserChoices_PeriodLength=${config_Post_PackFrequency}
289fi
290
291#==================================
292#R_SAVE : Job output directory
293#R_BUFR : Job output buffered directory
294if ( [ ! X${config_UserChoices_SpaceName} = X ] && [ ! X${config_UserChoices_ExperimentName} = X ] ) ; then
295    FreeName=$( echo ${config_UserChoices_JobName} | sed 's/.*_//' )
296    R_SAVE=${R_OUT}/${config_UserChoices_TagName}/${config_UserChoices_SpaceName}/${config_UserChoices_ExperimentName}/${FreeName}
297    R_BUFR=${R_BUF}/${config_UserChoices_TagName}/${config_UserChoices_SpaceName}/${config_UserChoices_ExperimentName}/${FreeName}
298    R_DODS=${config_UserChoices_TagName}/${config_UserChoices_SpaceName}/${config_UserChoices_ExperimentName}/${FreeName}
299else
300    R_SAVE=${R_OUT}/${config_UserChoices_TagName}/${config_UserChoices_JobName}
301    R_BUFR=${R_BUF}/${config_UserChoices_TagName}/${config_UserChoices_JobName}
302    R_DODS=${config_UserChoices_TagName}/${config_UserChoices_JobName}
303fi
304#
305# Determine component to take care of depending on kind of task create_ts will perform
306#
307[ ${CompToRead} ] && set -A config_ListOfComponents ${CompToRead} || IGCM_card_DefineArrayFromSection ${CARD_DIR}/config.card ListOfComponents
308#
309# Determine period for time series. Default : value from AA_job or from launch_TS if any
310#
311[ X${CompletedFlag} = X ] || CompletedFlag=$( IGCM_date_ConvertFormatToGregorian ${CompletedFlag} )
312
313DateBegin=${DateBegin:=$( IGCM_date_ConvertFormatToGregorian ${config_UserChoices_DateBegin} )}
314#
315PeriodDateEnd=${PeriodDateEnd:=$( IGCM_date_ConvertFormatToGregorian ${config_UserChoices_DateEnd} )}
316#
317# Determine Dimension of the produced time series : 2D or 3D
318if (   [ X${TsTask} = XChunck2D ] || [ X${TsTask} = X2D ] ) ; then
319    Dimension=2D
320elif ( [ X${TsTask} = XChunck3D ] || [ X${TsTask} = X3D ] ) ; then
321    Dimension=3D
322else
323    Dimension=""
324fi
325
326# ------------------------------------------------------------------
327#D- Test if all was right before entering the loop
328# ------------------------------------------------------------------
329IGCM_debug_Verif_Exit_Post
330
331########################################################################
332#
333#      Depending on requested time series fill following variables :
334#
335#                           - LISTE_FILE_${comp}[*]
336#                           - LISTE_VARS_${file}[*]
337#                           - LISTE_AXIS_${file}[*]
338#                           - LISTE_PATCH_${file}[*]
339########################################################################
340
341#
342# For each selected component determine which files need post-processing
343#
344DoJob=false
345for comp in ${config_ListOfComponents[*]} ; do
346    #
347    ActiveComp=false
348    #
349    IGCM_card_DefineArrayFromOption ${CARD_DIR}/config.card ListOfComponents ${comp}
350    eval compname=\${config_ListOfComponents_${comp}[0]} > /dev/null 2>&1
351    #
352    card=${CARD_DIR}/COMP/${compname}.card
353
354    IGCM_card_DefineArrayFromOption ${card} OutputFiles List
355    #
356    ListFilesName=${compname}_OutputFiles_List
357    eval FileName0=\${${ListFilesName}[0]} > /dev/null 2>&1
358    #
359    if [ X${FileName0} != X${NULL_STR} ] ; then
360        #
361        #IGCM_debug_Print 1 "Component      : ${compname}"
362        #
363        # INITIALISATION
364        #
365        typeset i
366        if [ ${FlagToRead} ] ; then
367            ((NbFiles=${FlagToRead}))
368            ((i=${NbFiles}))
369        else
370            eval NbFiles=\${#${ListFilesName}[@]} > /dev/null 2>&1
371            i=2
372        fi
373        #
374        until [ $i -gt $NbFiles ]; do
375            #
376            eval flag_post=\${${ListFilesName}[$i]} > /dev/null 2>&1
377            #
378            if [ X${flag_post} != XNONE ] ; then
379                #
380                # For each comp and each file who needs post-processing
381                # determine which variables need time series.
382                #
383                FILE=$( echo ${flag_post} | awk "-FPost_" '{print $2}' )
384                IGCM_card_DefineArrayFromOption ${card}    Post_${FILE} TimeSeriesVars${Dimension}
385                IGCM_card_DefineVariableFromOption ${card} Post_${FILE} ChunckJob${Dimension}
386                #
387                # If TimeSeriesVars list is empty we skip
388                #
389                if [ $( eval echo \${${compname}_Post_${FILE}_TimeSeriesVars${Dimension}} ) = ${NULL_STR} ] ; then
390                    #
391                    IGCM_debug_Print 3 "Nothing to do for ${FILE} according to ${card}"
392                    IGCM_debug_Print 3 "TimeSeriesVars${Dimension} for ${FILE} is empty"
393                    (( i=i+3 ))
394                    continue
395                    #
396                fi
397                #
398                # If files/variables has been switch off by ChunckJob${Dimension}=0 we skip
399                #
400                if [ X$( eval echo \${${compname}_Post_${FILE}_ChunckJob${Dimension}} ) = XOFF ] ; then
401                    IGCM_debug_Print 3 "Nothing to do for ${FILE} according to ${card}"
402                    IGCM_debug_Print 3 "ChunckJob${Dimension}=OFF for ${FILE} so it has been switched off"
403                    (( i=i+3 ))
404                    continue
405                fi
406                #
407                # If we are not a Chunck type task, we skip files/variables handled by chunck task
408                #
409                if ( [ ! X${TsTask} = XChunck${Dimension} ] && [ ! X${TsTask} = X ] && [ ! XChunck${Dimension} = XChunck ] ) ; then
410                    if [ ! $( eval echo \${${compname}_Post_${FILE}_ChunckJob${Dimension}} ) = NONE ] ; then
411                        IGCM_debug_Print 3 "Nothing to do for ${FILE} TimeSeriesVars${Dimension} according to ${card}"
412                        IGCM_debug_Print 3 "Let another chunck task do the job $( eval echo \${${compname}_Post_${FILE}_ChunckJob${Dimension}} )"
413                        (( i=i+3 ))
414                        continue
415                    fi
416                fi
417                #
418                # Now on we know we have things to do
419                #
420
421                #
422                #  We need coordinates axis to properly fill produced time series
423                #
424                IGCM_card_DefineArrayFromOption ${card} Post_${FILE} GatherWithInternal
425                #
426                if [ $( eval echo \${${compname}_Post_${FILE}_GatherWithInternal} ) = ${NULL_STR} ] ; then
427                    #
428                    IGCM_debug_Print 1 "ERROR !! We miss coordinate axis for ${FILE} according to ${card}"
429                    IGCM_debug_Print 1 "So no time series will be produced for ${FILE} !!"
430                    (( i=i+3 ))
431                    continue
432                    #
433                fi
434                #
435                # We need LIST of variables not allready produced (useful for standalone mode)
436                #
437                FlagDir=$( echo ${FILE} | awk -F "_" '{print $1}' )
438                case ${FlagDir} in
439                    *Y)  TS_Dir=TS_YE  ;;
440                    *M)  TS_Dir=TS_MO  ;;
441                    *D)  TS_Dir=TS_DA  ;;
442                    HF)  TS_Dir=TS_HF  ;;
443                    3H)  TS_Dir=TS_HF  ;;
444                    INS) TS_Dir=TS_INS ;;
445                esac
446                #
447                count=0
448                for var in $( eval echo \${${compname}_Post_${FILE}_TimeSeriesVars${Dimension}[*]} ) ; do
449                    #
450                    DIRECTORY=${R_SAVE}/${comp}/Analyse/${TS_Dir}
451                    TestedFile=${config_UserChoices_JobName}_${DateBegin}_${PeriodDateEnd}_${FlagDir}_${var}.nc
452                    #
453                    IGCM_sys_TestFileArchive ${DIRECTORY}/${TestedFile}
454                    if [ ! $? = 0 ] ; then
455                        eval set +A LISTE_VARS_${FILE} \${LISTE_VARS_${FILE}[*]} ${var}
456                        ActiveComp=true
457                        (( count = count + 1 ))
458                    fi
459                done
460                #
461                if [ ${count} -gt 0 ] ; then
462                    #
463                    eval set +A LISTE_FILE_${comp} \${LISTE_FILE_${comp}[*]} ${FILE}
464                    eval set +A LISTE_AXIS_${FILE} \${${compname}_Post_${FILE}_GatherWithInternal[*]}
465                    #
466                    if [ ! X${RebuildFrequency} = Xtrue ] ; then
467                        IGCM_card_DefineArrayFromOption ${card} Post_${FILE} Patches
468                        eval set +A LISTE_PATCHES_${FILE} \${${compname}_Post_${FILE}_Patches[*]}
469                        if [ X$( eval echo \${LISTE_PATCHES_${FILE}[0]} ) !=  X${NULL_STR} ]; then
470                            for Patch in $( eval echo \${LISTE_PATCHES_${FILE}[*]} ); do
471                                if [ Xload${Patch} != X ] ; then
472                                    . ${libIGCM}/libIGCM_post/IGCM_${Patch}.ksh
473                                    eval load${Patch}=loaded
474                                fi
475                            done
476                        fi
477                    fi
478                fi
479            fi
480            (( i=i+3 ))
481        done
482    fi
483    #
484    if [ ${ActiveComp} = true ] ; then
485        set +A ActiveListOfComponents ${ActiveListOfComponents[*]} ${comp}
486    fi
487done
488
489set -A config_ListOfComponents ${ActiveListOfComponents[*]}
490[ ! -z "${ActiveListOfComponents}" ] && DoJob=true
491
492########################################################################
493#
494#               IS THERE SOME ALLREADY PRODUCED TIME SERIES ?
495#                 IF SO BRING THEM IN THE WORKING DIRECTORY
496#
497# PS : Keep in mind that IGCM_sys_Get here is a weak link :
498#      - especially for IDRiS
499#      - no special protection against "command too long" !
500#      - libIGCM_sys should handle that or modify following code part
501#
502########################################################################
503
504if [ ${StandAlone} != true ] ; then
505    Running_Flag=$( IGCM_sys_RshMaster "IGCM_card_DefineVariableFromOption \
506       ${SUBMIT_DIR}/run.card PostProcessing TimeSeriesRunning ; \
507       echo \${run_PostProcessing_TimeSeriesRunning}" )
508
509    #if [ X${Running_Flag} = Xy ] ; then
510    #    # Time Series Job allready running
511    #   IGCM_debug_Print 1 "Time Series Job allready running exit"
512    #   exit
513    #fi
514    # Now run.card know we are running
515
516
517
518
519    IGCM_sys_RshMaster IGCM_card_WriteOption ${SUBMIT_DIR}/run.card PostProcessing TimeSeriesRunning "y"
520
521
522
523
524
525    # Get information from last execution
526    #CompletedFlag=$( IGCM_sys_RshMaster \
527    #   "IGCM_card_DefineVariableFromOption ${SUBMIT_DIR}/run.card PostProcessing TimeSeriesCompleted ;\
528    #        echo \${run_PostProcessing_TimeSeriesCompleted}" )
529fi
530
531# Is it the first submission or not ?
532
533if ( [ X${CompletedFlag} = X ] || [ X${CompletedFlag} = X$( IGCM_date_AddDaysToGregorianDate ${DateBegin} -1 ) ] ) ; then
534    # First Time Series Submission
535    FIRST_PASS=TRUE
536    Length=$( IGCM_date_DaysInPreviousPeriod ${DateBegin} ${config_UserChoices_PeriodLength} begin)
537    DATE_FIN_JOB_B=$( IGCM_date_AddDaysToGregorianDate ${DateBegin} $(( Length - 1 )) )
538else
539    # Last Completed Time Series
540    FIRST_PASS=FALSE
541    DATE_FIN_JOB_B=${CompletedFlag}
542    date=${DateBegin}_${DATE_FIN_JOB_B}
543    for comp in ${config_ListOfComponents[*]} ; do
544        #
545        IGCM_sys_Mkdir ${RUN_DIR_PATH}/${comp}
546        #
547        IGCM_sys_Cd ${RUN_DIR_PATH}/${comp}
548        #
549        #set -A liste_file
550        unset liste_file
551        #
552        file_path=${R_SAVE}/${comp}/Analyse
553        #
554        i=0
555        file=${NULL_STR}
556        #
557        for file in $( eval echo \${LISTE_FILE_${comp}[*]} ); do
558            #
559            # Determine in which output can we find file
560            # IE : Analyse/TS or Analyse/DA2TS or ...
561            #
562            FlagDir=$( echo ${file} | awk -F "_" '{print $1}' )
563            case ${FlagDir} in
564                *Y)  TS_Dir=TS_YE  ;;
565                *M)  TS_Dir=TS_MO  ;;
566                *D)  TS_Dir=TS_DA  ;;
567                HF)  TS_Dir=TS_HF  ;;
568                3H)  TS_Dir=TS_HF  ;;
569                INS) TS_Dir=TS_INS ;;
570            esac
571            for var in $( eval echo \${LISTE_VARS_${file}[*]} ) ; do
572                #
573                #set +A liste_file ${liste_file[*]} ${file_path}/${TS_Dir}/${config_UserChoices_JobName}_${date}_${FlagDir}_${var}.nc
574                liste_file[${#liste_file[*]}]=${file_path}/${TS_Dir}/${config_UserChoices_JobName}_${date}_${FlagDir}_${var}.nc
575                #
576            done
577        done
578        if [ X${file} != X${NULL_STR} ] ; then
579            IGCM_sys_Get /l liste_file[*] ${RUN_DIR_PATH}/${comp}
580            # Even if some files are missing we tried to continue
581            # Either ListVar in compname.card are asked but not present in original history file
582            # Either a previous TS task failed
583            ExitFlag=false
584            IGCM_debug_Verif_Exit_Post
585        fi
586    done
587    #
588    LEVEL=0
589    #
590fi
591
592########################################################################
593#
594#                          DEFINE LOOP PARAMETERS
595#
596########################################################################
597
598DATE_COUNT=${DATE_FIN_JOB_B}
599DATE_FIN_JOB_B_LOOP=${DATE_FIN_JOB_B}
600
601( [ -n "${LEVEL}" ] && [ ${LEVEL} -eq 0 ] ) && NBRE_FILE_TOT=0 || NBRE_FILE_TOT=1
602
603if [ ${DoJob} = true ] ; then
604    while [ ${DATE_COUNT} -lt ${PeriodDateEnd} ] ; do
605        (( NBRE_FILE_TOT = NBRE_FILE_TOT + 1 ))
606        Length=$( IGCM_date_DaysInNextPeriod ${DATE_COUNT} ${config_UserChoices_PeriodLength} )
607        DATE_COUNT=$( IGCM_date_AddDaysToGregorianDate ${DATE_COUNT} ${Length} )
608    done
609else
610    NBRE_FILE_TOT=0
611fi
612
613if [ ${NBRE_FILE_TOT} -le ${UNIX_MAX_LIMIT} ] ; then
614    NBRE_TOUR=1
615elif [ ${NBRE_FILE_TOT}%${UNIX_MAX_LIMIT} -eq 0 ] ; then
616    let NBRE_TOUR=${NBRE_FILE_TOT}/${UNIX_MAX_LIMIT} 
617else
618    let NBRE_TOUR=${NBRE_FILE_TOT}/${UNIX_MAX_LIMIT}+1
619fi
620
621CURRENT_LOOP=1
622# THIS LOOP GIVES PARAMETERS FOR THE DATE'S LOOP ie : DATE_COURANTE, DATE_FIN.
623# WE HAVE 3 LEVELS
624#    - LEVEL 1 : JUST ONE LOOP TO COMPLETE
625#    - LEVEL 2 : WE ARE IN THE "DEEP" LOOP
626#    - LEVEL 3 : WE ARE IN THE LAST LOOP
627
628while [ ${CURRENT_LOOP} -le  ${NBRE_TOUR} ] ; do
629     
630    if [ ${NBRE_FILE_TOT} -le ${UNIX_MAX_LIMIT} ] ; then 
631        # - LEVEL 1 : JUST ONE LOOP TO COMPLETE
632        NBRE_FILE_LOOP=${NBRE_FILE_TOT}
633
634        if [ ${FIRST_PASS} = TRUE ] ; then
635            DATE_COURANTE=${DATE_FIN_JOB_B_LOOP}
636        else
637            Length=$( IGCM_date_DaysInNextPeriod ${DATE_FIN_JOB_B_LOOP} ${config_UserChoices_PeriodLength} )
638            DATE_COURANTE=$( IGCM_date_AddDaysToGregorianDate ${DATE_FIN_JOB_B_LOOP} ${Length} )
639        fi
640
641        DATE_FIN=${PeriodDateEnd}
642        DATE_FIN_JOB_B_LOOP_PREC=${DATE_FIN_JOB_B_LOOP}
643
644        [ -n "${DATE_LOOP}" ] && DATE_FIN_JOB_B_LOOP=${DATE_LOOP}
645        [ -n "${LEVEL}" ] && FLAG_B="TRUE" || FLAG_B="FALSE"
646
647        LEVEL=1
648        DEPOT="TRUE"     
649    elif [ ${CURRENT_LOOP} -ne  ${NBRE_TOUR} ] ; then
650        # - LEVEL 2 : WE ARE IN THE "DEEP" LOOP
651        NBRE_FILE_LOOP=${UNIX_MAX_LIMIT}
652
653        if [ ! ${FIRST_PASS} = TRUE ] && [ ${CURRENT_LOOP} -eq 1 ] ; then
654            Length=$( IGCM_date_DaysInNextPeriod ${DATE_FIN_JOB_B_LOOP} ${config_UserChoices_PeriodLength} )
655            DATE_COURANTE=$( IGCM_date_AddDaysToGregorianDate ${DATE_FIN_JOB_B_LOOP} ${Length} )
656        elif [ -z "${DATE_COURANTE}" ] ; then
657            DATE_COURANTE=${DATE_FIN_JOB_B}
658        else
659            Length=$( IGCM_date_DaysInNextPeriod ${DATE_FIN} ${config_UserChoices_PeriodLength} )
660            DATE_COURANTE=$( IGCM_date_AddDaysToGregorianDate ${DATE_FIN} ${Length} )
661        fi
662         
663        (( TotLength = 0 ))
664        COMPTEUR=1
665        DATE_LOOP=${DATE_COURANTE}
666
667        while [ ${COMPTEUR} -lt ${NBRE_FILE_LOOP} ] ; do
668            #
669            Length=$( IGCM_date_DaysInNextPeriod ${DATE_LOOP} ${config_UserChoices_PeriodLength} )
670            DATE_LOOP=$( IGCM_date_AddDaysToGregorianDate ${DATE_LOOP} ${Length} )
671            (( TotLength = TotLength + Length ))
672            (( COMPTEUR = COMPTEUR + 1 ))
673            #
674        done # while [ ${COMPTEUR} -le ${NBRE_FILE_LOOP} ] done
675        DATE_FIN=$( IGCM_date_AddDaysToGregorianDate ${DATE_COURANTE} ${TotLength} )
676
677        [ -n "${DATE_LOOP}" ] && DATE_FIN_JOB_B_LOOP_PREC=${DATE_FIN_JOB_B_LOOP} ; DATE_FIN_JOB_B_LOOP=${DATE_LOOP}
678        [ -n "${LEVEL}" ] && [ ${LEVEL} -eq 0 ] && FLAG_B="TRUE" || [ ${CURRENT_LOOP} -gt 1 ] && FLAG_B="TRUE" || FLAG_B="FALSE"
679        DEPOT="FALSE"
680        LEVEL=2
681    else
682        # - LEVEL 3 : WE ARE IN THE LAST LOOP
683        NBRE_FILE_LOOP=$(( ${NBRE_FILE_TOT} % ( ${UNIX_MAX_LIMIT} * ( ${CURRENT_LOOP} - 1 ) ) ))
684        [ ${NBRE_FILE_LOOP} -eq 0 ] && NBRE_FILE_LOOP=${UNIX_MAX_LIMIT}
685
686        Length=$( IGCM_date_DaysInNextPeriod ${DATE_FIN} ${config_UserChoices_PeriodLength} )
687        DATE_COURANTE=$(IGCM_date_AddDaysToGregorianDate ${DATE_FIN} ${Length} )
688        DATE_FIN=${PeriodDateEnd}
689        [ -n "${DATE_LOOP}" ] && DATE_FIN_JOB_B_LOOP_PREC=${DATE_FIN_JOB_B_LOOP} ; DATE_FIN_JOB_B_LOOP=${DATE_LOOP}
690
691        LEVEL=3
692        DEPOT="TRUE"
693        FLAG_B="TRUE"
694    fi
695
696    # THEN FOR EACH FILE TYPE WE LOOP BETWEEN DATE_COURANTE AND DATE_FIN.
697    for comp in ${config_ListOfComponents[*]} ; do
698        #
699        IGCM_sys_Mkdir ${RUN_DIR_PATH}/${comp}
700        #
701        IGCM_sys_Cd ${RUN_DIR_PATH}/${comp}
702        #
703        eval R_OUT_${comp}=${R_SAVE}/${comp}
704        #
705        i=0
706        #
707        for file in $( eval echo \${LISTE_FILE_${comp}[*]} ); do
708            #
709            # Determine in which output can we find file
710            # IE : Output/MO or Output/DA or ...
711            #
712            FlagDir=$( echo ${file} | awk -F "_" '{print $1}' )
713            case ${FlagDir} in
714                *Y)    TS_Dir=TS_YE  ; FreqDir=YE  ;;
715                *M)    TS_Dir=TS_MO  ; FreqDir=MO  ;;
716                *D)    TS_Dir=TS_DA  ; FreqDir=DA  ;;
717                HF)    TS_Dir=TS_HF  ; FreqDir=HF  ;;
718                3H)    TS_Dir=TS_HF  ; FreqDir=HF  ;;
719                INS)   TS_Dir=TS_INS ; FreqDir=INS ;;
720                *) 
721                       IGCM_debug_Print 1 "Error in FlagDir=${FlagDir} for file ${file}."
722                       IGCM_sys_Exit "Job create_ts" ;;
723            esac
724
725            # Initialize array
726            #set -A liste_file
727            #set -A liste_file_tmp
728            unset liste_file
729            unset liste_file_tmp
730            eval file_path=\${R_OUT_${comp}}/Output/${FreqDir}/
731
732            COMPTEUR=1
733            DATE_LOOP=${DATE_COURANTE}
734
735            while [ ${COMPTEUR} -le ${NBRE_FILE_LOOP} ] ; do
736                #
737                Length1=$( IGCM_date_DaysInPreviousPeriod ${DATE_LOOP} ${config_UserChoices_PeriodLength} end)
738                DATE_TAB=$(  IGCM_date_AddDaysToGregorianDate ${DATE_LOOP} $(( 1 - Length1 )) )_${DATE_LOOP}
739
740                Length2=$( IGCM_date_DaysInNextPeriod ${DATE_LOOP} ${config_UserChoices_PeriodLength} )
741                DATE_LOOP=$( IGCM_date_AddDaysToGregorianDate ${DATE_LOOP} ${Length2} )
742
743                #set +A liste_file ${liste_file[*]} ${file_path}${config_UserChoices_JobName}_${DATE_TAB}_${file}.nc
744                #set +A liste_file_tmp ${liste_file_tmp[*]} ${config_UserChoices_JobName}_${DATE_TAB}_${file}.nc
745                liste_file[${#liste_file[*]}]=${file_path}${config_UserChoices_JobName}_${DATE_TAB}_${file}.nc
746                liste_file_tmp[${#liste_file_tmp[*]}]=${config_UserChoices_JobName}_${DATE_TAB}_${file}.nc
747                (( COMPTEUR = COMPTEUR + 1 ))
748                #
749            done # while [ ${COMPTEUR} -le ${NBRE_FILE_LOOP} ] done
750            DATE_LOOP=$( IGCM_date_AddDaysToGregorianDate ${DATE_LOOP} -${Length2} )
751
752            # Get selected files
753            IGCM_sys_Get /l liste_file[*] ${RUN_DIR_PATH}/${comp}
754            IGCM_debug_Verif_Exit_Post
755
756            # Apply IGCM_Patch if needed
757            if [ ! X${RebuildFrequency} = Xtrue ] ; then
758                if [ X$( eval echo \${LISTE_PATCHES_${file}[0]} ) !=  X${NULL_STR} ]; then
759                    for file_t in $( eval echo ${liste_file_tmp[*]} ); do               
760                        for Patch in $( eval echo \${LISTE_PATCHES_${file}[*]} ); do
761                            IGCM_${Patch} ${file_t}
762                            IGCM_debug_Verif_Exit_Post
763                        done
764                    done
765                fi
766            fi
767
768            # WE CAN CONCATENATE FILES AT THIS POINT
769            [ "${FLAG_B}" = "TRUE" ] && DATE_BUILD_B=${DateBegin}_${DATE_FIN_JOB_B_LOOP_PREC}
770            Length=$( IGCM_date_DaysInPreviousPeriod ${DATE_COURANTE} ${config_UserChoices_PeriodLength} end)
771            DATE_BUILD1=$( IGCM_date_AddDaysToGregorianDate ${DATE_COURANTE} -$(( Length - 1 )) )
772            DATE_BUILD=${DATE_BUILD1}_${DATE_FIN}
773            DATE_BUILD_END=${DateBegin}_${DATE_FIN}
774
775            liste_coord=" "
776            for axis in $( eval echo \${LISTE_AXIS_${file}[*]} ); do
777              liste_coord=${liste_coord}${axis}","
778            done
779
780            # Time axis must be the last dimension
781            time_axis=${axis}
782
783            # SWITCH BETWEEN MODEL TO FIT PARTICULAR CASE
784            for var in $( eval echo \${LISTE_VARS_${file}[*]} ) ; do
785                #
786                if [ "${FLAG_B}" = "TRUE" ] ; then
787                    # WE CONCATENATE WITH EXISTING FILES
788                    file1=${config_UserChoices_JobName}_${DATE_BUILD_B}_${FlagDir}_${var}.nc
789                    file_out=${config_UserChoices_JobName}_${DATE_BUILD_END}_${FlagDir}_${var}.nc
790                    IGCM_sys_ncrcat --hst -v ${liste_coord}${var} ${file1} ${liste_file_tmp[*]} ${file_out}
791                    #
792                    IGCM_sys_Rm ${file1}
793                    if [ ! "${DEPOT}" = "TRUE" ] ; then
794                        eval IGCM_sys_Put_Out ${file_out} \${R_OUT_${comp}}/Analyse/${TS_Dir}/${file_out}
795                        # "${file1} = file_before ?
796                        [ ! "${file1}" = "${config_UserChoices_JobName}_${DateBegin}_${DATE_FIN_JOB_B}_${FlagDir}_${var}.nc" ] && eval MENAGE \${R_OUT_${comp}}/Analyse/${TS_Dir} ${file1} ${file_out}
797                    fi
798
799                    ExitFlag=false
800                else
801                    # OR NOT
802                    IGCM_sys_ncrcat --hst -v ${liste_coord}${var} ${liste_file_tmp[*]} ${config_UserChoices_JobName}_${DATE_BUILD}_${FlagDir}_${var}.nc
803                fi
804
805                #
806                if [ "${DEPOT}" = "TRUE" ] ; then
807                    # WE PUT FINAL FILE ON FILE SYSTEM
808                    [ "${FLAG_B}" = "FALSE" ] && file_out=${config_UserChoices_JobName}_${DATE_BUILD}_${FlagDir}_${var}.nc
809                    file_before=${config_UserChoices_JobName}_${DateBegin}_${DATE_FIN_JOB_B}_${FlagDir}_${var}.nc
810                    #
811                    eval IGCM_sys_Put_Out ${file_out} \${R_OUT_${comp}}/Analyse/${TS_Dir}/${file_out}
812                    [ "${FLAG_B}" = "TRUE" ] && eval MENAGE \${R_OUT_${comp}}/Analyse/${TS_Dir} ${file_before} ${file_out}
813                    if [ ! "X${file1}" = "X" ] ; then
814                        [ ! "${file1}" = "${config_UserChoices_JobName}_${DateBegin}_${DATE_FIN_JOB_B}_${FlagDir}_${var}.nc" ] && eval MENAGE \${R_OUT_${comp}}/Analyse/${TS_Dir} ${file1} ${file_out}
815                    fi
816                    #
817                    if ( [ ${FlagDir} = "1M" ] && [ -f ${file_out} ] ) ; then
818                        file_before_YE=${config_UserChoices_JobName}_${DateBegin}_${DATE_FIN_JOB_B}_1Y_${var}.nc
819                        file_out_YE=${config_UserChoices_JobName}_${DATE_BUILD_END}_1Y_${var}.nc
820                        #
821                        # Compute yearly average considering calendar
822                        # and set date of the mid year to 01/07 at 00:00
823                        IGCM_sys_cdo -settime,00:00 -setday,1 -setmon,7 -settunits,days -divdpy -yearsum -muldpm -selvar,${var} ${file_out} ${file_out_YE}
824                        # Extract all ancillary variables except $var, they will be appended after the cdo command
825                        # Needed because cdo applies calculs on all variables
826                        IGCM_sys_ncks -Oh -x -v ${var} ${file_out} ${file_out_YE%%.nc}_tmp1.nc
827                        # This will remove the time axis because cdo rewrites severely with only considered useful variables
828                        IGCM_sys_cdo -mulc,1 ${file_out_YE%%.nc}_tmp1.nc ${file_out_YE%%.nc}_tmp2.nc 2>/dev/null
829                        if [ $? -eq 0 ] ; then
830                                # Now append all ancillary variables if previous cdo operator ok
831                                IGCM_sys_ncks -h -A ${file_out_YE%%.nc}_tmp2.nc ${file_out_YE}
832                        fi
833
834                        # Put global history attribut
835                        IGCM_sys_ncatted -Oh -a history,global,o,c,"build by libIGCM/create_ts" ${file_out_YE}
836                        #
837                        eval IGCM_sys_Put_Out ${file_out_YE} \${R_OUT_${comp}}/Analyse/TS_MO_YE/${file_out_YE}
838                        [ "${FLAG_B}" = "TRUE" ] && eval MENAGE \${R_OUT_${comp}}/Analyse/TS_MO_YE/ ${file_before_YE} ${file_out_YE}
839                        IGCM_sys_Rm ${file_out_YE%%.nc}_tmp*.nc
840                    fi
841                    #
842                    IGCM_sys_Rm ${file_out}
843                    ExitFlag=false
844                    #
845                fi
846                #
847            done     # for var in ${liste_var} ; do
848            IGCM_sys_Rm ${liste_file_tmp[*]}
849        done         # for file in ${liste_file_brut} do
850    done             # for comp in ${config_ListOfComponents[*]} ; do
851    # GO AHEAD IN DEEPEST LOOP
852    (( CURRENT_LOOP = CURRENT_LOOP + 1 ))
853done                 # while [ ${CURRENT_LOOP} -le  ${NBRE_TOUR} ] do
854# FINISH
855
856# DODS copy
857for comp in ${config_ListOfComponents[*]} ; do
858    for TS_Dir in TS_YE TS_MO TS_MO_YE TS_DA TS_HF TS_INS ; do
859        IGCM_sys_TestDirArchive ${R_SAVE}/${comp}/Analyse/${TS_Dir}
860        [ $? = 0 ] && IGCM_sys_Put_Dods ${comp}/Analyse/${TS_Dir}
861    done
862done
863
864export POST_DIR; export SUBMIT_DIR; export libIGCM; export R_INIT; export R_BC; export StandAlone
865export RESOL_ATM; export RESOL_OCE ; export RESOL_ICE ; export RESOL_MBG ; export RESOL_SRF ; export RESOL_SBG
866
867listVarEnv="POST_DIR,SUBMIT_DIR,libIGCM,R_INIT,R_BC,StandAlone,RESOL_ATM,RESOL_OCE,RESOL_ICE,RESOL_MBG,RESOL_SRF,RESOL_SBG"
868export listVarEnv
869
870#D-
871# --------------------------------------------------------------------
872#D- Test if all was right
873# --------------------------------------------------------------------
874IGCM_debug_Verif_Exit_Post
875# --------------------------------------------------------------------
876#D- Submit MONITORING
877# --------------------------------------------------------------------
878if ( [ X${TsTask} = X2D ] || [ X${TsTask} = X3D ] || [ X${TsTask} = X ] ) ; then
879    Script_Post_Output=monitoring.${PeriodDateEnd}
880    IGCM_sys_QsubPost monitoring
881fi
882
883#D-
884# --------------------------------------------------------------------
885#D- Update the run.card
886# --------------------------------------------------------------------
887if [ ${StandAlone} != true ] ; then
888    # Put in run.card end period of time series
889    [ X"${DATE_FIN}" = X ] || IGCM_sys_RshMaster IGCM_card_WriteOption ${SUBMIT_DIR}/run.card PostProcessing TimeSeriesCompleted "${DATE_FIN}"
890    # We have finish the job !
891    IGCM_sys_RshMaster IGCM_card_WriteOption ${SUBMIT_DIR}/run.card PostProcessing TimeSeriesRunning "n"
892fi
893
894# Clean RUN_DIR_PATH (necessary for cesium and titane only)
895IGCM_sys_RmRunDir -Rf ${RUN_DIR_PATH}
896
897date
Note: See TracBrowser for help on using the repository browser.