source: trunk/libIGCM/AA_TimeSeries_Checker @ 554

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