Changeset 554


Ignore:
Timestamp:
02/20/12 17:39:05 (12 years ago)
Author:
sdipsl
Message:
  • Mechanism in place to submit pack jobs.
  • Add a PackFrequency? ; default to RebuildFrequency? if not present in config.card
  • Add coherence checks between PackFrequency? and relevant dependant frequencies
  • pack_restart and pack_debug ready in batch mode. Testing in progress. Submission is still a comment in libIGCM_post
  • Move and generalize create_ts_next_date from AA_create_ts to libIGCM_date. Rename to IGCM_date_DaysInNextPeriod
  • Move and generalyze create_ts_begin_date from AA_create_ts to libIGCM_date. Rename to IGCM_date_DaysInPreviousPeriod
  • Cosmetics
Location:
trunk/libIGCM
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/libIGCM/AA_SE_Checker

    r546 r554  
    1818# all TS to last PeriodDateEnd value, give by run.card->Configuration->OldPrefix string. 
    1919 
    20 # Chemin vers libIGCM 
     20#D- Path to libIGCM 
     21#D- Default : value from AA_job if any 
     22# WARNING For StandAlone use : To run this script on some machine (ulam and cesium) 
     23# WARNING you must check MirrorlibIGCM variable in sys library. 
     24# WARNING If this variable is true, you must use libIGCM_POST path instead 
     25# WARNING of your running libIGCM directory. 
    2126libIGCM=${libIGCM:=::modipsl::/libIGCM} 
    22 # Attention : à changer si la machine de post-traitement n'est pas la frontale du serveur de calcul ! 
    23 #             voir précence de la variable MirrorlibIGCM dans votre couche systÚme. 
    2427 
    2528# Expericence class of the run 
  • trunk/libIGCM/AA_SaveSourceModifications

    r535 r554  
    8686MODIPSL=::modipsl:: 
    8787 
    88 #D- Low level debug : to bypass lib test checks and stack construction 
     88#D- Path to libIGCM 
    8989#D- Default : value from AA_job if any 
     90# WARNING For StandAlone use : To run this script on some machine (ulam and cesium) 
     91# WARNING you must check MirrorlibIGCM variable in sys library. 
     92# WARNING If this variable is true, you must use libIGCM_POST path instead 
     93# WARNING of your running libIGCM directory. 
    9094libIGCM=${libIGCM:=::modipsl::/libIGCM} 
    91 # WARNING for StandAlone used : To run this script on some machine, 
    92 # you must check MirrorlibIGCM variable in sys library. 
    93 # If this variable is true, you must use libIGCM_POST path instead 
    94 # of your running libIGCM directory. 
    9595 
    9696. ${libIGCM}/libIGCM_debug/libIGCM_debug.ksh 
  • trunk/libIGCM/AA_TimeSeries_Checker

    r546 r554  
    1818# all TS to last PeriodDateEnd value, give by run.card->Configuration->OldPrefix string. 
    1919 
    20 # Chemin vers libIGCM 
     20#D- Path to libIGCM 
     21#D- Default : value from AA_job if any 
     22# WARNING For StandAlone use : To run this script on some machine (ulam and cesium) 
     23# WARNING you must check MirrorlibIGCM variable in sys library. 
     24# WARNING If this variable is true, you must use libIGCM_POST path instead 
     25# WARNING of your running libIGCM directory. 
    2126libIGCM=${libIGCM:=::modipsl::/libIGCM} 
    22 # Attention : à changer si la machine de post-traitement n'est pas la frontale du serveur de calcul ! 
    23 #             voir précence de la variable MirrorlibIGCM dans votre couche systÚme. 
    2427 
    2528# Expericence class of the run 
  • trunk/libIGCM/AA_create_multi_se

    r546 r554  
    136136StandAlone=${StandAlone:=true} 
    137137 
    138 #D- Low level debug : to bypass lib test checks and stack construction 
     138#D- Path to libIGCM 
    139139#D- Default : value from AA_job if any 
     140# WARNING For StandAlone use : To run this script on some machine (ulam and cesium) 
     141# WARNING you must check MirrorlibIGCM variable in sys library. 
     142# WARNING If this variable is true, you must use libIGCM_POST path instead 
     143# WARNING of your running libIGCM directory. 
    140144libIGCM=${libIGCM:=::modipsl::/libIGCM} 
    141 # WARNING for StandAlone used : To run this script on some machine, 
    142 # you must check MirrorlibIGCM variable in sys library. 
    143 # If this variable is true, you must use libIGCM_POST path instead 
    144 # of your running libIGCM directory. 
    145145 
    146146#D- Flag to determine atlas job's output directory 
  • trunk/libIGCM/AA_create_se

    r546 r554  
    136136StandAlone=${StandAlone:=true} 
    137137 
    138 #D- Low level debug : to bypass lib test checks and stack construction 
     138#D- Path to libIGCM 
    139139#D- Default : value from AA_job if any 
     140# WARNING For StandAlone use : To run this script on some machine (ulam and cesium) 
     141# WARNING you must check MirrorlibIGCM variable in sys library. 
     142# WARNING If this variable is true, you must use libIGCM_POST path instead 
     143# WARNING of your running libIGCM directory. 
    140144libIGCM=${libIGCM:=::modipsl::/libIGCM} 
    141 # WARNING for StandAlone used : To run this script on some machine, 
    142 # you must check MirrorlibIGCM variable in sys library. 
    143 # If this variable is true, you must use libIGCM_POST path instead 
    144 # of your running libIGCM directory. 
    145145 
    146146#D- Flag to determine if rebuild process has been performed asynchronously 
  • trunk/libIGCM/AA_create_ts

    r546 r554  
    136136StandAlone=${StandAlone:=true} 
    137137 
    138 #D- Low level debug : to bypass lib test checks and stack construction 
     138#D- Path to libIGCM 
    139139#D- Default : value from AA_job if any 
     140# WARNING For StandAlone use : To run this script on some machine (ulam and cesium) 
     141# WARNING you must check MirrorlibIGCM variable in sys library. 
     142# WARNING If this variable is true, you must use libIGCM_POST path instead 
     143# WARNING of your running libIGCM directory. 
    140144libIGCM=${libIGCM:=::modipsl::/libIGCM} 
    141 # WARNING for StandAlone used : To run this script on some machine, 
    142 # you must check MirrorlibIGCM variable in sys library. 
    143 # If this variable is true, you must use libIGCM_POST path instead 
    144 # of your running libIGCM directory. 
    145145 
    146146#D- Flag to determine allready produced time series. Empty if you start from the beginning 
     
    462462######################################################################## 
    463463# 
    464 #                          DEFINE DATE FUNCTIONS 
    465 # 
    466 ######################################################################## 
    467  
    468 # Give the end of the next $1 period from $2 date 
    469 function create_ts_next_date { 
    470     IGCM_debug_PushStack "create_ts_next_date" $@ 
    471     typeset Length 
    472     case ${config_UserChoices_PeriodLength} in 
    473         *Y|*y)  
    474             PeriodLengthInYears=$( echo ${config_UserChoices_PeriodLength} | awk -F '[yY]' '{print $1}' ) 
    475             IGCM_date_GetYearMonth ${1} year month 
    476             year=$( IGCM_date_SupressZeros ${year} ) 
    477             (( Length=0 )) 
    478             (( i=0 )) 
    479             until [ $i -ge $PeriodLengthInYears ] ; do 
    480                 (( Length = Length + $( IGCM_date_DaysInYear $(( year + i + 1 )) ) ))  
    481                 (( i=i+1 )) 
    482             done 
    483             ;; 
    484         *M|*m)  
    485             PeriodLengthInMonths=$( echo ${config_UserChoices_PeriodLength} | awk -F '[mM]' '{print $1}' ) 
    486             IGCM_date_GetYearMonth ${1} year month 
    487             year=$( IGCM_date_SupressZeros ${year} ) 
    488             (( year0 = year )) 
    489             if [ $(( month + 1 )) -lt 13 ] ; then 
    490                 month0=$(( month + 1 )) 
    491             else 
    492                 month0=$(( month + 1 - 12 )) 
    493                 (( year = year0 + 1 )) 
    494             fi 
    495             (( Length=0 )) 
    496             (( i=0 )) 
    497             until [ $i -ge $PeriodLengthInMonths ] ; do 
    498                 if [ $(( month0 + i )) -lt 13 ] ; then 
    499                     (( Length = Length + $( IGCM_date_DaysInMonth $year $(( month0 + i )) ) )) 
    500                 else 
    501                     (( year = year0 + 1 )) 
    502                     (( Length = Length + $( IGCM_date_DaysInMonth $year $(( month0 + i - 12 )) ) )) 
    503                 fi 
    504                 (( i=i+1 )) 
    505             done 
    506             ;; 
    507         *D|*d) 
    508             Length=$( echo ${config_UserChoices_PeriodLength} | sed -e "s/[dD]//" ) ;; 
    509         *) 
    510             IGCM_debug_Exit "create_ts " ${config_UserChoices_PeriodLength} " invalid PeriodLength : choose in *Y, *M, *D." 
    511             IGCM_debug_Verif_Exit_Post ;; 
    512     esac 
    513     echo ${Length} 
    514  
    515     IGCM_debug_PopStack "create_ts_next_date" 
    516 } 
    517  
    518 # Give the end of the actual $1 period from $2 date 
    519 function create_ts_begin_date { 
    520     IGCM_debug_PushStack "create_ts_begin_date" $@ 
    521     typeset Length 
    522     case ${config_UserChoices_PeriodLength} in 
    523         *Y|*y)  
    524             PeriodLengthInYears=$( echo ${config_UserChoices_PeriodLength} | awk -F '[yY]' '{print $1}' ) 
    525             IGCM_date_GetYearMonth ${1} year month 
    526             year=$( IGCM_date_SupressZeros ${year} ) 
    527             if [ X${2} = Xend ] ; then 
    528                 (( year = year - PeriodLengthInYears + 1)) 
    529             fi 
    530             (( Length=0 )) 
    531             (( i=0 )) 
    532             until [ $i -ge $PeriodLengthInYears ] ; do 
    533                 (( Length = Length + $( IGCM_date_DaysInYear $(( year + i )) ) ))  
    534                 (( i=i+1 )) 
    535             done 
    536             ;; 
    537         *M|*m)  
    538             PeriodLengthInMonths=$( echo ${config_UserChoices_PeriodLength} | awk -F '[mM]' '{print $1}' ) 
    539             IGCM_date_GetYearMonth ${1} year month 
    540             year=$( IGCM_date_SupressZeros ${year} ) 
    541             if [ X${2} = Xend ] ; then 
    542                 (( month = month - PeriodLengthInMonths + 1 )) 
    543             fi       
    544             (( year0 = year )) 
    545             if [ $month -le 0 ] ; then 
    546                 (( month = month + 12 )) 
    547                 year=$( printf "%04i\n" $(( year - 1 )) ) 
    548             fi 
    549             month=$( printf "%02i\n" ${month} ) 
    550             (( Length=0 )) 
    551             (( i=0 )) 
    552             until [ $i -ge $PeriodLengthInMonths ] ; do 
    553                 if [ $(( month + i )) -lt 13 ] ; then 
    554                     (( Length = Length + $( IGCM_date_DaysInMonth $year $(( month + i )) ) )) 
    555                 else 
    556                     (( year = year0 + 1 )) 
    557                     (( Length = Length + $( IGCM_date_DaysInMonth $year $(( month + i - 12 )) ) )) 
    558                 fi 
    559                 (( i=i+1 )) 
    560             done 
    561             ;; 
    562         *D|*d) 
    563             Length=$( echo ${config_UserChoices_PeriodLength} | sed -e "s/[dD]//" ) ;; 
    564         *) 
    565             IGCM_debug_Exit "create_ts " ${config_UserChoices_PeriodLength} " invalid PeriodLength : choose in *Y, *M, *D." 
    566             IGCM_debug_Verif_Exit_Post ;; 
    567     esac 
    568     echo ${Length} 
    569  
    570     IGCM_debug_PopStack "create_ts_begin_date" 
    571 } 
    572  
    573 ######################################################################## 
    574 # 
    575464#               IS THERE SOME ALLREADY PRODUCED TIME SERIES ? 
    576465#                 IF SO BRING THEM IN THE WORKING DIRECTORY 
     
    615504    # First Time Series Submission 
    616505    FIRST_PASS=TRUE 
    617     Length=$( create_ts_begin_date ${DateBegin} begin) 
     506    Length=$( IGCM_date_DaysInPreviousPeriod ${DateBegin} ${config_UserChoices_PeriodLength} begin) 
    618507    DATE_FIN_JOB_B=$( IGCM_date_AddDaysToGregorianDate ${DateBegin} $(( Length - 1 )) ) 
    619508else 
     
    685574    while [ ${DATE_COUNT} -lt ${PeriodDateEnd} ] ; do 
    686575        (( NBRE_FILE_TOT = NBRE_FILE_TOT + 1 )) 
    687         Length=$( create_ts_next_date ${DATE_COUNT} ) 
     576        Length=$( IGCM_date_DaysInNextPeriod ${DATE_COUNT} ${config_UserChoices_PeriodLength} ) 
    688577        DATE_COUNT=$( IGCM_date_AddDaysToGregorianDate ${DATE_COUNT} ${Length} ) 
    689578    done 
     
    716605            DATE_COURANTE=${DATE_FIN_JOB_B_LOOP} 
    717606        else 
    718             Length=$( create_ts_next_date ${DATE_FIN_JOB_B_LOOP} ) 
     607            Length=$( IGCM_date_DaysInNextPeriod ${DATE_FIN_JOB_B_LOOP} ${config_UserChoices_PeriodLength} ) 
    719608            DATE_COURANTE=$( IGCM_date_AddDaysToGregorianDate ${DATE_FIN_JOB_B_LOOP} ${Length} ) 
    720609        fi 
     
    733622 
    734623        if [ ! ${FIRST_PASS} = TRUE ] && [ ${CURRENT_LOOP} -eq 1 ] ; then 
    735             Length=$( create_ts_next_date ${DATE_FIN_JOB_B_LOOP} ) 
     624            Length=$( IGCM_date_DaysInNextPeriod ${DATE_FIN_JOB_B_LOOP} ${config_UserChoices_PeriodLength} ) 
    736625            DATE_COURANTE=$( IGCM_date_AddDaysToGregorianDate ${DATE_FIN_JOB_B_LOOP} ${Length} ) 
    737626        elif [ -z "${DATE_COURANTE}" ] ; then 
    738627            DATE_COURANTE=${DATE_FIN_JOB_B} 
    739628        else 
    740             Length=$( create_ts_next_date ${DATE_FIN} ) 
     629            Length=$( IGCM_date_DaysInNextPeriod ${DATE_FIN} ${config_UserChoices_PeriodLength} ) 
    741630            DATE_COURANTE=$( IGCM_date_AddDaysToGregorianDate ${DATE_FIN} ${Length} ) 
    742631        fi 
     
    748637        while [ ${COMPTEUR} -lt ${NBRE_FILE_LOOP} ] ; do 
    749638            # 
    750             Length=$( create_ts_next_date ${DATE_LOOP} ) 
     639            Length=$( IGCM_date_DaysInNextPeriod ${DATE_LOOP} ${config_UserChoices_PeriodLength} ) 
    751640            DATE_LOOP=$( IGCM_date_AddDaysToGregorianDate ${DATE_LOOP} ${Length} ) 
    752641            (( TotLength = TotLength + Length )) 
     
    765654        [ ${NBRE_FILE_LOOP} -eq 0 ] && NBRE_FILE_LOOP=${UNIX_MAX_LIMIT} 
    766655 
    767         Length=$( create_ts_next_date ${DATE_FIN} ) 
     656        Length=$( IGCM_date_DaysInNextPeriod ${DATE_FIN} ${config_UserChoices_PeriodLength} ) 
    768657        DATE_COURANTE=$(IGCM_date_AddDaysToGregorianDate ${DATE_FIN} ${Length} ) 
    769658        DATE_FIN=${PeriodDateEnd} 
     
    816705            while [ ${COMPTEUR} -le ${NBRE_FILE_LOOP} ] ; do 
    817706                # 
    818                 Length1=$( create_ts_begin_date ${DATE_LOOP} end) 
     707                Length1=$( IGCM_date_DaysInPreviousPeriod ${DATE_LOOP} ${config_UserChoices_PeriodLength} end) 
    819708                DATE_TAB=$(  IGCM_date_AddDaysToGregorianDate ${DATE_LOOP} $(( 1 - Length1 )) )_${DATE_LOOP} 
    820709 
    821                 Length2=$( create_ts_next_date ${DATE_LOOP} end) 
     710                Length2=$( IGCM_date_DaysInNextPeriod ${DATE_LOOP} ${config_UserChoices_PeriodLength} ) 
    822711                DATE_LOOP=$( IGCM_date_AddDaysToGregorianDate ${DATE_LOOP} ${Length2} ) 
    823712 
     
    849738            # WE CAN CONCATENATE FILES AT THIS POINT 
    850739            [ "${FLAG_B}" = "TRUE" ] && DATE_BUILD_B=${DateBegin}_${DATE_FIN_JOB_B_LOOP_PREC} 
    851             Length=$( create_ts_begin_date ${DATE_COURANTE} end) 
     740            Length=$( IGCM_date_DaysInPreviousPeriod ${DATE_COURANTE} ${config_UserChoices_PeriodLength} end) 
    852741            DATE_BUILD1=$( IGCM_date_AddDaysToGregorianDate ${DATE_COURANTE} -$(( Length - 1 )) ) 
    853742            DATE_BUILD=${DATE_BUILD1}_${DATE_FIN} 
  • trunk/libIGCM/AA_monitoring

    r546 r554  
    136136StandAlone=${StandAlone:=true} 
    137137 
    138 #D- Low level debug : to bypass lib test checks and stack construction 
    139 #D- Default : value from AA_job if any 
     138#D- Path to libIGCM 
     139#D- Default : value from AA_job if any 
     140# WARNING For StandAlone use : To run this script on some machine (ulam and cesium) 
     141# WARNING you must check MirrorlibIGCM variable in sys library. 
     142# WARNING If this variable is true, you must use libIGCM_POST path instead 
     143# WARNING of your running libIGCM directory. 
    140144libIGCM=${libIGCM:=::modipsl::/libIGCM} 
    141 # WARNING for StandAlone used : To run this script on some machine, 
    142 # you must check MirrorlibIGCM variable in sys library. 
    143 # If this variable is true, you must use libIGCM_POST path instead 
    144 # of your running libIGCM directory. 
    145145 
    146146#D- Increased verbosity (1, 2, 3) 
  • trunk/libIGCM/AA_move-and-rename

    r508 r554  
    3333######################################################################## 
    3434 
    35 # Chemin vers MODIPSL 
     35# Path to modipsl 
    3636MODIPSL=${MODIPSL:=::modipsl::} 
    3737 
    38 # Chemin vers libIGCM 
    39 libIGCM=${libIGCM:=${MODIPSL}/libIGCM} 
    40 # Attention : à changer si la machine de post-traitement n'est pas la frontale du serveur de calcul ! 
    41 #             voir précence de la variable MirrorlibIGCM dans votre couche systÚme. 
    42  
     38#D- Path to libIGCM 
     39#D- Default : value from AA_job if any 
     40# WARNING For StandAlone use : To run this script on some machine (ulam and cesium) 
     41# WARNING you must check MirrorlibIGCM variable in sys library. 
     42# WARNING If this variable is true, you must use libIGCM_POST path instead 
     43# WARNING of your running libIGCM directory. 
     44libIGCM=${libIGCM:=::modipsl::/libIGCM} 
    4345 
    4446DEBUG_sys=false 
  • trunk/libIGCM/AA_pack_debug

    r547 r554  
    3333#-Q- sx8brodie # pour recevoir un mail en cas de depassement du temps Elapsed (ou autre pb.) 
    3434#-Q- sx8brodie # @ notification = error 
    35 #-Q- sx8brodie # @ environment  = $DEBUG_debug ; $MODIPSL ; $libIGCM ; $libIGCM_SX ; $SUBMIT_DIR ; $DateBegin ; $PeriodDateBegin ; $PeriodDateEnd ; $StandAlone ; $MASTER 
     35#-Q- sx8brodie # @ environment  = $DEBUG_debug ; $MODIPSL ; $libIGCM ; $libIGCM_SX ; $SUBMIT_DIR ; $DateBegin ; $DateEnd ; $PeriodPack ; $StandAlone ; $MASTER 
    3636#-Q- sx8brodie # @ queue 
    3737#-Q- aix6 #!/bin/ksh 
     
    4949#-Q- aix6 # pour recevoir un mail en cas de depassement du temps Elapsed (ou autre pb.) 
    5050#-Q- aix6 # @ notification = error 
    51 #-Q- aix6 # @ environment  = $DEBUG_debug ; $MODIPSL ; $libIGCM ; $libIGCM_SX ; $SUBMIT_DIR ; $DateBegin ; $PeriodDateBegin ; $PeriodDateEnd ; $StandAlone ; $MASTER 
     51#-Q- aix6 # @ environment  = $DEBUG_debug ; $MODIPSL ; $libIGCM ; $libIGCM_SX ; $SUBMIT_DIR ; $DateBegin ; $DateEnd ; $PeriodPack ; $StandAlone ; $MASTER 
    5252#-Q- aix6 # @ queue 
    5353#-Q- ulam #!/bin/ksh 
     
    6565#-Q- ulam # pour recevoir un mail en cas de depassement du temps Elapsed (ou autre pb.) 
    6666#-Q- ulam # @ notification = error 
    67 #-Q- ulam # @ environment  = $DEBUG_debug ; $MODIPSL ; $libIGCM ; $libIGCM_SX ; $SUBMIT_DIR ; $DateBegin ; $PeriodDateBegin ; $PeriodDateEnd ; $StandAlone ; $MASTER 
     67#-Q- ulam # @ environment  = $DEBUG_debug ; $MODIPSL ; $libIGCM ; $libIGCM_SX ; $SUBMIT_DIR ; $DateBegin ; $DateEnd ; $PeriodPack ; $StandAlone ; $MASTER 
    6868#-Q- ulam # @ queue 
    6969#-Q- sx8mercure #!/bin/ksh 
     
    132132StandAlone=${StandAlone:=true} 
    133133 
    134 #D- Flag to determine begin date for restart pack 
    135 #D- Default : value from AA_job if any 
    136 DateBegin=20000101 
    137  
    138 #D- Flag to determine end date for restart pack 
    139 #D- Default : value from AA_job if any 
    140 DateEnd=20691231 
    141  
    142 #D- Flag to determine pack period 
    143 #D- Default : value from AA_job if any 
    144 period_pack=${period_pack:=10Y} 
    145  
    146 SUBMIT_DIR=${PWD} 
    147  
    148 RUN_DIR_PATH=/scratch/cont003/p86denv/Pack_Test 
     134#D- Path to libIGCM 
     135#D- Default : value from AA_job if any 
     136# WARNING For StandAlone use : To run this script on some machine (ulam and cesium) 
     137# WARNING you must check MirrorlibIGCM variable in sys library. 
     138# WARNING If this variable is true, you must use libIGCM_POST path instead 
     139# WARNING of your running libIGCM directory. 
     140libIGCM=${libIGCM:=::modipsl::/libIGCM} 
    149141 
    150142#-D- $hostname of the MASTER job when SUBMIT_DIR is not visible on postprocessing computer. 
    151143MASTER=${MASTER:=mercure|titane|brodie|vargas} 
    152144 
     145#D- Flag to determine begin date for restart pack 
     146#D- Default : value from AA_job if any 
     147DateBegin=${DateBegin:=20000101) 
     148 
     149#D- Flag to determine end date for restart pack 
     150#D- Default : value from AA_job if any 
     151DateEnd=${DateEnd:=20691231} 
     152 
     153#D- Flag to determine pack period 
     154#D- Default : value from AA_job if any 
     155PeriodPack=${PeriodPack:=10Y} 
     156 
     157#D- Uncomment to run interactively 
     158#D- For testing purpose, will be remove 
     159#SUBMIT_DIR=${PWD} 
     160#RUN_DIR_PATH=${SCRATCHDIR}/Pack_Test 
     161 
     162#D- Increased verbosity (1, 2, 3) 
     163#D- Default : value from AA_job if any 
     164Verbosity=${Verbosity:=3} 
     165 
    153166#D- Low level debug : to bypass lib test checks and stack construction 
    154167#D- Default : value from AA_job if any 
    155 libIGCM=${libIGCM:=/work/cont003/p86denv/PARA_XEON_CM5_IPSLCM5A.16122011_39L/modipsl/libIGCM} 
    156  
    157 # WARNING for StandAlone use : To run this script on some machine, 
    158 # you must check MirrorlibIGCM variable in sys library. 
    159 # If this variable is true, you must use libIGCM_POST path instead 
    160 # of your running libIGCM directory. 
    161  
    162 #D- Increased verbosity (1, 2, 3) 
    163 #D- Default : value from AA_job if any 
    164 Verbosity=${Verbosity:=3} 
    165  
    166 #D- Low level debug : to bypass lib test checks and stack construction 
    167 #D- Default : value from AA_job if any 
    168168DEBUG_debug=${DEBUG_debug:=false} 
     169 
     170#D- Keep following comments for now. Will be remove. 
    169171 
    170172#on veut archiver les fichiers restart 
     
    187189# $1= PATH/config_card d'une simulation avec  
    188190# TagName/JobName/ExperimentName/SpaceName/DateBegin/DateEnd/PATH_SIMUL 
    189 # $2=period_pack en M/m ou Y/y 
     191# $2=PeriodPack en M/m ou Y/y 
    190192 
    191193######################################################################## 
     
    264266#### Preparation de l'environnement 
    265267# repertoire dans lequel seront crees les archives 
    266 #STORE_DEBUG=${R_SAVE}/DEBUG 
    267 #IGCM_sys_MkdirArchive ${STORE_DEBUG} 
    268  
    269 STORE_DEBUG=/scratch/cont003/p86denv/Pack_Test/DEBUG 
    270 mkdir -p ${STORE_DEBUG} 
    271  
    272 #### 0- lecture de config.card  
    273 #### on veut les renseignements suivants :  
    274 #### JobName, PATH_SIMUL, DateBegin et DateEnd 
    275  
     268STORE_DEBUG=${R_SAVE}/DEBUG 
     269IGCM_sys_MkdirArchive ${STORE_DEBUG} 
     270 
     271#STORE_DEBUG=/scratch/cont003/p86denv/Pack_Test/DEBUG 
     272#mkdir -p ${STORE_DEBUG} 
     273 
     274# Switch to script variables meaning (try to be compatible with ipsl_pack TGCC moving procedure) 
    276275JobName=${config_UserChoices_JobName} 
    277 #DateBegin=$( IGCM_date_ConvertFormatToGregorian ${config_UserChoices_DateBegin} ) 
    278 #DateEnd=$(   IGCM_date_ConvertFormatToGregorian ${config_UserChoices_DateEnd}   ) 
    279276PATH_SIMUL=${R_BUFR} 
    280277echo $JobName $PATH_SIMUL $DateBegin $DateEnd 
     
    295292###cat  ${RUN_DIR}/liste_debug_files.txt | xargs dmget  
    296293 
    297 # Rename debug files we will work with 
     294# Rename debug files we will work with using symlinks 
    298295#gawk -F/ '{dest_name=$(NF-2)("_") $(NF); system("cp --preserve " $0 " "dest_name)}' ${RUN_DIR}/liste_debug_files.txt 
    299296gawk -F/ '{dest_name=$(NF-2)("_") $(NF); system("ln -s " $0 " "dest_name)}' ${RUN_DIR}/liste_debug_files.txt 
     
    303300 
    304301### 2- creer les listes de fichiers par periode #### 
    305 ### 2.1- dechiffrer period_pack et le separer en year et month ### 
    306 case ${period_pack} in 
     302### 2.1- dechiffrer PeriodPack et le separer en year et month ### 
     303case ${PeriodPack} in 
    307304*Y|*y)  
    308   periodpackinyear=$( echo ${period_pack} | sed -e 's/[yY]//' )  
     305  periodpackinyear=$( echo ${PeriodPack} | sed -e 's/[yY]//' )  
    309306  periodpackinmonth=0 
    310307  ;; 
     
    312309*M|*m)  
    313310  periodpackinyear=0 
    314   periodpackinmonth=$( echo ${period_pack} | sed -e 's/[mM]//' )  
     311  periodpackinmonth=$( echo ${PeriodPack} | sed -e 's/[mM]//' )  
    315312  ;; 
    316313 
    317314*) 
    318   echo "period_pack doit etre en mois ou annees" 
     315  echo "PeriodPack doit etre en mois ou annees" 
    319316  IGCM_debug_Exit "period pack unit" 
    320317  ;; 
     
    366363    if [ ${date_file} -lt ${date_end_pack} ] && [ ${date_file} -ge ${date_begin_pack} ] ; then  
    367364        echo $( basename ${file} ) >> ${RUN_DIR}/liste_pack_${number_pack}.txt 
     365#    Will not work. Need to find a better ordering. 
    368366#    elif [ ${date_file} -ge ${date_end_pack} ] ; then 
    369367#      break 
     
    375373  date_begin_pack=${year_begin_pack}$( printf "%02i\n" ${month_begin_pack} )01 
    376374 
    377   tar -cvf ${STORE_DEBUG}/debug_pack_${number_pack}.tar --dereference --files-from ${RUN_DIR}/liste_pack_${number_pack}.txt 
     375  # Here we create tar files directly in $STORE. Avoid to create then to copy. 
     376  tar -cvf ${STORE_DEBUG}/${JobName}_${year_begin_pack}_${year_end_pack}_debug.tar --dereference --files-from ${RUN_DIR}/liste_pack_${number_pack}.txt 
    378377  cat  ${RUN_DIR}/liste_pack_${number_pack}.txt | xargs rm  
    379378  mv ${RUN_DIR}/liste_pack_${number_pack}.txt ${STORE_DEBUG} 
  • trunk/libIGCM/AA_pack_restart

    r547 r554  
    3333#-Q- sx8brodie # pour recevoir un mail en cas de depassement du temps Elapsed (ou autre pb.) 
    3434#-Q- sx8brodie # @ notification = error 
    35 #-Q- sx8brodie # @ environment  = $DEBUG_debug ; $MODIPSL ; $libIGCM ; $libIGCM_SX ; $SUBMIT_DIR ; $DateBegin ; $PeriodDateBegin ; $PeriodDateEnd ; $StandAlone ; $MASTER 
     35#-Q- sx8brodie # @ environment  = $DEBUG_debug ; $MODIPSL ; $libIGCM ; $libIGCM_SX ; $SUBMIT_DIR ; $DateBegin ; $DateEnd ; $PeriodPack ; $StandAlone ; $MASTER 
    3636#-Q- sx8brodie # @ queue 
    3737#-Q- aix6 #!/bin/ksh 
     
    4949#-Q- aix6 # pour recevoir un mail en cas de depassement du temps Elapsed (ou autre pb.) 
    5050#-Q- aix6 # @ notification = error 
    51 #-Q- aix6 # @ environment  = $DEBUG_debug ; $MODIPSL ; $libIGCM ; $libIGCM_SX ; $SUBMIT_DIR ; $DateBegin ; $PeriodDateBegin ; $PeriodDateEnd ; $StandAlone ; $MASTER 
     51#-Q- aix6 # @ environment  = $DEBUG_debug ; $MODIPSL ; $libIGCM ; $libIGCM_SX ; $SUBMIT_DIR ; $DateBegin ; $DateEnd ; $PeriodPack ; $StandAlone ; $MASTER 
    5252#-Q- aix6 # @ queue 
    5353#-Q- ulam #!/bin/ksh 
     
    6565#-Q- ulam # pour recevoir un mail en cas de depassement du temps Elapsed (ou autre pb.) 
    6666#-Q- ulam # @ notification = error 
    67 #-Q- ulam # @ environment  = $DEBUG_debug ; $MODIPSL ; $libIGCM ; $libIGCM_SX ; $SUBMIT_DIR ; $DateBegin ; $PeriodDateBegin ; $PeriodDateEnd ; $StandAlone ; $MASTER 
     67#-Q- ulam # @ environment  = $DEBUG_debug ; $MODIPSL ; $libIGCM ; $libIGCM_SX ; $SUBMIT_DIR ; $DateBegin ; $DateEnd ; $PeriodPack ; $StandAlone ; $MASTER 
    6868#-Q- ulam # @ queue 
    6969#-Q- sx8mercure #!/bin/ksh 
     
    132132StandAlone=${StandAlone:=true} 
    133133 
    134 #D- Flag to determine begin date for restart pack 
    135 #D- Default : value from AA_job if any 
    136 DateBegin=20000101 
    137  
    138 #D- Flag to determine end date for restart pack 
    139 #D- Default : value from AA_job if any 
    140 DateEnd=20691231 
    141  
    142 #D- Flag to determine pack period 
    143 #D- Default : value from AA_job if any 
    144 period_pack=${period_pack:=10Y} 
    145  
    146 SUBMIT_DIR=${PWD} 
    147  
    148 RUN_DIR_PATH=/scratch/cont003/p86denv/Pack_Test 
     134#D- Path to libIGCM 
     135#D- Default : value from AA_job if any 
     136# WARNING For StandAlone use : To run this script on some machine (ulam and cesium) 
     137# WARNING you must check MirrorlibIGCM variable in sys library. 
     138# WARNING If this variable is true, you must use libIGCM_POST path instead 
     139# WARNING of your running libIGCM directory. 
     140libIGCM=${libIGCM:=::modipsl::/libIGCM} 
    149141 
    150142#-D- $hostname of the MASTER job when SUBMIT_DIR is not visible on postprocessing computer. 
    151143MASTER=${MASTER:=mercure|titane|brodie|vargas} 
    152144 
     145#D- Flag to determine begin date for restart pack 
     146#D- Default : value from AA_job if any 
     147DateBegin=${DateBegin:=20000101) 
     148 
     149#D- Flag to determine end date for restart pack 
     150#D- Default : value from AA_job if any 
     151DateEnd=${DateEnd:=20691231} 
     152 
     153#D- Flag to determine pack period 
     154#D- Default : value from AA_job if any 
     155PeriodPack=${PeriodPack:=10Y} 
     156 
     157#D- Uncomment to run interactively 
     158#D- For testing purpose, will be remove 
     159#SUBMIT_DIR=${PWD} 
     160#RUN_DIR_PATH=${SCRATCHDIR}/Pack_Test 
     161 
     162#D- Increased verbosity (1, 2, 3) 
     163#D- Default : value from AA_job if any 
     164Verbosity=${Verbosity:=3} 
     165 
    153166#D- Low level debug : to bypass lib test checks and stack construction 
    154167#D- Default : value from AA_job if any 
    155 libIGCM=${libIGCM:=/work/cont003/p86denv/PARA_XEON_CM5_IPSLCM5A.16122011_39L/modipsl/libIGCM} 
    156  
    157 # WARNING for StandAlone use : To run this script on some machine, 
    158 # you must check MirrorlibIGCM variable in sys library. 
    159 # If this variable is true, you must use libIGCM_POST path instead 
    160 # of your running libIGCM directory. 
    161  
    162 #D- Increased verbosity (1, 2, 3) 
    163 #D- Default : value from AA_job if any 
    164 Verbosity=${Verbosity:=3} 
    165  
    166 #D- Low level debug : to bypass lib test checks and stack construction 
    167 #D- Default : value from AA_job if any 
    168168DEBUG_debug=${DEBUG_debug:=false} 
     169 
     170#D- Keep following comments for now. Will be remove. 
    169171 
    170172#on veut archiver les fichiers restart 
     
    187189# $1= PATH/config_card d'une simulation avec  
    188190# TagName/JobName/ExperimentName/SpaceName/DateBegin/DateEnd/PATH_SIMUL 
    189 # $2=period_pack en M/m ou Y/y 
     191# $2=PeriodPack en M/m ou Y/y 
    190192 
    191193######################################################################## 
     
    264266#### Preparation de l'environnement 
    265267# repertoire dans lequel seront crees les archives 
    266 #STORE_RESTART=${R_SAVE}/RESTART 
    267 #IGCM_sys_MkdirArchive ${STORE_RESTART} 
    268  
    269 STORE_RESTART=/scratch/cont003/p86denv/Pack_Test/RESTART 
    270 mkdir -p ${STORE_RESTART} 
    271  
    272 #### 0- lecture de config.card  
    273 #### on veut les renseignements suivants :  
    274 #### JobName, PATH_SIMUL, DateBegin et DateEnd 
    275  
     268STORE_RESTART=${R_SAVE}/RESTART 
     269IGCM_sys_MkdirArchive ${STORE_RESTART} 
     270 
     271#STORE_RESTART=/scratch/cont003/p86denv/Pack_Test/RESTART 
     272#mkdir -p ${STORE_RESTART} 
     273 
     274# Switch to script variables meaning (try to be compatible with ipsl_pack TGCC moving procedure) 
    276275JobName=${config_UserChoices_JobName} 
    277 #DateBegin=$( IGCM_date_ConvertFormatToGregorian ${config_UserChoices_DateBegin} ) 
    278 #DateEnd=$(   IGCM_date_ConvertFormatToGregorian ${config_UserChoices_DateEnd}   ) 
    279276PATH_SIMUL=${R_BUFR} 
    280277echo $JobName $PATH_SIMUL $DateBegin $DateEnd 
     
    305302 
    306303### 2- creer les listes de fichiers par periode #### 
    307 ### 2.1- dechiffrer period_pack et le separer en year et month ### 
    308 case ${period_pack} in 
     304### 2.1- dechiffrer PeriodPack et le separer en year et month ### 
     305case ${PeriodPack} in 
    309306*Y|*y)  
    310   periodpackinyear=$( echo ${period_pack} | sed -e 's/[yY]//' )  
     307  periodpackinyear=$( echo ${PeriodPack} | sed -e 's/[yY]//' )  
    311308  periodpackinmonth=0 
    312309  ;; 
     
    314311*M|*m)  
    315312  periodpackinyear=0 
    316   periodpackinmonth=$( echo ${period_pack} | sed -e 's/[mM]//' )  
     313  periodpackinmonth=$( echo ${PeriodPack} | sed -e 's/[mM]//' )  
    317314  ;; 
    318315 
    319316*) 
    320   echo "period_pack doit etre en mois ou annees" 
     317  echo "PeriodPack doit etre en mois ou annees" 
    321318  IGCM_debug_Exit "period pack unit" 
    322319  ;; 
     
    368365    if [ ${date_file} -lt ${date_end_pack} ] && [ ${date_file} -ge ${date_begin_pack} ] ; then  
    369366        echo $( basename ${file} ) >> ${RUN_DIR}/liste_pack_${number_pack}.txt 
     367#    Will not work. Need to find a better ordering. 
    370368#    elif [ ${date_file} -ge ${date_end_pack} ] ; then 
    371369#      break 
     
    377375  date_begin_pack=${year_begin_pack}$( printf "%02i\n" ${month_begin_pack} )01 
    378376 
    379   tar -cvf ${STORE_RESTART}/restart_pack_${number_pack}.tar --dereference --files-from ${RUN_DIR}/liste_pack_${number_pack}.txt 
     377  # Here we create tar files directly in $STORE. Avoid to create then to copy. 
     378  tar -cvf ${STORE_RESTART}/${JobName}_${year_begin_pack}_${year_end_pack}_restart.tar --dereference --files-from ${RUN_DIR}/liste_pack_${number_pack}.txt 
    380379  cat  ${RUN_DIR}/liste_pack_${number_pack}.txt | xargs rm  
    381380  mv ${RUN_DIR}/liste_pack_${number_pack}.txt ${STORE_RESTART} 
  • trunk/libIGCM/AA_rebuild_fromArchive

    r544 r554  
    136136StandAlone=${StandAlone:=true} 
    137137 
    138 #D- Low level debug : to bypass lib test checks and stack construction 
    139 #D- Default : value from AA_job if any 
     138#D- Path to libIGCM 
     139#D- Default : value from AA_job if any 
     140# WARNING For StandAlone use : To run this script on some machine (ulam and cesium) 
     141# WARNING you must check MirrorlibIGCM variable in sys library. 
     142# WARNING If this variable is true, you must use libIGCM_POST path instead 
     143# WARNING of your running libIGCM directory. 
    140144libIGCM=${libIGCM:=::modipsl::/libIGCM} 
    141 # WARNING for StandAlone used : To run this script on some machine, 
    142 # you must check MirrorlibIGCM variable in sys library. 
    143 # If this variable is true, you must use libIGCM_POST path instead 
    144 # of your running libIGCM directory. 
    145145 
    146146#-D- $hostname of the MASTER job when SUBMIT_DIR is not visible on postprocessing computer. 
  • trunk/libIGCM/AA_rebuild_fromWorkdir

    r544 r554  
    136136StandAlone=${StandAlone:=true} 
    137137 
    138 #D- Low level debug : to bypass lib test checks and stack construction 
    139 #D- Default : value from AA_job if any 
     138#D- Path to libIGCM 
     139#D- Default : value from AA_job if any 
     140# WARNING For StandAlone use : To run this script on some machine (ulam and cesium) 
     141# WARNING you must check MirrorlibIGCM variable in sys library. 
     142# WARNING If this variable is true, you must use libIGCM_POST path instead 
     143# WARNING of your running libIGCM directory. 
    140144libIGCM=${libIGCM:=::modipsl::/libIGCM} 
    141 # WARNING for StandAlone used : To run this script on some machine, 
    142 # you must check MirrorlibIGCM variable in sys library. 
    143 # If this variable is true, you must use libIGCM_POST path instead 
    144 # of your running libIGCM directory. 
    145145 
    146146#-D- $hostname of the MASTER job when SUBMIT_DIR is not visible on postprocessing computer. 
  • trunk/libIGCM/libIGCM_config/libIGCM_config.ksh

    r545 r554  
    211211 
    212212  #================================== 
    213   # Post :  
     213  # Read Post section:  
    214214  IGCM_card_DefineArrayFromSection ${SUBMIT_DIR}/config.card Post 
    215215 
     
    222222    IGCM_debug_Print 3 "${option} : ${auxprint}" 
    223223  done 
     224 
     225  #================================== 
     226  # Define default value to keep compatibility with previous card: means before changes due to TGCC  
     227  [ X${config_Post_PackFrequency} = X ] && config_Post_PackFrequency=${config_Post_RebuildFrequency} 
    224228 
    225229  #==================================================== 
     
    341345  typeset i 
    342346 
     347  # Check RebuildFrequency against key frequencies : PeriodLength ; PackFrequency ; TimeSeriesFrequency ; SeasonalFrequency 
    343348  if ( [ ! X${config_Post_RebuildFrequency} = X${NULL_STR} ] && [ ! X${config_Post_RebuildFrequency} = XNONE ] ) ; then 
    344349    AsynchronousRebuild=true 
     
    348353    IGCM_debug_Print 1 "Check coherence between RebuildFrequency and PeriodLength" 
    349354    IGCM_post_CheckModuloFrequency config_Post_RebuildFrequency config_UserChoices_PeriodLength 
     355    IGCM_debug_Print 1 "Check coherence between PackFrequency and RebuildFrequency" 
     356    IGCM_post_CheckModuloFrequency config_Post_PackFrequency config_Post_RebuildFrequency 
    350357    IGCM_debug_Print 1 "Check coherence between TimeSeriesFrequency and RebuildFrequency" 
    351358    IGCM_post_CheckModuloFrequency config_Post_TimeSeriesFrequency config_Post_RebuildFrequency 
     
    357364    IGCM_debug_Print 1 "Proceed with standard post-treatment pathway" 
    358365    echo 
    359     #modulo (TimeSeriesFrequency/SeasonalFrequency and PeriodLenght) must be zero 
     366    #modulo (PeriodLength and TimeSeriesFrequency/SeasonalFrequency) must be zero 
    360367    IGCM_debug_Print 1 "Check coherence between TimeSeriesFrequency and PeriodLength" 
    361368    IGCM_post_CheckModuloFrequency config_Post_TimeSeriesFrequency config_UserChoices_PeriodLength 
    362369    IGCM_debug_Print 1 "Check coherence between SeasonalFrequency and PeriodLength" 
    363370    IGCM_post_CheckModuloFrequency config_Post_SeasonalFrequency   config_UserChoices_PeriodLength 
     371  fi 
     372 
     373  # Check PackFrequency against other key frequencies  
     374  # Modulo (PackFrequency and TimeSeriesFrequency/SeasonalFrequency and PeriodLenght) must be zero 
     375  if ( [ ! X${config_Post_PackFrequency} = X${NULL_STR} ] && [ ! X${config_Post_PackFrequency} = XNONE ] ) ; then 
     376    Pack=true 
     377    # 
     378    IGCM_debug_Print 1 "Check coherence between PackFrequency and PeriodLength" 
     379    IGCM_post_CheckModuloFrequency config_Post_PackFrequency config_UserChoices_PeriodLength 
     380    IGCM_debug_Print 1 "Check coherence between TimeSeriesFrequency and PackFrequency" 
     381    IGCM_post_CheckModuloFrequency config_Post_TimeSeriesFrequency config_Post_PackFrequency 
     382    IGCM_debug_Print 1 "Check coherence between SeasonalFrequency and PackFrequency" 
     383    IGCM_post_CheckModuloFrequency config_Post_SeasonalFrequency config_Post_PackFrequency 
     384  else 
     385    Pack=false 
    364386  fi 
    365387 
  • trunk/libIGCM/libIGCM_date/libIGCM_date.ksh

    r544 r554  
    825825 
    826826#D-#================================================================== 
     827#D-function IGCM_date_DaysInPreviousPeriod () 
     828#D-* Purpose: Give the numbers of days during the previous prd1 period from grg1 date # OLD create_ts_begin_date 
     829#D-* Usage: IGCM_date_DaysInPreviousPeriod grg1 prd1 [end] 
     830#D-         where grg1 gregorian date is in the form yyyymmdd 
     831#D-         where prd1 period is in the form N[Yy], N[Mm], N[Dd]. N integer 
     832#D-         where [end] is an optionnal keyword to specify grg1 is the end of prd1 
     833#D- 
     834function IGCM_date_DaysInPreviousPeriod { 
     835  IGCM_debug_PushStack "IGCM_date_DaysInPreviousPeriod" $@ 
     836  typeset Length Period 
     837  Period=${2} 
     838  case ${Period} in 
     839  *Y|*y) 
     840    PeriodLengthInYears=$( echo ${Period} | awk -F '[yY]' '{print $1}' ) 
     841    IGCM_date_GetYearMonth ${1} year month 
     842    year=$( IGCM_date_SupressZeros ${year} ) 
     843    if [ X${2} = Xend ] ; then 
     844      (( year = year - PeriodLengthInYears + 1)) 
     845    fi 
     846    (( Length=0 )) 
     847    (( i=0 )) 
     848    until [ $i -ge $PeriodLengthInYears ] ; do 
     849      (( Length = Length + $( IGCM_date_DaysInYear $(( year + i )) ) ))  
     850      (( i=i+1 )) 
     851    done 
     852    ;; 
     853  *M|*m) 
     854    PeriodLengthInMonths=$( echo ${Period} | awk -F '[mM]' '{print $1}' ) 
     855    IGCM_date_GetYearMonth ${1} year month 
     856    year=$( IGCM_date_SupressZeros ${year} ) 
     857    if [ X${2} = Xend ] ; then 
     858      (( month = month - PeriodLengthInMonths + 1 )) 
     859    fi       
     860    (( year0 = year )) 
     861    if [ $month -le 0 ] ; then 
     862      (( month = month + 12 )) 
     863      year=$( printf "%04i\n" $(( year - 1 )) ) 
     864    fi 
     865    month=$( printf "%02i\n" ${month} ) 
     866    (( Length=0 )) 
     867    (( i=0 )) 
     868    until [ $i -ge $PeriodLengthInMonths ] ; do 
     869      if [ $(( month + i )) -lt 13 ] ; then 
     870        (( Length = Length + $( IGCM_date_DaysInMonth $year $(( month + i )) ) )) 
     871      else 
     872        (( year = year0 + 1 )) 
     873        (( Length = Length + $( IGCM_date_DaysInMonth $year $(( month + i - 12 )) ) )) 
     874      fi 
     875      (( i=i+1 )) 
     876    done 
     877    ;; 
     878  *D|*d) 
     879    Length=$( echo ${Period} | sed -e "s/[dD]//" ) ;; 
     880  *) 
     881    IGCM_debug_Exit "IGCM_date_DaysInPreviousPeriod " ${Period} " invalid PeriodLength : choose in *Y, *M, *D." 
     882    IGCM_debug_Verif_Exit_Post ;; 
     883  esac 
     884  echo ${Length} 
     885 
     886  IGCM_debug_PopStack "IGCM_date_DaysInPreviousPeriod" 
     887} 
     888 
     889#D-#================================================================== 
     890#D-function IGCM_date_DaysInNextPeriod () 
     891#D-* Purpose: Give the numbers of days during the next prd1 period from grg1 date # OLD create_ts_next_date 
     892#D-* Usage: IGCM_date_DaysInNextPeriod grg1 prd1 
     893#D-         where grg1 gregorian date is in the form yyyymmdd 
     894#D-         where prd1 period is in the form N[Yy], N[Mm], N[Dd]. N integer 
     895#D- 
     896function IGCM_date_DaysInNextPeriod { 
     897  IGCM_debug_PushStack "IGCM_date_DaysInNextPeriod" $@ 
     898  typeset Length Period 
     899  Period=${2} 
     900  case ${Period} in 
     901  *Y|*y)  
     902    PeriodLengthInYears=$( echo ${Period} | awk -F '[yY]' '{print $1}' ) 
     903    IGCM_date_GetYearMonth ${1} year month 
     904    year=$( IGCM_date_SupressZeros ${year} ) 
     905    (( Length=0 )) 
     906    (( i=0 )) 
     907    until [ $i -ge $PeriodLengthInYears ] ; do 
     908      (( Length = Length + $( IGCM_date_DaysInYear $(( year + i + 1 )) ) ))  
     909      (( i=i+1 )) 
     910    done 
     911    ;; 
     912  *M|*m)  
     913    PeriodLengthInMonths=$( echo ${Period} | awk -F '[mM]' '{print $1}' ) 
     914    IGCM_date_GetYearMonth ${1} year month 
     915    year=$( IGCM_date_SupressZeros ${year} ) 
     916    (( year0 = year )) 
     917    if [ $(( month + 1 )) -lt 13 ] ; then 
     918      month0=$(( month + 1 )) 
     919    else 
     920      month0=$(( month + 1 - 12 )) 
     921      (( year = year0 + 1 )) 
     922    fi 
     923    (( Length=0 )) 
     924    (( i=0 )) 
     925    until [ $i -ge $PeriodLengthInMonths ] ; do 
     926      if [ $(( month0 + i )) -lt 13 ] ; then 
     927        (( Length = Length + $( IGCM_date_DaysInMonth $year $(( month0 + i )) ) )) 
     928      else 
     929        (( year = year0 + 1 )) 
     930        (( Length = Length + $( IGCM_date_DaysInMonth $year $(( month0 + i - 12 )) ) )) 
     931      fi 
     932      (( i=i+1 )) 
     933    done 
     934    ;; 
     935  *D|*d) 
     936    Length=$( echo ${Period} | sed -e "s/[dD]//" ) ;; 
     937  *) 
     938    IGCM_debug_Exit "IGCM_date_DaysInNextPeriod " ${Period} " invalid PeriodLength : choose in *Y, *M, *D." 
     939    IGCM_debug_Verif_Exit_Post ;; 
     940  esac 
     941  echo ${Length} 
     942 
     943  IGCM_debug_PopStack "IGCM_date_DaysInNextPeriod" 
     944} 
     945 
     946 
     947#D-#================================================================== 
    827948#D-function IGCM_date_Check 
    828949#D- * Purpose: Check the present file by comparison with a reference file 
  • trunk/libIGCM/libIGCM_post/libIGCM_post.ksh

    r545 r554  
    2626  POST=false 
    2727  RebuildFrequency=false 
     28  PackFrequency=false 
    2829  TimeSeriesFrequency=false 
    2930  SeasonalFrequency=false 
     31  unset list_post 
    3032  # 
    3133  # ONLY IF SOMETHING NEEDS TO BE DONE (EATHER TIME SERIES OR SEASONAL) COMPUTE THE MODULOS 
     
    3335  if [ X${AsynchronousRebuild} = Xtrue ] ; then 
    3436    list_post="RebuildFrequency" 
     37  fi 
     38  # 
     39  if [ X${Pack} = Xtrue ] ; then 
     40    list_post="${list_post} PackFrequency" 
    3541  fi 
    3642  # 
     
    102108  fi 
    103109 
    104   #============ TIME SERIES POST-TREATMENT ===========# 
     110  #============ TIME SERIES POST-PROCESSING ===========# 
    105111  if [ ${TimeSeriesFrequency} = true ] ; then 
    106112 
     
    329335  fi 
    330336 
    331   #=============  SEASONAL POST-TREATMENT ============# 
     337  #=============  SEASONAL POST-PROCESSING ============# 
    332338  if [ ${SeasonalFrequency} = true ] ; then 
    333339    # 
    334     IGCM_debug_Print 1 "SEASONNAL POST-TREATMENT" 
     340    IGCM_debug_Print 1 "SEASONNAL POST-PROCESSING" 
    335341    echo 
    336342    # 
     
    406412  fi 
    407413 
    408   #============== REBUILD POST-TREATMENT =============# 
     414  #============== REBUILD POST-PROCESSING =============# 
    409415  if [ X${AsynchronousRebuild} = Xtrue ] ; then 
    410416    # ----------------------------------------------------------------------------------- 
     
    424430  if [ ${RebuildFrequency} = true ] ; then 
    425431    if ( [ ${config_Post_RebuildFromArchive} = true ] ) ; then 
    426       IGCM_debug_Print 1 "REBUILD POST-TREATMENT FROM ARCHIVE" 
     432      IGCM_debug_Print 1 "REBUILD POST-PROCESSING FROM ARCHIVE" 
    427433      echo 
    428434      # 
    429435      script=rebuild_fromArchive 
    430436    else 
    431       IGCM_debug_Print 1 "REBUILD POST-TREATMENT FROM WORKDIR" 
     437      IGCM_debug_Print 1 "REBUILD POST-PROCESSING FROM WORKDIR" 
    432438      echo 
    433439      # 
     
    468474EOF 
    469475  fi 
     476 
     477  #============== PACK PROCESSING FOR RESTART AND DEBUG FILES =============# 
     478  if [ ${PackFrequency} = true ] ; then 
     479    IGCM_debug_Print 1 "PACK POST-PROCESSING" 
     480    echo 
     481    ## Need to Remember This One 
     482    SavedDateBegin=${DateBegin} 
     483    ## Need to Remember This One 
     484    SavedDateEnd=${DateEnd} 
     485    # 
     486    PackDateBegin=$( IGCM_date_AddDaysToGregorianDate ${PeriodDateEnd} -$( IGCM_date_DaysInPreviousPeriod ${PeriodDateEnd} end ) ) 
     487    # 
     488    script=pack_debug 
     489    # 
     490    Script_Post_Output=${script}.${PeriodDateEnd} 
     491    # 
     492    listVarEnv="DEBUG_debug,MODIPSL,libIGCM,libIGCM_SX,SUBMIT_DIR,MASTER,DateBegin,DateEnd,PeriodPack,StandAlone" 
     493    IGCM_sys_RshPost <<-EOF 
     494    export DEBUG_debug=${DEBUG_debug} 
     495    export MODIPSL=${MODIPSL} 
     496    export libIGCM_SX=${libIGCM} 
     497    export libIGCM=${libIGCM_POST} 
     498    export SUBMIT_DIR=${SUBMIT_DIR} 
     499    export MASTER=${MASTER} 
     500    export DateBegin=${PackDateBegin} 
     501    export DateEnd=${PeriodDateEnd} 
     502    export PeriodPack=${config_UserChoices_PackFrequency} 
     503    export StandAlone=false 
     504    export listVarEnv=${listVarEnv} 
     505    export Script_Post_Output=${Script_Post_Output} 
     506    . ${libIGCM_POST}/libIGCM_debug/libIGCM_debug.ksh 
     507    . ${libIGCM_POST}/libIGCM_sys/libIGCM_sys.ksh 
     508    IGCM_sys_MkdirWork ${POST_DIR} 
     509    IGCM_debug_Verif_Exit_Post 
     510#    IGCM_sys_QsubPost ${script} 
     511EOF 
     512  fi 
     513 
     514  export DateBegin=${SavedDateBegin} 
     515  export DateEnd=${SavedDateEnd} 
    470516 
    471517  IGCM_debug_PopStack "IGCM_post_Submit" 
Note: See TracChangeset for help on using the changeset viewer.