Changeset 390 for trunk/libIGCM


Ignore:
Timestamp:
11/24/10 18:07:12 (14 years ago)
Author:
sdipsl
Message:

Step 1/3 toward CompletedFlag? auto-detection, part of ticket #40
Tests ongoing.

This should close ticket #41

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libIGCM/AA_TimeSeries_Checker

    r387 r390  
    251251                            countGood=0 
    252252                            countBad=0 
     253                            unset RemoveList 
     254                            unset PotentialCompletedFlag 
    253255                            for var in $( eval echo \${${compname}_Post_${FILE}_TimeSeriesVars${Dimension}[*]} ) ; do 
    254256                                TestedFile=${config_UserChoices_JobName}_${ChunckDebut}_${ChunckFin}_${FlagDir}_${var}.nc 
    255257                                # 
     258                                Candidat=$( find ${DIRECTORY} -name "${config_UserChoices_JobName}_${ChunckDebut}_*_${FlagDir}_${var}.nc" ) 
     259                                # 
     260                                BestCandidat=${ChunckDebut} 
     261                                # 
     262                                FoundCandidat=false 
     263                                if [ ! "X${Candidat}" = "X" ] ; then 
     264                                    FoundCandidat=true 
     265                                    for i in ${Candidat} ; do 
     266                                        IGCM_debug_Print 1 -e "\033[1;32m[CompletedFlag CANDIDAT MATCH FOUND]\033[m $( basename ${i} )" 
     267                                        CandidatEnd=$( echo ${i}   | awk -F${config_UserChoices_JobName} '{print $3}' | awk -F_ '{print $3}' ) 
     268                                        if [ ${CandidatEnd} -gt ${ChunckFin} ] ; then 
     269                                            IGCM_debug_Print 2 -e "File $( basename ${i} ) should be suppress" 
     270                                            set +A RemoveList ${RemoveList[*]} ${i} 
     271                                        elif [ ${CandidatEnd} -lt ${ChunckFin} ] ; then 
     272                                            IGCM_debug_Print 2 -e "File $( basename ${i} ) should be suppress or used as a CompletedFlag baseline" 
     273                                            # We keep the best candidat and remove the others 
     274                                            if [ ${BestCandidat} -lt ${CandidatEnd} ] ; then  
     275                                                BestCandidat=${CandidatEnd} 
     276                                            else 
     277                                                set +A RemoveList ${RemoveList[*]} ${i} 
     278                                            fi 
     279                                        fi 
     280                                    done 
     281                                else 
     282                                    # No CompletedFlag candidat found 
     283                                    CandidatCompletedFlag="" 
     284                                fi 
     285                                # 
    256286                                if [ ! -f ${DIRECTORY}/${TestedFile} ] ; then 
    257287                                    (( countBad = countBad + 1 )) 
    258288                                    [ ${countBad} = 1 ] && IGCM_debug_Print 3 "Missing time series from ${FILE} :" 
    259289                                    IGCM_debug_Print 3 ${DIRECTORY}/${TestedFile} 
     290                                    # Then we keep a track of the Best Candidat 
     291                                    [ ${FoundCandidat} = true ] && set +A PotentialCompletedFlag ${PotentialCompletedFlag[*]} ${BestCandidat} 
    260292                                else 
    261293                                    (( countGood = countGood + 1 )) 
     294                                    # Then we do not need the best candidat 
     295                                    [ ${FoundCandidat} = true ] && set +A RemoveList ${RemoveList[*]} ${config_UserChoices_JobName}_${ChunckDebut}_${BestCandidat}_${FlagDir}_${var}.nc 
    262296                                fi 
    263297                                (( countTotal = countTotal + 1 )) 
     
    270304                                IGCM_debug_Print 2 -e "\033[1;32m${SuccessRate}% files OK.\033[m for period ${ChunckDebut}-${ChunckFin}" 
    271305                            fi 
    272  
    273306                            echo 
     307 
     308                            # Remove what's in the RemoveList 
     309                            if [ ${RemoveList} ] ; then 
     310                                IGCM_debug_Print 2 "File(s) that will be removed ${RemoveList[*]}" 
     311                                #IGCM_sys_Rm ${RemoveList[*]} 
     312                            fi 
     313 
    274314                            if ( [ ${chunck} = true ] && [ ${SuccessRate} -ne 100 ] ) ; then 
     315 
     316                                # 
     317                                # TO REWRITE BEGIN 
     318                                # 
    275319                                ChunckCompletedFlag="" 
    276320                                CompletedFlag=${SavedCompletedFlag} 
     
    278322                                        ( [ ${CompletedFlag} -gt ${ChunckDebut} ] && [ ${CompletedFlag} -le ${ChunckFin} ] ) && ChunckCompletedFlag=${CompletedFlag} 
    279323                                fi 
     324                                # 
     325                                # TO REWRITE END 
     326                                # 
     327 
     328 
    280329                                IGCM_debug_Print 2 -e "\033[1;31mSubmit ${FILE} chunck ${Dimension}\033[m period ${ChunckDebut}-${ChunckFin}" 
    281330                                listVarEnv="libIGCM,SUBMIT_DIR,POST_DIR,DateBegin,PeriodDateEnd,CompletedFlag,TsTask,CompToRead,FlagToRead" 
Note: See TracChangeset for help on using the changeset viewer.