source: trunk/libIGCM/AA_TimeSeries_Checker @ 712

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