source: tags/libIGCM_v1_2/libIGCM_post/libIGCM_post.ksh @ 1435

Last change on this file since 1435 was 36, checked in by sdipsl, 16 years ago

SD : - no more stack files everywhere when you have

DEBUG_debug=false in AA_job (default)

  • some corrections to have good continuity between rebuilds and post-processing in case of asynchronous rebuilds from archive.
  • 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: 19.6 KB
Line 
1#!/bin/ksh
2
3#**************************************************************
4# Author: Sebastien Denvil
5# Contact: Sebastien.Denvil@ipsl.jussieu.fr
6# $Date$
7# $Author$
8# $Revision$
9# IPSL (2006)
10#  This software is governed by the CeCILL licence see libIGCM/libIGCM_CeCILL.LIC
11# History:
12# Modification:
13#
14#**************************************************************
15
16#=======================================================================
17
18function IGCM_post_Configure
19{
20    IGCM_debug_PushStack "IGCM_post_Configure"
21
22    # Debug Print :
23    echo
24    IGCM_debug_Print 1 "IGCM_post_Configure :"
25    echo
26
27    typeset NbDays PeriodEndJul PostEndJul PeriodPost
28    RebuildFrequency=false
29
30    if ( [ ! X${config_Post_RebuildFrequency} = X${NULL_STR} ] && [ ! X${config_Post_RebuildFrequency} = XNONE ] ) ; then
31
32        IGCM_debug_Print 1 "Asynchronous rebuild has been activated."
33        echo
34
35        case ${config_Post_RebuildFrequency} in
36            *y|*Y)
37                PeriodYear=$( echo ${config_Post_RebuildFrequency} | sed -e "s/[yY]//" )
38                case ${config_UserChoices_PeriodLength} in
39                    *Y|*y)
40                        PeriodPost=$( echo ${config_UserChoices_PeriodLength} | sed -e "s/[yY]//" )
41                        if [ ${PeriodPost} -le ${PeriodYear} ] ; then
42                            if [ $( expr $(( ${CumulPeriod} * ${PeriodPost} )) % ${PeriodYear}  ) -eq 0 ] ;  then
43                                RebuildFrequency=true
44                                NbRebuildDir=$( expr ${PeriodYear} / ${PeriodPost} )
45                            fi
46                        else
47                            IGCM_debug_Print 3 "PeriodLength frequency ${config_UserChoices_PeriodLength} not compatbile with"
48                            IGCM_debug_Print 3 "RebuildFrequency frequency : ${config_Post_RebuildFrequency}"
49                        fi ;;
50                    *M|*m)
51                        PeriodPost=$( echo ${config_UserChoices_PeriodLength} | sed -e "s/[mM]//" )
52                        if [ ${PeriodPost} -le $(( ${PeriodYear} * 12 )) ] ; then
53                            if [ $( expr $(( ${CumulPeriod} * ${PeriodPost} )) % $(( ${PeriodYear} * 12 )) ) -eq 0 ] ; then
54                                RebuildFrequency=true
55                                NbRebuildDir=$( expr $(( 12 * ${PeriodYear} )) / ${PeriodPost} )
56                            fi
57                        else
58                            IGCM_debug_Print 3 "PeriodLength frequency ${config_UserChoices_PeriodLength} not compatbile with"
59                            IGCM_debug_Print 3 "RebuildFrequency frequency : ${config_Post_RebuildFrequency}"
60                        fi ;;
61                    *D|*d)
62                        PeriodPost=$( echo ${config_UserChoices_PeriodLength} | sed -e "s/[dD]//" )
63                        NbDays=$( IGCM_date_DaysInYear ${year} )
64                        if [ ${config_UserChoices_CalendarType} = 360d ] || [ ${config_UserChoices_CalendarType} = noleap ] ; then
65                            if [ ${PeriodPost} -le $(( ${PeriodYear} * ${NbDays} )) ] ; then
66                                if [ $( expr ${CumulPeriod} % $( expr \( ${NbDays} \* ${PeriodYear} \/ ${PeriodPost} \) ) ) -eq 0 ] ; then
67                                    RebuildFrequency=true
68                                    NbRebuildDir=$( expr $(( ${NbDays} * ${PeriodYear} )) / ${PeriodPost} )
69                                fi
70                            else
71                                IGCM_debug_Print 3 "PeriodLength frequency ${config_UserChoices_PeriodLength} not compatbile with"
72                                IGCM_debug_Print 3 "RebuildFrequency frequency : ${config_Post_RebuildFrequency}"
73                            fi
74                        else
75#                           if [ ${PeriodYear} -eq 1 ] ; then
76#                               PeriodEndJul=$( IGCM_date_ConvertGregorianDateToJulian ${PeriodDateEnd} )
77#                               PostEndJul=${year}${NbDays}
78#                               #echo "PeriodYear=${PeriodYear} NbDays=${NbDays}"
79#                               #echo "PeriodEndJul=${PeriodEndJul} PostEndJul=${PostEndJul}"
80#                               if [ ${PostEndJul} -eq ${PeriodEndJul} ] ; then
81#                                   RebuildFrequency=true
82#                                   NbRebuildDir=$( expr ${NbDays} / ${PeriodPost} )
83#                               fi
84#                           else
85                            IGCM_debug_Print 3 "For RebuildFrequency with leap calendar:"
86                            IGCM_debug_Print 3 "We have a daily PeriodLength frequency and RebuildFrequency=${PeriodYear}Y."
87                            IGCM_debug_Print 3 "No post-treatment. Case not properly handle at this moment."
88#                           fi
89                        fi;;
90                esac ;;
91            *M|*m)
92                PeriodMonth=$( echo ${config_Post_RebuildFrequency} | sed -e "s/[mM]//" )
93                case ${config_UserChoices_PeriodLength} in
94                    *Y|*y)
95                        IGCM_debug_Print 3 "PeriodLength frequency ${config_UserChoices_PeriodLength} not compatbile with"
96                        IGCM_debug_Print 3 "RebuildFrequency frequency ${config_Post_RebuildFrequency}" ;;
97                    *M|*m)
98                        PeriodPost=$( echo ${config_UserChoices_PeriodLength} | sed -e "s/[mM]//" )
99                        if [ ${PeriodPost} -le ${PeriodMonth} ] ; then
100                            if [ $( expr $(( ${CumulPeriod} * ${PeriodPost} )) % ${PeriodMonth}  ) -eq 0 ] ;  then
101                                RebuildFrequency=true
102                                NbRebuildDir=$( expr ${PeriodMonth} / ${PeriodPost} )
103                            fi
104                        else
105                            IGCM_debug_Print 3 "PeriodLength frequency ${config_UserChoices_PeriodLength} not compatbile with"
106                            IGCM_debug_Print 3 "RebuildFrequency frequency : ${config_Post_RebuildFrequency}"
107                        fi ;;
108                    *D|*d)
109                        IGCM_debug_Print 3 "PeriodLength frequency ${config_UserChoices_PeriodLength} not compatbile with"
110                        IGCM_debug_Print 3 "RebuildFrequency frequency : ${config_Post_RebuildFrequency}" ;;
111                esac
112                ;;
113            NONE|none)
114                ;;
115            *)
116                IGCM_debug_Print 3 "KeyWord not allowed for RebuildFrequency in config.card"
117                ;;
118        esac
119    else
120        #
121        IGCM_debug_Print 1 "Asynchronous rebuild has not been activated"
122        IGCM_debug_Print 1 "Proceed with standard post-treatment pathway"
123        echo
124        #
125    fi
126
127    IGCM_debug_Print 1 "RebuildFrequency flag value : ${RebuildFrequency}"
128    IGCM_post_Initialize
129
130    IGCM_debug_PopStack "IGCM_post_Configure"
131}
132
133function IGCM_post_Initialize
134{
135    IGCM_debug_PushStack "IGCM_post_Initialize"
136
137    # Debug Print :
138    echo
139    IGCM_debug_Print 1 "IGCM_post_Initialize :"
140    echo
141
142    typeset POST NbDays PeriodEndJul PostEndJul LengthDays
143    POST=false
144
145    # READ TIME SERIES OR SEASONAL FREQUENCY
146    # AND TURN ON THE FLAG WHEN MODULO IS ZERO
147    for post_freq in TimeSeriesFrequency SeasonalFrequency ; do
148        #
149        # Initialize
150        #
151        eval ${post_freq}=false
152        #
153        # Define the variable ${config_Post_${post_freq}}
154        # who contains frequency for specific post-treatment
155        #
156        IGCM_card_DefineVariableFromOption ${SUBMIT_DIR}/config.card Post ${post_freq}
157        #
158        # Extract frequency from above variable
159        #
160        config_Post_post_freq=$( eval echo \${config_Post_${post_freq}} )
161        #
162        if ( [ X${config_Post_post_freq} = X${NULL_STR} ] || [ X${config_Post_post_freq} = XNONE ] ) ; then
163            #
164            continue
165            #
166        fi
167        #
168        # For each componant select determine which files need post-processing
169        #
170        for comp in ${config_ListOfComponents[*]} ; do
171            #
172            #echo "-----"
173            eval compname=\${config_ListOfComponents_${comp}[0]} > /dev/null 2>&1
174            ListFilesName=${compname}_OutputFiles_List
175            eval FileName0=\${${ListFilesName}[0]} > /dev/null 2>&1
176            #
177            if [ X${FileName0} != X${NULL_STR} ] ; then
178                #
179                #IGCM_debug_Print 1 "Component      : ${compname}"
180                #
181                # INITIALISATION
182                #
183                eval NbFiles=\${#${ListFilesName}[@]} > /dev/null 2>&1
184                typeset i=0
185                #
186                until [ $i -eq $NbFiles ]; do
187                    #
188                    eval file_in_=\${${ListFilesName}[$i]} > /dev/null 2>&1
189                    eval file_in=${file_in_}
190                    let $(( i_ = i+2 ))
191                    eval flag_post_=\${${ListFilesName}[$i_]} > /dev/null 2>&1
192                    eval flag_post=${flag_post_}
193                    #
194                    if [ X${flag_post} != XNONE ] ; then
195                    #
196                        case ${config_Post_post_freq} in
197                            *y|*Y)
198                                PeriodYear=$( echo ${config_Post_post_freq} | sed -e "s/[yY]//" )
199                                case ${config_UserChoices_PeriodLength} in
200                                    *Y|*y)
201                                        PeriodPost=$( echo ${config_UserChoices_PeriodLength} | sed -e "s/[yY]//" )
202                                        if [ ${PeriodPost} -le ${PeriodYear} ] ; then
203                                            if [ $( expr $(( ${CumulPeriod} * ${PeriodPost} )) % ${PeriodYear}  ) -eq 0 ] ;  then
204                                                eval ${post_freq}=true
205                                                POST=true
206                                            fi
207                                        else
208                                            IGCM_debug_Print 3 "PeriodLength frequency ${config_UserChoices_PeriodLength} not compatbile with"
209                                            IGCM_debug_Print 3 "${flag_post} frequency : ${config_Post_post_freq} "
210                                        fi ;;
211                                    *M|*m)
212                                        PeriodPost=$( echo ${config_UserChoices_PeriodLength} | sed -e "s/[mM]//" )
213                                        if [ ${PeriodPost} -le $(( ${PeriodYear} * 12 )) ] ; then
214                                            if [ $( expr $(( ${CumulPeriod} * ${PeriodPost} )) % $(( ${PeriodYear} * 12 )) ) -eq 0 ] ; then
215                                                eval ${post_freq}=true
216                                                POST=true
217                                            fi
218                                        else
219                                            IGCM_debug_Print 3 "PeriodLength frequency ${config_UserChoices_PeriodLength} not compatbile with"
220                                            IGCM_debug_Print 3 "${flag_post} frequency : ${config_Post_post_freq} "
221                                        fi ;;
222                                    *D|*d)
223                                        PeriodPost=$( echo ${config_UserChoices_PeriodLength} | sed -e "s/[dD]//" )
224                                        NbDays=$( IGCM_date_DaysInYear ${year} )
225                                        if [ ${config_UserChoices_CalendarType} = 360d ] | [ ${config_UserChoices_CalendarType} = noleap ] ; then
226                                            if [ ${PeriodPost} -le $(( ${PeriodYear} * ${NbDays} )) ] ; then
227                                                if [ $( expr ${CumulPeriod} % $( expr \( ${NbDays} \* ${PeriodYear} \/ ${PeriodPost} \) ) ) -eq 0 ] ; then
228                                                    eval ${post_freq}=true
229                                                    POST=true
230                                                fi
231                                            else
232                                                IGCM_debug_Print 3 "PeriodLength frequency ${config_UserChoices_PeriodLength} not compatbile with"
233                                                IGCM_debug_Print 3 "${flag_post} frequency : ${config_Post_post_freq} "
234                                            fi
235                                        else
236#                                           if [ ${PeriodYear} -eq 1 ] ; then
237#                                               PeriodEndJul=$( IGCM_date_ConvertGregorianDateToJulian ${PeriodDateEnd} )
238#                                               PostEndJul=${year}${NbDays}
239#                                                #echo "PeriodYear=${PeriodYear} NbDays=${NbDays}"
240#                                               #echo PeriodEndJul=${PeriodEndJul} PostEndJul=${PostEndJul}"
241#                                               if [ ${PostEndJul} -le ${PeriodEndJul} ] ; then
242#                                                   eval ${post_freq}=true
243#                                                   POST=true
244#                                               fi
245#                                           else
246                                            IGCM_debug_Print 3 "For ${post_freq} with leap calendar, for ${comp} and ${file_in} :"
247                                            IGCM_debug_Print 3 "We have a daily PeriodLength frequency and RebuildFrequency=${PeriodYear}Y."
248                                            IGCM_debug_Print 3 "No post-treatment. Case not properly handle at this moment."
249#                                           fi
250                                        fi;;
251                                esac ;;
252                            *M|*m)
253                                PeriodMonth=$( echo ${config_Post_RebuildFrequency} | sed -e "s/[mM]//" )
254                                case ${config_UserChoices_PeriodLength} in
255                                    *Y|*y)
256                                        IGCM_debug_Print 3 "PeriodLength frequency ${config_UserChoices_PeriodLength} not compatbile with"
257                                        IGCM_debug_Print 3 "${flag_post} frequency : ${config_Post_post_freq} " ;;
258                                    *M|*m)
259                                        PeriodPost=$( echo ${config_UserChoices_PeriodLength} | sed -e "s/[mM]//" )
260                                        if [ ${PeriodPost} -le ${PeriodMonth} ] ; then
261                                            if [ $( expr $(( ${CumulPeriod} * ${PeriodPost} )) % ${PeriodMonth}  ) -eq 0 ] ;  then
262                                                eval ${post_freq}=true
263                                                POST=true
264                                            fi
265                                        else
266                                            IGCM_debug_Print 3 "PeriodLength frequency ${config_UserChoices_PeriodLength} not compatbile with"
267                                            IGCM_debug_Print 3 "${flag_post} frequency : ${config_Post_post_freq} "
268                                        fi;;
269                                    *D|*d)
270                                        IGCM_debug_Print 3 "PeriodLength frequency ${config_UserChoices_PeriodLength} not compatbile with"
271                                        IGCM_debug_Print 3 "${flag_post} frequency : ${config_Post_post_freq} " ;;
272                                esac ;;
273                            NONE|none)
274                                ;;
275                            *)
276                                IGCM_debug_Print 3 "KeyWord not allowed for ${post_freq} in config.card"
277                                ;;
278                        esac
279                    fi
280                    let $(( i=i+3 ))
281                done
282            fi
283        done
284    done
285
286    IGCM_debug_Print 1 "POST-TREATEMENT flag value : ${POST}"
287    #
288    if [ ${SimulationLengthInDays} -ge ${ExperienceLengthInDays} ] ; then
289        TimeSeriesFrequency=true
290    fi
291    #
292    IGCM_post_Submit
293
294    IGCM_debug_PopStack "IGCM_post_Initialize"
295}
296
297function IGCM_post_Submit
298{
299    IGCM_debug_PushStack "IGCM_post_Submit"
300
301    POST_DIR=${R_OUT_POST}/${config_UserChoices_TagName}/${config_UserChoices_JobName}
302
303    if [ ${POST} = true ]; then
304        echo
305        IGCM_debug_Print 1 "IGCM_post_Submit :"
306        echo
307        IGCM_debug_Print 1 "POST_DIR = ${POST_DIR}"
308    fi
309
310    #============ TIME SERIES POST-TREATMENT ===========#
311    if [ ${TimeSeriesFrequency} = true ] ; then
312
313        IGCM_debug_Print 2 "TIME SERIES POST-TREATMENT :"
314        echo
315        #
316        typeset listVarEnv
317        listVarEnv="DEBUG_debug,MODIPSL,libIGCM,libIGCM_SX,SUBMIT_DIR,POST_DIR,DateBegin,PeriodDateEnd,StandAlone,RESOL_ATM,RESOL_OCE,RESOL_ICE,RESOL_SRF"
318
319        if [ ${RebuildFrequency} = true ] ; then
320            #
321            echo export DEBUG_debug=${DEBUG_debug}     >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
322            echo export MODIPSL=${MODIPSL}             >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
323            echo export libIGCM_SX=${libIGCM}          >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
324            echo export libIGCM=${libIGCM_POST}        >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
325            echo export SUBMIT_DIR=${SUBMIT_DIR}       >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
326            echo export POST_DIR=${POST_DIR}           >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
327            echo export DateBegin=${DateBegin}         >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
328            echo export PeriodDateEnd=${PeriodDateEnd} >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
329            echo export StandAlone=false               >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
330            echo export RESOL_ATM=${RESOL_ATM}         >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
331            echo export RESOL_OCE=${RESOL_OCE}         >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
332            echo export RESOL_ICE=${RESOL_ICE}         >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
333            echo export RESOL_SRF=${RESOL_SRF}         >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
334            echo export listVarEnv=${listVarEnv}       >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
335            echo IGCM_sys_MkdirWork ${POST_DIR}        >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
336            echo IGCM_debug_Verif_Exit                 >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
337            echo IGCM_sys_QsubPost create_ts           >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
338            #
339        else
340            #
341            IGCM_sys_RshPost <<-EOF
342            export DEBUG_debug=${DEBUG_debug}
343            export MODIPSL=${MODIPSL}
344            export libIGCM_SX=${libIGCM}
345            export libIGCM=${libIGCM_POST}
346            export SUBMIT_DIR=${SUBMIT_DIR}
347            export POST_DIR=${POST_DIR}
348            export DateBegin=${DateBegin}
349            export PeriodDateEnd=${PeriodDateEnd}
350            export StandAlone=false
351            export RESOL_ATM=${RESOL_ATM}
352            export RESOL_OCE=${RESOL_OCE}
353            export RESOL_ICE=${RESOL_ICE}
354            export RESOL_SRF=${RESOL_SRF}
355            export listVarEnv=${listVarEnv}
356            . ${libIGCM_POST}/libIGCM_debug/libIGCM_debug.ksh
357            . ${libIGCM_POST}/libIGCM_sys/libIGCM_sys.ksh
358            IGCM_sys_MkdirWork ${POST_DIR}
359            IGCM_debug_Verif_Exit
360            IGCM_sys_QsubPost create_ts
361EOF
362            #
363        fi
364    fi
365
366    #=============  SEASONAL POST-TREATMENT ============#
367    if [ ${SeasonalFrequency} = true ] ; then
368        #
369        IGCM_debug_Print 2 "SEASONNAL POST-TREATMENT :"
370        echo
371        #
372        typeset listVarEnv
373        listVarEnv="DEBUG_debug,MODIPSL,libIGCM,libIGCM_SX,SUBMIT_DIR,POST_DIR,DateBegin,PeriodDateEnd,StandAlone,RESOL_ATM,RESOL_OCE,RESOL_ICE,RESOL_SRF"
374
375        if [ ${RebuildFrequency} = true ] ; then
376            #
377            echo export DEBUG_debug=${DEBUG_debug}     >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
378            echo export MODIPSL=${MODIPSL}             >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
379            echo export libIGCM_SX=${libIGCM}          >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
380            echo export libIGCM=${libIGCM_POST}        >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
381            echo export SUBMIT_DIR=${SUBMIT_DIR}       >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
382            echo export POST_DIR=${POST_DIR}           >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
383            echo export DateBegin=${DateBegin}         >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
384            echo export PeriodDateEnd=${PeriodDateEnd} >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
385            echo export StandAlone=false               >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
386            echo export RESOL_ATM=${RESOL_ATM}         >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
387            echo export RESOL_OCE=${RESOL_OCE}         >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
388            echo export RESOL_ICE=${RESOL_ICE}         >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
389            echo export RESOL_SRF=${RESOL_SRF}         >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
390            echo export listVarEnv=${listVarEnv}       >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
391            echo IGCM_sys_MkdirWork ${POST_DIR}        >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
392            echo IGCM_debug_Verif_Exit                 >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
393            echo IGCM_sys_QsubPost create_se           >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
394            #
395        else
396            #
397            IGCM_sys_RshPost <<-EOF
398            export DEBUG_debug=${DEBUG_debug}
399            export MODIPSL=${MODIPSL}
400            export libIGCM_SX=${libIGCM}
401            export libIGCM=${libIGCM_POST}
402            export SUBMIT_DIR=${SUBMIT_DIR}
403            export POST_DIR=${POST_DIR}
404            export DateBegin=${DateBegin}
405            export PeriodDateEnd=${PeriodDateEnd}
406            export StandAlone=false
407            export RESOL_ATM=${RESOL_ATM}
408            export RESOL_OCE=${RESOL_OCE}
409            export RESOL_ICE=${RESOL_ICE}
410            export RESOL_SRF=${RESOL_SRF}
411            export listVarEnv=${listVarEnv}
412            . ${libIGCM_POST}/libIGCM_debug/libIGCM_debug.ksh
413            . ${libIGCM_POST}/libIGCM_sys/libIGCM_sys.ksh
414            IGCM_sys_MkdirWork ${POST_DIR}
415            IGCM_debug_Verif_Exit
416            IGCM_sys_QsubPost create_se
417EOF
418        #
419        fi
420    fi
421
422    #============== REBUILD POST-TREATMENT =============#
423
424    if ( [ ${config_Post_RebuildFromArchive} = true ] && [ ! X${config_Post_RebuildFrequency} = X${NULL_STR} ] && [ ! X${config_Post_RebuildFrequency} = XNONE ] ) ; then
425        IGCM_sys_Put_Dir REBUILD_${PeriodDateBegin} ${REBUILD_DIR}
426    fi
427    #
428    if [ ${RebuildFrequency} = true ] ; then
429        #
430        IGCM_debug_Print 2 "REBUILD POST-TREATMENT :"
431        echo
432        #
433        typeset listVarEnv
434        listVarEnv="DEBUG_debug,MODIPSL,libIGCM,libIGCM_SX,SUBMIT_DIR,REBUILD_DIR,RebuildFromArchive,POST_DIR,DateBegin,PeriodDateBegin,PeriodDateEnd,NbRebuildDir,StandAlone,RESOL_ATM,RESOL_OCE,RESOL_ICE,RESOL_SRF"
435        IGCM_sys_RshPost <<-EOF
436        export DEBUG_debug=${DEBUG_debug}
437        export MODIPSL=${MODIPSL}
438        export libIGCM_SX=${libIGCM}
439        export libIGCM=${libIGCM_POST}
440        export SUBMIT_DIR=${SUBMIT_DIR}
441        export RebuildFromArchive=${config_Post_RebuildFromArchive}
442        export REBUILD_DIR=${REBUILD_DIR}
443        export POST_DIR=${POST_DIR}
444        export DateBegin=${DateBegin}
445        export PeriodDateBegin=${PeriodDateBegin}
446        export PeriodDateEnd=${PeriodDateEnd}
447        export NbRebuildDir=${NbRebuildDir}
448        export StandAlone=false
449        export RESOL_ATM=${RESOL_ATM}
450        export RESOL_OCE=${RESOL_OCE}
451        export RESOL_ICE=${RESOL_ICE}
452        export RESOL_SRF=${RESOL_SRF}
453        export listVarEnv=${listVarEnv}
454        . ${libIGCM_POST}/libIGCM_debug/libIGCM_debug.ksh
455        . ${libIGCM_POST}/libIGCM_sys/libIGCM_sys.ksh
456        IGCM_sys_MkdirWork ${POST_DIR}
457        IGCM_debug_Verif_Exit
458        IGCM_sys_QsubPost rebuild
459EOF
460    fi
461
462    IGCM_debug_PopStack "IGCM_post_Submit"
463}
Note: See TracBrowser for help on using the repository browser.