Ignore:
Timestamp:
03/01/10 16:59:54 (14 years ago)
Author:
sdipsl
Message:
  • Slight modification in the way we read and interpret card for post-processing. Actual card will not work with this revision

List=(histmth.nc, ${R_OUT_ATM_O_M}/${PREFIX}_1M_histmth.nc, Post_1M_histmth), \

(histday.nc, ${R_OUT_ATM_O_D}/${PREFIX}_1D_histday.nc, Post_1D_histday), \
(histhf.nc, ${R_OUT_ATM_O_H}/${PREFIX}_HF_histhf.nc, Post_HF_histhf)

  • ChunckJob2D, ChunckJob3d have control over TS, with the folliwing keywords :

OFF (TimeSeries? not active), NONE (TimeSeries? active but without chunck), 10Y (TimeSeries? active, but produce as many as needed 10 years lenght time series)

  • Seasonnal (ON/OFF), have control over SE files production.
  • Patch can be applied systematicaly even if no Time Series or Seasonal post-proceesing are required
  • A first step towards the merge between rebuildFromArchive and rebuildFrowWorkdir jobs
  • We may change rebuildFromArchive job name as it is not that meaningful in this context
  • We may change ChunckJob2D/ChunckJob3D as it is not that meaningful in this context
  • Some bugfix and optimisation
  • For testing purpose only (still try to have backward compatibility)

Exemple :

