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
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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} 
Note: See TracChangeset for help on using the changeset viewer.