source: trunk/libIGCM/AA_create_ts @ 599

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