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

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

MAF :
On the way to finalyze vargas

  • adjustment to support large numbers of cpus (and files)
  • prepare another policy for rebuild : from workdir

Some cleanup

  • 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: 21.5 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 MASTER=${MASTER}               >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
339            echo export DateBegin=${DateBegin}         >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
340            echo export PeriodDateEnd=${PeriodDateEnd} >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
341            echo export StandAlone=false               >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
342            echo export RESOL_ATM=${RESOL_ATM}         >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
343            echo export RESOL_OCE=${RESOL_OCE}         >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
344            echo export RESOL_ICE=${RESOL_ICE}         >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
345            echo export RESOL_SRF=${RESOL_SRF}         >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
346            echo export listVarEnv=${listVarEnv}       >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
347            echo IGCM_sys_MkdirWork ${POST_DIR}        >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
348            echo IGCM_debug_Verif_Exit                 >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
349            echo IGCM_sys_QsubPost create_ts           >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
350            #
351        else
352            #
353            IGCM_sys_RshPost <<-EOF
354            export DEBUG_debug=${DEBUG_debug}
355            export MODIPSL=${MODIPSL}
356            export libIGCM_SX=${libIGCM}
357            export libIGCM=${libIGCM_POST}
358            export SUBMIT_DIR=${SUBMIT_DIR}
359            export POST_DIR=${POST_DIR}
360            export MASTER=${MASTER}
361            export DateBegin=${DateBegin}
362            export PeriodDateEnd=${PeriodDateEnd}
363            export StandAlone=false
364            export RESOL_ATM=${RESOL_ATM}
365            export RESOL_OCE=${RESOL_OCE}
366            export RESOL_ICE=${RESOL_ICE}
367            export RESOL_SRF=${RESOL_SRF}
368            export listVarEnv=${listVarEnv}
369            . ${libIGCM_POST}/libIGCM_debug/libIGCM_debug.ksh
370            . ${libIGCM_POST}/libIGCM_sys/libIGCM_sys.ksh
371            IGCM_sys_MkdirWork ${POST_DIR}
372            IGCM_debug_Verif_Exit
373            IGCM_sys_QsubPost create_ts
374EOF
375            #
376        fi
377    fi
378
379    #=============  SEASONAL POST-TREATMENT ============#
380    if [ ${SeasonalFrequency} = true ] ; then
381        #
382        IGCM_debug_Print 2 "SEASONNAL POST-TREATMENT :"
383        echo
384        #
385        typeset listVarEnv
386        listVarEnv="DEBUG_debug,MODIPSL,libIGCM,libIGCM_SX,SUBMIT_DIR,POST_DIR,DateBegin,PeriodDateEnd,StandAlone,RESOL_ATM,RESOL_OCE,RESOL_ICE,RESOL_SRF"
387
388        if [ ${RebuildFrequency} = true ] ; then
389            #
390            echo export DEBUG_debug=${DEBUG_debug}     >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
391            echo export MODIPSL=${MODIPSL}             >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
392            echo export libIGCM_SX=${libIGCM}          >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
393            echo export libIGCM=${libIGCM_POST}        >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
394            echo export SUBMIT_DIR=${SUBMIT_DIR}       >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
395            echo export POST_DIR=${POST_DIR}           >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
396            echo export MASTER=${MASTER}               >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
397            echo export DateBegin=${DateBegin}         >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
398            echo export PeriodDateEnd=${PeriodDateEnd} >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
399            echo export StandAlone=false               >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
400            echo export RESOL_ATM=${RESOL_ATM}         >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
401            echo export RESOL_OCE=${RESOL_OCE}         >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
402            echo export RESOL_ICE=${RESOL_ICE}         >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
403            echo export RESOL_SRF=${RESOL_SRF}         >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
404            echo export listVarEnv=${listVarEnv}       >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
405            echo IGCM_sys_MkdirWork ${POST_DIR}        >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
406            echo IGCM_debug_Verif_Exit                 >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
407            echo IGCM_sys_QsubPost create_se           >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
408            #
409        else
410            #
411            IGCM_sys_RshPost <<-EOF
412            export DEBUG_debug=${DEBUG_debug}
413            export MODIPSL=${MODIPSL}
414            export libIGCM_SX=${libIGCM}
415            export libIGCM=${libIGCM_POST}
416            export SUBMIT_DIR=${SUBMIT_DIR}
417            export POST_DIR=${POST_DIR}
418            export MASTER=${MASTER}
419            export DateBegin=${DateBegin}
420            export PeriodDateEnd=${PeriodDateEnd}
421            export StandAlone=false
422            export RESOL_ATM=${RESOL_ATM}
423            export RESOL_OCE=${RESOL_OCE}
424            export RESOL_ICE=${RESOL_ICE}
425            export RESOL_SRF=${RESOL_SRF}
426            export listVarEnv=${listVarEnv}
427            . ${libIGCM_POST}/libIGCM_debug/libIGCM_debug.ksh
428            . ${libIGCM_POST}/libIGCM_sys/libIGCM_sys.ksh
429            IGCM_sys_MkdirWork ${POST_DIR}
430            IGCM_debug_Verif_Exit
431            IGCM_sys_QsubPost create_se
432EOF
433        #
434        fi
435    fi
436
437    #============== REBUILD POST-TREATMENT =============#
438
439    if ( [ ${config_Post_RebuildFromArchive} = true ] && [ ! X${config_Post_RebuildFrequency} = X${NULL_STR} ] && [ ! X${config_Post_RebuildFrequency} = XNONE ] ) ; then
440        IGCM_sys_Put_Dir REBUILD_${PeriodDateBegin} ${REBUILD_DIR}
441    fi
442    #
443    if [ ${RebuildFrequency} = true ] ; then
444        #
445        if ( [ ${config_Post_RebuildFromArchive} = true ] ) ; then
446        #
447        IGCM_debug_Print 2 "REBUILD POST-TREATMENT FROM ARCHIVE:"
448        echo
449        #
450        typeset listVarEnv
451        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"
452        IGCM_sys_RshPost <<-EOF
453        export DEBUG_debug=${DEBUG_debug}
454        export MODIPSL=${MODIPSL}
455        export libIGCM_SX=${libIGCM}
456        export libIGCM=${libIGCM_POST}
457        export SUBMIT_DIR=${SUBMIT_DIR}
458        export RebuildFromArchive=${config_Post_RebuildFromArchive}
459        export REBUILD_DIR=${REBUILD_DIR}
460        export POST_DIR=${POST_DIR}
461        export MASTER=${MASTER}
462        export DateBegin=${DateBegin}
463        export PeriodDateBegin=${PeriodDateBegin}
464        export PeriodDateEnd=${PeriodDateEnd}
465        export NbRebuildDir=${NbRebuildDir}
466        export StandAlone=false
467        export RESOL_ATM=${RESOL_ATM}
468        export RESOL_OCE=${RESOL_OCE}
469        export RESOL_ICE=${RESOL_ICE}
470        export RESOL_SRF=${RESOL_SRF}
471        export listVarEnv=${listVarEnv}
472        . ${libIGCM_POST}/libIGCM_debug/libIGCM_debug.ksh
473        . ${libIGCM_POST}/libIGCM_sys/libIGCM_sys.ksh
474        IGCM_sys_MkdirWork ${POST_DIR}
475        IGCM_debug_Verif_Exit
476        IGCM_sys_QsubPost rebuild
477EOF
478        else 
479        #
480        IGCM_debug_Print 2 "REBUILD POST-TREATMENT FROM WORKDIR :"
481        echo
482        #
483        typeset listVarEnv
484        listVarEnv="DEBUG_debug,MODIPSL,libIGCM,libIGCM_SX,SUBMIT_DIR,REBUILD_DIR,RebuildFromArchive,POST_DIR,MASTER,DateBegin,PeriodDateBegin,PeriodDateEnd,NbRebuildDir,StandAlone,RESOL_ATM,RESOL_OCE,RESOL_ICE,RESOL_SRF"
485        export DEBUG_debug=${DEBUG_debug}
486        export MODIPSL=${MODIPSL}
487        export libIGCM_SX=${libIGCM}
488        export libIGCM=${libIGCM}
489        export SUBMIT_DIR=${SUBMIT_DIR}
490        export RebuildFromArchive=${config_Post_RebuildFromArchive}
491        export REBUILD_DIR=${REBUILD_DIR}
492        export POST_DIR=${libIGCM}
493        export DateBegin=${DateBegin}
494        export PeriodDateBegin=${PeriodDateBegin}
495        export PeriodDateEnd=${PeriodDateEnd}
496        export NbRebuildDir=${NbRebuildDir}
497        export StandAlone=false
498        export RESOL_ATM=${RESOL_ATM}
499        export RESOL_OCE=${RESOL_OCE}
500        export RESOL_ICE=${RESOL_ICE}
501        export RESOL_SRF=${RESOL_SRF}
502        export listVarEnv=${listVarEnv}
503        IGCM_sys_Qsub rebuildtmp.job ${libIGCM}
504        fi
505    fi
506
507    IGCM_debug_PopStack "IGCM_post_Submit"
508}
Note: See TracBrowser for help on using the repository browser.