[Post_1D_histday]
Patches= (Patch_20091030_histcom_time_axis)
GatherWithInternal? = (lon, lat, presnivs, time_counter)
TimeSeriesVars2D = (bils, cldh, ...)
ChunckJob2D = 50Y
TimeSeriesVars3D = (temp, theta, ovap, ovapinit, geop, ...)
ChunckJob3D = OFF
Seasonal=OFF

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libIGCM/libIGCM_post/libIGCM_post.ksh

    r210 r236  
    165165    typeset POST NbDays PeriodEndJul PostEndJul LengthDays 
    166166    POST=false 
    167  
     167    # 
     168    # ONLY IF SOMETHING NEEDS TO BE DONE (EATHER TIME SERIES OR SEASONAL) COMPUTE THE MODULOS 
     169    # 
     170    if ( [ X${TimeSeries} = Xtrue ] || [ X${TimeSeries2D} = Xtrue ] || [ X${TimeSeries3D} = Xtrue ] ) ; then 
     171        list_post=TimeSeriesFrequency 
     172    fi 
     173    # 
     174    if [ X${Seasonal} = Xtrue ] ; then 
     175        list_post=${list_post} SeasonalFrequency 
     176    fi 
     177    # 
    168178    # READ TIME SERIES OR SEASONAL FREQUENCY 
    169     # AND TURN ON THE FLAG WHEN MODULO IS ZERO 
    170     for post_freq in TimeSeriesFrequency SeasonalFrequency ; do 
     179    # AND TURN ON THE SUBMISSION FLAG WHEN MODULO IS ZERO 
     180    # 
     181    for post_freq in ${list_post} ; do 
    171182        # 
    172183        # Initialize 
     
    196207        fi 
    197208        # 
    198         # For each componant select determine which files need post-processing 
    199         # 
    200         for comp in ${config_ListOfComponents[*]} ; do 
    201             # 
    202             #echo "-----" 
    203             eval compname=\${config_ListOfComponents_${comp}[0]} > /dev/null 2>&1 
    204             ListFilesName=${compname}_OutputFiles_List 
    205             eval FileName0=\${${ListFilesName}[0]} > /dev/null 2>&1 
    206             # 
    207             if [ X${FileName0} != X${NULL_STR} ] ; then 
    208                 # 
    209                 #IGCM_debug_Print 1 "Component      : ${compname}" 
    210                 # 
    211                 # INITIALISATION 
    212                 # 
    213                 eval NbFiles=\${#${ListFilesName}[@]} > /dev/null 2>&1 
    214                 typeset i=0 
    215                 # 
    216                 until [ $i -eq $NbFiles ]; do 
    217                     # 
    218                     eval file_in_=\${${ListFilesName}[$i]} > /dev/null 2>&1 
    219                     eval file_in=${file_in_} 
    220                     let $(( i_ = i+2 )) 
    221                     eval flag_post_=\${${ListFilesName}[$i_]} > /dev/null 2>&1 
    222                     eval flag_post=${flag_post_} 
    223                     # 
    224                     if [ X${flag_post} != XNONE ] ; then 
    225                     # 
    226                         case ${config_Post_post_freq} in 
    227                             *y|*Y) 
    228                                 PeriodYear=$( echo ${config_Post_post_freq} | sed -e "s/[yY]//" ) 
    229                                 # 
    230                                 case ${config_UserChoices_PeriodLength} in 
    231                                     *Y|*y) 
    232                                         PeriodPost=$( echo ${config_UserChoices_PeriodLength} | sed -e "s/[yY]//" ) 
    233                                         if [ ${PeriodPost} -le ${PeriodYear} ] ; then 
    234                                             if [ $( expr $(( ${CumulPeriod} * ${PeriodPost} - ${PeriodOffset} )) % ${PeriodYear} ) -eq 0 ] ;  then 
    235                                                 [ $(( ${CumulPeriod} * ${PeriodPost} - ${PeriodOffset} )) -ne 0 ] && eval ${post_freq}=true 
    236                                                 [ $(( ${CumulPeriod} * ${PeriodPost} - ${PeriodOffset} )) -ne 0 ] && POST=true 
    237                                             fi 
    238                                         else 
    239                                             IGCM_debug_Print 3 "PeriodLength frequency ${config_UserChoices_PeriodLength} not compatbile with" 
    240                                             IGCM_debug_Print 3 "${flag_post} frequency : ${config_Post_post_freq} " 
    241                                         fi ;; 
    242                                     *M|*m) 
    243                                         PeriodPost=$( echo ${config_UserChoices_PeriodLength} | sed -e "s/[mM]//" ) 
    244                                         if [ ${PeriodPost} -le $(( ${PeriodYear} * 12 )) ] ; then 
    245                                             if [ $( expr $(( ${CumulPeriod} * ${PeriodPost} - ${PeriodOffset} * 12 )) % $(( ${PeriodYear} * 12 )) ) -eq 0 ] ; then 
    246                                                 [ $(( ${CumulPeriod} * ${PeriodPost} - ${PeriodOffset} * 12 )) -ne 0 ] && eval ${post_freq}=true 
    247                                                 [ $(( ${CumulPeriod} * ${PeriodPost} - ${PeriodOffset} * 12 )) -ne 0 ] && POST=true 
    248                                             fi 
    249                                         else 
    250                                             IGCM_debug_Print 3 "PeriodLength frequency ${config_UserChoices_PeriodLength} not compatbile with" 
    251                                             IGCM_debug_Print 3 "${flag_post} frequency : ${config_Post_post_freq} " 
    252                                         fi ;; 
    253                                     *D|*d) 
    254                                         PeriodPost=$( echo ${config_UserChoices_PeriodLength} | sed -e "s/[dD]//" ) 
    255                                         NbDays=$( IGCM_date_DaysInYear ${year} ) 
    256                                         if [ ${config_UserChoices_CalendarType} = 360d ] | [ ${config_UserChoices_CalendarType} = noleap ] ; then 
    257                                             if [ ${PeriodPost} -le $(( ${PeriodYear} * ${NbDays} )) ] ; then 
    258                                                 if [ $( expr $(( ${CumulPeriod} - ( ${PeriodOffset} * ${NbDays} / ${PeriodPost} ) )) % \ 
    259                                                      $(( ${NbDays} * ${PeriodYear} / ${PeriodPost} )) ) -eq 0 ] ; then 
    260                                                     [ $(( ${CumulPeriod} - ( ${PeriodOffset} * ${NbDays} / ${PeriodPost} ) )) -ne 0 ] && eval ${post_freq}=true 
    261                                                     [ $(( ${CumulPeriod} - ( ${PeriodOffset} * ${NbDays} / ${PeriodPost} ) )) -ne 0 ] POST=true 
    262                                                 fi 
    263                                             else 
    264                                                 IGCM_debug_Print 3 "PeriodLength frequency ${config_UserChoices_PeriodLength} not compatbile with" 
    265                                                 IGCM_debug_Print 3 "${flag_post} frequency : ${config_Post_post_freq} " 
    266                                             fi 
    267                                         else 
     209        case ${config_Post_post_freq} in 
     210            *y|*Y) 
     211                PeriodYear=$( echo ${config_Post_post_freq} | sed -e "s/[yY]//" ) 
     212                # 
     213                case ${config_UserChoices_PeriodLength} in 
     214                    *Y|*y) 
     215                        PeriodPost=$( echo ${config_UserChoices_PeriodLength} | sed -e "s/[yY]//" ) 
     216                        if [ ${PeriodPost} -le ${PeriodYear} ] ; then 
     217                            if [ $( expr $(( ${CumulPeriod} * ${PeriodPost} - ${PeriodOffset} )) % ${PeriodYear} ) -eq 0 ] ;  then 
     218                                [ $(( ${CumulPeriod} * ${PeriodPost} - ${PeriodOffset} )) -ne 0 ] && eval ${post_freq}=true 
     219                                [ $(( ${CumulPeriod} * ${PeriodPost} - ${PeriodOffset} )) -ne 0 ] && POST=true 
     220                            fi 
     221                        else 
     222                            IGCM_debug_Print 3 "PeriodLength frequency ${config_UserChoices_PeriodLength} not compatbile with" 
     223                            IGCM_debug_Print 3 "${flag_post} frequency : ${config_Post_post_freq} " 
     224                        fi ;; 
     225                    *M|*m) 
     226                        PeriodPost=$( echo ${config_UserChoices_PeriodLength} | sed -e "s/[mM]//" ) 
     227                        if [ ${PeriodPost} -le $(( ${PeriodYear} * 12 )) ] ; then 
     228                            if [ $( expr $(( ${CumulPeriod} * ${PeriodPost} - ${PeriodOffset} * 12 )) % $(( ${PeriodYear} * 12 )) ) -eq 0 ] ; then 
     229                                [ $(( ${CumulPeriod} * ${PeriodPost} - ${PeriodOffset} * 12 )) -ne 0 ] && eval ${post_freq}=true 
     230                                [ $(( ${CumulPeriod} * ${PeriodPost} - ${PeriodOffset} * 12 )) -ne 0 ] && POST=true 
     231                            fi 
     232                        else 
     233                            IGCM_debug_Print 3 "PeriodLength frequency ${config_UserChoices_PeriodLength} not compatbile with" 
     234                            IGCM_debug_Print 3 "${flag_post} frequency : ${config_Post_post_freq} " 
     235                        fi ;; 
     236                    *D|*d) 
     237                        PeriodPost=$( echo ${config_UserChoices_PeriodLength} | sed -e "s/[dD]//" ) 
     238                        NbDays=$( IGCM_date_DaysInYear ${year} ) 
     239                        if [ ${config_UserChoices_CalendarType} = 360d ] | [ ${config_UserChoices_CalendarType} = noleap ] ; then 
     240                            if [ ${PeriodPost} -le $(( ${PeriodYear} * ${NbDays} )) ] ; then 
     241                                if [ $( expr $(( ${CumulPeriod} - ( ${PeriodOffset} * ${NbDays} / ${PeriodPost} ) )) % \ 
     242                                    $(( ${NbDays} * ${PeriodYear} / ${PeriodPost} )) ) -eq 0 ] ; then 
     243                                    [ $(( ${CumulPeriod} - ( ${PeriodOffset} * ${NbDays} / ${PeriodPost} ) )) -ne 0 ] && eval ${post_freq}=true 
     244                                    [ $(( ${CumulPeriod} - ( ${PeriodOffset} * ${NbDays} / ${PeriodPost} ) )) -ne 0 ] POST=true 
     245                                fi 
     246                            else 
     247                                IGCM_debug_Print 3 "PeriodLength frequency ${config_UserChoices_PeriodLength} not compatbile with" 
     248                                IGCM_debug_Print 3 "${flag_post} frequency : ${config_Post_post_freq} " 
     249                            fi 
     250                        else 
    268251#                                           if [ ${PeriodYear} -eq 1 ] ; then 
    269252#                                               PeriodEndJul=$( IGCM_date_ConvertGregorianDateToJulian ${PeriodDateEnd} ) 
     
    276259#                                               fi 
    277260#                                           else 
    278                                             IGCM_debug_Print 3 "For ${post_freq} with leap calendar, for ${comp} and ${file_in} :" 
    279                                             IGCM_debug_Print 3 "We have a daily PeriodLength frequency and RebuildFrequency=${PeriodYear}Y." 
    280                                             IGCM_debug_Print 3 "No post-treatment. Case not properly handle at this moment." 
     261                            IGCM_debug_Print 3 "For ${post_freq} with leap calendar, for ${comp} and ${file_in} :" 
     262                            IGCM_debug_Print 3 "We have a daily PeriodLength frequency and RebuildFrequency=${PeriodYear}Y." 
     263                            IGCM_debug_Print 3 "No post-treatment. Case not properly handle at this moment." 
    281264#                                           fi 
    282                                         fi;; 
    283                                 esac ;; 
    284                             *M|*m) 
    285                                 PeriodMonth=$( echo ${config_Post_post_freq} | sed -e "s/[mM]//" ) 
    286                                 case ${config_UserChoices_PeriodLength} in 
    287                                     *Y|*y) 
    288                                         IGCM_debug_Print 3 "PeriodLength frequency ${config_UserChoices_PeriodLength} not compatbile with" 
    289                                         IGCM_debug_Print 3 "${flag_post} frequency : ${config_Post_post_freq} " ;; 
    290                                     *M|*m) 
    291                                         PeriodPost=$( echo ${config_UserChoices_PeriodLength} | sed -e "s/[mM]//" ) 
    292                                         if [ ${PeriodPost} -le ${PeriodMonth} ] ; then 
    293                                             if [ $( expr $(( ${CumulPeriod} * ${PeriodPost} -  ${PeriodOffset} )) % ${PeriodMonth}  ) -eq 0 ] ;  then 
    294                                                 [ $(( ${CumulPeriod} * ${PeriodPost} -  ${PeriodOffset} )) -ne 0 ] && eval ${post_freq}=true 
    295                                                 [ $(( ${CumulPeriod} * ${PeriodPost} -  ${PeriodOffset} )) -ne 0 ] && POST=true 
    296                                             fi 
    297                                         else 
    298                                             IGCM_debug_Print 3 "PeriodLength frequency ${config_UserChoices_PeriodLength} not compatbile with" 
    299                                             IGCM_debug_Print 3 "${flag_post} frequency : ${config_Post_post_freq} " 
    300                                         fi;; 
    301                                     *D|*d) 
    302                                         IGCM_debug_Print 3 "PeriodLength frequency ${config_UserChoices_PeriodLength} not compatbile with" 
    303                                         IGCM_debug_Print 3 "${flag_post} frequency : ${config_Post_post_freq} " ;; 
    304                                 esac ;; 
    305                             *D|*d) 
    306                                 PeriodDay=$( echo ${config_Post_post_freq} | sed -e "s/[dD]//" ) 
    307                                 case ${config_UserChoices_PeriodLength} in 
    308                                     *Y|*y) 
    309                                         IGCM_debug_Print 3 "PeriodLength frequency ${config_UserChoices_PeriodLength} not compatbile with" 
    310                                         IGCM_debug_Print 3 "${flag_post} frequency : ${config_Post_post_freq} " ;; 
    311                                     *M|*m) 
    312                                         IGCM_debug_Print 3 "PeriodLength frequency ${config_UserChoices_PeriodLength} not compatbile with" 
    313                                         IGCM_debug_Print 3 "${flag_post} frequency : ${config_Post_post_freq} " ;; 
    314                                     *D|*d) 
    315                                         PeriodPost=$( echo ${config_UserChoices_PeriodLength} | sed -e "s/[dD]//" ) 
    316                                         if [ ${PeriodPost} -le ${PeriodDay} ] ; then 
    317                                             if [ $( expr $(( ${CumulPeriod} * ${PeriodPost} - ${PeriodOffset} )) % ${PeriodDay}  ) -eq 0 ] ;  then 
    318                                                 [ $(( ${CumulPeriod} * ${PeriodPost} - ${PeriodOffset} )) -ne 0 ] && eval ${post_freq}=true 
    319                                                 [ $(( ${CumulPeriod} * ${PeriodPost} - ${PeriodOffset} )) -ne 0 ] && POST=true 
    320                                             fi 
    321                                         else 
    322                                             IGCM_debug_Print 3 "PeriodLength frequency ${config_UserChoices_PeriodLength} not compatbile with" 
    323                                             IGCM_debug_Print 3 "${flag_post} frequency : ${config_Post_post_freq} " 
    324                                         fi;; 
    325                                 esac ;; 
    326                             NONE|none) 
    327                                 ;; 
    328                             *) 
    329                                 IGCM_debug_Print 3 "KeyWord not allowed for ${post_freq} in config.card" 
    330                                 ;; 
    331                         esac 
    332                     fi 
    333                     let $(( i=i+3 )) 
    334                 done 
    335             fi 
    336         done 
     265                        fi;; 
     266                esac ;; 
     267            *M|*m) 
     268                PeriodMonth=$( echo ${config_Post_post_freq} | sed -e "s/[mM]//" ) 
     269                case ${config_UserChoices_PeriodLength} in 
     270                    *Y|*y) 
     271                        IGCM_debug_Print 3 "PeriodLength frequency ${config_UserChoices_PeriodLength} not compatbile with" 
     272                        IGCM_debug_Print 3 "${flag_post} frequency : ${config_Post_post_freq} " ;; 
     273                    *M|*m) 
     274                        PeriodPost=$( echo ${config_UserChoices_PeriodLength} | sed -e "s/[mM]//" ) 
     275                        if [ ${PeriodPost} -le ${PeriodMonth} ] ; then 
     276                            if [ $( expr $(( ${CumulPeriod} * ${PeriodPost} -  ${PeriodOffset} )) % ${PeriodMonth}  ) -eq 0 ] ;  then 
     277                                [ $(( ${CumulPeriod} * ${PeriodPost} -  ${PeriodOffset} )) -ne 0 ] && eval ${post_freq}=true 
     278                                [ $(( ${CumulPeriod} * ${PeriodPost} -  ${PeriodOffset} )) -ne 0 ] && POST=true 
     279                            fi 
     280                        else 
     281                            IGCM_debug_Print 3 "PeriodLength frequency ${config_UserChoices_PeriodLength} not compatbile with" 
     282                            IGCM_debug_Print 3 "${flag_post} frequency : ${config_Post_post_freq} " 
     283                        fi;; 
     284                    *D|*d) 
     285                        IGCM_debug_Print 3 "PeriodLength frequency ${config_UserChoices_PeriodLength} not compatbile with" 
     286                        IGCM_debug_Print 3 "${flag_post} frequency : ${config_Post_post_freq} " ;; 
     287                esac ;; 
     288            *D|*d) 
     289                PeriodDay=$( echo ${config_Post_post_freq} | sed -e "s/[dD]//" ) 
     290                case ${config_UserChoices_PeriodLength} in 
     291                    *Y|*y) 
     292                        IGCM_debug_Print 3 "PeriodLength frequency ${config_UserChoices_PeriodLength} not compatbile with" 
     293                        IGCM_debug_Print 3 "${flag_post} frequency : ${config_Post_post_freq} " ;; 
     294                    *M|*m) 
     295                        IGCM_debug_Print 3 "PeriodLength frequency ${config_UserChoices_PeriodLength} not compatbile with" 
     296                        IGCM_debug_Print 3 "${flag_post} frequency : ${config_Post_post_freq} " ;; 
     297                    *D|*d) 
     298                        PeriodPost=$( echo ${config_UserChoices_PeriodLength} | sed -e "s/[dD]//" ) 
     299                        if [ ${PeriodPost} -le ${PeriodDay} ] ; then 
     300                            if [ $( expr $(( ${CumulPeriod} * ${PeriodPost} - ${PeriodOffset} )) % ${PeriodDay}  ) -eq 0 ] ;  then 
     301                                [ $(( ${CumulPeriod} * ${PeriodPost} - ${PeriodOffset} )) -ne 0 ] && eval ${post_freq}=true 
     302                                [ $(( ${CumulPeriod} * ${PeriodPost} - ${PeriodOffset} )) -ne 0 ] && POST=true 
     303                            fi 
     304                        else 
     305                            IGCM_debug_Print 3 "PeriodLength frequency ${config_UserChoices_PeriodLength} not compatbile with" 
     306                            IGCM_debug_Print 3 "${flag_post} frequency : ${config_Post_post_freq} " 
     307                        fi;; 
     308                esac ;; 
     309            NONE|none) 
     310                ;; 
     311            *) 
     312                IGCM_debug_Print 3 "KeyWord not allowed for ${post_freq} in config.card" 
     313                ;; 
     314        esac 
    337315    done 
    338316    # 
     
    662640            # 
    663641            typeset listVarEnv 
    664             listVarEnv="DEBUG_debug,MODIPSL,libIGCM,libIGCM_SX,SUBMIT_DIR,REBUILD_DIR,POST_DIR,MASTER,DateBegin,PeriodDateBegin,PeriodDateEnd,NbRebuildDir,StandAlone,RESOL_ATM,RESOL_OCE,RESOL_ICE,RESOL_MBG,RESOL_SRF,RESOL_BIOS,config_UserChoices_JobName,R_SAVE" 
     642            listVarEnv="DEBUG_debug,MODIPSL,libIGCM,libIGCM_SX,SUBMIT_DIR,REBUILD_DIR,POST_DIR,MASTER,RebuildFromArchive,DateBegin,PeriodDateBegin,PeriodDateEnd,NbRebuildDir,StandAlone,RESOL_ATM,RESOL_OCE,RESOL_ICE,RESOL_MBG,RESOL_SRF,RESOL_BIOS,config_UserChoices_JobName,R_SAVE" 
    665643            IGCM_sys_RshPost <<-EOF 
    666644            export DEBUG_debug=${DEBUG_debug} 
     
    672650            export POST_DIR=${POST_DIR} 
    673651            export MASTER=${MASTER} 
     652            export RebuildFromArchive=${config_Post_RebuildFromArchive} 
    674653            export DateBegin=${DateBegin} 
    675654            export PeriodDateBegin=${PeriodDateBegin} 
     
    698677            # 
    699678            typeset listVarEnv 
    700             listVarEnv="DEBUG_debug,MODIPSL,libIGCM,libIGCM_SX,SUBMIT_DIR,REBUILD_DIR,POST_DIR,MASTER,DateBegin,PeriodDateBegin,PeriodDateEnd,NbRebuildDir,StandAlone,RESOL_ATM,RESOL_OCE,RESOL_ICE,RESOL_MBG,RESOL_SRF,RESOL_BIOS,config_UserChoices_JobName,R_SAVE" 
     679            listVarEnv="DEBUG_debug,MODIPSL,libIGCM,libIGCM_SX,SUBMIT_DIR,REBUILD_DIR,POST_DIR,MASTER,RebuildFromArchive,DateBegin,PeriodDateBegin,PeriodDateEnd,NbRebuildDir,StandAlone,RESOL_ATM,RESOL_OCE,RESOL_ICE,RESOL_MBG,RESOL_SRF,RESOL_BIOS,config_UserChoices_JobName,R_SAVE" 
    701680            IGCM_sys_RshPost <<-EOF 
    702681            export DEBUG_debug=${DEBUG_debug} 
     
    708687            export POST_DIR=${POST_DIR} 
    709688            export MASTER=${MASTER} 
     689            export RebuildFromArchive=${config_Post_RebuildFromArchive} 
    710690            export DateBegin=${DateBegin} 
    711691            export PeriodDateBegin=${PeriodDateBegin} 
Note: See TracChangeset for help on using the changeset viewer.