source: trunk/libIGCM/AA_TimeSeries_Checker @ 553

Last change on this file since 553 was 546, checked in by sdipsl, 12 years ago

R_BUFR defined in post-processing job

  • Property svn:keywords set to Revision Author Date
File size: 20.2 KB
Line 
1#!/bin/ksh
2
3#**************************************************************
4# Author: Sebastien Denvil
5# Contact: Sebastien.Denvil__at__ipsl.jussieu.fr
6# $Revision::                                          $ Revision of last commit
7# $Author::                                            $ Author of last commit
8# $Date::                                              $ Date of last commit
9# IPSL (2006)
10#  This software is governed by the CeCILL licence see libIGCM/libIGCM_CeCILL.LIC
11#
12#**************************************************************
13
14# Check that everything went well during time series production
15# Display a short report
16# Launch what's missing
17# For use during a run (not on the end : PeriodState=Completed), it will complete
18# all TS to last PeriodDateEnd value, give by run.card->Configuration->OldPrefix string.
19
20# Chemin vers libIGCM
21libIGCM=${libIGCM:=::modipsl::/libIGCM}
22# Attention : à changer si la machine de post-traitement n'est pas la frontale du serveur de calcul !
23#             voir précence de la variable MirrorlibIGCM dans votre couche systÚme.
24
25# Expericence class of the run
26ExperimentName=${ExperimentName:=historical}
27
28# Name of this job
29JobName=${JobName:=v2.historical1}
30
31# répertoire courrant
32CURRENT_DIR=$( pwd )
33
34# Emplacement des cartes
35CARD_DIR=${CARD_DIR:=${CURRENT_DIR}/${ExperimentName}/${JobName}}
36
37# répertoire de stockage des sorties des create_ts
38POST_DIR=${POST_DIR:=${CARD_DIR}/OutScript}
39
40if [ ! -d ${CARD_DIR} ]; then
41    echo "No ${CARD_DIR}, we stop here"
42    exit
43fi
44
45########################################################################
46
47. ${libIGCM}/libIGCM_debug/libIGCM_debug.ksh ;
48. ${libIGCM}/libIGCM_sys/libIGCM_sys.ksh     #; IGCM_debug_Check
49. ${libIGCM}/libIGCM_card/libIGCM_card.ksh   #; IGCM_card_Check
50. ${libIGCM}/libIGCM_date/libIGCM_date.ksh   #; IGCM_date_Check
51
52########################################################################
53
54#set -vx
55
56echo "Hi I'm here to help you complete the time series production you planned according to your *.card."
57echo "This action can potentially submit numbers of jobs (up to 50)"
58echo "This action can potentially remove unnecessary files but I will ALWAYS ask permission to do so"
59echo -e "\033[1;31mDo you want me to run in dryrun mode just telling what I would submit?\033[m"
60echo -e "\033[1;31mOr do you want me to submit job for real? Answer yes in this case.\033[m"
61echo -n " Run for real (y/n) :"
62read ActionAnswer
63
64case ${ActionAnswer} in   
65    oui|OUI|o|y|yes|YES)
66        echo "OK. I will submit jobs but ask permissions before removing files"
67        action=true
68        ;;
69    non|NON|n|no|NO)
70        echo "OK. I won't submit jobs and only print out files I could remove"
71        action=false
72        ;;
73    *)
74        echo "I did not recognize your answer. I will stop here."
75        echo "Please respond: oui|OUI|o|y|yes|YES"
76        echo "Or please respond: non|NON|n|no|NO"
77        exit
78        ;;
79esac
80
81# First of all
82IGCM_card_DefineArrayFromSection       ${CARD_DIR}/config.card UserChoices
83typeset option
84for option in ${config_UserChoices[*]} ; do
85    IGCM_card_DefineVariableFromOption ${CARD_DIR}/config.card UserChoices ${option}
86done
87
88echo
89IGCM_debug_Print 1 "DefineVariableFromOption  : config_UserChoices"
90IGCM_debug_PrintVariables 3 config_UserChoices_JobName
91#IGCM_debug_PrintVariables 3 config_UserChoices_SpaceName
92#IGCM_debug_PrintVariables 3 config_UserChoices_ExperimentName
93IGCM_debug_PrintVariables 3 config_UserChoices_CalendarType
94IGCM_debug_PrintVariables 3 config_UserChoices_DateBegin
95IGCM_debug_PrintVariables 3 config_UserChoices_DateEnd
96
97if [ -f ${CARD_DIR}/run.card ] ; then
98    IGCM_card_DefineVariableFromOption ${CARD_DIR}/run.card Configuration OldPrefix
99    IGCM_card_DefineVariableFromOption ${CARD_DIR}/run.card Configuration PeriodState
100    IGCM_card_DefineVariableFromOption ${CARD_DIR}/run.card PostProcessing TimeSeriesCompleted
101    IGCM_debug_Print 1 "DefineVariableFromOption  : run_Configuration"
102    IGCM_debug_PrintVariables 3 run_Configuration_OldPrefix
103    IGCM_debug_PrintVariables 3 run_Configuration_PeriodState
104    IGCM_debug_Print 1 "DefineVariableFromOption  : run_PostProcessing"
105    IGCM_debug_PrintVariables 3 run_PostProcessing_TimeSeriesCompleted
106    if [ X${run_Configuration_PeriodState} != X"Completed" ] ; then
107        DateEnd=$( IGCM_date_ConvertFormatToGregorian $( echo ${run_Configuration_OldPrefix} | awk -F'_' '{print $2}' ) )
108    else
109        DateEnd=$( IGCM_date_ConvertFormatToGregorian ${config_UserChoices_DateEnd} )
110    fi
111    CompletedFlag=${run_PostProcessing_TimeSeriesCompleted}
112else
113    DateEnd=$( IGCM_date_ConvertFormatToGregorian ${config_UserChoices_DateEnd} )
114    CompletedFlag=""
115fi
116SavedCompletedFlag=${CompletedFlag}
117DateBegin=$( IGCM_date_ConvertFormatToGregorian ${config_UserChoices_DateBegin} )
118
119IGCM_date_GetYearMonth ${DateBegin} YearBegin MonthBegin
120IGCM_date_GetYearMonth ${DateEnd}   YearEnd   MonthEnd
121
122echo
123IGCM_debug_Print 1 "DateBegin for TimeSeries_Checker : "${DateBegin}
124IGCM_debug_Print 1 "DateEnd   for TimeSeries_Checker : "${DateEnd}
125IGCM_debug_Print 1 "CompletedFlag = "${CompletedFlag}
126echo
127
128#====================================================
129#R_SAVE : Job output directory
130#R_BUFR : Job output buffered directory
131if ( [ ! X${config_UserChoices_SpaceName} = X ] && [ ! X${config_UserChoices_ExperimentName} = X ] ) ; then
132    FreeName=$( echo ${config_UserChoices_JobName} | sed 's/.*_//' )
133    R_SAVE=${R_OUT}/${config_UserChoices_TagName}/${config_UserChoices_SpaceName}/${config_UserChoices_ExperimentName}/${FreeName}
134    R_BUFR=${R_BUF}/${config_UserChoices_TagName}/${config_UserChoices_SpaceName}/${config_UserChoices_ExperimentName}/${FreeName}
135    R_DODS=${config_UserChoices_TagName}/${config_UserChoices_SpaceName}/${config_UserChoices_ExperimentName}/${FreeName}
136else
137    R_SAVE=${R_OUT}/${config_UserChoices_TagName}/${config_UserChoices_JobName}
138    R_BUFR=${R_BUF}/${config_UserChoices_TagName}/${config_UserChoices_JobName}
139    R_DODS=${config_UserChoices_TagName}/${config_UserChoices_JobName}
140fi
141
142IGCM_card_DefineArrayFromSection ${CARD_DIR}/config.card ListOfComponents
143
144for comp in ${config_ListOfComponents[*]} ; do
145    # Debug Print
146    IGCM_debug_Print 1 ${comp}
147    # Define component
148    IGCM_card_DefineArrayFromOption ${CARD_DIR}/config.card ListOfComponents ${comp}
149    eval compname=\${config_ListOfComponents_${comp}[0]} > /dev/null 2>&1
150    eval comptagname=\${config_ListOfComponents_${comp}[1]} > /dev/null 2>&1
151
152    # Read libIGCM compatibility version in ${compname}.card
153    card=${CARD_DIR}/COMP/${compname}.card
154
155    # Read and Build Output File stuff
156    #IGCM_debug_Print 1 "DefineArrayFromOption  : ${compname}_OutputFiles ${card}"
157    IGCM_card_DefineArrayFromOption ${card} OutputFiles List
158    ListFilesName=${compname}_OutputFiles_List
159    eval FileName0=\${${ListFilesName}[0]} > /dev/null 2>&1
160    #
161    if [ X${FileName0} != X${NULL_STR} ] ; then
162        #
163        #IGCM_debug_Print 1 "Component      : ${compname}"
164        #
165        # INITIALISATION
166        #
167        eval NbFiles=\${#${ListFilesName}[@]} > /dev/null 2>&1
168        i=2
169        #
170        until [ $i -ge $NbFiles ]; do
171            #
172            eval flag_post=\${${ListFilesName}[$i]} > /dev/null 2>&1
173            #
174            if [ X${flag_post} != XNONE ] ; then
175                #
176                # First of all
177                #
178                IGCM_card_DefineArrayFromSection ${card} ${flag_post}
179                #
180                IGCM_card_DefineArrayFromOption ${card} ${flag_post} TimeSeriesVars
181                IGCM_card_DefineArrayFromOption ${card} ${flag_post} Patches
182                if [ X"$( eval echo \${${compname}_${flag_post}_TimeSeriesVars[*]} )" = X"Option not" ] ; then
183                    # New TimeSeriesVar description, with 2D, 3D and associate ChunckJob.
184                    unset ListDimension
185                    ListDimension[0]=2D
186                    ListDimension[1]=3D
187                    TimeSeries=false
188                    TimeSeries2D=false
189                    TimeSeries3D=false
190                    chunck=false
191                    iLoop=${#ListDimension[*]}
192                    j=0
193                    until [ $j -ge ${iLoop} ]; do
194                        Dimension=${ListDimension[${j}]}
195                        IGCM_card_DefineArrayFromOption ${card} ${flag_post} TimeSeriesVars${Dimension}
196                        IGCM_card_DefineVariableFromOption ${card} ${flag_post} ChunckJob${Dimension}
197                        #
198                        # Time series WITHOUT chunk
199                        #
200                        if [ ! $( eval echo \${${compname}_${flag_post}_TimeSeriesVars${Dimension}} ) = ${NULL_STR} ] ; then
201                            if [ $( eval echo \${${compname}_${flag_post}_ChunckJob${Dimension}} ) = NONE ] ; then
202                                IGCM_debug_Print 2 "${Dimension} time series activated for ${flag_post}"
203                                eval TimeSeries${Dimension}=true
204                                chunck=false
205                            fi
206                        fi
207                        #
208                        # Time series WITH chunk
209                        #
210                        if [ ! $( eval echo \${${compname}_${flag_post}_TimeSeriesVars${Dimension}} ) = ${NULL_STR} ] ; then
211                            chunck_size=$( eval echo \${${compname}_${flag_post}_ChunckJob${Dimension}} )
212                            if [ ! ${chunck_size} = NONE ] &&  [ ! ${chunck_size} = OFF ] ; then
213                                IGCM_debug_Print 2 "${Dimension} time series activated with ${chunck_size} chunck for ${flag_post}"
214                                eval TimeSeriesChunck${Dimension}=true
215                                chunck=true
216                            fi
217                        fi
218                        (( j=j+1 ))
219                        #
220                        # If TimeSeriesVars list is empty or OFF we skip
221                        #
222                        if ( [ $( eval echo \${${compname}_${flag_post}_TimeSeriesVars${Dimension}} ) = ${NULL_STR} ] || \
223                            [ ${chunck_size} = OFF ] ) ; then
224                            #IGCM_debug_Print 2 "Empty TS : ${compname}_Post_${FILE}_TimeSeriesVars${Dimension}"
225                            #(( i=i+3 ))
226                            continue
227                        fi
228                        #
229                        #  ICI ON TESTE QUE LES FICHIERS TS SONT LA!
230                        #
231                        #
232                        FILE=$( echo ${flag_post} | awk "-FPost_" '{print $2}' )
233                        IGCM_card_DefineArrayFromOption ${card}    Post_${FILE} TimeSeriesVars${Dimension}
234                        IGCM_card_DefineVariableFromOption ${card} Post_${FILE} ChunckJob${Dimension}
235                        #
236                        FlagDir=$( echo ${FILE} | awk -F "_" '{print $1}' )
237                        case ${FlagDir} in
238                            *Y)  TS_Dir=TS_YE  ;;
239                            *M)  TS_Dir=TS_MO  ;;
240                            *D)  TS_Dir=TS_DA  ;;
241                         3H|HF)  TS_Dir=TS_HF  ;;
242                           INS) TS_Dir=TS_INS ;;
243                        esac
244                        #
245                        # We need LIST of variables not allready produced (useful for standalone mode)
246                        #
247                        DateBegin=$( IGCM_date_ConvertFormatToGregorian ${config_UserChoices_DateBegin} )
248                        IGCM_date_GetYearMonth ${DateBegin} YearBegin MonthBegin
249
250                        # Si on n'a pas de chunck, dans ce cas chunck_size=la durée de la simulation en années
251                        YearsChunckLength=$( echo ${chunck_size} | sed -e "s/[yY]//" )
252                        [ ${chunck} = false ] && YearsChunckLength=$(( YearEnd - YearBegin + 1 ))
253
254                        NbYearsChunckLoop=$(( ( YearEnd - YearBegin + 1 ) / YearsChunckLength ))
255                        Reste=$(( ( YearEnd - YearBegin + 1 ) % YearsChunckLength ))
256
257                        if [ ${Reste} -ne 0 ] ; then
258                            NbYearsChunckLoop=$(( NbYearsChunckLoop + 1 ))
259                        fi
260
261                        if [ ${NbYearsChunckLoop} -eq 1 ] ; then
262                            PeriodDateEnd=${DateEnd}
263                        else
264                            DaysInYear=$( IGCM_date_DaysInYear ${YearBegin} )
265                            PeriodDateEnd=$( IGCM_date_AddDaysToGregorianDate ${DateBegin} $(( YearsChunckLength * DaysInYear - 1 )) )
266                        fi
267                        #
268                        DIRECTORY=${R_SAVE}/${comp}/Analyse/${TS_Dir}
269                        YearsChunckLoop=1
270                        ChunckDebut=${DateBegin}
271                        ChunckFin=${PeriodDateEnd}
272                        while [ ${YearsChunckLoop} -le ${NbYearsChunckLoop} ] ; do
273                            countTotal=0
274                            countGood=0
275                            countBad=0
276                            unset RemoveList
277                            unset PotentialCompletedFlag
278                            for var in $( eval echo \${${compname}_Post_${FILE}_TimeSeriesVars${Dimension}[*]} ) ; do
279                                TestedFile=${config_UserChoices_JobName}_${ChunckDebut}_${ChunckFin}_${FlagDir}_${var}.nc
280                                #
281                                if [ -d ${DIRECTORY} ] ; then
282                                    Candidat=$( find ${DIRECTORY} -name "${config_UserChoices_JobName}_${ChunckDebut}_*_${FlagDir}_${var}.nc" )
283                                else
284                                    Candidat=""
285                                fi
286                                #
287                                BestCandidat=${ChunckDebut}
288                                #
289                                FoundCandidat=false
290                                if [ ! "X${Candidat}" = "X" ] ; then
291                                    for candid in ${Candidat} ; do
292                                        #IGCM_debug_Print 1 -e "\033[1;32m[CompletedFlag CANDIDAT MATCH FOUND]\033[m $( basename ${candid} )"
293                                        CandidatEnd=$( echo ${candid}   | awk -F${config_UserChoices_JobName} '{print $3}' | awk -F_ '{print $3}' )
294                                        if [ ${CandidatEnd} -gt ${ChunckFin} ] ; then
295                                            #IGCM_debug_Print 3 -e "File $( basename ${candid} ) should be suppress"
296                                            set +A RemoveList ${RemoveList[*]} ${candid}
297                                        elif [ ${CandidatEnd} -lt ${ChunckFin} ] ; then
298                                            #IGCM_debug_Print 3 -e "File $( basename ${candid} ) should be suppress or used as a CompletedFlag baseline"
299                                            # We keep the best candidat and remove the others
300                                            if [ ${BestCandidat} -lt ${CandidatEnd} ] ; then
301                                                if [ ${FoundCandidat} = true ] ; then
302                                                   set +A RemoveList ${RemoveList[*]} ${DIRECTORY}/${config_UserChoices_JobName}_${ChunckDebut}_${BestCandidat}_${FlagDir}_${var}.nc
303                                                else
304                                                   FoundCandidat=true
305                                                fi
306                                                BestCandidat=${CandidatEnd}
307                                            else
308                                                set +A RemoveList ${RemoveList[*]} ${candid}
309                                            fi
310                                        fi
311                                    done
312                                else
313                                    # No CompletedFlag candidat found
314                                    CandidatCompletedFlag=""
315                                fi
316                                #
317                                if [ ! -f ${DIRECTORY}/${TestedFile} ] ; then
318                                    (( countBad = countBad + 1 ))
319                                    [ ${countBad} = 1 ] && IGCM_debug_Print 3 "Missing time series from ${FILE} :"
320                                    IGCM_debug_Print 3 ${DIRECTORY}/${TestedFile}
321                                    # Then we keep a track of the Best Candidat
322                                    if [ ${FoundCandidat} = true ] ; then
323                                        if [ ${chunck} = true ] ; then
324                                            set +A PotentialCompletedFlag ${PotentialCompletedFlag[*]} ${BestCandidat}
325                                        else
326                                            eval set +A PotentialCompletedFlag${Dimension} \${PotentialCompletedFlag${Dimension}[*]} \${BestCandidat}
327                                        fi
328                                    fi
329                                else
330                                    (( countGood = countGood + 1 ))
331                                    # Then we do not need the best candidat if any
332                                    [ ${FoundCandidat} = true ] && set +A RemoveList ${RemoveList[*]} ${DIRECTORY}/${config_UserChoices_JobName}_${ChunckDebut}_${BestCandidat}_${FlagDir}_${var}.nc
333                                fi
334                                (( countTotal = countTotal + 1 ))
335                            done
336
337                            SuccessRate=$(( countGood * 100 / countTotal ))
338                            if [ ${SuccessRate} -ne 100 ] ; then
339                                IGCM_debug_Print 2 -e "\033[1;31m${SuccessRate}% files OK.\033[m for period ${ChunckDebut}-${ChunckFin}"
340                            else
341                                IGCM_debug_Print 2 -e "\033[1;32m${SuccessRate}% files OK.\033[m for period ${ChunckDebut}-${ChunckFin}"
342                            fi
343                            echo
344
345                            # Remove what's in the RemoveList
346                            if [ ${RemoveList} ] ; then
347                                IGCM_debug_Print 2 "File(s) that will be removed ${RemoveList[*]}"
348                                if [ ${action} = true ] ; then
349                                    echo -e "\033[1;32mDo you want to remove them?\033[m"
350                                    echo -n " Your answer (y/n) : "
351                                    read RemoveAnswer
352                                    case ${RemoveAnswer} in   
353                                        oui|OUI|o|y|yes|YES)
354                                            echo "OK. I will erase them"
355                                            IGCM_sys_Rm -f ${RemoveList[*]}
356                                            ;;
357                                        non|NON|n|no|NO)
358                                            echo "OK. I won't erase them"
359                                            ;;
360                                        *)
361                                            echo "I did not recognize your answer."
362                                            echo "Please respond: oui|OUI|o|y|yes|YES"
363                                            echo "Or please respond: non|NON|n|no|NO"
364                                            exit
365                                            ;;
366                                    esac
367                                fi
368                            fi
369                            #[ ${FoundCandidat} = true ] && IGCM_debug_Print 2 "Potentials CompletedFlag: ${PotentialCompletedFlag[*]}"
370                            if ( [ ${chunck} = true ] && [ ${SuccessRate} -ne 100 ] ) ; then
371                                #
372                                # TO REWRITE BEGIN
373                                #
374                                NbCandidats=${#PotentialCompletedFlag[@]}
375                                countCandid=1
376                                if [ ${NbCandidats} -eq 0 ] ; then
377                                    ChunckCompletedFlag=""
378                                    IGCM_debug_Print 2 -e "\033[1;31mNO CompletedFlag\033[m"
379                                elif [ ${NbCandidats} -eq 1 ] ; then
380                                    ChunckCompletedFlag=${PotentialCompletedFlag[0]}
381                                    IGCM_debug_Print 2 -e "\033[1;32mCompletedFlag=${ChunckCompletedFlag}\033[m"
382                                elif [ ${NbCandidats} -gt 1 ] ; then
383                                    k=1
384                                    until [ $k -ge ${NbCandidats} ]; do
385                                        ((k_m1=k-1))
386                                        if [ ${PotentialCompletedFlag[${k_m1}]} = ${PotentialCompletedFlag[${k}]} ] ; then
387                                            ((countCandid=countCandid+1))
388                                        fi
389                                        ((k=k+1))
390                                    done
391                                    if [ ${NbCandidats} -eq ${countCandid} ] ; then
392                                        ChunckCompletedFlag=${PotentialCompletedFlag[0]}
393                                        IGCM_debug_Print 2 -e "\033[1;32mCompletedFlag=${ChunckCompletedFlag}\033[m"
394                                    else
395                                        ChunckCompletedFlag=${PotentialCompletedFlag[0]}
396                                        IGCM_debug_Print 2 -e "\033[1;31mToo Many Potential CompletedFlag\033[m Let start with first CompletedPeriod"
397                                        IGCM_debug_Print 2 -e "\033[1;31mYou will have to redo TimeSeries_Checker\033[m for other period."
398                                    fi
399                                fi
400                                #
401                                # TO REWRITE END
402                                #
403                                if [ ${action} = true ] ; then
404                                    IGCM_debug_Print 2 -e "\033[1;31mSubmit ${FILE} chunck ${Dimension}\033[m period ${ChunckDebut}-${ChunckFin} and CompletedFlag=${ChunckCompletedFlag}"
405                                    listVarEnv="libIGCM,SUBMIT_DIR,POST_DIR,DateBegin,PeriodDateEnd,CompletedFlag,TsTask,CompToRead,FlagToRead"
406                                    export libIGCM=${libIGCM}
407                                    export SUBMIT_DIR=${CARD_DIR}
408                                    export POST_DIR=${POST_DIR}
409                                    export DateBegin=${ChunckDebut}
410                                    export PeriodDateEnd=${ChunckFin}
411                                    export CompletedFlag=${ChunckCompletedFlag}
412                                    export TsTask=Chunck${Dimension}
413                                    export CompToRead=${comp}
414                                    export FlagToRead=${i}
415                                    export NameToRead=${flag_post}
416                                    export listVarEnv=${listVarEnv}
417                                    IGCM_sys_MkdirWork ${POST_DIR}
418                                    IGCM_debug_Verif_Exit_Post
419                                    Script_Post_Output=create_ts.${PeriodDateEnd}.${TsTask}.${CompToRead}.${NameToRead}
420                                    IGCM_sys_QsubPost create_ts
421                                    echo
422                                else
423                                    IGCM_debug_Print 2 -e "\033[1;31mI should NOW submit ${FILE} chunck ${Dimension}\033[m period ${ChunckDebut}-${ChunckFin} and CompletedFlag=${ChunckCompletedFlag}"
424                                fi
425                            fi
426
427                            if ( [ ${chunck} = false ] && [ ${SuccessRate} -ne 100 ] ) ; then
428                                eval Launch${Dimension}=true
429                            fi
430
431                            # Date update
432                            ChunckDebut=$( IGCM_date_AddDaysToGregorianDate ${ChunckFin} 1 )
433
434                            (( YearsChunckLoop = YearsChunckLoop + 1 ))
435
436                            if [ ${YearsChunckLoop} -eq ${NbYearsChunckLoop} ] ; then
437                                ChunckFin=${DateEnd}
438                            else
439                                ChunckFin=$( IGCM_date_AddDaysToGregorianDate ${ChunckDebut} $(( YearsChunckLength * DaysInYear - 1 )) )
440                            fi
441                        done
442                    done
443                else
444                    ListDimension[0]=""
445                    TimeSeries=true
446                    TimeSeries2D=false
447                    TimeSeries3D=false
448                    TimeSeriesChunck2D=false
449                    TimeSeriesChunck3D=false
450                fi
451            fi
452            (( i=i+3 ))
453        done
454    fi
455done # comp loop
456
457echo
458
459DateBegin=$( IGCM_date_ConvertFormatToGregorian ${config_UserChoices_DateBegin} )
460IGCM_date_GetYearMonth ${DateBegin} YearBegin MonthBegin
461CompletedFlag=${SavedCompletedFlag}
462
463unset CompToRead
464unset FlagToRead
465
466if [ X${Launch2D} = Xtrue ] ; then
467    if [ ${action} = true ] ; then
468        #IGCM_debug_Print 2 "Potentials CompletedFlag: ${PotentialCompletedFlag2D[*]}"
469        IGCM_debug_Print 2 -e "\033[1;31mSubmit 2D\033[m without chunck period ${DateBegin}-${DateEnd}"
470        listVarEnv="libIGCM,SUBMIT_DIR,POST_DIR,DateBegin,PeriodDateEnd,CompletedFlag,TsTask"
471        export libIGCM=${libIGCM}
472        export SUBMIT_DIR=${CARD_DIR}
473        export POST_DIR=${POST_DIR}
474        export DateBegin=${DateBegin}
475        export PeriodDateEnd=${DateEnd}
476        export CompletedFlag=${CompletedFlag}
477        export TsTask=2D
478        export listVarEnv=${listVarEnv}
479        IGCM_sys_MkdirWork ${POST_DIR}
480        IGCM_debug_Verif_Exit_Post
481        Script_Post_Output=create_ts.${PeriodDateEnd}.${TsTask}
482        IGCM_sys_QsubPost create_ts
483        echo
484    else
485        IGCM_debug_Print 2 -e "\033[1;31mI should NOW submit 2D without chunck\033[m period ${DateBegin}-${DateEnd}"
486    fi
487fi
488
489if [ X${Launch3D} = Xtrue ] ; then
490    if [ ${action} = true ] ; then
491        #IGCM_debug_Print 2 "Potentials CompletedFlag: ${PotentialCompletedFlag3D[*]}"
492        IGCM_debug_Print 2 -e "\033[1;31mSubmit 3D\033[m without chunck period ${DateBegin}-${DateEnd}"
493        listVarEnv="libIGCM,SUBMIT_DIR,POST_DIR,DateBegin,PeriodDateEnd,CompletedFlag,TsTask"
494        export libIGCM=${libIGCM}
495        export SUBMIT_DIR=${CARD_DIR}
496        export POST_DIR=${POST_DIR}
497        export DateBegin=${DateBegin}
498        export PeriodDateEnd=${DateEnd}
499        export CompletedFlag=${CompletedFlag}
500        export TsTask=3D
501        export listVarEnv=${listVarEnv}
502        IGCM_sys_MkdirWork ${POST_DIR}
503        IGCM_debug_Verif_Exit_Post
504        Script_Post_Output=create_ts.${PeriodDateEnd}.${TsTask}
505        IGCM_sys_QsubPost create_ts
506        echo
507    else
508        IGCM_debug_Print 2 -e "\033[1;31mI should NOW submit 3D without chunck\033[m  period ${DateBegin}-${DateEnd}"
509    fi
510fi
Note: See TracBrowser for help on using the repository browser.