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

Last change on this file since 238 was 238, checked in by sdipsl, 14 years ago
  • Protect rebuild.ksh creation in case of DRYRUNaaaa
  • Bugfix regarding backward compatibility : IGCM_card_DefineArrayFromOption ${card} ${flag_post} Seasonal will produce an array, take that into account whentesting his value
  • 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: 35.3 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            *D|*d)
114                PeriodDay=$( echo ${config_Post_RebuildFrequency} | sed -e "s/[dD]//" )
115                case ${config_UserChoices_PeriodLength} in
116                    *Y|*y)
117                        IGCM_debug_Print 3 "PeriodLength frequency ${config_UserChoices_PeriodLength} not compatbile with"
118                        IGCM_debug_Print 3 "RebuildFrequency frequency ${config_Post_RebuildFrequency}" ;;
119                    *M|*m)
120                        IGCM_debug_Print 3 "PeriodLength frequency ${config_UserChoices_PeriodLength} not compatbile with"
121                        IGCM_debug_Print 3 "RebuildFrequency frequency ${config_Post_RebuildFrequency}" ;;
122                    *D|*d)
123                        PeriodPost=$( echo ${config_UserChoices_PeriodLength} | sed -e "s/[dD]//" )
124                        if [ ${PeriodPost} -le ${PeriodDay} ] ; then
125                            if [ $( expr $(( ${CumulPeriod} * ${PeriodPost} )) % ${PeriodDay}  ) -eq 0 ] ;  then
126                                RebuildFrequency=true
127                                NbRebuildDir=$( expr ${PeriodDay} / ${PeriodPost} )
128                            fi
129                        else
130                            IGCM_debug_Print 3 "PeriodLength frequency ${config_UserChoices_PeriodLength} not compatbile with"
131                            IGCM_debug_Print 3 "RebuildFrequency frequency : ${config_Post_RebuildFrequency}"
132                        fi ;;
133
134                esac
135                ;;
136            NONE|none)
137                ;;
138            *)
139                IGCM_debug_Print 3 "KeyWord not allowed for RebuildFrequency in config.card"
140                ;;
141        esac
142    else
143        #
144        IGCM_debug_Print 1 "Asynchronous rebuild has not been activated"
145        IGCM_debug_Print 1 "Proceed with standard post-treatment pathway"
146        echo
147        #
148    fi
149
150    IGCM_debug_Print 1 "RebuildFrequency flag value : ${RebuildFrequency}"
151    IGCM_post_Initialize
152
153    IGCM_debug_PopStack "IGCM_post_Configure"
154}
155
156function IGCM_post_Initialize
157{
158    IGCM_debug_PushStack "IGCM_post_Initialize"
159
160    # Debug Print :
161    echo
162    IGCM_debug_Print 1 "IGCM_post_Initialize :"
163    echo
164
165    typeset POST NbDays PeriodEndJul PostEndJul LengthDays
166    POST=false
167    #
168    # ONLY IF SOMETHING NEEDS TO BE DONE (EATHER TIME SERIES OR SEASONAL) COMPUTE THE MODULOS
169    #
170    if ( [ X${TimeSeries} = Xtrue ] || [ X${TimeSeries2D} = Xtrue ] || [ X${TimeSeries3D} = Xtrue ] ) ; then
171        list_post=TimeSeriesFrequency
172    fi
173    #
174    if [ X${Seasonal} = Xtrue ] ; then
175        list_post="${list_post} SeasonalFrequency"
176    fi
177    #
178    # READ TIME SERIES OR SEASONAL FREQUENCY
179    # AND TURN ON THE SUBMISSION FLAG WHEN MODULO IS ZERO
180    #
181    for post_freq in ${list_post} ; do
182        #
183        # Initialize
184        #
185        eval ${post_freq}=false
186        #
187        # Extract frequency from previously defined variable
188        #
189        config_Post_post_freq=$( eval echo \${config_Post_${post_freq}} )
190        #
191        # Offset for Seasonal Average starting period
192        #
193        if [ ${post_freq} = SeasonalFrequency ] ; then
194            if ( [ X${config_Post_SeasonalFrequencyOffset} = X${NULL_STR} ] || [ X${config_Post_SeasonalFrequencyOffset} = XNONE ] || [ X${config_Post_SeasonalFrequencyOffset} = X ] ) ; then
195                PeriodOffset=0
196            else
197                PeriodOffset=${config_Post_SeasonalFrequencyOffset}
198            fi
199        else
200            PeriodOffset=0
201        fi
202        #
203        if ( [ X${config_Post_post_freq} = X${NULL_STR} ] || [ X${config_Post_post_freq} = XNONE ] ) ; then
204            #
205            continue
206            #
207        fi
208        #
209        case ${config_Post_post_freq} in
210            *y|*Y)
211                PeriodYear=$( echo ${config_Post_post_freq} | sed -e "s/[yY]//" )
212                #
213                case ${config_UserChoices_PeriodLength} in
214                    *Y|*y)
215                        PeriodPost=$( echo ${config_UserChoices_PeriodLength} | sed -e "s/[yY]//" )
216                        if [ ${PeriodPost} -le ${PeriodYear} ] ; then
217                            if [ $( expr $(( ${CumulPeriod} * ${PeriodPost} - ${PeriodOffset} )) % ${PeriodYear} ) -eq 0 ] ;  then
218                                [ $(( ${CumulPeriod} * ${PeriodPost} - ${PeriodOffset} )) -ne 0 ] && eval ${post_freq}=true
219                                [ $(( ${CumulPeriod} * ${PeriodPost} - ${PeriodOffset} )) -ne 0 ] && POST=true
220                            fi
221                        else
222                            IGCM_debug_Print 3 "PeriodLength frequency ${config_UserChoices_PeriodLength} not compatbile with"
223                            IGCM_debug_Print 3 "${flag_post} frequency : ${config_Post_post_freq} "
224                        fi ;;
225                    *M|*m)
226                        PeriodPost=$( echo ${config_UserChoices_PeriodLength} | sed -e "s/[mM]//" )
227                        if [ ${PeriodPost} -le $(( ${PeriodYear} * 12 )) ] ; then
228                            if [ $( expr $(( ${CumulPeriod} * ${PeriodPost} - ${PeriodOffset} * 12 )) % $(( ${PeriodYear} * 12 )) ) -eq 0 ] ; then
229                                [ $(( ${CumulPeriod} * ${PeriodPost} - ${PeriodOffset} * 12 )) -ne 0 ] && eval ${post_freq}=true
230                                [ $(( ${CumulPeriod} * ${PeriodPost} - ${PeriodOffset} * 12 )) -ne 0 ] && POST=true
231                            fi
232                        else
233                            IGCM_debug_Print 3 "PeriodLength frequency ${config_UserChoices_PeriodLength} not compatbile with"
234                            IGCM_debug_Print 3 "${flag_post} frequency : ${config_Post_post_freq} "
235                        fi ;;
236                    *D|*d)
237                        PeriodPost=$( echo ${config_UserChoices_PeriodLength} | sed -e "s/[dD]//" )
238                        NbDays=$( IGCM_date_DaysInYear ${year} )
239                        if [ ${config_UserChoices_CalendarType} = 360d ] | [ ${config_UserChoices_CalendarType} = noleap ] ; then
240                            if [ ${PeriodPost} -le $(( ${PeriodYear} * ${NbDays} )) ] ; then
241                                if [ $( expr $(( ${CumulPeriod} - ( ${PeriodOffset} * ${NbDays} / ${PeriodPost} ) )) % \
242                                    $(( ${NbDays} * ${PeriodYear} / ${PeriodPost} )) ) -eq 0 ] ; then
243                                    [ $(( ${CumulPeriod} - ( ${PeriodOffset} * ${NbDays} / ${PeriodPost} ) )) -ne 0 ] && eval ${post_freq}=true
244                                    [ $(( ${CumulPeriod} - ( ${PeriodOffset} * ${NbDays} / ${PeriodPost} ) )) -ne 0 ] POST=true
245                                fi
246                            else
247                                IGCM_debug_Print 3 "PeriodLength frequency ${config_UserChoices_PeriodLength} not compatbile with"
248                                IGCM_debug_Print 3 "${flag_post} frequency : ${config_Post_post_freq} "
249                            fi
250                        else
251#                                           if [ ${PeriodYear} -eq 1 ] ; then
252#                                               PeriodEndJul=$( IGCM_date_ConvertGregorianDateToJulian ${PeriodDateEnd} )
253#                                               PostEndJul=${year}${NbDays}
254#                                                #echo "PeriodYear=${PeriodYear} NbDays=${NbDays}"
255#                                               #echo PeriodEndJul=${PeriodEndJul} PostEndJul=${PostEndJul}"
256#                                               if [ ${PostEndJul} -le ${PeriodEndJul} ] ; then
257#                                                   eval ${post_freq}=true
258#                                                   POST=true
259#                                               fi
260#                                           else
261                            IGCM_debug_Print 3 "For ${post_freq} with leap calendar, for ${comp} and ${file_in} :"
262                            IGCM_debug_Print 3 "We have a daily PeriodLength frequency and RebuildFrequency=${PeriodYear}Y."
263                            IGCM_debug_Print 3 "No post-treatment. Case not properly handle at this moment."
264#                                           fi
265                        fi;;
266                esac ;;
267            *M|*m)
268                PeriodMonth=$( echo ${config_Post_post_freq} | sed -e "s/[mM]//" )
269                case ${config_UserChoices_PeriodLength} in
270                    *Y|*y)
271                        IGCM_debug_Print 3 "PeriodLength frequency ${config_UserChoices_PeriodLength} not compatbile with"
272                        IGCM_debug_Print 3 "${flag_post} frequency : ${config_Post_post_freq} " ;;
273                    *M|*m)
274                        PeriodPost=$( echo ${config_UserChoices_PeriodLength} | sed -e "s/[mM]//" )
275                        if [ ${PeriodPost} -le ${PeriodMonth} ] ; then
276                            if [ $( expr $(( ${CumulPeriod} * ${PeriodPost} -  ${PeriodOffset} )) % ${PeriodMonth}  ) -eq 0 ] ;  then
277                                [ $(( ${CumulPeriod} * ${PeriodPost} -  ${PeriodOffset} )) -ne 0 ] && eval ${post_freq}=true
278                                [ $(( ${CumulPeriod} * ${PeriodPost} -  ${PeriodOffset} )) -ne 0 ] && POST=true
279                            fi
280                        else
281                            IGCM_debug_Print 3 "PeriodLength frequency ${config_UserChoices_PeriodLength} not compatbile with"
282                            IGCM_debug_Print 3 "${flag_post} frequency : ${config_Post_post_freq} "
283                        fi;;
284                    *D|*d)
285                        IGCM_debug_Print 3 "PeriodLength frequency ${config_UserChoices_PeriodLength} not compatbile with"
286                        IGCM_debug_Print 3 "${flag_post} frequency : ${config_Post_post_freq} " ;;
287                esac ;;
288            *D|*d)
289                PeriodDay=$( echo ${config_Post_post_freq} | sed -e "s/[dD]//" )
290                case ${config_UserChoices_PeriodLength} in
291                    *Y|*y)
292                        IGCM_debug_Print 3 "PeriodLength frequency ${config_UserChoices_PeriodLength} not compatbile with"
293                        IGCM_debug_Print 3 "${flag_post} frequency : ${config_Post_post_freq} " ;;
294                    *M|*m)
295                        IGCM_debug_Print 3 "PeriodLength frequency ${config_UserChoices_PeriodLength} not compatbile with"
296                        IGCM_debug_Print 3 "${flag_post} frequency : ${config_Post_post_freq} " ;;
297                    *D|*d)
298                        PeriodPost=$( echo ${config_UserChoices_PeriodLength} | sed -e "s/[dD]//" )
299                        if [ ${PeriodPost} -le ${PeriodDay} ] ; then
300                            if [ $( expr $(( ${CumulPeriod} * ${PeriodPost} - ${PeriodOffset} )) % ${PeriodDay}  ) -eq 0 ] ;  then
301                                [ $(( ${CumulPeriod} * ${PeriodPost} - ${PeriodOffset} )) -ne 0 ] && eval ${post_freq}=true
302                                [ $(( ${CumulPeriod} * ${PeriodPost} - ${PeriodOffset} )) -ne 0 ] && POST=true
303                            fi
304                        else
305                            IGCM_debug_Print 3 "PeriodLength frequency ${config_UserChoices_PeriodLength} not compatbile with"
306                            IGCM_debug_Print 3 "${flag_post} frequency : ${config_Post_post_freq} "
307                        fi;;
308                esac ;;
309            NONE|none)
310                ;;
311            *)
312                IGCM_debug_Print 3 "KeyWord not allowed for ${post_freq} in config.card"
313                ;;
314        esac
315    done
316    #
317    if ( [ ! X${config_Post_TimeSeriesFrequency} = X${NULL_STR} ] && \
318         [ ! X${config_Post_TimeSeriesFrequency} = XNONE ]        && \
319         [ ${SimulationLengthInDays} -ge ${ExperienceLengthInDays} ] ) ; then
320        TimeSeriesFrequency=true
321        POST=true
322    fi
323
324    if ( [ ! X${config_Post_RebuildFrequency} = X${NULL_STR} ] && \
325         [ ! X${config_Post_RebuildFrequency} = XNONE ]        && \
326         [ ${SimulationLengthInDays} -ge ${ExperienceLengthInDays} ] ) ; then
327        RebuildFrequency=true
328        POST=true
329    fi
330
331    #
332    IGCM_debug_Print 1 "POST-TREATEMENT flag value : ${POST}"
333    #
334    IGCM_post_Submit
335
336    IGCM_debug_PopStack "IGCM_post_Initialize"
337}
338
339function IGCM_post_Submit
340{
341    IGCM_debug_PushStack "IGCM_post_Submit"
342
343    POST_DIR=${R_OUT_POST}/${config_UserChoices_TagName}/${config_UserChoices_JobName}
344
345    if [ ${POST} = true ]; then
346        echo
347        IGCM_debug_Print 1 "IGCM_post_Submit :"
348        echo
349        IGCM_debug_Print 1 "POST_DIR = ${POST_DIR}"
350    fi
351
352    #============ TIME SERIES POST-TREATMENT ===========#
353    if [ ${TimeSeriesFrequency} = true ] ; then
354
355        IGCM_debug_Print 2 "TIME SERIES POST-PROCESSING ACTIVATED :"
356        echo
357
358
359
360        # Get information from last execution
361        IGCM_card_DefineVariableFromOption ${SUBMIT_DIR}/run.card PostProcessing TimeSeriesCompleted
362        CompletedFlag=${run_PostProcessing_TimeSeriesCompleted}
363        #
364
365
366
367        typeset listVarEnv
368        listVarEnv="DEBUG_debug,MODIPSL,libIGCM,libIGCM_SX,SUBMIT_DIR,POST_DIR,MASTER,RebuildFrequency,DateBegin,PeriodDateEnd,StandAlone,CompletedFlag,TsTask,CompToRead,FlagToRead,RESOL_ATM,RESOL_OCE,RESOL_ICE,RESOL_MBG,RESOL_SRF,RESOL_BIOS,config_UserChoices_JobName,R_SAVE"
369        #
370        jLoop=${#ListDimension[*]}
371        j=0
372        until [ $j -ge ${jLoop} ]; do
373            Dimension=${ListDimension[${j}]}
374            #
375            if [ X$( eval echo \${TimeSeries${Dimension}} ) = Xtrue ] ; then
376                #
377                IGCM_debug_Print 2 "TIME SERIES POST-PROCESSING ${Dimension} ACTIVATED :"
378                echo
379                #
380                TsTask=${Dimension}
381                #
382                if [ ${RebuildFrequency} = true ] && [ ${DRYRUN} -le 1 ] ; then
383                    #
384                    echo export DEBUG_debug=${DEBUG_debug}            >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
385                    echo export MODIPSL=${MODIPSL}                    >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
386                    echo export libIGCM_SX=${libIGCM}                 >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
387                    echo export libIGCM=${libIGCM_POST}               >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
388                    echo export SUBMIT_DIR=${SUBMIT_DIR}              >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
389                    echo export POST_DIR=${POST_DIR}                  >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
390                    echo export MASTER=${MASTER}                      >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
391                    echo export RebuildFrequency=${RebuildFrequency}  >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
392                    echo export DateBegin=${DateBegin}                >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
393                    echo export PeriodDateEnd=${PeriodDateEnd}        >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
394                    echo export StandAlone=false                      >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
395                    echo export CompletedFlag=${CompletedFlag}        >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
396                    echo export TsTask=${TsTask}                      >> ${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_MBG=${RESOL_MBG}                >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
401                    echo export RESOL_SRF=${RESOL_SRF}                >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
402                    echo export RESOL_BIOS=${RESOL_BIOS}              >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
403                    echo export config_UserChoices_JobName=${config_UserChoices_JobName} >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
404                    echo export R_SAVE=${R_SAVE}                      >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
405                    echo export listVarEnv=${listVarEnv}              >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
406                    echo IGCM_sys_MkdirWork ${POST_DIR}               >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
407                    echo IGCM_debug_Verif_Exit                        >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
408                    echo IGCM_sys_QsubPost create_ts                  >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
409                    #
410                else
411                    #
412                    IGCM_sys_RshPost <<-EOF
413                    export DEBUG_debug=${DEBUG_debug}
414                    export MODIPSL=${MODIPSL}
415                    export libIGCM_SX=${libIGCM}
416                    export libIGCM=${libIGCM_POST}
417                    export SUBMIT_DIR=${SUBMIT_DIR}
418                    export POST_DIR=${POST_DIR}
419                    export MASTER=${MASTER}
420                    export RebuildFrequency=${RebuildFrequency}
421                    export DateBegin=${DateBegin}
422                    export PeriodDateEnd=${PeriodDateEnd}
423                    export StandAlone=false
424                    export CompletedFlag=${CompletedFlag}
425                    export TsTask=${TsTask}
426                    export RESOL_ATM=${RESOL_ATM}
427                    export RESOL_OCE=${RESOL_OCE}
428                    export RESOL_ICE=${RESOL_ICE}
429                    export RESOL_MBG=${RESOL_MBG}
430                    export RESOL_SRF=${RESOL_SRF}
431                    export RESOL_BIOS=${RESOL_BIOS}
432                    export config_UserChoices_JobName=${config_UserChoices_JobName}
433                    export R_SAVE=${R_SAVE}
434                    export listVarEnv=${listVarEnv}
435                    . ${libIGCM_POST}/libIGCM_debug/libIGCM_debug.ksh
436                    . ${libIGCM_POST}/libIGCM_sys/libIGCM_sys.ksh
437                    IGCM_sys_MkdirWork ${POST_DIR}
438                    IGCM_debug_Verif_Exit
439                    IGCM_sys_QsubPost create_ts
440EOF
441                fi
442            fi
443            #
444            if [ X$( eval echo \${TimeSeriesChunck${Dimension}} ) = Xtrue ] ; then
445                #
446                IGCM_debug_Print 2 "TIME SERIES POST-PROCESSING ${Dimension} WITH CHUNCK ACTIVATED :"
447                echo
448                # Need to Remember This One
449                SavedDateBegin=${DateBegin}
450                # Kind of task create_ts will perform
451                TsTask=Chunck${Dimension}
452                # Number of chunck jobs to configure and submit
453                eval NbJob=\${#CHUNCK${Dimension}_COMP[@]}
454                export i=0
455                until [ $i -ge $NbJob ]; do
456                    CompToRead=$( eval echo \${CHUNCK${Dimension}_COMP[\${i}]} )
457                    FlagToRead=$( eval echo \${CHUNCK${Dimension}_FLAG[\${i}]} )
458                    ChunckSize=$( eval echo \${CHUNCK${Dimension}_SIZE[\${i}]} )
459                    # Chunck Length (mandatory in Year)
460                    YearsChunckLength=$( echo ${ChunckSize} | sed -e "s/[yY]//" )
461                    #
462                    IGCM_date_GetYearMonth ${DateBegin}     YearBegin MonthBegin
463                    #
464                    IGCM_date_GetYearMonth ${PeriodDateEnd} YearEnd   MonthEnd
465                    # How many chunck in total since simulation began
466                    NbYearsChunckLoop=$(( ( ${YearEnd} - ${YearBegin} + 1 ) / ${YearsChunckLength} ))
467                    #  Tweak special case
468                    [ $(( ( ${YearEnd} - ${YearBegin} + 1 ) % ${YearsChunckLength} )) = 0 ] && NbYearsChunckLoop=$(( ${NbYearsChunckLoop} - 1 ))
469                    # Starting Year of the current chunck
470                    ChunckTsYearBegin=$(( ${NbYearsChunckLoop} *  ${YearsChunckLength} + ${YearBegin} ))
471                    # Starting date of the current chunck
472                    ChunckTsDateBegin=${ChunckTsYearBegin}${MonthBegin}01
473                    #
474                    if [ ${RebuildFrequency} = true ] && [ ${DRYRUN} -le 1 ] ; then
475                        #
476                        echo export DEBUG_debug=${DEBUG_debug}            >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
477                        echo export MODIPSL=${MODIPSL}                    >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
478                        echo export libIGCM_SX=${libIGCM}                 >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
479                        echo export libIGCM=${libIGCM_POST}               >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
480                        echo export SUBMIT_DIR=${SUBMIT_DIR}              >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
481                        echo export POST_DIR=${POST_DIR}                  >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
482                        echo export MASTER=${MASTER}                      >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
483                        echo export RebuildFrequency=${RebuildFrequency}  >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
484                        echo export DateBegin=${ChunckTsDateBegin}        >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
485                        echo export PeriodDateEnd=${PeriodDateEnd}        >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
486                        echo export StandAlone=false                      >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
487                        echo export CompletedFlag=${CompletedFlag}        >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
488                        echo export TsTask=${TsTask}                      >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
489                        echo export CompToRead=${CompToRead}              >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
490                        echo export FlagToRead=${FlagToRead}              >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
491                        echo export RESOL_ATM=${RESOL_ATM}                >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
492                        echo export RESOL_OCE=${RESOL_OCE}                >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
493                        echo export RESOL_ICE=${RESOL_ICE}                >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
494                        echo export RESOL_MBG=${RESOL_MBG}                >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
495                        echo export RESOL_SRF=${RESOL_SRF}                >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
496                        echo export RESOL_BIOS=${RESOL_BIOS}              >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
497                        echo export config_UserChoices_JobName=${config_UserChoices_JobName} >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
498                        echo export R_SAVE=${R_SAVE}                      >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
499                        echo export listVarEnv=${listVarEnv}              >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
500                        echo IGCM_sys_MkdirWork ${POST_DIR}               >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
501                        echo IGCM_debug_Verif_Exit                        >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
502                        echo IGCM_sys_QsubPost create_ts                  >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
503                        #
504                    else
505                        #
506                        IGCM_sys_RshPost <<-EOF
507                        export DEBUG_debug=${DEBUG_debug}
508                        export MODIPSL=${MODIPSL}
509                        export libIGCM_SX=${libIGCM}
510                        export libIGCM=${libIGCM_POST}
511                        export SUBMIT_DIR=${SUBMIT_DIR}
512                        export POST_DIR=${POST_DIR}
513                        export MASTER=${MASTER}
514                        export RebuildFrequency=${RebuildFrequency}
515                        export DateBegin=${ChunckTsDateBegin}
516                        export PeriodDateEnd=${PeriodDateEnd}
517                        export StandAlone=false
518                        export CompletedFlag=${CompletedFlag}
519                        export TsTask=${TsTask}
520                        export CompToRead=${CompToRead}
521                        export FlagToRead=${FlagToRead}
522                        export RESOL_ATM=${RESOL_ATM}
523                        export RESOL_OCE=${RESOL_OCE}
524                        export RESOL_ICE=${RESOL_ICE}
525                        export RESOL_MBG=${RESOL_MBG}
526                        export RESOL_SRF=${RESOL_SRF}
527                        export RESOL_BIOS=${RESOL_BIOS}
528                        export config_UserChoices_JobName=${config_UserChoices_JobName}
529                        export R_SAVE=${R_SAVE}
530                        export listVarEnv=${listVarEnv}
531                        . ${libIGCM_POST}/libIGCM_debug/libIGCM_debug.ksh
532                        . ${libIGCM_POST}/libIGCM_sys/libIGCM_sys.ksh
533                        IGCM_sys_MkdirWork ${POST_DIR}
534                        IGCM_debug_Verif_Exit
535                        IGCM_sys_QsubPost create_ts
536EOF
537                        #
538                    fi
539                    #
540                    export DateBegin=${SavedDateBegin}
541                    #
542                    (( i=i+1 ))
543                    #
544                done
545            fi
546            (( j=j+1 ))
547        done
548    fi
549
550    #=============  SEASONAL POST-TREATMENT ============#
551    if [ ${SeasonalFrequency} = true ] ; then
552        #
553        IGCM_debug_Print 2 "SEASONNAL POST-TREATMENT :"
554        echo
555        #
556        typeset listVarEnv
557        listVarEnv="DEBUG_debug,MODIPSL,libIGCM,libIGCM_SX,SUBMIT_DIR,POST_DIR,MASTER,RebuildFrequency,DateBegin,PeriodDateEnd,StandAlone,RESOL_ATM,RESOL_OCE,RESOL_ICE,RESOL_MBG,RESOL_SRF,RESOL_BIOS,config_UserChoices_JobName,R_SAVE"
558
559        if [ ${RebuildFrequency} = true ] && [ ${DRYRUN} -le 1 ] ; then
560            #
561            echo export DEBUG_debug=${DEBUG_debug}            >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
562            echo export MODIPSL=${MODIPSL}                    >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
563            echo export libIGCM_SX=${libIGCM}                 >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
564            echo export libIGCM=${libIGCM_POST}               >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
565            echo export SUBMIT_DIR=${SUBMIT_DIR}              >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
566            echo export POST_DIR=${POST_DIR}                  >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
567            echo export MASTER=${MASTER}                      >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
568            echo export RebuildFrequency=${RebuildFrequency}  >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
569            echo export DateBegin=${DateBegin}                >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
570            echo export PeriodDateEnd=${PeriodDateEnd}        >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
571            echo export StandAlone=false                      >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
572            echo export RESOL_ATM=${RESOL_ATM}                >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
573            echo export RESOL_OCE=${RESOL_OCE}                >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
574            echo export RESOL_ICE=${RESOL_ICE}                >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
575            echo export RESOL_MBG=${RESOL_MBG}                >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
576            echo export RESOL_SRF=${RESOL_SRF}                >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
577            echo export RESOL_BIOS=${RESOL_BIOS}              >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
578            echo export config_UserChoices_JobName=${config_UserChoices_JobName} >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
579            echo export R_SAVE=${R_SAVE}                      >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
580            echo export listVarEnv=${listVarEnv}              >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
581            echo IGCM_sys_MkdirWork ${POST_DIR}               >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
582            echo IGCM_debug_Verif_Exit                        >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
583            echo IGCM_sys_QsubPost create_se                  >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
584            #
585        else
586            #
587            IGCM_sys_RshPost <<-EOF
588            export DEBUG_debug=${DEBUG_debug}
589            export MODIPSL=${MODIPSL}
590            export libIGCM_SX=${libIGCM}
591            export libIGCM=${libIGCM_POST}
592            export SUBMIT_DIR=${SUBMIT_DIR}
593            export POST_DIR=${POST_DIR}
594            export MASTER=${MASTER}
595            export RebuildFrequency=${RebuildFrequency}
596            export DateBegin=${DateBegin}
597            export PeriodDateEnd=${PeriodDateEnd}
598            export StandAlone=false
599            export RESOL_ATM=${RESOL_ATM}
600            export RESOL_OCE=${RESOL_OCE}
601            export RESOL_ICE=${RESOL_ICE}
602            export RESOL_MBG=${RESOL_MBG}
603            export RESOL_SRF=${RESOL_SRF}
604            export RESOL_BIOS=${RESOL_BIOS}
605            export config_UserChoices_JobName=${config_UserChoices_JobName}
606            export R_SAVE=${R_SAVE}
607            export listVarEnv=${listVarEnv}
608            . ${libIGCM_POST}/libIGCM_debug/libIGCM_debug.ksh
609            . ${libIGCM_POST}/libIGCM_sys/libIGCM_sys.ksh
610            IGCM_sys_MkdirWork ${POST_DIR}
611            IGCM_debug_Verif_Exit
612            IGCM_sys_QsubPost create_se
613EOF
614        #
615        fi
616    fi
617
618    #============== REBUILD POST-TREATMENT =============#
619    if ( [ ! X${config_Post_RebuildFrequency} = X${NULL_STR} ] && [ ! X${config_Post_RebuildFrequency} = XNONE ] ) ; then
620        # -----------------------------------------------------------------------------------
621        # Function IGCM_FlushRebuild define in rebuild.ksh has not been closed yet. Do it now
622        # -----------------------------------------------------------------------------------
623        if [ ${DRYRUN} -le 1 ] ; then
624            echo IGCM_debug_PopStack "IGCM_FlushRebuild" >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
625            echo }                                       >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
626        fi
627        if [ ${config_Post_RebuildFromArchive} = true ] ; then
628            IGCM_sys_Put_Dir REBUILD_${PeriodDateBegin} ${REBUILD_DIR}
629        elif [ ${RebuildFrequency} = true ] ; then
630            IGCM_sys_Mv      REBUILD_${PeriodDateBegin} ${REBUILD_DIR}
631        fi
632    fi
633    #
634    if [ ${RebuildFrequency} = true ] ; then
635        #
636        if ( [ ${config_Post_RebuildFromArchive} = true ] ) ; then
637            #
638            IGCM_debug_Print 2 "REBUILD POST-TREATMENT FROM ARCHIVE:"
639            echo
640            #
641            typeset listVarEnv
642            listVarEnv="DEBUG_debug,MODIPSL,libIGCM,libIGCM_SX,SUBMIT_DIR,REBUILD_DIR,POST_DIR,MASTER,RebuildFromArchive,DateBegin,PeriodDateBegin,PeriodDateEnd,NbRebuildDir,StandAlone,RESOL_ATM,RESOL_OCE,RESOL_ICE,RESOL_MBG,RESOL_SRF,RESOL_BIOS,config_UserChoices_JobName,R_SAVE"
643            IGCM_sys_RshPost <<-EOF
644            export DEBUG_debug=${DEBUG_debug}
645            export MODIPSL=${MODIPSL}
646            export libIGCM_SX=${libIGCM}
647            export libIGCM=${libIGCM_POST}
648            export SUBMIT_DIR=${SUBMIT_DIR}
649            export REBUILD_DIR=${REBUILD_DIR}
650            export POST_DIR=${POST_DIR}
651            export MASTER=${MASTER}
652            export RebuildFromArchive=${config_Post_RebuildFromArchive}
653            export DateBegin=${DateBegin}
654            export PeriodDateBegin=${PeriodDateBegin}
655            export PeriodDateEnd=${PeriodDateEnd}
656            export NbRebuildDir=${NbRebuildDir}
657            export StandAlone=false
658            export RESOL_ATM=${RESOL_ATM}
659            export RESOL_OCE=${RESOL_OCE}
660            export RESOL_ICE=${RESOL_ICE}
661            export RESOL_MBG=${RESOL_MBG}
662            export RESOL_SRF=${RESOL_SRF}
663            export RESOL_BIOS=${RESOL_BIOS}
664            export config_UserChoices_JobName=${config_UserChoices_JobName}
665            export R_SAVE=${R_SAVE}
666            export listVarEnv=${listVarEnv}
667            . ${libIGCM_POST}/libIGCM_debug/libIGCM_debug.ksh
668            . ${libIGCM_POST}/libIGCM_sys/libIGCM_sys.ksh
669            IGCM_sys_MkdirWork ${POST_DIR}
670            IGCM_debug_Verif_Exit
671            IGCM_sys_QsubPost rebuild_fromArchive
672EOF
673        else
674            #
675            IGCM_debug_Print 2 "REBUILD POST-TREATMENT FROM WORKDIR:"
676            echo
677            #
678            typeset listVarEnv
679            listVarEnv="DEBUG_debug,MODIPSL,libIGCM,libIGCM_SX,SUBMIT_DIR,REBUILD_DIR,POST_DIR,MASTER,RebuildFromArchive,DateBegin,PeriodDateBegin,PeriodDateEnd,NbRebuildDir,StandAlone,RESOL_ATM,RESOL_OCE,RESOL_ICE,RESOL_MBG,RESOL_SRF,RESOL_BIOS,config_UserChoices_JobName,R_SAVE"
680            IGCM_sys_RshPost <<-EOF
681            export DEBUG_debug=${DEBUG_debug}
682            export MODIPSL=${MODIPSL}
683            export libIGCM_SX=${libIGCM}
684            export libIGCM=${libIGCM_POST}
685            export SUBMIT_DIR=${SUBMIT_DIR}
686            export REBUILD_DIR=${REBUILD_DIR}
687            export POST_DIR=${POST_DIR}
688            export MASTER=${MASTER}
689            export RebuildFromArchive=${config_Post_RebuildFromArchive}
690            export DateBegin=${DateBegin}
691            export PeriodDateBegin=${PeriodDateBegin}
692            export PeriodDateEnd=${PeriodDateEnd}
693            export NbRebuildDir=${NbRebuildDir}
694            export StandAlone=false
695            export RESOL_ATM=${RESOL_ATM}
696            export RESOL_OCE=${RESOL_OCE}
697            export RESOL_ICE=${RESOL_ICE}
698            export RESOL_MBG=${RESOL_MBG}
699            export RESOL_SRF=${RESOL_SRF}
700            export RESOL_BIOS=${RESOL_BIOS}
701            export config_UserChoices_JobName=${config_UserChoices_JobName}
702            export R_SAVE=${R_SAVE}
703            export listVarEnv=${listVarEnv}
704            . ${libIGCM_POST}/libIGCM_debug/libIGCM_debug.ksh
705            . ${libIGCM_POST}/libIGCM_sys/libIGCM_sys.ksh
706            IGCM_sys_MkdirWork ${POST_DIR}
707            IGCM_debug_Verif_Exit
708            IGCM_sys_QsubPost rebuild_fromWorkdir
709EOF
710        fi
711    fi
712
713    IGCM_debug_PopStack "IGCM_post_Submit"
714}
Note: See TracBrowser for help on using the repository browser.