source: trunk/libIGCM/AA_create_ts @ 373

Last change on this file since 373 was 373, checked in by sdipsl, 14 years ago

Remove libIGCM_sys_claude.ksh and libIGCM_sys_calculo.ksh
Update/homogenize all headers usgin the new fixed-length keyword syntax regarding properties keywords
$Rev:: 13 i $: Revision of last commit
$Author:: harry $: Author of last commit
$Date:: 2006-03-15 02:33:03 -0500 (Wed, 15 Mar 2006) $: Date of last commit
Add / update original author and contact when missing

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