[271] | 1 | #!/bin/ksh |
---|
[338] | 2 | #-Q- cesium #!/bin/ksh |
---|
| 3 | #-Q- cesium ###################### |
---|
| 4 | #-Q- cesium ## CESIUM CEA ## |
---|
| 5 | #-Q- cesium ###################### |
---|
| 6 | #-Q- cesium #MSUB -r TimeSeries # Nom du job |
---|
| 7 | #-Q- cesium #MSUB -N 1 # Reservation du noeud |
---|
| 8 | #-Q- cesium #MSUB -n 1 # Reservation du processus |
---|
| 9 | #-Q- cesium #MSUB -T 86400 # Limite de temps elapsed du job |
---|
| 10 | #-Q- cesium #MSUB -E "-j o" |
---|
| 11 | #-Q- cesium #MSUB -E "-S /bin/ksh" |
---|
| 12 | #-Q- platine #!/usr/bin/ksh |
---|
| 13 | #-Q- platine ################### |
---|
| 14 | #-Q- platine ## PLATINE CEA ## |
---|
| 15 | #-Q- platine ################### |
---|
| 16 | #-Q- platine #BSUB -J TimeSeries # Nom du job |
---|
| 17 | #-Q- platine #BSUB -N # message a la fin du job |
---|
| 18 | #-Q- platine #BSUB -n 1 # reservation des processeurs pour le job |
---|
| 19 | #-Q- platine #BSUB -W 1:00 # Limite temps |
---|
| 20 | #-Q- platine #BSUB -q post # Passage en queue post |
---|
| 21 | #-Q- sx8brodie #!/bin/ksh |
---|
| 22 | #-Q- sx8brodie ####################### |
---|
| 23 | #-Q- sx8brodie ## SX8BRODIE IDRIS ## |
---|
| 24 | #-Q- sx8brodie ####################### |
---|
| 25 | #-Q- sx8brodie # Temps Elapsed max. d'une requete hh:mm:ss |
---|
| 26 | #-Q- sx8brodie # @ wall_clock_limit = 20:00:00 |
---|
| 27 | #-Q- sx8brodie # Nom du travail LoadLeveler |
---|
| 28 | #-Q- sx8brodie # @ job_name = TimeSeries |
---|
| 29 | #-Q- sx8brodie # Fichier de sortie standard du travail |
---|
| 30 | #-Q- sx8brodie # @ output = $(job_name).$(jobid) |
---|
| 31 | #-Q- sx8brodie # Fichier de sortie d'erreur du travail |
---|
| 32 | #-Q- sx8brodie # @ error = $(job_name).$(jobid) |
---|
| 33 | #-Q- sx8brodie # pour recevoir un mail en cas de depassement du temps Elapsed (ou autre pb.) |
---|
| 34 | #-Q- sx8brodie # @ notification = error |
---|
| 35 | #-Q- sx8brodie # @ environment = $DEBUG_debug ; $MODIPSL ; $libIGCM ; $libIGCM_SX ; $SUBMIT_DIR ; $REBUILD_DIR ; $RebuildFromArchive ; $POST_DIR ; $MASTER ; $RebuildFrequency ; $PeriodDateBegin ; $PeriodDateEnd ; $NbRebuildDir ; $StandAlone ; $CompletedFlag ; $TsTask ; $CompToRead ; $FlagToRead ; $RESOL_ATM ; $RESOL_OCE ; $RESOL_ICE ; $RESOL_MBG ; $RESOL_SRF ; $RESOL_SBG ; $MASTER |
---|
| 36 | #-Q- aix6 #!/bin/ksh |
---|
| 37 | #-Q- aix6 ####################### |
---|
| 38 | #-Q- aix6 ## VARGAS IDRIS ## |
---|
| 39 | #-Q- aix6 ####################### |
---|
| 40 | #-Q- aix6 # Temps Elapsed max. d'une requete hh:mm:ss |
---|
| 41 | #-Q- aix6 # @ wall_clock_limit = 20:00:00 |
---|
| 42 | #-Q- aix6 # Nom du travail LoadLeveler |
---|
| 43 | #-Q- aix6 # @ job_name = TimeSeries |
---|
| 44 | #-Q- aix6 # Fichier de sortie standard du travail |
---|
| 45 | #-Q- aix6 # @ output = $(job_name).$(jobid) |
---|
| 46 | #-Q- aix6 # Fichier de sortie d'erreur du travail |
---|
| 47 | #-Q- aix6 # @ error = $(job_name).$(jobid) |
---|
| 48 | #-Q- aix6 # pour recevoir un mail en cas de depassement du temps Elapsed (ou autre pb.) |
---|
| 49 | #-Q- aix6 # @ notification = error |
---|
| 50 | #-Q- aix6 # @ environment = $DEBUG_debug ; $MODIPSL ; $libIGCM ; $libIGCM_SX ; $SUBMIT_DIR ; $REBUILD_DIR ; $RebuildFromArchive ; $POST_DIR ; $MASTER ; $RebuildFrequency ; $DateBegin ; $PeriodDateBegin ; $PeriodDateEnd ; $NbRebuildDir ; $StandAlone ; $CompletedFlag ; $TsTask ; $CompToRead ; $FlagToRead ; $RESOL_ATM ; $RESOL_OCE ; $RESOL_ICE ; $RESOL_MBG ; $RESOL_SRF ; $RESOL_SBG ; $MASTER |
---|
| 51 | #-Q- aix6 # @ queue |
---|
| 52 | #-Q- sx8brodie # @ queue |
---|
| 53 | #-Q- sx8mercure #!/bin/ksh |
---|
| 54 | #-Q- sx8mercure ###################### |
---|
| 55 | #-Q- sx8mercure ## SX8MERCURE CEA ## |
---|
| 56 | #-Q- sx8mercure ###################### |
---|
| 57 | #-Q- sx8mercure #PBS -N TimeSeries # Nom du job |
---|
| 58 | #-Q- sx8mercure #PBS -j o # regroupement des stdout et stderr |
---|
| 59 | #-Q- sx8mercure #PBS -S /usr/bin/ksh # shell de soumission |
---|
| 60 | #-Q- sx8mercure #PBS -l memsz_job=1gb # Limite memoire a 1 Go |
---|
| 61 | #-Q- sx8mercure #PBS -l cputim_job=24:00:00 # Limite temps a 2 heures |
---|
| 62 | #-Q- sx8mercure #PBS -q scalaire |
---|
| 63 | #-Q- sx9mercure #!/bin/ksh |
---|
| 64 | #-Q- sx9mercure ######################### |
---|
| 65 | #-Q- sx9mercure ## CESIUM FOR SX9 CEA ## |
---|
| 66 | #-Q- sx9mercure ######################### |
---|
| 67 | #-Q- sx9mercure #MSUB -r TimeSeries # Nom du job |
---|
| 68 | #-Q- sx9mercure #MSUB -N 1 # Reservation du noeud |
---|
| 69 | #-Q- sx9mercure #MSUB -n 1 # Reservation du processus |
---|
| 70 | #-Q- sx9mercure #MSUB -T 86400 # Limite de temps elapsed du job |
---|
| 71 | #-Q- sx9mercure #MSUB -E "-j o" |
---|
| 72 | #-Q- sx9mercure #MSUB -E "-S /bin/ksh" |
---|
| 73 | #-Q- titane #!/bin/ksh |
---|
| 74 | #-Q- titane ###################### |
---|
| 75 | #-Q- titane ## TITANE CEA ## |
---|
| 76 | #-Q- titane ###################### |
---|
| 77 | #-Q- titane #MSUB -r TimeSeries # Nom du job |
---|
| 78 | #-Q- titane #MSUB -N 1 # Reservation du noeud |
---|
| 79 | #-Q- titane #MSUB -n 1 # Reservation du processus |
---|
| 80 | #-Q- titane #MSUB -T 86400 # Limite de temps elapsed du job |
---|
| 81 | #-Q- titane #MSUB -E "-j o" |
---|
| 82 | #-Q- titane #MSUB -E "-S /bin/ksh" |
---|
| 83 | #-Q- titane ##MSUB -e nco.out # Sortie standard |
---|
| 84 | #-Q- titane ##MSUB -o nco.out # Sortie standard |
---|
| 85 | #-Q- lxiv8 ###################### |
---|
| 86 | #-Q- lxiv8 ## OBELIX LSCE ## |
---|
| 87 | #-Q- lxiv8 ###################### |
---|
| 88 | #-Q- lxiv8 #PBS -N TimeSeries |
---|
| 89 | #-Q- lxiv8 #PBS -m a |
---|
| 90 | #-Q- lxiv8 #PBS -j oe |
---|
| 91 | #-Q- lxiv8 #PBS -q medium |
---|
| 92 | #-Q- lxiv8 #PBS -o TimeSeries.$$ |
---|
| 93 | #-Q- lxiv8 #PBS -S /bin/ksh |
---|
| 94 | #-Q- default #!/bin/ksh |
---|
| 95 | #-Q- default ################## |
---|
| 96 | #-Q- default ## DEFAULT HOST ## |
---|
| 97 | #-Q- default ################## |
---|
[271] | 98 | |
---|
| 99 | #************************************************************** |
---|
| 100 | # Author: Sebastien Denvil |
---|
| 101 | # Contact: Sebastien.Denvil@ipsl.jussieu.fr |
---|
| 102 | # $Date: $ |
---|
| 103 | # $Author: $ |
---|
| 104 | # $Revision: $ |
---|
| 105 | # IPSL (2006) |
---|
| 106 | # This software is governed by the CeCILL licence see libIGCM/libIGCM_CeCILL.LIC |
---|
| 107 | # History: |
---|
| 108 | # Modification: |
---|
| 109 | # |
---|
| 110 | #************************************************************** |
---|
| 111 | |
---|
| 112 | # Check that everything went well during time series production |
---|
| 113 | # Display a short report |
---|
| 114 | # Launch what's missing |
---|
[338] | 115 | # For use during a run (not on the end : PeriodState=Completed), it will complete |
---|
| 116 | # all TS to last PeriodDateEnd value, give by run.card->Configuration->OldPrefix string. |
---|
[271] | 117 | |
---|
[338] | 118 | |
---|
| 119 | # Chemin vers libIGCM |
---|
[271] | 120 | libIGCM=${libIGCM:=::modipsl::/libIGCM} |
---|
[338] | 121 | # Attention : Ã changer si la machine de post-traitement n'est pas la frontale du serveur de calcul ! |
---|
| 122 | # voir précence de la variable MirrorlibIGCM dans votre couche systÚme. |
---|
[271] | 123 | |
---|
[344] | 124 | # Name Space of this experience |
---|
| 125 | SpaceName=${SpaceName:=PROD} |
---|
[271] | 126 | |
---|
[344] | 127 | # Expericence class of the run |
---|
| 128 | ExperimentName=${ExperimentName:=historical} |
---|
| 129 | |
---|
| 130 | # Name of this job |
---|
[271] | 131 | JobName=${JobName:=HISTORC2} |
---|
| 132 | |
---|
[338] | 133 | # répertoire courrant |
---|
[271] | 134 | CURRENT_DIR=$( pwd ) |
---|
| 135 | |
---|
[338] | 136 | # Emplacement des cartes |
---|
[344] | 137 | CARD_DIR=${CARD_DIR:=${CURRENT_DIR}/${ExperimentName}/${JobName}} |
---|
[271] | 138 | |
---|
[344] | 139 | # répertoire de stockage des sorties des create_ts |
---|
[338] | 140 | POST_DIR=${POST_DIR:=${CARD_DIR}/OutScript} |
---|
| 141 | |
---|
| 142 | |
---|
[271] | 143 | if [ ! -d ${CARD_DIR} ]; then |
---|
| 144 | echo "No ${CARD_DIR}, we stop here" |
---|
| 145 | exit |
---|
| 146 | fi |
---|
| 147 | |
---|
| 148 | ######################################################################## |
---|
| 149 | |
---|
| 150 | . ${libIGCM}/libIGCM_debug/libIGCM_debug.ksh ; |
---|
| 151 | . ${libIGCM}/libIGCM_sys/libIGCM_sys.ksh #; IGCM_debug_Check |
---|
| 152 | . ${libIGCM}/libIGCM_card/libIGCM_card.ksh #; IGCM_card_Check |
---|
| 153 | . ${libIGCM}/libIGCM_date/libIGCM_date.ksh #; IGCM_date_Check |
---|
| 154 | |
---|
| 155 | ######################################################################## |
---|
| 156 | |
---|
| 157 | # First of all |
---|
| 158 | IGCM_card_DefineArrayFromSection ${CARD_DIR}/config.card UserChoices |
---|
| 159 | typeset option |
---|
| 160 | for option in ${config_UserChoices[*]} ; do |
---|
| 161 | IGCM_card_DefineVariableFromOption ${CARD_DIR}/config.card UserChoices ${option} |
---|
| 162 | done |
---|
| 163 | |
---|
| 164 | echo |
---|
| 165 | IGCM_debug_Print 1 "DefineArrayFromOption : config_UserChoices" |
---|
| 166 | IGCM_debug_PrintVariables 3 config_UserChoices_JobName |
---|
| 167 | #IGCM_debug_PrintVariables 3 config_UserChoices_SpaceName |
---|
| 168 | #IGCM_debug_PrintVariables 3 config_UserChoices_ExperimentName |
---|
| 169 | IGCM_debug_PrintVariables 3 config_UserChoices_CalendarType |
---|
| 170 | IGCM_debug_PrintVariables 3 config_UserChoices_DateBegin |
---|
| 171 | IGCM_debug_PrintVariables 3 config_UserChoices_DateEnd |
---|
[338] | 172 | |
---|
| 173 | if [ -f ${CARD_DIR}/run.card ] ; then |
---|
| 174 | IGCM_card_DefineVariableFromOption ${CARD_DIR}/run.card Configuration OldPrefix |
---|
| 175 | IGCM_card_DefineVariableFromOption ${CARD_DIR}/run.card Configuration PeriodState |
---|
[340] | 176 | IGCM_card_DefineVariableFromOption ${CARD_DIR}/run.card PostProcessing TimeSeriesCompleted |
---|
[338] | 177 | IGCM_debug_PrintVariables 3 run_Configuration_OldPrefix |
---|
| 178 | IGCM_debug_PrintVariables 3 run_Configuration_PeriodState |
---|
[340] | 179 | IGCM_debug_PrintVariables 3 run_PostProcessing_TimeSeriesCompleted |
---|
[338] | 180 | if [ X${run_Configuration_PeriodState} != X"Completed" ] ; then |
---|
| 181 | DateEnd=$( IGCM_date_ConvertFormatToGregorian $( echo ${run_Configuration_OldPrefix} | awk -F'_' '{print $2}' ) ) |
---|
| 182 | else |
---|
| 183 | DateEnd=$( IGCM_date_ConvertFormatToGregorian ${config_UserChoices_DateEnd} ) |
---|
| 184 | fi |
---|
[340] | 185 | CompletedFlag=${run_PostProcessing_TimeSeriesCompleted} |
---|
[338] | 186 | else |
---|
| 187 | DateEnd=$( IGCM_date_ConvertFormatToGregorian ${config_UserChoices_DateEnd} ) |
---|
[340] | 188 | CompletedFlag="" |
---|
[338] | 189 | fi |
---|
[340] | 190 | SavedCompletedFlag=${CompletedFlag} |
---|
[338] | 191 | |
---|
[271] | 192 | echo |
---|
[338] | 193 | echo "DateEnd for TimeSeries_Checker : " ${DateEnd} |
---|
| 194 | IGCM_date_GetYearMonth ${DateEnd} YearEnd MonthEnd |
---|
| 195 | echo "YearEnd MonthEnd for TimeSeries_Checker : " ${YearEnd} ${MonthEnd} |
---|
[340] | 196 | echo "CompletedFlag = " ${CompletedFlag} |
---|
[338] | 197 | echo |
---|
[271] | 198 | |
---|
[340] | 199 | |
---|
[271] | 200 | #set -vx |
---|
| 201 | |
---|
| 202 | #==================================================== |
---|
| 203 | #R_SAVE : Job output directory |
---|
| 204 | if ( [ ! X${config_UserChoices_SpaceName} = X ] && [ ! X${config_UserChoices_ExperimentName} = X ] ) ; then |
---|
| 205 | FreeName=$( echo ${config_UserChoices_JobName} | sed 's/.*_//' ) |
---|
| 206 | R_SAVE=${R_OUT}/${config_UserChoices_TagName}/${config_UserChoices_SpaceName}/${config_UserChoices_ExperimentName}/${FreeName} |
---|
| 207 | R_DODS=${config_UserChoices_TagName}/${config_UserChoices_SpaceName}/${config_UserChoices_ExperimentName}/${FreeName} |
---|
| 208 | else |
---|
| 209 | R_SAVE=${R_OUT}/${config_UserChoices_TagName}/${config_UserChoices_JobName} |
---|
| 210 | R_DODS=${config_UserChoices_TagName}/${config_UserChoices_JobName} |
---|
| 211 | fi |
---|
| 212 | |
---|
| 213 | IGCM_card_DefineArrayFromSection ${CARD_DIR}/config.card ListOfComponents |
---|
| 214 | |
---|
| 215 | for comp in ${config_ListOfComponents[*]} ; do |
---|
| 216 | # Debug Print |
---|
| 217 | IGCM_debug_Print 1 ${comp} |
---|
| 218 | # Define component |
---|
| 219 | IGCM_card_DefineArrayFromOption ${CARD_DIR}/config.card ListOfComponents ${comp} |
---|
| 220 | eval compname=\${config_ListOfComponents_${comp}[0]} > /dev/null 2>&1 |
---|
| 221 | eval comptagname=\${config_ListOfComponents_${comp}[1]} > /dev/null 2>&1 |
---|
| 222 | |
---|
| 223 | # Read libIGCM compatibility version in ${compname}.card |
---|
| 224 | card=${CARD_DIR}/COMP/${compname}.card |
---|
| 225 | |
---|
| 226 | # Read and Build Output File stuff |
---|
| 227 | #IGCM_debug_Print 1 "DefineArrayFromOption : ${compname}_OutputFiles ${card}" |
---|
| 228 | IGCM_card_DefineArrayFromOption ${card} OutputFiles List |
---|
| 229 | ListFilesName=${compname}_OutputFiles_List |
---|
| 230 | eval FileName0=\${${ListFilesName}[0]} > /dev/null 2>&1 |
---|
| 231 | # |
---|
| 232 | if [ X${FileName0} != X${NULL_STR} ] ; then |
---|
| 233 | # |
---|
| 234 | #IGCM_debug_Print 1 "Component : ${compname}" |
---|
| 235 | # |
---|
| 236 | # INITIALISATION |
---|
| 237 | # |
---|
| 238 | eval NbFiles=\${#${ListFilesName}[@]} > /dev/null 2>&1 |
---|
| 239 | i=2 |
---|
| 240 | # |
---|
| 241 | until [ $i -ge $NbFiles ]; do |
---|
| 242 | # |
---|
| 243 | eval flag_post=\${${ListFilesName}[$i]} > /dev/null 2>&1 |
---|
| 244 | # |
---|
| 245 | if [ X${flag_post} != XNONE ] ; then |
---|
| 246 | # |
---|
| 247 | # First of all |
---|
| 248 | # |
---|
| 249 | IGCM_card_DefineArrayFromSection ${card} ${flag_post} |
---|
| 250 | # |
---|
| 251 | IGCM_card_DefineArrayFromOption ${card} ${flag_post} TimeSeriesVars |
---|
| 252 | IGCM_card_DefineArrayFromOption ${card} ${flag_post} Patches |
---|
| 253 | if [ X"$( eval echo \${${compname}_${flag_post}_TimeSeriesVars[*]} )" = X"Option not found ${flag_post}" ] ; then |
---|
| 254 | # New TimeSeriesVar description, with 2D, 3D and associate ChunckJob. |
---|
[338] | 255 | unset ListDimension |
---|
[271] | 256 | ListDimension[0]=2D |
---|
| 257 | ListDimension[1]=3D |
---|
| 258 | TimeSeries=false |
---|
[272] | 259 | TimeSeries2D=false |
---|
| 260 | TimeSeries3D=false |
---|
[358] | 261 | chunck=false |
---|
[271] | 262 | iLoop=${#ListDimension[*]} |
---|
| 263 | j=0 |
---|
| 264 | until [ $j -ge ${iLoop} ]; do |
---|
| 265 | Dimension=${ListDimension[${j}]} |
---|
| 266 | IGCM_card_DefineArrayFromOption ${card} ${flag_post} TimeSeriesVars${Dimension} |
---|
| 267 | IGCM_card_DefineVariableFromOption ${card} ${flag_post} ChunckJob${Dimension} |
---|
| 268 | # |
---|
| 269 | # Time series WITHOUT chunk |
---|
| 270 | # |
---|
| 271 | if [ ! $( eval echo \${${compname}_${flag_post}_TimeSeriesVars${Dimension}} ) = ${NULL_STR} ] ; then |
---|
| 272 | if [ $( eval echo \${${compname}_${flag_post}_ChunckJob${Dimension}} ) = NONE ] ; then |
---|
| 273 | IGCM_debug_Print 2 "${Dimension} time series activated for ${flag_post}" |
---|
| 274 | eval TimeSeries${Dimension}=true |
---|
| 275 | chunck=false |
---|
| 276 | fi |
---|
| 277 | fi |
---|
| 278 | # |
---|
| 279 | # Time series WITH chunk |
---|
| 280 | # |
---|
| 281 | if [ ! $( eval echo \${${compname}_${flag_post}_TimeSeriesVars${Dimension}} ) = ${NULL_STR} ] ; then |
---|
| 282 | chunck_size=$( eval echo \${${compname}_${flag_post}_ChunckJob${Dimension}} ) |
---|
| 283 | if [ ! ${chunck_size} = NONE ] && [ ! ${chunck_size} = OFF ] ; then |
---|
| 284 | IGCM_debug_Print 2 "${Dimension} time series activated with ${chunck_size} chunck for ${flag_post}" |
---|
| 285 | eval TimeSeriesChunck${Dimension}=true |
---|
| 286 | chunck=true |
---|
| 287 | fi |
---|
| 288 | fi |
---|
| 289 | (( j=j+1 )) |
---|
| 290 | |
---|
| 291 | # |
---|
[338] | 292 | # ICI ON TESTE QUE LES FICHIERS TS SONT LA! |
---|
[271] | 293 | # |
---|
| 294 | # |
---|
| 295 | FILE=$( echo ${flag_post} | awk "-FPost_" '{print $2}' ) |
---|
| 296 | IGCM_card_DefineArrayFromOption ${card} Post_${FILE} TimeSeriesVars${Dimension} |
---|
| 297 | IGCM_card_DefineVariableFromOption ${card} Post_${FILE} ChunckJob${Dimension} |
---|
| 298 | # |
---|
| 299 | FlagDir=$( echo ${FILE} | awk -F "_" '{print $1}' ) |
---|
| 300 | case ${FlagDir} in |
---|
| 301 | *Y) TS_Dir=TS_YE ;; |
---|
| 302 | *M) TS_Dir=TS_MO ;; |
---|
| 303 | *D) TS_Dir=TS_DA ;; |
---|
| 304 | 3H|HF) TS_Dir=TS_HF ;; |
---|
| 305 | INS) TS_Dir=TS_INS ;; |
---|
| 306 | esac |
---|
| 307 | |
---|
| 308 | # |
---|
| 309 | # If TimeSeriesVars list is empty we skip |
---|
| 310 | # |
---|
| 311 | if [ $( eval echo \${${compname}_Post_${FILE}_TimeSeriesVars${Dimension}} ) = ${NULL_STR} ] ; then |
---|
[358] | 312 | #IGCM_debug_Print 2 "Empty TS : ${compname}_Post_${FILE}_TimeSeriesVars${Dimension}" |
---|
[271] | 313 | #(( i=i+3 )) |
---|
| 314 | continue |
---|
| 315 | fi |
---|
| 316 | # |
---|
| 317 | # We need LIST of variables not allready produced (useful for standalone mode) |
---|
| 318 | # |
---|
| 319 | DateBegin=$( IGCM_date_ConvertFormatToGregorian ${config_UserChoices_DateBegin} ) |
---|
| 320 | IGCM_date_GetYearMonth ${DateBegin} YearBegin MonthBegin |
---|
| 321 | |
---|
| 322 | # Si on n'a pas de chunck, dans ce cas chunck_size=la durée de la simulation en années |
---|
| 323 | YearsChunckLength=$( echo ${chunck_size} | sed -e "s/[yY]//" ) |
---|
[358] | 324 | [ ${chunck} = false ] && YearsChunckLength=$(( YearEnd - YearBegin + 1 )) |
---|
[271] | 325 | |
---|
[338] | 326 | NbYearsChunckLoop=$(( ( YearEnd - YearBegin + 1 ) / YearsChunckLength )) |
---|
| 327 | Reste=$(( ( YearEnd - YearBegin + 1 ) % YearsChunckLength )) |
---|
[271] | 328 | |
---|
[338] | 329 | if [ ${Reste} -ne 0 ] ; then |
---|
| 330 | NbYearsChunckLoop=$(( NbYearsChunckLoop + 1 )) |
---|
[271] | 331 | fi |
---|
| 332 | |
---|
| 333 | if [ ${NbYearsChunckLoop} -eq 1 ] ; then |
---|
| 334 | PeriodDateEnd=${DateEnd} |
---|
| 335 | else |
---|
| 336 | DaysInYear=$( IGCM_date_DaysInYear ${YearBegin} ) |
---|
| 337 | PeriodDateEnd=$( IGCM_date_AddDaysToGregorianDate ${DateBegin} $(( YearsChunckLength * DaysInYear - 1 )) ) |
---|
| 338 | fi |
---|
| 339 | # |
---|
| 340 | DIRECTORY=${R_SAVE}/${comp}/Analyse/${TS_Dir} |
---|
| 341 | YearsChunckLoop=1 |
---|
| 342 | ChunckDebut=${DateBegin} |
---|
| 343 | ChunckFin=${PeriodDateEnd} |
---|
| 344 | while [ ${YearsChunckLoop} -le ${NbYearsChunckLoop} ] ; do |
---|
| 345 | countTotal=0 |
---|
| 346 | countGood=0 |
---|
| 347 | countBad=0 |
---|
| 348 | for var in $( eval echo \${${compname}_Post_${FILE}_TimeSeriesVars${Dimension}[*]} ) ; do |
---|
| 349 | TestedFile=${config_UserChoices_JobName}_${ChunckDebut}_${ChunckFin}_${FlagDir}_${var}.nc |
---|
| 350 | # |
---|
| 351 | if [ ! -f ${DIRECTORY}/${TestedFile} ] ; then |
---|
| 352 | (( countBad = countBad + 1 )) |
---|
| 353 | [ ${countBad} = 1 ] && IGCM_debug_Print 3 "Missing time series from ${FILE} :" |
---|
| 354 | IGCM_debug_Print 3 ${DIRECTORY}/${TestedFile} |
---|
| 355 | else |
---|
| 356 | (( countGood = countGood + 1 )) |
---|
| 357 | fi |
---|
| 358 | (( countTotal = countTotal + 1 )) |
---|
| 359 | done |
---|
| 360 | |
---|
| 361 | SuccessRate=$(( countGood * 100 / countTotal )) |
---|
[338] | 362 | if [ ${SuccessRate} -ne 100 ] ; then |
---|
[286] | 363 | IGCM_debug_Print 2 -e "\033[1;31m${SuccessRate}% files OK.\033[m for period ${ChunckDebut}-${ChunckFin}" |
---|
[271] | 364 | else |
---|
[286] | 365 | IGCM_debug_Print 2 -e "\033[1;32m${SuccessRate}% files OK.\033[m for period ${ChunckDebut}-${ChunckFin}" |
---|
[271] | 366 | fi |
---|
| 367 | |
---|
| 368 | echo |
---|
[358] | 369 | if ( [ ${chunck} = true ] && [ ${SuccessRate} -ne 100 ] ) ; then |
---|
[340] | 370 | ChunckCompletedFlag="" |
---|
| 371 | CompletedFlag=${SavedCompletedFlag} |
---|
[357] | 372 | if [ X${CompletedFlag} != X ] ; then |
---|
| 373 | ( [ ${CompletedFlag} -gt ${ChunckDebut} ] && [ ${CompletedFlag} -le ${ChunckFin} ] ) && ChunckCompletedFlag=${CompletedFlag} |
---|
| 374 | fi |
---|
[286] | 375 | IGCM_debug_Print 2 -e "\033[1;31mSubmit ${FILE} chunck ${Dimension}\033[m period ${ChunckDebut}-${ChunckFin}" |
---|
[340] | 376 | listVarEnv="libIGCM,SUBMIT_DIR,POST_DIR,DateBegin,PeriodDateEnd,CompletedFlag,TsTask,CompToRead,FlagToRead" |
---|
[271] | 377 | export libIGCM=${libIGCM} |
---|
| 378 | export SUBMIT_DIR=${CARD_DIR} |
---|
| 379 | export POST_DIR=${POST_DIR} |
---|
| 380 | export DateBegin=${ChunckDebut} |
---|
| 381 | export PeriodDateEnd=${ChunckFin} |
---|
[340] | 382 | export CompletedFlag=${ChunckCompletedFlag} |
---|
[271] | 383 | export TsTask=Chunck${Dimension} |
---|
| 384 | export CompToRead=${comp} |
---|
| 385 | export FlagToRead=${i} |
---|
| 386 | export listVarEnv=${listVarEnv} |
---|
| 387 | IGCM_sys_MkdirWork ${POST_DIR} |
---|
| 388 | IGCM_debug_Verif_Exit |
---|
| 389 | IGCM_sys_QsubPost create_ts |
---|
[272] | 390 | echo |
---|
[271] | 391 | fi |
---|
| 392 | |
---|
[338] | 393 | if ( [ ${chunck} = false ] && [ ${SuccessRate} -ne 100 ] ) ; then |
---|
[271] | 394 | eval Launch${Dimension}=true |
---|
| 395 | fi |
---|
| 396 | |
---|
| 397 | # Date update |
---|
| 398 | ChunckDebut=$( IGCM_date_AddDaysToGregorianDate ${ChunckFin} 1 ) |
---|
| 399 | |
---|
| 400 | (( YearsChunckLoop = YearsChunckLoop + 1 )) |
---|
| 401 | |
---|
| 402 | if [ ${YearsChunckLoop} -eq ${NbYearsChunckLoop} ] ; then |
---|
| 403 | ChunckFin=${DateEnd} |
---|
| 404 | else |
---|
[338] | 405 | #PeriodDateEnd=$(( YearBegin + YearsChunckLength - 1 )) |
---|
[271] | 406 | ChunckFin=$( IGCM_date_AddDaysToGregorianDate ${ChunckDebut} $(( YearsChunckLength * DaysInYear - 1 )) ) |
---|
| 407 | fi |
---|
| 408 | done |
---|
| 409 | done |
---|
| 410 | else |
---|
| 411 | ListDimension[0]="" |
---|
| 412 | TimeSeries=true |
---|
| 413 | TimeSeries2D=false |
---|
| 414 | TimeSeries3D=false |
---|
| 415 | TimeSeriesChunck2D=false |
---|
| 416 | TimeSeriesChunck3D=false |
---|
| 417 | fi |
---|
| 418 | fi |
---|
| 419 | (( i=i+3 )) |
---|
| 420 | done |
---|
| 421 | fi |
---|
| 422 | done # comp loop |
---|
| 423 | |
---|
[272] | 424 | echo |
---|
| 425 | |
---|
[338] | 426 | DateBegin=$( IGCM_date_ConvertFormatToGregorian ${config_UserChoices_DateBegin} ) |
---|
| 427 | IGCM_date_GetYearMonth ${DateBegin} YearBegin MonthBegin |
---|
[340] | 428 | CompletedFlag=${SavedCompletedFlag} |
---|
[338] | 429 | |
---|
[272] | 430 | if [ X${Launch2D} = Xtrue ] ; then |
---|
[286] | 431 | IGCM_debug_Print 2 -e "\033[1;31mSubmit 2D\033[m without chunck period ${DateBegin}-${DateEnd}" |
---|
[340] | 432 | listVarEnv="libIGCM,SUBMIT_DIR,POST_DIR,DateBegin,PeriodDateEnd,CompletedFlag,TsTask" |
---|
[271] | 433 | export libIGCM=${libIGCM} |
---|
| 434 | export SUBMIT_DIR=${CARD_DIR} |
---|
| 435 | export POST_DIR=${POST_DIR} |
---|
| 436 | export DateBegin=${DateBegin} |
---|
| 437 | export PeriodDateEnd=${DateEnd} |
---|
[340] | 438 | export CompletedFlag=${CompletedFlag} |
---|
[271] | 439 | export TsTask=2D |
---|
| 440 | export listVarEnv=${listVarEnv} |
---|
| 441 | IGCM_sys_MkdirWork ${POST_DIR} |
---|
| 442 | IGCM_debug_Verif_Exit |
---|
| 443 | IGCM_sys_QsubPost create_ts |
---|
[272] | 444 | echo |
---|
[271] | 445 | fi |
---|
| 446 | |
---|
[272] | 447 | if [ X${Launch3D} = Xtrue ] ; then |
---|
[286] | 448 | IGCM_debug_Print 2 -e "\033[1;31mSubmit 3D\033[m without chunck period ${DateBegin}-${DateEnd}" |
---|
[340] | 449 | listVarEnv="libIGCM,SUBMIT_DIR,POST_DIR,DateBegin,PeriodDateEnd,CompletedFlag,TsTask" |
---|
[271] | 450 | export libIGCM=${libIGCM} |
---|
| 451 | export SUBMIT_DIR=${CARD_DIR} |
---|
| 452 | export POST_DIR=${POST_DIR} |
---|
| 453 | export DateBegin=${DateBegin} |
---|
| 454 | export PeriodDateEnd=${DateEnd} |
---|
[340] | 455 | export CompletedFlag=${CompletedFlag} |
---|
[271] | 456 | export TsTask=3D |
---|
| 457 | export listVarEnv=${listVarEnv} |
---|
| 458 | IGCM_sys_MkdirWork ${POST_DIR} |
---|
| 459 | IGCM_debug_Verif_Exit |
---|
| 460 | IGCM_sys_QsubPost create_ts |
---|
[272] | 461 | echo |
---|
[271] | 462 | fi |
---|