Changeset 236 for trunk


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

Location:
trunk/libIGCM
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/libIGCM/AA_create_se

    r231 r236  
    230230    if [ X${FileName0} != X${NULL_STR} ] ; then 
    231231        # 
    232         #IGCM_debug_Print 1 "Component      : ${compname}" 
    233         # 
    234232        # INITIALISATION 
    235233        # 
    236234        eval NbFiles=\${#${ListFilesName}[@]} > /dev/null 2>&1 
    237         typeset i=0 
     235        typeset i=2 
    238236        # 
    239237        until [ $i -eq $NbFiles ]; do 
    240238            # 
    241             eval file_in_=\${${ListFilesName}[$i]} > /dev/null 2>&1 
    242             eval file_in=${file_in_} 
    243             let $(( i_ = i+2 )) 
    244             eval flag_post_=\${${ListFilesName}[$i_]} > /dev/null 2>&1 
     239            eval flag_post_=\${${ListFilesName}[$i]} > /dev/null 2>&1 
    245240            eval flag_post=${flag_post_} 
    246241            # 
    247242            if [ X${flag_post} != XNONE ] ; then 
    248243                # 
    249                 # Initialize ${flag_post}_${compname}_${post_freq} 
     244                # Check if seasonal is required for this file 
    250245                # 
    251                 eval export ${flag_post}_${compname}_SeasonalFrequency=true 
     246                IGCM_card_DefineArrayFromOption ${card} ${flag_post} Seasonal 
     247                # 
     248                if [ ! X$( eval echo \${${compname}_${flag_post}_Seasonal} ) = XON ] ; then 
     249                    continue 
     250                fi 
     251                # 
     252                # CREATE LIST 
     253                # 
     254                FILE=$( echo ${flag_post} | awk "-FPost_" '{print $2}' ) 
     255                # 
     256                DIRECTORY=${R_SAVE}/${comp}/Analyse/SE 
     257                # 
     258                TestedFile=${config_UserChoices_JobName}_SE_${an_deb}_${an_fin}_${FILE}.nc 
     259                # 
     260                IGCM_sys_TestFileArchive ${DIRECTORY}/${TestedFile} 
     261                if [ ! $? = 0 ] ; then 
     262                    eval set +A LISTE_FILE_${comp} \$\{LISTE_FILE_${comp}[*]} ${FILE} 
     263                    if [ ! ${RebuildFrequency} = true ] ; then 
     264                        IGCM_card_DefineArrayFromOption ${card} Post_${FILE} Patches 
     265                        eval set +A LISTE_PATCHES_${FILE} \$\{${compname}_Post_${FILE}_Patches[*]} 
     266                        if [ X$( eval echo \${LISTE_PATCHES_${FILE}[0]} ) !=  X${NULL_STR} ]; then 
     267                            for Patch in $( eval echo \${LISTE_PATCHES_${FILE}[*]} ); do 
     268                                if [ Xload${Patch} != X ] ; then 
     269                                    . ${libIGCM}/libIGCM_post/IGCM_${Patch}.ksh 
     270                                    eval load${Patch}=loaded 
     271                                fi 
     272                            done 
     273                        fi 
     274                    fi 
     275                fi 
    252276            fi 
    253277            let $(( i=i+3 )) 
    254         done 
     278        done # until [ $i -eq $NbFiles ] 
    255279    fi 
    256  
    257     for element in $( env | grep Post_ | grep ${compname}_SeasonalFrequency | grep -i "=true" ) ; do 
    258         # 
    259         FILE=$( echo ${element} | awk -F "_${compname}_SeasonalFrequency" '{print $1}' | awk "-FPost_" '{print $2}' ) 
    260         # 
    261         # CREATE LIST 
    262         # 
    263         DIRECTORY=${R_SAVE}/${comp}/Analyse/SE 
    264         # 
    265         TestedFile=${config_UserChoices_JobName}_SE_${an_deb}_${an_fin}_${FILE}.nc 
    266         # 
    267         IGCM_sys_TestFileArchive ${DIRECTORY}/${TestedFile} 
    268         if [ ! $? = 0 ] ; then 
    269             eval set +A LISTE_FILE_${comp} \$\{LISTE_FILE_${comp}[*]} ${FILE} 
    270             if [ ! ${RebuildFrequency} = true ] ; then 
    271                 IGCM_card_DefineArrayFromOption ${card} Post_${FILE} Patches 
    272                 eval set +A LISTE_PATCHES_${FILE} \$\{${compname}_Post_${FILE}_Patches[*]} 
    273                 if [ X$( eval echo \${LISTE_PATCHES_${FILE}[0]} ) !=  X${NULL_STR} ]; then 
    274                     for Patch in $( eval echo \${LISTE_PATCHES_${FILE}[*]} ); do 
    275                         if [ Xload${Patch} != X ] ; then 
    276                             . ${libIGCM}/libIGCM_post/IGCM_${Patch}.ksh 
    277                             eval load${Patch}=loaded 
    278                         fi 
    279                     done 
    280                 fi 
    281             fi 
    282         fi 
    283              # 
    284     done     # for element 
    285280done         # for comp 
    286281 
  • trunk/libIGCM/AA_create_ts

    r229 r236  
    290290                # 
    291291                FILE=$( echo ${flag_post} | awk "-FPost_" '{print $2}' ) 
    292                 IGCM_card_DefineArrayFromOption ${card} Post_${FILE} TimeSeriesVars${Dimension} 
     292                IGCM_card_DefineArrayFromOption ${card}    Post_${FILE} TimeSeriesVars${Dimension} 
     293                IGCM_card_DefineVariableFromOption ${card} Post_${FILE} ChunckJob${Dimension} 
    293294                # 
     295                # If TimeSeriesVars list is empty we skip 
     296                # 
    294297                if [ $( eval echo \${${compname}_Post_${FILE}_TimeSeriesVars${Dimension}} ) = ${NULL_STR} ] ; then 
    295298                    # 
    296299                    IGCM_debug_Print 3 "Nothing to do for ${FILE} according to ${card}" 
     300                    IGCM_debug_Print 3 "TimeSeriesVars${Dimension} for ${FILE} is empty" 
    297301                    (( i=i+3 )) 
    298302                    continue 
     
    300304                fi 
    301305                # 
    302                 # If we are not a Chunck type task, skip files/variables handled  by chunck task 
     306                # If files/variables has been switch off by ChunckJob${Dimension}=0 we skip 
     307                # 
     308                if [ X$( eval echo \${${compname}_Post_${FILE}_ChunckJob${Dimension}} ) = X0 ] ; then 
     309                    IGCM_debug_Print 3 "Nothing to do for ${FILE} according to ${card}" 
     310                    IGCM_debug_Print 3 "ChunckJob${Dimension}=0 for ${FILE} so it has been switched off" 
     311                    (( i=i+3 )) 
     312                    continue 
     313                fi 
     314                # 
     315                # If we are not a Chunck type task, we skip files/variables handled by chunck task 
    303316                # 
    304317                if ( [ ! X${TsTask} = XChunck${Dimension} ] && [ ! X${TsTask} = X ] && [ ! XChunck${Dimension} = XChunck ] ) ; then 
    305                     IGCM_card_DefineVariableFromOption ${card} Post_${FILE} ChunckJob${Dimension} 
    306318                    if [ ! $( eval echo \${${compname}_Post_${FILE}_ChunckJob${Dimension}} ) = NONE ] ; then 
    307319                        IGCM_debug_Print 3 "Nothing to do for ${FILE} TimeSeriesVars${Dimension} according to ${card}" 
     
    311323                    fi 
    312324                fi 
     325                # 
     326                # Now on we know we have things to do 
     327                # 
     328 
    313329                # 
    314330                #  We need coordinates axis to properly fill produced time series 
  • trunk/libIGCM/AA_rebuild_fromArchive

    r229 r236  
    2222#-Q- sx8brodie # pour recevoir un mail en cas de depassement du temps Elapsed (ou autre pb.) 
    2323#-Q- sx8brodie # @ notification = error 
    24 #-Q- sx8brodie # @ environment  = $DEBUG_debug ; $MODIPSL ; $libIGCM ; $libIGCM_SX ; $SUBMIT_DIR ; $REBUILD_DIR ; $RebuildFromArchive ; $POST_DIR ; $DateBegin ; $PeriodDateBegin ; $PeriodDateEnd ; $NbRebuildDir ; $StandAlone ; $RESOL_ATM ; $RESOL_OCE ; $RESOL_ICE ; $RESOL_MBG ; $RESOL_SRF ; $RESOL_SBG ; $MASTER ; $config_UserChoices_JobName ; $R_SAVE 
     24#-Q- sx8brodie # @ environment  = $DEBUG_debug ; $MODIPSL ; $libIGCM ; $libIGCM_SX ; $SUBMIT_DIR ; $REBUILD_DIR ; $RebuildFromArchive ; $POST_DIR ; $DateBegin ; $PeriodDateBegin ; $PeriodDateEnd ; $NbRebuildDir ; $StandAlone ; $RESOL_ATM ; $RESOL_OCE ; $RESOL_ICE ; $RESOL_MBG ; $RESOL_SRF ; $RESOL_SBG ; $MASTER ; $RebuildFromArchive ; $config_UserChoices_JobName ; $R_SAVE 
    2525#-Q- sx8brodie # @ queue 
    2626#-Q- aix6 #!/bin/ksh 
     
    3838#-Q- aix6 # pour recevoir un mail en cas de depassement du temps Elapsed (ou autre pb.) 
    3939#-Q- aix6 # @ notification = error 
    40 #-Q- aix6 # @ environment  = $DEBUG_debug ; $MODIPSL ; $libIGCM ; $libIGCM_SX ; $SUBMIT_DIR ; $REBUILD_DIR ; $RebuildFromArchive ; $POST_DIR ; $DateBegin ; $PeriodDateBegin ; $PeriodDateEnd ; $NbRebuildDir ; $StandAlone ; $RESOL_ATM ; $RESOL_OCE ; $RESOL_ICE ; $RESOL_MBG ; $RESOL_SRF ; $RESOL_SBG ; $MASTER ; $config_UserChoices_JobName ; $R_SAVE 
     40#-Q- aix6 # @ environment  = $DEBUG_debug ; $MODIPSL ; $libIGCM ; $libIGCM_SX ; $SUBMIT_DIR ; $REBUILD_DIR ; $RebuildFromArchive ; $POST_DIR ; $DateBegin ; $PeriodDateBegin ; $PeriodDateEnd ; $NbRebuildDir ; $StandAlone ; $RESOL_ATM ; $RESOL_OCE ; $RESOL_ICE ; $RESOL_MBG ; $RESOL_SRF ; $RESOL_SBG ; $MASTER ; $RebuildFromArchive ; $config_UserChoices_JobName ; $R_SAVE 
    4141#-Q- aix6 # @ queue 
    4242#-Q- sx8mercure #!/bin/ksh 
     
    124124config_UserChoices_JobName=${config_UserChoices_JobName:=name_of_the_job} 
    125125 
    126 #D- Directory where output data are stored (needed in standalone mode for mask patch ) 
     126#D- Directory where output data are stored (needed in standalone mode for mask patch) 
    127127#D- Default : value from AA_job if any 
    128128R_SAVE=${R_SAVE:=/path/to/your/ARCHIVE/FILES} 
     
    184184IGCM_sys_Cd ${RUN_DIR} 
    185185# 
    186 ListAllRebuildDir=$( IGCM_sys_RshArchive ls -d ${REBUILD_DIR}/REBUILD_* | grep -B $(( ${NbRebuildDir} -1 )) ${LastPeriodForRebuild} ) 
     186if [ ${RebuildFromArchive} = true ] ; then 
     187    ListAllRebuildDir=$( IGCM_sys_RshArchive ls -d ${REBUILD_DIR}/REBUILD_* | grep -B $(( ${NbRebuildDir} -1 )) ${LastPeriodForRebuild} ) 
     188else 
     189    ListAllRebuildDir=$( IGCM_sys_RshMaster ls -d ${REBUILD_DIR}/REBUILD_* | grep -B $(( ${NbRebuildDir} -1 )) ${LastPeriodForRebuild} ) 
     190fi 
    187191# 
    188192 
    189193for directory in ${ListAllRebuildDir} ; do 
    190194    # 
    191     IGCM_sys_Get_Dir ${directory} ${RUN_DIR} 
     195    if [ ${RebuildFromArchive} = true ] ; then 
     196        IGCM_sys_Get_Dir ${directory} ${RUN_DIR} 
     197    else 
     198        IGCM_sys_Get_Master ${directory} ${RUN_DIR} 
     199    fi 
    192200    # 
    193201    IGCM_sys_Cd ${RUN_DIR}/$( basename ${directory} ) 
     
    201209    IGCM_sys_Cd ${RUN_DIR} 
    202210    # Clean Up 
    203     IGCM_sys_RshArchive rm -rf ${directory} 
     211    if [ ${RebuildFromArchive} = true ] ; then 
     212        IGCM_sys_RshArchive rm -rf ${directory} 
     213    else 
     214        IGCM_sys_Rm -rf ${directory} 
     215    fi 
    204216done 
    205217 
    206 # Clean RUN_DIR_PATH (necessary for cesium) 
     218# Clean RUN_DIR_PATH (necessary for cesium only) 
    207219IGCM_sys_RmRunDir -Rf ${RUN_DIR_PATH} 
  • trunk/libIGCM/AA_rebuild_fromWorkdir

    r229 r236  
    2222#-Q- sx8brodie # pour recevoir un mail en cas de depassement du temps Elapsed (ou autre pb.) 
    2323#-Q- sx8brodie # @ notification = error 
    24 #-Q- sx8brodie # @ environment  = $DEBUG_debug ; $MODIPSL ; $libIGCM ; $libIGCM_SX ; $SUBMIT_DIR ; $REBUILD_DIR ; $RebuildFromArchive ; $POST_DIR ; $DateBegin ; $PeriodDateBegin ; $PeriodDateEnd ; $NbRebuildDir ; $StandAlone ; $RESOL_ATM ; $RESOL_OCE ; $RESOL_ICE ; $RESOL_MBG ; $RESOL_SRF ; $RESOL_SBG ; $MASTER ; $config_UserChoices_JobName ; $R_SAVE 
     24#-Q- sx8brodie # @ environment  = $DEBUG_debug ; $MODIPSL ; $libIGCM ; $libIGCM_SX ; $SUBMIT_DIR ; $REBUILD_DIR ; $RebuildFromArchive ; $POST_DIR ; $DateBegin ; $PeriodDateBegin ; $PeriodDateEnd ; $NbRebuildDir ; $StandAlone ; $RESOL_ATM ; $RESOL_OCE ; $RESOL_ICE ; $RESOL_MBG ; $RESOL_SRF ; $RESOL_SBG ; $MASTER ; $RebuildFromArchive ; $config_UserChoices_JobName ; $R_SAVE 
    2525#-Q- sx8brodie # @ queue 
    2626#-Q- aix6 #!/bin/ksh 
     
    3939#-Q- aix6 # pour recevoir un mail en cas de depassement du temps Elapsed (ou autre pb.) 
    4040#-Q- aix6 # @ notification = error 
    41 #-Q- aix6 # @ environment  = $DEBUG_debug ; $MODIPSL ; $libIGCM ; $libIGCM_SX ; $SUBMIT_DIR ; $REBUILD_DIR ; $RebuildFromArchive ; $POST_DIR ; $DateBegin ; $PeriodDateBegin ; $PeriodDateEnd ; $NbRebuildDir ; $StandAlone ; $RESOL_ATM ; $RESOL_OCE ; $RESOL_ICE ; $RESOL_MBG ; $RESOL_SRF ; $RESOL_SBG ; $MASTER ; $config_UserChoices_JobName ; $R_SAVE 
     41#-Q- aix6 # @ environment  = $DEBUG_debug ; $MODIPSL ; $libIGCM ; $libIGCM_SX ; $SUBMIT_DIR ; $REBUILD_DIR ; $RebuildFromArchive ; $POST_DIR ; $DateBegin ; $PeriodDateBegin ; $PeriodDateEnd ; $NbRebuildDir ; $StandAlone ; $RESOL_ATM ; $RESOL_OCE ; $RESOL_ICE ; $RESOL_MBG ; $RESOL_SRF ; $RESOL_SBG ; $MASTER ; $RebuildFromArchive ; $config_UserChoices_JobName ; $R_SAVE 
    4242#-Q- aix6 # @ queue 
    4343#-Q- sx8mercure #!/bin/ksh 
     
    181181#set -vx 
    182182 
    183 #RUN_DIR=${REBUILD_DIR} 
    184183RUN_DIR=${RUN_DIR_PATH} 
    185184IGCM_sys_MkdirWork ${RUN_DIR} 
    186185IGCM_sys_Cd ${RUN_DIR} 
    187186# 
    188 ListAllRebuildDir=$( IGCM_sys_RshMaster ls -d ${REBUILD_DIR}/REBUILD_* | grep -B $(( ${NbRebuildDir} -1 )) ${LastPeriodForRebuild} ) 
     187if [ ${RebuildFromArchive} = true ] ; then 
     188    ListAllRebuildDir=$( IGCM_sys_RshArchive ls -d ${REBUILD_DIR}/REBUILD_* | grep -B $(( ${NbRebuildDir} -1 )) ${LastPeriodForRebuild} ) 
     189else 
     190    ListAllRebuildDir=$( IGCM_sys_RshMaster ls -d ${REBUILD_DIR}/REBUILD_* | grep -B $(( ${NbRebuildDir} -1 )) ${LastPeriodForRebuild} ) 
     191fi 
    189192# 
     193 
    190194for directory in ${ListAllRebuildDir} ; do 
    191195    # 
    192     IGCM_sys_Get_Master ${directory} ${RUN_DIR} 
     196    if [ ${RebuildFromArchive} = true ] ; then 
     197        IGCM_sys_Get_Dir ${directory} ${RUN_DIR} 
     198    else 
     199        IGCM_sys_Get_Master ${directory} ${RUN_DIR} 
     200    fi 
    193201    # 
    194202    IGCM_sys_Cd ${RUN_DIR}/$( basename ${directory} ) 
     
    202210    IGCM_sys_Cd ${RUN_DIR} 
    203211    # Clean Up 
    204     IGCM_sys_Rm -rf ${directory} 
     212    if [ ${RebuildFromArchive} = true ] ; then 
     213        IGCM_sys_RshArchive rm -rf ${directory} 
     214    else 
     215        IGCM_sys_Rm -rf ${directory} 
     216    fi 
    205217done 
    206218 
  • trunk/libIGCM/libIGCM_comp/libIGCM_comp.ksh

    r168 r236  
    163163                        TimeSeriesChunck3D=false 
    164164                    fi 
     165                    # Seasonal case 
     166                    IGCM_card_DefineArrayFromOption ${card} ${flag_post} Seasonal 
     167                    if [ $( eval echo \${${compname}_${flag_post}_Seasonal} ) = ON ] ; then 
     168                        Seasonal=true 
     169                    fi 
    165170                fi 
    166171                (( i=i+3 )) 
     
    596601        eval ExeNameIn=\${config_Executable_${comp}[0]} 
    597602        eval ExeNameOut=\${config_Executable_${comp}[1]} 
     603 
     604        # If missing executable then stop! 
     605        if [ ! X${ExeNameIn} = X ] && [ ! -f ${R_EXE}/${ExeNameIn} ] ; then 
     606            IGCM_debug_Exit "IGCM_comp_Update missing executable ${ExeNameIn}" 
     607        fi  
    598608 
    599609        if [ ${Period} -eq 1 ] && [ -f ${R_EXE}/${ExeNameIn} ] ; then 
  • 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.