source: trunk/libIGCM/libIGCM_post/libIGCM_post.ksh @ 50

Last change on this file since 50 was 50, checked in by sdipsl, 15 years ago

BugFix? 2
When simulation finished and asynchronous rebuild is on : submit rebuild anyway
Also when simulation finished and time series are on : submit create_ts anyway

  • 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: 20.0 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    if ( [ ! X${config_Post_TimeSeriesFrequency} = X${NULL_STR} ] && \
287         [ ! X${config_Post_TimeSeriesFrequency} = XNONE ]        && \
288         [ ${SimulationLengthInDays} -ge ${ExperienceLengthInDays} ] ) ; then
289        TimeSeriesFrequency=true
290        POST=true
291    fi
292
293    if ( [ ! X${config_Post_RebuildFrequency} = X${NULL_STR} ] && \
294         [ ! X${config_Post_RebuildFrequency} = XNONE ]        && \
295         [ ${SimulationLengthInDays} -ge ${ExperienceLengthInDays} ] ) ; then
296        RebuildFrequency=true
297        POST=true
298    fi
299
300    #
301    IGCM_debug_Print 1 "POST-TREATEMENT flag value : ${POST}"
302    #
303    IGCM_post_Submit
304
305    IGCM_debug_PopStack "IGCM_post_Initialize"
306}
307
308function IGCM_post_Submit
309{
310    IGCM_debug_PushStack "IGCM_post_Submit"
311
312    POST_DIR=${R_OUT_POST}/${config_UserChoices_TagName}/${config_UserChoices_JobName}
313
314    if [ ${POST} = true ]; then
315        echo
316        IGCM_debug_Print 1 "IGCM_post_Submit :"
317        echo
318        IGCM_debug_Print 1 "POST_DIR = ${POST_DIR}"
319    fi
320
321    #============ TIME SERIES POST-TREATMENT ===========#
322    if [ ${TimeSeriesFrequency} = true ] ; then
323
324        IGCM_debug_Print 2 "TIME SERIES POST-TREATMENT :"
325        echo
326        #
327        typeset listVarEnv
328        listVarEnv="DEBUG_debug,MODIPSL,libIGCM,libIGCM_SX,SUBMIT_DIR,POST_DIR,DateBegin,PeriodDateEnd,StandAlone,RESOL_ATM,RESOL_OCE,RESOL_ICE,RESOL_SRF"
329
330        if [ ${RebuildFrequency} = true ] ; then
331            #
332            echo export DEBUG_debug=${DEBUG_debug}     >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
333            echo export MODIPSL=${MODIPSL}             >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
334            echo export libIGCM_SX=${libIGCM}          >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
335            echo export libIGCM=${libIGCM_POST}        >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
336            echo export SUBMIT_DIR=${SUBMIT_DIR}       >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
337            echo export POST_DIR=${POST_DIR}           >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
338            echo export DateBegin=${DateBegin}         >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
339            echo export PeriodDateEnd=${PeriodDateEnd} >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
340            echo export StandAlone=false               >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
341            echo export RESOL_ATM=${RESOL_ATM}         >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
342            echo export RESOL_OCE=${RESOL_OCE}         >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
343            echo export RESOL_ICE=${RESOL_ICE}         >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
344            echo export RESOL_SRF=${RESOL_SRF}         >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
345            echo export listVarEnv=${listVarEnv}       >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
346            echo IGCM_sys_MkdirWork ${POST_DIR}        >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
347            echo IGCM_debug_Verif_Exit                 >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
348            echo IGCM_sys_QsubPost create_ts           >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
349            #
350        else
351            #
352            IGCM_sys_RshPost <<-EOF
353            export DEBUG_debug=${DEBUG_debug}
354            export MODIPSL=${MODIPSL}
355            export libIGCM_SX=${libIGCM}
356            export libIGCM=${libIGCM_POST}
357            export SUBMIT_DIR=${SUBMIT_DIR}
358            export POST_DIR=${POST_DIR}
359            export DateBegin=${DateBegin}
360            export PeriodDateEnd=${PeriodDateEnd}
361            export StandAlone=false
362            export RESOL_ATM=${RESOL_ATM}
363            export RESOL_OCE=${RESOL_OCE}
364            export RESOL_ICE=${RESOL_ICE}
365            export RESOL_SRF=${RESOL_SRF}
366            export listVarEnv=${listVarEnv}
367            . ${libIGCM_POST}/libIGCM_debug/libIGCM_debug.ksh
368            . ${libIGCM_POST}/libIGCM_sys/libIGCM_sys.ksh
369            IGCM_sys_MkdirWork ${POST_DIR}
370            IGCM_debug_Verif_Exit
371            IGCM_sys_QsubPost create_ts
372EOF
373            #
374        fi
375    fi
376
377    #=============  SEASONAL POST-TREATMENT ============#
378    if [ ${SeasonalFrequency} = true ] ; then
379        #
380        IGCM_debug_Print 2 "SEASONNAL POST-TREATMENT :"
381        echo
382        #
383        typeset listVarEnv
384        listVarEnv="DEBUG_debug,MODIPSL,libIGCM,libIGCM_SX,SUBMIT_DIR,POST_DIR,DateBegin,PeriodDateEnd,StandAlone,RESOL_ATM,RESOL_OCE,RESOL_ICE,RESOL_SRF"
385
386        if [ ${RebuildFrequency} = true ] ; then
387            #
388            echo export DEBUG_debug=${DEBUG_debug}     >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
389            echo export MODIPSL=${MODIPSL}             >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
390            echo export libIGCM_SX=${libIGCM}          >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
391            echo export libIGCM=${libIGCM_POST}        >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
392            echo export SUBMIT_DIR=${SUBMIT_DIR}       >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
393            echo export POST_DIR=${POST_DIR}           >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
394            echo export DateBegin=${DateBegin}         >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
395            echo export PeriodDateEnd=${PeriodDateEnd} >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
396            echo export StandAlone=false               >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
397            echo export RESOL_ATM=${RESOL_ATM}         >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
398            echo export RESOL_OCE=${RESOL_OCE}         >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
399            echo export RESOL_ICE=${RESOL_ICE}         >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
400            echo export RESOL_SRF=${RESOL_SRF}         >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
401            echo export listVarEnv=${listVarEnv}       >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
402            echo IGCM_sys_MkdirWork ${POST_DIR}        >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
403            echo IGCM_debug_Verif_Exit                 >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
404            echo IGCM_sys_QsubPost create_se           >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
405            #
406        else
407            #
408            IGCM_sys_RshPost <<-EOF
409            export DEBUG_debug=${DEBUG_debug}
410            export MODIPSL=${MODIPSL}
411            export libIGCM_SX=${libIGCM}
412            export libIGCM=${libIGCM_POST}
413            export SUBMIT_DIR=${SUBMIT_DIR}
414            export POST_DIR=${POST_DIR}
415            export DateBegin=${DateBegin}
416            export PeriodDateEnd=${PeriodDateEnd}
417            export StandAlone=false
418            export RESOL_ATM=${RESOL_ATM}
419            export RESOL_OCE=${RESOL_OCE}
420            export RESOL_ICE=${RESOL_ICE}
421            export RESOL_SRF=${RESOL_SRF}
422            export listVarEnv=${listVarEnv}
423            . ${libIGCM_POST}/libIGCM_debug/libIGCM_debug.ksh
424            . ${libIGCM_POST}/libIGCM_sys/libIGCM_sys.ksh
425            IGCM_sys_MkdirWork ${POST_DIR}
426            IGCM_debug_Verif_Exit
427            IGCM_sys_QsubPost create_se
428EOF
429        #
430        fi
431    fi
432
433    #============== REBUILD POST-TREATMENT =============#
434
435    if ( [ ${config_Post_RebuildFromArchive} = true ] && [ ! X${config_Post_RebuildFrequency} = X${NULL_STR} ] && [ ! X${config_Post_RebuildFrequency} = XNONE ] ) ; then
436        IGCM_sys_Put_Dir REBUILD_${PeriodDateBegin} ${REBUILD_DIR}
437    fi
438    #
439    if [ ${RebuildFrequency} = true ] ; then
440        #
441        IGCM_debug_Print 2 "REBUILD POST-TREATMENT :"
442        echo
443        #
444        typeset listVarEnv
445        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"
446        IGCM_sys_RshPost <<-EOF
447        export DEBUG_debug=${DEBUG_debug}
448        export MODIPSL=${MODIPSL}
449        export libIGCM_SX=${libIGCM}
450        export libIGCM=${libIGCM_POST}
451        export SUBMIT_DIR=${SUBMIT_DIR}
452        export RebuildFromArchive=${config_Post_RebuildFromArchive}
453        export REBUILD_DIR=${REBUILD_DIR}
454        export POST_DIR=${POST_DIR}
455        export DateBegin=${DateBegin}
456        export PeriodDateBegin=${PeriodDateBegin}
457        export PeriodDateEnd=${PeriodDateEnd}
458        export NbRebuildDir=${NbRebuildDir}
459        export StandAlone=false
460        export RESOL_ATM=${RESOL_ATM}
461        export RESOL_OCE=${RESOL_OCE}
462        export RESOL_ICE=${RESOL_ICE}
463        export RESOL_SRF=${RESOL_SRF}
464        export listVarEnv=${listVarEnv}
465        . ${libIGCM_POST}/libIGCM_debug/libIGCM_debug.ksh
466        . ${libIGCM_POST}/libIGCM_sys/libIGCM_sys.ksh
467        IGCM_sys_MkdirWork ${POST_DIR}
468        IGCM_debug_Verif_Exit
469        IGCM_sys_QsubPost rebuild
470EOF
471    fi
472
473    IGCM_debug_PopStack "IGCM_post_Submit"
474}
Note: See TracBrowser for help on using the repository browser.