source: tags/libIGCM_v1_8-old/AA_create_ts @ 484

Last change on this file since 484 was 316, checked in by mafoipsl, 14 years ago

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