source: tags/libIGCM_v2.0_beta1/AA_create_ts @ 1579

Last change on this file since 1579 was 647, checked in by aclsce, 12 years ago

Modified CARD_DIR variable to take into account modifications about the use of Get_Master function to get files (instead of directory).

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