Changeset 1489 for trunk


Ignore:
Timestamp:
09/17/19 10:55:34 (5 years ago)
Author:
flavoni
Message:

razionalitation of ensembles and ins_job (-e), remove useless options

Location:
trunk/libIGCM
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/libIGCM/ins_job

    r1475 r1489  
    359359      echo "Directory ${j}/${JobName} exists already. It will not be overwritten." 
    360360      echo "Remove the existing directory or change JobName before relaunching ins_job." 
    361       continue 
     361      #continue 
     362      exit   
    362363    fi 
    363364    echo "=> Submit directory ${JobName} will be created with cards from EXPERIMENTS/${config_UserChoices_ExpType}" 
     
    370371    fi 
    371372    rm -f ${j}/${F_CFG} 
    372     rm -f ${j}/${F_CFG_ENS} 
     373    # rm -f ${j}/${F_CFG_ENS} 
    373374    rm -f ${j}/${F_CFG}.bak 
    374375    j=${j}/${JobName} 
     
    452453# Limited to hindcast/forecast and date restart Ensemble for the time being 
    453454if [ ${x_e} = 'true' ] ; then 
     455    if [ ! -f ${F_CFG_ENS} ] ; then 
     456       echo "" 
     457       echo "################## WARNING ##################" 
     458       echo "No ensemble.card available in current directory" 
     459       echo "" 
     460       exit 
     461      #  continue 
     462   fi 
     463 
    454464  #.. Read input data from ensemble.card .. 
    455465  SUBMIT_DIR=${SUBMIT_DIR_ENS} 
     
    460470  IGCM_ensemble_Init 
    461471 
    462   if [[ ${ensemble_Ens_PARAMETRIC_active} = 'y' ]] ; then 
    463     echo "WARNING: Parametric Ensemble is not implemented yet..." 
    464   fi 
    465  
    466472  if [[ ${ensemble_Ens_DATE_active} = 'y' ]] ; then 
    467473    IGCM_sys_Cd ${SUBMIT_DIR} 
     
    469475    # As it says 
    470476    IGCM_sys_Cd ${SUBMIT_DIR} 
    471     IGCM_ensemble_DatePeriodicStarts 
    472     # As it says 
    473     IGCM_sys_Cd ${SUBMIT_DIR} 
    474477    IGCM_ensemble_DateNonPeriodicStarts 
    475     # Clean 
    476     IGCM_sys_Rm -rf ${RUN_DIR} 
    477478  fi 
    478479 
     
    484485    IGCM_ensemble_CastPeriodicStarts 
    485486    # As it says 
    486     IGCM_sys_Cd ${SUBMIT_DIR} 
    487     IGCM_ensemble_CastNonPeriodicStarts 
    488     # As it says 
    489     IGCM_sys_Cd ${SUBMIT_DIR} 
    490     IGCM_ensemble_CastMemberList 
    491     # Done 
    492     #IGCM_sys_Cp ${RUN_DIR}/CreatedDir.txt ${SUBMIT_DIR} 
    493     IGCM_sys_Cd ${SUBMIT_DIR} 
    494     # Clean 
    495     IGCM_sys_Rm -rf ${RUN_DIR} 
    496   fi 
     487    #IGCM_sys_Cd ${SUBMIT_DIR} 
     488    #IGCM_ensemble_CastMemberList 
     489  fi 
     490  # Done 
     491  IGCM_sys_Cd ${SUBMIT_DIR} 
     492  # Clean 
     493  IGCM_sys_Rm -rf ${RUN_DIR} 
     494   
    497495fi 
    498496#- 
  • trunk/libIGCM/libIGCM_ensemble/libIGCM_ensemble.ksh

    r1475 r1489  
    2121# IPSL (2014) 
    2222# 
     23# >>> Uniform DATE and PERTURB ensemble (remove old, useless), ADD some functions <<< 
     24# add : IGCM_ensemble_InitRunDir, IGCM_ensemble_FilesUpdate (unique function) 
     25# DATE           ensemble : removed periodic case 
     26#                         : all dates are NON-periodic 
     27# CAST PERTURBED ensemble : removed NON-periodic case 
     28#                         : all casts are periodic (*Y or *M) 
     29#                         : removed Ens_PERTURB_PERTU_MAP_LIST case 
     30#  
     31# Author: Simona Flavoni & Nicola Lebas 
     32# Contact: Simona.Flavoni__at__locean-ipsl.upmc.fr 
     33# IPSL (2019) 
    2334#************************************************************** 
    2435 
     
    3041  IGCM_card_DefineVariableFromOption ${F_CFG_ENS} Ens_PERTURB active 
    3142  IGCM_card_DefineVariableFromOption ${F_CFG_ENS} Ens_DATE active 
    32   IGCM_card_DefineVariableFromOption ${F_CFG_ENS} Ens_PARAMETRIC active 
     43  
     44  Job_Period=10 # PARAMETER USED in function IGCM_ensemble_FilesUpdate 
    3345 
    3446  IGCM_debug_Print 1 "Ens_PERTURB ACTIVE     = ${ensemble_Ens_PERTURB_active}" 
    3547  IGCM_debug_Print 1 "Ens_DATE ACTIVE        = ${ensemble_Ens_DATE_active}" 
    36   IGCM_debug_Print 1 "Ens_PARAMETRIC ACTIVE  = ${ensemble_Ens_PARAMETRIC_active}" 
    3748  echo "" 
    3849 
     
    4859} 
    4960 
    50 # Set Alphanumerical variables ajust to member nb 
    51 function IGCM_ensemble_SetAlpha 
    52 { 
    53   IGCM_debug_PushStack "IGCM_ensemble_SetAlpha" 
    54  
    55   set -A Alpha      A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 
    56   set -A AlphaMonth a b c d e f g h i j k l 
    57  
    58   IGCM_debug_PopStack "IGCM_ensemble_SetAlpha" 
    59 } 
    60  
    61 ############### Perturb ENSEMBLE ################# 
    62 function IGCM_ensemble_CastInit 
    63 { 
    64   IGCM_debug_PushStack "IGCM_ensemble_CastInit" 
    65  
     61 
     62############### ENSEMBLE ################# 
     63function IGCM_ensemble_InitRunDir 
     64{ 
     65 
     66  if [ -d ${SUBMIT_DIR}/${JobName} ] ; then 
     67    IGCM_debug_Print 3 "STOP directory ${SUBMIT_DIR}/${JobName} already exists." 
     68    exit # SF: stop at this point because in ENSEMBLE case need to be stopped  
     69  fi 
    6670  IGCM_sys_Mkdir ${RUN_DIR} 
    6771 
     
    7680    IGCM_sys_Cp ${SUBMIT_DIR}/Qclean.*      ${RUN_DIR} 
    7781  fi 
     82 
     83} 
     84 
     85############### Create Member Directory ENSEMBLE #################  
     86function IGCM_ensemble_CreateMemberDir 
     87{ 
     88 
     89 #  if [ ! -d  ${SUBMIT_DIR}/${StartDir}/${MemberDir} ] ; then 
     90     IGCM_sys_Mkdir ${SUBMIT_DIR}/${StartDir}/${MemberDir} 
     91     IGCM_sys_Cd ${SUBMIT_DIR}/${StartDir}/${MemberDir} 
     92     ln -s ../../COMP 
     93     ln -s ../../PARAM 
     94     ln -s ../../POST 
     95     ln -s ../../DRIVER 
     96     IGCM_sys_Cd ${RUN_DIR} 
     97     IGCM_sys_Cp config.card run.card.init ${SUBMIT_DIR}/${StartDir}/${MemberDir} 
     98     IGCM_sys_Cp Job_${config_UserChoices_JobName} ${SUBMIT_DIR}/${StartDir}/${MemberDir}/${JobName} 
     99 
     100     # Dump command to be lauched 
     101     echo "cd ${StartDir}/${MemberDir}/ ;"    >> ${RUN_DIR}/Qsub.${StartDir}.sh 
     102     echo "${SUBMIT} ${JobName} ; cd -"       >> ${RUN_DIR}/Qsub.${StartDir}.sh 
     103 
     104     echo "cd ${StartDir}/${MemberDir}/ ;"    >> ${RUN_DIR}/Qclean.latestPackperiod.${StartDir}.sh 
     105     echo "${libIGCM}/clean_latestPackperiod.job ; cd -"  >> ${RUN_DIR}/Qclean.latestPackperiod.${StartDir}.sh 
     106 
     107     echo "cd ${StartDir}/${MemberDir}/ ;"    >> ${RUN_DIR}/Qclean.PeriodLength.${StartDir}.sh 
     108     echo "${libIGCM}/clean_PeriodLength.job ; cd -"  >> ${RUN_DIR}/Qclean.PeriodLength.${StartDir}.sh 
     109 
     110} 
     111 
     112 
     113############### FilesUpdate ENSEMBLE ################# 
     114function IGCM_ensemble_FilesUpdate 
     115{ 
     116  IGCM_debug_PushStack "IGCM_ensemble_FilesUpdate" 
     117 
     118  # Debug Print : 
     119  echo  
     120  IGCM_debug_Print 1 "IGCM_ensemble_FilesUpdate :" 
     121 
     122  EnsembleType=${1} 
     123  MemberNb=${2} 
     124  HumanDateBegin=$(   IGCM_date_ConvertFormatToHuman ${3} ) 
     125  HumanDateEnd=$(     IGCM_date_ConvertFormatToHuman ${4} ) 
     126  HumanRestartDate=$( IGCM_date_ConvertFormatToHuman ${5} ) 
     127  if [[ X${6} != "X" ]]; then  
     128    initFrom=${6} # non periodic config (INITFROM could be different between members) 
     129  else  
     130    initFrom=$(eval echo $\ensemble_Ens_${EnsembleType}_INITFROM) # periodic (same INITFROM value) 
     131  fi 
     132 
     133  if [[ X${7} != "X" ]]; then  
     134    initPath=${7} # non periodic config (INITPATH could be different between members) 
     135  else  
     136    initPath=$(eval echo $\ensemble_Ens_${EnsembleType}_INITPATH) # periodic (same INITPATH value) 
     137  fi 
    78138   
    79   ## Init some variables 
    80   CastPeriodicStart=false 
    81   CastNonPeriodicStart=false 
    82   CastRestartNonPer=false 
    83   CastLengthNonPer=false 
     139  # ==> config.card 
     140  # [ENSEMBLE] 
     141  IGCM_card_WriteOption ${SUBMIT_DIR}/${StartDir}/${MemberDir}/config.card Ensemble EnsembleRun 'y' 
     142  IGCM_card_WriteOption ${SUBMIT_DIR}/${StartDir}/${MemberDir}/config.card Ensemble EnsembleName $(eval echo $\ensemble_Ens_${EnsembleType}_NAME) 
     143  IGCM_card_WriteOption ${SUBMIT_DIR}/${StartDir}/${MemberDir}/config.card Ensemble EnsembleDate ${HumanDateBegin} 
     144  IGCM_card_WriteOption ${SUBMIT_DIR}/${StartDir}/${MemberDir}/config.card Ensemble EnsembleType "Ens_${EnsembleType}" 
    84145   
    85   # Useful? 
    86   #if [ -f  ${SUBMIT_DIR}/CreatedDir.txt ] ; then 
    87   #  IGCM_sys_Cp ${SUBMIT_DIR}/CreatedDir.txt ${RUN_DIR} 
    88   #fi 
    89   # Useful? 
    90   #if [ -f  ${SUBMIT_DIR}/Qsub.sh ] ; then 
    91   #  IGCM_sys_Cp ${SUBMIT_DIR}/Qsub.sh ${RUN_DIR} 
    92   #fi 
    93   echo ${PWD} 
     146  # [UserChoices] 
     147  IGCM_card_WriteOption ${SUBMIT_DIR}/${StartDir}/${MemberDir}/config.card UserChoices JobName   ${MemberDir} 
     148  IGCM_card_WriteOption ${SUBMIT_DIR}/${StartDir}/${MemberDir}/config.card UserChoices DateBegin ${HumanDateBegin} 
     149  IGCM_card_WriteOption ${SUBMIT_DIR}/${StartDir}/${MemberDir}/config.card UserChoices DateEnd   ${HumanDateEnd} 
     150  # Adhoc exceptioN for CMIP6 : update realisation number in member field. 
     151  if ( [ X"$( echo ${config_UserChoices_ExpType} | grep CMIP6 )" != "X" ] ) ; then 
     152      IGCM_card_WriteOption ${SUBMIT_DIR}/${StartDir}/${MemberDir}/config.card UserChoices Member "r${MemberNb}i1p1f1" 
     153  fi 
     154 
     155  # [Restarts] 
     156  IGCM_card_WriteOption ${SUBMIT_DIR}/${StartDir}/${MemberDir}/config.card Restarts OverRule "n" 
     157  # [ATM/OCE/...] 
     158  for comp in ${config_ListOfComponents[*]} ; do 
     159    IGCM_card_WriteOption ${SUBMIT_DIR}/${StartDir}/${MemberDir}/config.card ${comp} Restart "y" 
     160    IGCM_card_WriteOption ${SUBMIT_DIR}/${StartDir}/${MemberDir}/config.card ${comp} RestartDate ${HumanRestartDate} 
     161    IGCM_card_WriteOption ${SUBMIT_DIR}/${StartDir}/${MemberDir}/config.card ${comp} RestartJobName ${initFrom} 
     162    IGCM_card_WriteOption ${SUBMIT_DIR}/${StartDir}/${MemberDir}/config.card ${comp} RestartPath ${initPath} 
     163 
     164    # Adhoc exception for CMIP6 : exclude XIOS from the restart overrule mechanism. 
     165    if ( [ X${comp} = XIOS ] && [ X"$( echo ${config_UserChoices_ExpType} | grep CMIP6 )" != "X" ] ) ; then 
     166    IGCM_card_WriteOption ${SUBMIT_DIR}/${StartDir}/${MemberDir}/config.card ${comp} Restart "n" 
     167    fi 
     168  done 
     169 
     170  unset initFrom 
     171 
     172  # ==> Job 
     173  sed -e "s/\(#.*Script_Output_\)${config_UserChoices_JobName}\(\.*\)/\1${MemberDir}\2/" \ 
     174      -e "s/\(#.*\)${config_UserChoices_JobName}\(\.*\)/\1${MemberDir} \2/"              \ 
     175      -e "s/^PeriodNb=.*/PeriodNb=${Job_Period}/"                                        \ 
     176      ${SUBMIT_DIR}/${StartDir}/${MemberDir}/Job_${MemberDir} > Job_${MemberDir}.tmp 
     177  IGCM_sys_Mv Job_${MemberDir}.tmp ${SUBMIT_DIR}/${StartDir}/${MemberDir}/Job_${MemberDir} 
     178 
     179  IGCM_debug_PopStack "IGCM_ensemble_FilesUpdate" 
     180} 
     181 
     182 
     183############### Perturb ENSEMBLE ################# 
     184function IGCM_ensemble_CastInit 
     185{ 
     186  IGCM_debug_PushStack "IGCM_ensemble_CastInit" 
     187 
     188  IGCM_ensemble_InitRunDir 
     189   
     190  ## Init some variables (only periodic case) 
     191  CastPeriodicStart=true 
     192   
     193  echo " pwd id : ${PWD}" 
    94194 
    95195  IGCM_card_DefineVariableFromOption ${F_CFG_ENS} Ens_PERTURB active 
     
    98198  IGCM_card_DefineVariableFromOption ${F_CFG_ENS} Ens_PERTURB END_INIT 
    99199  IGCM_card_DefineVariableFromOption ${F_CFG_ENS} Ens_PERTURB PERIODICITY 
    100   IGCM_card_DefineArrayFromOption    ${F_CFG_ENS} Ens_PERTURB NONPERIODIC 
    101   IGCM_card_DefineArrayFromOption    ${F_CFG_ENS} Ens_PERTURB RESTART_NONPERIODIC 
    102200  IGCM_card_DefineVariableFromOption ${F_CFG_ENS} Ens_PERTURB LENGTH 
    103   IGCM_card_DefineArrayFromOption    ${F_CFG_ENS} Ens_PERTURB LENGTH_NONPERIODIC 
    104201  IGCM_card_DefineVariableFromOption ${F_CFG_ENS} Ens_PERTURB MEMBER 
    105   IGCM_card_DefineArrayFromOption    ${F_CFG_ENS} Ens_PERTURB PERTU_MAP_LIST 
    106202  IGCM_card_DefineArrayFromOption    ${F_CFG_ENS} Ens_PERTURB MEMBER_NAMESLIST 
    107203  IGCM_card_DefineVariableFromOption ${F_CFG_ENS} Ens_PERTURB MEMBER_INITFROM 
     
    122218  IGCM_debug_Print 1 "END_INIT          = ${ensemble_Ens_PERTURB_END_INIT}" 
    123219  IGCM_debug_Print 1 "PERIODICITY       = ${ensemble_Ens_PERTURB_PERIODICITY}" 
    124   IGCM_debug_Print 1 "NONPERIODIC       = ${ensemble_Ens_PERTURB_NONPERIODIC[*]}" 
    125   IGCM_debug_Print 1 "RESTART_NONPERIODIC=${ensemble_Ens_PERTURB_RESTART_NONPERIODIC[*]}" 
    126220  IGCM_debug_Print 1 "LENGTH            = ${ensemble_Ens_PERTURB_LENGTH}" 
    127   IGCM_debug_Print 1 "LENGTH_NONPERIODIC= ${ensemble_Ens_PERTURB_LENGTH_NONPERIODIC[*]}" 
    128221  IGCM_debug_Print 1 "MEMBER            = ${ensemble_Ens_PERTURB_MEMBER}" 
    129   IGCM_debug_Print 1 "PERTU_MAP_LIST    = ${ensemble_Ens_PERTURB_PERTU_MAP_LIST[*]}" 
    130222  IGCM_debug_Print 1 "MEMBER_NAMESLIST  = ${ensemble_Ens_PERTURB_MEMBER_NAMESLIST[*]}" 
    131223  IGCM_debug_Print 1 "MEMBER_INITFROM   = ${ensemble_Ens_PERTURB_MEMBER_INITFROM}" 
     
    139231  IGCM_debug_Print 1 "ListOfComponents  = ${config_ListOfComponents[*]}" 
    140232 
    141   ### Retro compatibility with former param name ### 
    142   if [ X"${ensemble_Ens_PERTURB_MEMBER_LIST[0]}" != "XOption" ]; 
    143   then 
    144       if [ X"${ensemble_Ens_PERTURB_PERTU_MAP_LIST[0]}" = "XOption" ]; 
    145       then 
    146           ensemble_Ens_PERTURB_PERTU_MAP_LIST=${ensemble_Ens_PERTURB_MEMBER_LIST} 
    147           IGCM_debug_Print 1 "WARNING: PERTU_MAP_LIST is deprecacated, please use PERTURB_PERTU_MAP_LIST instead." 
    148       else 
    149           IGCM_debug_Print 1 "WARNING: both PERTURB_PERTU_MAP_LIST and PERTU_MAP_LIST are specified!" 
    150           IGCM_debug_Print 1 "Ignore PERTU_MAP_LIST which is deprecated." 
    151       fi 
    152   fi 
    153   ####### End of retro compatibility code ####### 
    154233 
    155234  ### Check unset variables and set them to empty 
    156235  # Following var are set because they could be unset in some  
    157236  # use case (ex: non periodic if periodic is active...) 
    158   if [[ X"${ensemble_Ens_PERTURB_RESTART_NONPERIODIC[0]}" = "XOption" || X"${ensemble_Ens_PERTURB_RESTART_NONPERIODIC[0]}" = "X" ]]; 
    159   then  
    160       ensemble_Ens_PERTURB_RESTART_NONPERIODIC[0]=_0_ 
    161       CastRestartNonPer=false 
    162   else 
    163       CastRestartNonPer=true 
    164   fi 
    165   if [[ X"${ensemble_Ens_PERTURB_PERTU_MAP_LIST[0]}" = "XOption" || X"${ensemble_Ens_PERTURB_PERTU_MAP_LIST[0]}" = "X" ]]; 
    166   then  
    167       ensemble_Ens_PERTURB_PERTU_MAP_LIST[0]=_0_ 
    168   fi 
    169   if [[ X"${ensemble_Ens_PERTURB_LENGTH_NONPERIODIC[0]}" = "XOption" || X"${ensemble_Ens_PERTURB_LENGTH_NONPERIODIC[0]}" = "X" ]]; 
    170   then  
    171       CastLengthNonPer=false 
    172       ensemble_Ens_PERTURB_LENGTH_NONPERIODIC[0]=_0_ 
    173   else 
    174       CastLengthNonPer=true 
    175   fi 
    176   if [ X"${ensemble_Ens_PERTURB_NONPERIODIC[0]}" = "XOption" ]; 
    177   then  
    178       ensemble_Ens_PERTURB_NONPERIODIC[0]=_0_ 
    179   fi 
    180237  if [[ "${ensemble_Ens_PERTURB_PERIODICITY}" = _0_ || "${ensemble_Ens_PERTURB_PERIODICITY}" = '' ]]; 
    181238  then  
     
    223280    ;; 
    224281  esac 
    225   IGCM_ensemble_SetAlpha ${ensemble_Ens_PERTURB_MEMBER} 
    226282 
    227283  # A few checks Period case: 
     
    251307  esac 
    252308 
    253 ################################ 
    254   if [[ ${#ensemble_Ens_PERTURB_NONPERIODIC[*]} != ${#ensemble_Ens_PERTURB_RESTART_NONPERIODIC[*]} && CastRestartNonPer = "true" ]] ; then 
    255     IGCM_debug_Exit "IGCM_ensemble_CastInit: NONPERIODIC and RESTART_NONPERIODIC lists have different sizes" 
    256     IGCM_debug_Verif_Exit 
    257   fi 
    258   if [[ ${#ensemble_Ens_PERTURB_NONPERIODIC[*]} > 0 ]] && [[ ${ensemble_Ens_PERTURB_NONPERIODIC[0]} != _0_ ]]; then 
    259     DateNonPeriodicStart=true 
    260      
    261     # Use LENGTH if no NONPERIODIC_LENGTH given 
    262     if [[ ${#ensemble_Ens_PERTURB_LENGTH_NONPERIODIC[*]} < ${#ensemble_Ens_PERTURB_NONPERIODIC[*]} || ${ensemble_Ens_PERTURB_LENGTH_NONPERIODIC[0]} = _0_ ]] ; then 
    263       IGCM_debug_Print 1 "WARNING: LENGTH_NONPERIODIC is not fill (or not correctly). Use LENGTH value '${ensemble_Ens_PERTURB_LENGTH}' for all NONPERIODIC runs" 
    264       echo "WARNING: LENGTH_NONPERIODIC is not fill (or not correctly). Use LENGTH value '${ensemble_Ens_PERTURB_LENGTH}' for all NONPERIODIC runs" 
    265       DateNum=0 
    266       while [ ${DateNum} -lt ${#ensemble_Ens_PERTURB_NONPERIODIC[*]} ] ; do 
    267         ensemble_Ens_PERTURB_LENGTH_NONPERIODIC[${DateNum}]=${ensemble_Ens_PERTURB_LENGTH} 
    268         (( DateNum = DateNum + 1 )) 
    269       done 
    270     fi 
    271     # Check lengths 
    272     DateNum=0 
    273     while [ ${DateNum} -lt ${#ensemble_Ens_PERTURB_NONPERIODIC[*]} ] ; do 
    274         # - Check LENGTH_NONPERIODIC 
    275         case ${ensemble_Ens_PERTURB_LENGTH_NONPERIODIC[${DateNum}]} in 
    276             _0_) 
    277                 IGCM_debug_Print 1 "non-periodic start not active" 
    278                 CastNonPeriodicStart=false 
    279                 break 
    280                 ;; 
    281             *[Yy]|*[Mm]) 
    282                 IGCM_debug_Print 1 "Non-periodic duration : ${ensemble_Ens_PERTURB_LENGTH_NONPERIODIC[${DateNum}]}" 
    283                 CastNonPeriodicStart=true 
    284                 ;; 
    285             *) 
    286                 IGCM_debug_Exit "IGCM_ensemble_CastInit ${ensemble_Ens_PERTURB_LENGTH_NONPERIODIC[${DateNum}]} : invalid LENGTH" 
    287                 IGCM_debug_Exit "choose in *Y or *M" 
    288                 IGCM_debug_Verif_Exit ;; 
    289         esac 
    290         (( DateNum = DateNum + 1 )) 
    291          
    292         # - Check RESTART_NONPERIODIC 
    293         if [[ DateNonPeriodicStart ]]; then 
    294             case ${ensemble_Ens_PERTURB_RESTART_NONPERIODIC[${DateNum}]} in 
    295                 _0_) 
    296                     IGCM_debug_Exit "IGCM_ensemble_CastInit ${ensemble_Ens_PERTURB_RESTART_NONPERIODIC[${DateNum}]} : invalid NON PERIODIC RESTART" 
    297                     IGCM_debug_Verif_Exit ;; 
    298             esac 
    299         fi 
    300     done 
    301      
    302     # Use INITFROM if no INITFROM_NONPERIODIC given 
    303     if [ ${#ensemble_Ens_PERTURB_INITFROM_NONPERIODIC[*]} -lt ${#ensemble_Ens_PERTURB_NONPERIODIC[*]} ] ; then 
    304       IGCM_debug_Print 1 "WARNING: INITFROM_NONPERIODIC is not fill (or not correctly). Use INITFROM value '${ensemble_Ens_PERTURB_INITFROM}' for all NONPERIODIC runs" 
    305       DateNum=0 
    306       while [ ${DateNum} -lt ${#ensemble_Ens_PERTURB_NONPERIODIC[*]} ] ; do 
    307         ensemble_Ens_PERTURB_INITFROM_NONPERIODIC[${DateNum}]=${ensemble_Ens_PERTURB_INITFROM} 
    308         (( DateNum = DateNum + 1 )) 
    309       done 
    310     fi 
    311      
    312     # Use INITPATH if no INITPATH_NONPERIODIC given 
    313     if [ ${#ensemble_Ens_PERTURB_INITPATH_NONPERIODIC[*]} -lt ${#ensemble_Ens_PERTURB_NONPERIODIC[*]} ] ; then 
    314       IGCM_debug_Print 1 "WARNING: INITPATH_NONPERIODIC is not fill (or not correctly). Use INITPATH value '${ensemble_Ens_PERTURB_INITPATH}' for all NONPERIODIC runs" 
    315       DateNum=0 
    316       while [ ${DateNum} -lt ${#ensemble_Ens_PERTURB_NONPERIODIC[*]} ] ; do 
    317         ensemble_Ens_PERTURB_INITPATH_NONPERIODIC[${DateNum}]=${ensemble_Ens_PERTURB_INITPATH} 
    318         (( DateNum = DateNum + 1 )) 
    319       done 
    320     fi 
    321   else 
    322     IGCM_debug_Print 1 "Non-Periodic start NOT ACTIVE" 
    323     DateNonPeriodicStart=false 
    324   fi 
    325 ################################ 
    326  
    327   # A few checks for the Non-Periodic case: 
    328    
    329   # A few checks for the PERTU_MAP_LIST case: 
    330   case ${ensemble_Ens_PERTURB_PERTU_MAP_LIST[0]} in 
    331   _0_) 
    332     IGCM_debug_Print 1 "list of perturbation maps not active" 
    333     CastMemberList=false 
    334     ;; 
    335   *) 
    336     if [ ${CastPeriodicStart} = "true" ] ; then 
    337       IGCM_debug_Exit "list of perturbation maps for periodic start not implemented, will stop execution" 
    338       IGCM_debug_Verif_Exit 
    339     elif [ ${CastNonPeriodicStart} = "true" ] ; then 
    340       IGCM_debug_Exit "list of perturbation maps for non periodic start not implemented, will stop execution" 
    341       IGCM_debug_Verif_Exit 
    342     fi 
    343  
    344     # test that MEMBER_NAMESLIST and PERTU_MAP_LIST have the same size 
    345  
    346     if [ ${#ensemble_Ens_PERTURB_PERTU_MAP_LIST[*]} -ne ${#ensemble_Ens_PERTURB_MEMBER_NAMESLIST[*]} ] ; then 
    347       IGCM_debug_Exit "number of elements in PERTU_MAP_LIST and MEMBER_NAMESLIST differ" 
    348       IGCM_debug_Verif_Exit 
    349     fi 
    350  
    351     IGCM_debug_Print 1 "list of perturbation maps : ${ensemble_Ens_PERTURB_PERTU_MAP_LIST[*]}" 
    352     IGCM_debug_Print 1 "list of members names : ${ensemble_Ens_PERTURB_MEMBER_NAMESLIST[*]}" 
    353     CastMemberList=true 
    354     ;; 
    355   esac 
    356  
    357 #  IGCM_debug_Exit "fin du test PERTU_MAP_LIST" 
    358 #  IGCM_debug_Verif_Exit 
    359  
    360309  # Need to know all the restart filename of the component we will apply the noise to 
    361310  IGCM_card_DefineArrayFromOption config.card ListOfComponents ${PerturbComp} 
     
    399348 
    400349  # - Determine number of day(s) in LENGTH 
    401     DureeLengthInDays=$(( $( IGCM_date_DaysInCurrentPeriod ${DateBegin} ${ensemble_Ens_PERTURB_LENGTH} ) - 1 )) 
     350    DurationLengthInDays=$(( $( IGCM_date_DaysInCurrentPeriod ${DateBegin} ${ensemble_Ens_PERTURB_LENGTH} ) - 1 )) 
    402351 
    403352  # - Determine DateEnd 
    404     (( DateEnd = $( IGCM_date_AddDaysToGregorianDate ${DateBegin} ${DureeLengthInDays} ) )) 
     353    (( DateEnd = $( IGCM_date_AddDaysToGregorianDate ${DateBegin} ${DurationLengthInDays} ) )) 
    405354 
    406355  # - Build directory name 
    407     IGCM_ensemble_CastDirectoryName ${ensemble_Ens_PERTURB_NAME} ${ensemble_Ens_PERTURB_PERIODICITY} $year $month $StartDir 
     356    #SF IGCM_ensemble_CastDirectoryName ${ensemble_Ens_PERTURB_NAME} ${ensemble_Ens_PERTURB_PERIODICITY} ${year} ${month} ${StartDir} 
     357    IGCM_ensemble_CastDirectoryName ${ensemble_Ens_PERTURB_NAME} ${ensemble_Ens_PERTURB_PERIODICITY} ${year} ${month} 
     358    # StartDir="${ensemble_Ens_PERTURB_NAME}" 
    408359 
    409360  # - Determine RestartDate 
     
    428379 
    429380  # - Loop over members 
    430     i=0 
    431     while [ $i -lt ${ensemble_Ens_PERTURB_MEMBER} ] ; do 
    432       MemberDir="${StartDir}${Alpha[$i]}" 
     381    i=1 
     382    while [ $i -le ${ensemble_Ens_PERTURB_MEMBER} ] ; do 
     383      if [ $((i)) -le 9 ] ; then 
     384        MemberDir="${StartDir}"-0"$((i))" 
     385      else  
     386        MemberDir="${StartDir}-$((i))" 
     387      fi 
    433388      echo 
    434389      IGCM_debug_Print 3 "${MemberDir}" 
     
    438393    # * Create directory if it doesn't exist and copy/link files 
    439394      if [ ! -d  ${SUBMIT_DIR}/${StartDir}/${MemberDir} ] ; then 
    440         IGCM_sys_Mkdir ${SUBMIT_DIR}/${StartDir}/${MemberDir} 
    441         IGCM_sys_Cd ${SUBMIT_DIR}/${StartDir}/${MemberDir} 
    442         ln -s ../../COMP 
    443         ln -s ../../PARAM 
    444         ln -s ../../POST 
    445         ln -s ../../DRIVER 
    446         IGCM_sys_Cd ${RUN_DIR} 
    447         IGCM_sys_Cp config.card run.card.init ${SUBMIT_DIR}/${StartDir}/${MemberDir} 
    448         IGCM_sys_Cp Job_${config_UserChoices_JobName} ${SUBMIT_DIR}/${StartDir}/${MemberDir}/${JobName} 
    449  
    450         # Dump command to be lauched 
    451         echo "cd ${StartDir}/${MemberDir}/ ;"    >> ${RUN_DIR}/Qsub.${StartDir}.sh 
    452         echo "${SUBMIT} ${JobName} ; cd -"       >> ${RUN_DIR}/Qsub.${StartDir}.sh 
    453  
    454         echo "cd ${StartDir}/${MemberDir}/ ;"    >> ${RUN_DIR}/Qclean.PeriodLength.${StartDir}.sh 
    455         echo "${libIGCM}/clean_PeriodLength.job ; cd -"  >> ${RUN_DIR}/Qclean.PeriodLength.${StartDir}.sh 
     395      
     396        # * Create ${SUBMIT_DIR}/${StartDir}/${MemberDir} directories 
     397        #   link COMP PARAM POST and DRIVER 
     398        #   cp config.card, run.card.init, Job_ 
     399        #   and Dump command to be launched  
     400        IGCM_ensemble_CreateMemberDir 
    456401 
    457402        # * Update files : config.card, Job_, COMP/comp.card 
    458         IGCM_ensemble_CastFilesUpdate ${DateBegin} ${DateEnd} ${RestartDate} 
     403        IGCM_ensemble_FilesUpdate "PERTURB" ${i} ${DateBegin} ${DateEnd} ${RestartDate}  
    459404 
    460405        # * Apply noise on restart file 
     
    468413    IGCM_sys_Cp ${RUN_DIR}/Qsub.${StartDir}.sh ${SUBMIT_DIR} 
    469414    IGCM_sys_Cp ${RUN_DIR}/Qclean.PeriodLength.${StartDir}.sh ${SUBMIT_DIR} 
     415    IGCM_sys_Cp ${RUN_DIR}/Qclean.latestPackperiod.${StartDir}.sh ${SUBMIT_DIR} 
    470416 
    471417  # - Next DateBegin 
     
    482428} 
    483429 
    484 function IGCM_ensemble_CastNonPeriodicStarts 
    485 { 
    486   IGCM_debug_PushStack "IGCM_ensemble_CastNonPeriodicStarts" 
    487  
    488   #.. Manage non periodic starts => Loop over DateBegin .. 
    489   #   ========================== 
    490  
    491   [ ${CastNonPeriodicStart} = false ] && return 
    492  
    493   echo 
    494   IGCM_debug_Print 1 "Manage non periodic starts" 
    495  
    496   DateNum=0 
    497 # ... Loop over ensemble_Ens_PERTURB_NONPERIODIC ... 
    498   echo ">${DateNum}<" 
    499   echo ">${#ensemble_Ens_PERTURB_NONPERIODIC[*]}<" 
    500   while [ ${DateNum} -lt ${#ensemble_Ens_PERTURB_NONPERIODIC[*]} ] ; do 
    501     DateBegin=${ensemble_Ens_PERTURB_NONPERIODIC[${DateNum}]} 
    502     Duree=${ensemble_Ens_PERTURB_LENGTH_NONPERIODIC[${DateNum}]} 
    503     echo ">${DateBegin}<" 
    504     echo ">${Duree}<" 
    505  
    506   # - Determine number of day(s) in LENGTH_NONPERIODIC 
    507     IGCM_date_GetYearMonth ${DateBegin} year month 
    508     DureeLengthInDays=$(( $( IGCM_date_DaysInCurrentPeriod ${DateBegin} ${Duree} ) - 1 )) 
    509  
    510   # - Build directory name 
    511     echo "========================================================================" 
    512     echo "ensemble_Ens_PERTURB_NAME = ${ensemble_Ens_PERTURB_NAME}" 
    513     IGCM_ensemble_CastDirectoryName ${ensemble_Ens_PERTURB_NAME} ${Duree} $year $month $StartDir 
    514  
    515   # - Determine DateEnd 
    516     (( DateEnd = $( IGCM_date_AddDaysToGregorianDate ${DateBegin} ${DureeLengthInDays} ) )) 
    517     echo ">${DateEnd}<" 
    518     echo "tout va bien 1" 
    519  
    520   # - Determine RestartDate 
    521     if [[ ${CastRestartNonPer} == "true" ]]; then 
    522         RestartDate=${ensemble_Ens_PERTURB_RESTART_NONPERIODIC[${DateNum}]} 
    523     else 
    524         (( Offset = -1 )) 
    525         (( RestartDate = $( IGCM_date_AddDaysToGregorianDate ${DateBegin} ${Offset} ) )) 
    526     fi 
    527      
    528     IGCM_debug_Print 2 "${DateBegin} => ${DateEnd} : ${StartDir}" 
    529  
    530   # -  Does $StartDir already exist ? 
    531     #echo "tout va bien 2" ${StartDir} 
    532     if [ ! -d ${SUBMIT_DIR}/${StartDir} ] ; then 
    533       echo "create dir" 
    534       IGCM_sys_Mkdir ${SUBMIT_DIR}/${StartDir} 
    535       IGCM_sys_Cd ${SUBMIT_DIR}/${StartDir} 
    536       ln -s ../../.resol . 
    537       ln -s ../../.libmpi . 
    538       IGCM_sys_Cd ${RUN_DIR} 
    539       echo "${DateBegin} ${DateEnd} ${StartDir}" >> ${RUN_DIR}/CreatedDir.txt 
    540     fi 
    541     PeriodDateEnd=$( grep -m1 ${StartDir} ${RUN_DIR}/CreatedDir.txt | cut -f2 -d\  ) 
    542  
    543   # - Create directory in which to store new restart files if it does'nt already exist 
    544     RestartDir=${STORAGE}/IGCM_IN/${config_UserChoices_TagName}/${StartDir} 
    545     IGCM_sys_MkdirArchive ${RestartDir} 
    546  
    547   # - Loop over members 
    548     i=0 
    549     while [ $i -lt ${ensemble_Ens_PERTURB_MEMBER} ] ; do 
    550       MemberDir="${StartDir}${Alpha[$i]}" 
    551       IGCM_debug_Print 3 "${MemberDir}" 
    552  
    553       JobName="Job_${MemberDir}" 
    554  
    555     # * Create directory if it doesn't exist and copy files 
    556       if [ ! -d  ${SUBMIT_DIR}/${StartDir}/${MemberDir} ] ; then 
    557         IGCM_sys_Mkdir ${SUBMIT_DIR}/${StartDir}/${MemberDir} 
    558         #IGCM_sys_Cp -r COMP/ PARAM/ ${StartDir}/${MemberDir} 
    559         IGCM_sys_Cd ${SUBMIT_DIR}/${StartDir}/${MemberDir} 
    560         ln -s ../../COMP 
    561         ln -s ../../PARAM 
    562         ln -s ../../POST 
    563         ln -s ../../DRIVER 
    564         IGCM_sys_Cd ${RUN_DIR} 
    565         IGCM_sys_Cp config.card run.card.init ${SUBMIT_DIR}/${StartDir}/${MemberDir} 
    566         IGCM_sys_Cp Job_${config_UserChoices_JobName} ${SUBMIT_DIR}/${StartDir}/${MemberDir}/Job_${MemberDir} 
    567  
    568         # Dump command to be lauched 
    569         echo "cd ${StartDir}/${MemberDir}/ ;"    >> Qsub.${StartDir}.sh 
    570         echo "${SUBMIT} ${JobName} ; cd -"       >> Qsub.${StartDir}.sh 
    571  
    572         echo "cd ${StartDir}/${MemberDir}/ ;"    >> ${RUN_DIR}/Qclean.PeriodLength.${StartDir}.sh 
    573         echo "${libIGCM}/clean_PeriodLength.job ; cd -"  >> ${RUN_DIR}/Qclean.PeriodLength.${StartDir}.sh 
    574  
    575         # * Update files : config.card, Job_, COMP/comp.card 
    576         echo "${PeriodDateEnd} ? ${DateEnd}" 
    577         if [ ${PeriodDateEnd} -gt ${DateEnd} ] ; then 
    578           DateEnd=${PeriodDateEnd} 
    579         fi 
    580          
    581         IGCM_ensemble_CastFilesUpdate ${DateBegin} ${DateEnd} ${RestartDate} 
    582  
    583         # * Apply noise on restart file 
    584         IGCM_ensemble_CastPerturbFile 
    585       fi 
    586  
    587       (( i = i + 1 )) 
    588     done 
    589  
    590     # Done. Save ${StartDir} submission text file 
    591     IGCM_sys_Cp ${RUN_DIR}/Qsub.${StartDir}.sh ${SUBMIT_DIR} 
    592     IGCM_sys_Cp ${RUN_DIR}/Qclean.PeriodLength.${StartDir}.sh ${SUBMIT_DIR} 
    593  
    594     (( DateNum = DateNum + 1 )) 
    595   done 
    596   IGCM_debug_PopStack "IGCM_ensemble_CastNonPeriodicStarts" 
    597 } 
    598  
    599430function IGCM_ensemble_CastMemberList 
    600431{ 
     
    615446  eval DateBegin=\${ensemble_Ens_PERTURB_BEGIN_INIT} 
    616447 
    617   IGCM_date_GetYearMonth ${DateBegin} year month 
     448  IGCM_date_GetYearMonth ${DateBegin} ${year} ${month} 
    618449 
    619450  # - Determine number of day(s) in LENGTH 
    620   DureeLengthInDays=$(( $( IGCM_date_DaysInCurrentPeriod ${DateBegin} ${ensemble_Ens_PERTURB_LENGTH} ) - 1 )) 
     451  DurationLengthInDays=$(( $( IGCM_date_DaysInCurrentPeriod ${DateBegin} ${ensemble_Ens_PERTURB_LENGTH} ) - 1 )) 
    621452 
    622453  # - Determine DateEnd 
    623   DateEnd=$( IGCM_date_AddDaysToGregorianDate ${DateBegin} ${DureeLengthInDays} ) 
     454  DateEnd=$( IGCM_date_AddDaysToGregorianDate ${DateBegin} ${DurationLengthInDays} ) 
    624455 
    625456  # bad hack enforce yearly for parent directory name 
    626457  # - Build directory name 
    627   IGCM_ensemble_CastDirectoryName ${ensemble_Ens_PERTURB_NAME} 1Y $year $month $StartDir 
     458  IGCM_ensemble_CastDirectoryName ${ensemble_Ens_PERTURB_NAME} 1Y ${year} ${month} 
     459  #SF IGCM_ensemble_CastDirectoryName ${ensemble_Ens_PERTURB_NAME} 1Y ${year} ${month} ${StartDir} 
    628460 
    629461  # - Determine RestartDate 
     
    648480 
    649481  # - Loop over members 
    650   i=0 
    651   nbmember=${#ensemble_Ens_PERTURB_PERTU_MAP_LIST[*]} 
     482  i=1 
     483  nbmember=${ensemble_Ens_PERTURB_MEMBER} 
    652484  while [ $i -lt $nbmember ] ; do 
    653     MemberDir=${ensemble_Ens_PERTURB_MEMBER_NAMESLIST[${i}]} 
    654     MemberVec=${ensemble_Ens_PERTURB_PERTU_MAP_LIST[${i}]} 
     485    MemberVec=${ensemble_PERTURB_MEMBER_[${i}]} 
     486    MemberDir=${config_UserChoices_Member} 
     487    echo  
     488    IGCM_debug_Print 3 "print nbmember: ${nbmember}" 
     489    IGCM_debug_Print 3 "print MemberVec: ${ensemble_PERTURB_MEMBER[${i}]}" 
    655490 
    656491    JobName="Job_${MemberDir}" 
     
    660495    # * Create directory if it doesn't exist and copy/link files 
    661496    if [ ! -d  ${SUBMIT_DIR}/${StartDir}/${MemberDir} ] ; then 
    662       IGCM_sys_Mkdir ${SUBMIT_DIR}/${StartDir}/${MemberDir} 
    663       IGCM_sys_Cd ${SUBMIT_DIR}/${StartDir}/${MemberDir} 
    664       ln -s ../../COMP 
    665       ln -s ../../PARAM 
    666       ln -s ../../POST 
    667       ln -s ../../DRIVER 
    668       IGCM_sys_Cd ${RUN_DIR} 
    669       IGCM_sys_Cp config.card run.card.init ${SUBMIT_DIR}/${StartDir}/${MemberDir} 
    670       IGCM_sys_Cp Job_${config_UserChoices_JobName} ${SUBMIT_DIR}/${StartDir}/${MemberDir}/${JobName} 
    671  
    672       # Dump command to be lauched 
    673       echo "cd ${StartDir}/${MemberDir}/ ;"     >> ${RUN_DIR}/Qsub.${StartDir}.sh 
    674       echo "${SUBMIT} ${JobName} ; cd -"        >> ${RUN_DIR}/Qsub.${StartDir}.sh 
    675  
    676       echo "cd ${StartDir}/${MemberDir}/ ;"     >> ${RUN_DIR}/Qclean.PeriodLength.${StartDir}.sh 
    677       echo "${libIGCM}/clean_PeriodLength.job ; cd -"   >> ${RUN_DIR}/Qclean.PeriodLength.${StartDir}.sh 
     497 
     498      # * Create ${SUBMIT_DIR}/${StartDir}/${MemberDir} directories 
     499      #   link COMP PARAM POST and DRIVER 
     500      #   cp config.card, run.card.init, Job_ 
     501      #   and Dump command to be launched  
     502      IGCM_ensemble_CreateMemberDir 
    678503 
    679504      # * Update files : config.card, Job_, COMP/comp.card 
    680       IGCM_ensemble_CastFilesUpdate ${DateBegin} ${DateEnd} ${RestartDate} 
     505      IGCM_ensemble_FilesUpdate "PERTURB" ${i} ${DateBegin} ${DateEnd} ${RestartDate} ${InitFrom} ${InitPath} 
    681506 
    682507      # * Apply noise on restart file 
     
    692517 
    693518  IGCM_debug_PopStack "IGCM_ensemble_CastMemberList" 
    694 } 
    695  
    696 function IGCM_ensemble_CastFilesUpdate 
    697 { 
    698   IGCM_debug_PushStack "IGCM_ensemble_CastFilesUpdate" 
    699  
    700   # Debug Print : 
    701   echo 
    702   IGCM_debug_Print 1 "IGCM_ensemble_CastFilesUpdate :" 
    703  
    704   HumanDateBegin=$(   IGCM_date_ConvertFormatToHuman ${1} ) 
    705   HumanDateEnd=$(     IGCM_date_ConvertFormatToHuman ${2} ) 
    706   HumanRestartDate=$( IGCM_date_ConvertFormatToHuman ${3} ) 
    707   # ==> config.card 
    708   IGCM_card_WriteOption ${SUBMIT_DIR}/${StartDir}/${MemberDir}/config.card Ensemble EnsembleRun 'y' 
    709   IGCM_card_WriteOption ${SUBMIT_DIR}/${StartDir}/${MemberDir}/config.card Ensemble EnsembleName ${ensemble_Ens_PERTURB_NAME} 
    710   IGCM_card_WriteOption ${SUBMIT_DIR}/${StartDir}/${MemberDir}/config.card Ensemble EnsembleDate ${StartDir} 
    711   IGCM_card_WriteOption ${SUBMIT_DIR}/${StartDir}/${MemberDir}/config.card Ensemble EnsembleType "Ens_PERTURB" 
    712  
    713   IGCM_card_WriteOption ${SUBMIT_DIR}/${StartDir}/${MemberDir}/config.card UserChoices JobName   ${MemberDir} 
    714   IGCM_card_WriteOption ${SUBMIT_DIR}/${StartDir}/${MemberDir}/config.card UserChoices DateBegin ${HumanDateBegin} 
    715   IGCM_card_WriteOption ${SUBMIT_DIR}/${StartDir}/${MemberDir}/config.card UserChoices DateEnd   ${HumanDateEnd} 
    716   IGCM_card_WriteOption ${SUBMIT_DIR}/${StartDir}/${MemberDir}/config.card Restarts OverRule "n" 
    717  
    718   for comp in ${config_ListOfComponents[*]} ; do 
    719     IGCM_card_WriteOption ${SUBMIT_DIR}/${StartDir}/${MemberDir}/config.card ${comp} Restart "y" 
    720     IGCM_card_WriteOption ${SUBMIT_DIR}/${StartDir}/${MemberDir}/config.card ${comp} RestartDate ${HumanRestartDate} 
    721     IGCM_card_WriteOption ${SUBMIT_DIR}/${StartDir}/${MemberDir}/config.card ${comp} RestartJobName ${ensemble_Ens_PERTURB_INITFROM} 
    722     IGCM_card_WriteOption ${SUBMIT_DIR}/${StartDir}/${MemberDir}/config.card ${comp} RestartPath ${ensemble_Ens_PERTURB_INITPATH} 
    723   done 
    724   # Adhoc exception for CMIP6 : exclude XIOS from the restart overrule mechanism. 
    725   if ( [ X${comp} = XIOS ] && [ X"$( echo ${config_UserChoices_ExpType} | grep CMIP6 )" != "X" ] ) ; then 
    726       IGCM_card_WriteOption ${SUBMIT_DIR}/${StartDir}/${MemberDir}/config.card ${comp} Restart "n" 
    727   fi 
    728  
    729   # ==> Job 
    730   sed -e "s/\(#.*Script_Output_\)${config_UserChoices_JobName}\(\.*\)/\1${MemberDir}\2/" \ 
    731       -e "s/\(#.*\)${config_UserChoices_JobName}\(\.*\)/\1${MemberDir} \2/"            \ 
    732       -e "s/^PeriodNb=.*/PeriodNb=5/"                                                   \ 
    733       ${SUBMIT_DIR}/${StartDir}/${MemberDir}/Job_${MemberDir} > Job_${MemberDir}.tmp 
    734   IGCM_sys_Mv Job_${MemberDir}.tmp ${SUBMIT_DIR}/${StartDir}/${MemberDir}/Job_${MemberDir} 
    735  
    736   IGCM_debug_PopStack "IGCM_ensemble_CastFilesUpdate" 
    737519} 
    738520 
     
    747529 
    748530  Name=$1 
    749   Duree=$2 
    750   year=$3 
    751   month=$4 
     531  PeriodLen=$2 
     532  Year=$3 
     533  Month=$4 
    752534 
    753535  # - Build directory name 
    754   case ${Duree} in 
     536  case ${PeriodLen} in 
    755537  *Y|*y) 
    756     siecle="$( echo $year | cut -c1-2 )" 
    757     siecle=$( (( $siecle - 18 )) ) 
    758     StartYear="${siecle}$( echo $year | cut -c3-4 )" 
    759     StartDir="${Name}${StartYear}" 
    760     ;; 
    761   *M|*m) 
    762     echo $month 
    763     siecle="$( echo $year | cut -c1-2 )" 
    764     siecle=$( (( $siecle - 18 )) ) 
    765     StartYear="${siecle}$( echo $year | cut -c3-4 )" 
    766     StartMonth="${AlphaMonth[ (( 10#${month} - 1 )) ]}" 
    767     StartDir="${Name}${StartYear}${StartMonth}" 
     538    StartDir="${Name}${year}" 
    768539    ;; 
    769540  esac 
     
    998769  IGCM_debug_PushStack "IGCM_ensemble_DateInit" 
    999770 
    1000   IGCM_sys_Mkdir ${RUN_DIR} 
    1001  
    1002   IGCM_sys_Cp ${SUBMIT_DIR}/config.card   ${RUN_DIR} 
    1003   IGCM_sys_Cp ${SUBMIT_DIR}/ensemble.card ${RUN_DIR} 
    1004   IGCM_sys_Cp ${SUBMIT_DIR}/Job_*         ${RUN_DIR} 
    1005   IGCM_sys_Cp ${SUBMIT_DIR}/run.card.init ${RUN_DIR} 
    1006   if [ -f ${SUBMIT_DIR}/Qsub.* ]; then 
    1007     IGCM_sys_Cp ${SUBMIT_DIR}/Qsub.*        ${RUN_DIR} 
    1008   fi 
    1009   if [ -f ${SUBMIT_DIR}/Qclean.* ]; then 
    1010     IGCM_sys_Cp ${SUBMIT_DIR}/Qclean.*      ${RUN_DIR} 
    1011   fi 
     771  IGCM_ensemble_InitRunDir 
    1012772 
    1013773  IGCM_card_DefineVariableFromOption ${F_CFG_ENS} Ens_DATE active 
     
    1016776  IGCM_card_DefineVariableFromOption ${F_CFG_ENS} Ens_DATE BEGIN_RESTART 
    1017777  IGCM_card_DefineVariableFromOption ${F_CFG_ENS} Ens_DATE END_INIT 
    1018   IGCM_card_DefineVariableFromOption ${F_CFG_ENS} Ens_DATE PERIODICITY 
     778  IGCM_card_DefineVariableFromOption ${F_CFG_ENS} Ens_DATE STARTDATE 
    1019779  IGCM_card_DefineArrayFromOption    ${F_CFG_ENS} Ens_DATE NONPERIODIC 
    1020780  IGCM_card_DefineArrayFromOption    ${F_CFG_ENS} Ens_DATE RESTART_NONPERIODIC 
     
    1036796  IGCM_debug_Print 1 "BEGIN_INIT           = ${ensemble_Ens_DATE_BEGIN_INIT}" 
    1037797  IGCM_debug_Print 1 "END_INIT             = ${ensemble_Ens_DATE_END_INIT}" 
    1038   IGCM_debug_Print 1 "PERIODICITY          = ${ensemble_Ens_DATE_PERIODICITY}" 
    1039798  IGCM_debug_Print 1 "BEGIN_RESTART        = ${ensemble_Ens_DATE_BEGIN_RESTART}" 
     799  IGCM_debug_Print 1 "STARTDATE            = ${ensemble_Ens_DATE_STARTDATE}" 
    1040800  IGCM_debug_Print 1 "NONPERIODIC          = ${ensemble_Ens_DATE_NONPERIODIC[*]}" 
    1041801  IGCM_debug_Print 1 "RESTART_NONPERIODIC  = ${ensemble_Ens_DATE_RESTART_NONPERIODIC[*]}" 
     
    1052812  echo "" 
    1053813 
    1054   ensemble_Ens_DATE_MEMBER=1 # actually use only 1 member 
    1055   IGCM_ensemble_SetAlpha ${ensemble_Ens_DATE_MEMBER} 
    1056  
    1057814  IGCM_debug_Print 1 "Check args..." 
    1058   DatePeriodicStart=false 
    1059   DateNonPeriodicStart=false 
     815  DateNonPeriodicStart=true 
    1060816 
    1061817  # ... Check LENGTH ... 
     
    1070826 
    1071827  # *************************************** 
    1072   # A few checks Period case: 
    1073   # *************************************** 
    1074   # if all Periodic params are not filled: desactivate Periodic mode 
    1075   totalPeriodArgs=4 
    1076   periodFillArgs=0 
    1077  
    1078   if [[ X${ensemble_Ens_DATE_BEGIN_RESTART} != "X" ]]; then 
    1079     (( periodFillArgs = periodFillArgs + 1 )) 
    1080   fi 
    1081  
    1082   if [[ X${ensemble_Ens_DATE_BEGIN_INIT} != "X" ]]; then 
    1083     (( periodFillArgs = periodFillArgs + 1 )) 
    1084   fi 
    1085  
    1086   if [[ X${ensemble_Ens_DATE_END_INIT} != "X" ]]; then 
    1087     (( periodFillArgs = periodFillArgs + 1 )) 
    1088   fi 
    1089  
    1090   if [[ X${ensemble_Ens_DATE_PERIODICITY} != "X" ]]; then 
    1091     (( periodFillArgs = periodFillArgs + 1 )) 
    1092  
    1093     # ... Check PERIODICITY ... 
    1094     case ${ensemble_Ens_DATE_PERIODICITY} in 
    1095     *[Yy]|*[Mm]) 
    1096       IGCM_debug_Print 1 "Periodic length : ${ensemble_Ens_DATE_PERIODICITY}" ;; 
    1097     *) 
    1098       IGCM_debug_Exit "IGCM_ensemble_DateInit ${ensemble_Ens_DATE_PERIODICITY} : invalid PERIODICITY" 
    1099       IGCM_debug_Exit "Choose a value in *Y or *M" 
    1100       IGCM_debug_Verif_Exit ;; 
    1101     esac 
    1102   fi # if periodicity 
    1103  
    1104   if [[ ${periodFillArgs} = ${totalPeriodArgs} ]]; then 
    1105     DatePeriodicStart=true 
    1106   else 
    1107     if [[ ${periodFillArgs} = 0 ]]; then 
    1108       IGCM_debug_Print 1 "Periodic start NOT ACTIVE" 
    1109       DatePeriodicStart=false 
    1110     else 
    1111       IGCM_debug_Exit "IGCM_ensemble_DateInit missing arguments for Periodic mode!" 
    1112       IGCM_debug_Exit "Get only ${periodFillArgs} on ${totalPeriodArgs} args. Check ${F_CFG_ENS} file." 
    1113       IGCM_debug_Verif_Exit 
    1114     fi 
    1115   fi 
    1116  
    1117   # *************************************** 
    1118828  # A few checks for the Non-Periodic case: 
    1119829  # *************************************** 
    1120   if [[ ${#ensemble_Ens_DATE_NONPERIODIC[*]} != ${#ensemble_Ens_DATE_RESTART_NONPERIODIC[*]} ]] ; then 
    1121     IGCM_debug_Exit "IGCM_ensemble_DateInit: NONPERIODIC and RESTART_NONPERIODIC lists have different sizes" 
    1122     IGCM_debug_Verif_Exit 
    1123   fi 
    1124  
    1125   if [[ ${#ensemble_Ens_DATE_NONPERIODIC[*]} > 0 ]] && [[ ${ensemble_Ens_DATE_NONPERIODIC[*]} != _0_ ]]; then 
     830#  if [[ ${#ensemble_Ens_DATE_NONPERIODIC[*]} != ${#ensemble_Ens_DATE_RESTART_NONPERIODIC[*]} ]] ; then 
     831#    IGCM_debug_Exit "IGCM_ensemble_DateInit: NONPERIODIC and RESTART_NONPERIODIC lists have different sizes" 
     832#    IGCM_debug_Verif_Exit 
     833#  fi 
     834 
     835  if [[ ${#ensemble_Ens_DATE_RESTART_NONPERIODIC[*]} > 0 ]] && [[ ${ensemble_Ens_DATE_RESTART_NONPERIODIC[*]} != _0_ ]]; then 
    1126836    DateNonPeriodicStart=true 
    1127837 
    1128838    # Use LENGTH if no NONPERIODIC_LENGTH given 
    1129     if [[ ${#ensemble_Ens_DATE_LENGTH_NONPERIODIC[*]} < ${#ensemble_Ens_DATE_NONPERIODIC[*]} ]] ; then 
    1130       IGCM_debug_Print 1 "WARNING: LENGTH_NONPERIODIC is not fill (or not correctly). Use LENGTH value '${ensemble_Ens_DATE_LENGTH}' for all NONPERIODIC runs" 
     839    if [[ ${#ensemble_Ens_DATE_LENGTH_NONPERIODIC[*]} < ${#ensemble_Ens_DATE_NONPERIODIC[*]} ]] || 
     840           [[ X"${ensemble_Ens_DATE_LENGTH_NONPERIODIC[0]}" = "XOption" ]] ; then 
     841        IGCM_debug_Print 1 "WARNING: LENGTH_NONPERIODIC is not fill (or not correctly). " 
     842        IGCM_debug_Print 1 "Use LENGTH value '${ensemble_Ens_DATE_LENGTH}' for all NONPERIODIC runs" 
    1131843      DateNum=0 
    1132844      while [ ${DateNum} -lt ${#ensemble_Ens_DATE_NONPERIODIC[*]} ] ; do 
     
    1135847      done 
    1136848    fi 
    1137  
     849     
     850    # Use STARTDATE if no NONPERIODIC start date given 
     851    if [[ ${#ensemble_Ens_DATE_NONPERIODIC[*]} < ${#ensemble_Ens_DATE_RESTART_NONPERIODIC[*]} ]] || 
     852           [[ X"${ensemble_Ens_DATE_NONPERIODIC[0]}" = "XOption" ]] ; then 
     853        IGCM_debug_Print 1 "WARNING: NONPERIODIC start date not fill (or not correctly)." 
     854        IGCM_debug_Print 1 "Use STARTDATE value '${ensemble_Ens_DATE_STARTDATE}' for all NONPERIODIC runs" 
     855      DateNum=0 
     856      while [ ${DateNum} -lt ${#ensemble_Ens_DATE_RESTART_NONPERIODIC[*]} ] ; do 
     857        ensemble_Ens_DATE_NONPERIODIC[${DateNum}]=${ensemble_Ens_DATE_STARTDATE} 
     858        (( DateNum = DateNum + 1 )) 
     859      done 
     860    fi 
     861         
    1138862    # Use INITFROM if no INITFROM_NONPERIODIC given 
    1139863    if [ ${#ensemble_Ens_DATE_INITFROM_NONPERIODIC[*]} -lt ${#ensemble_Ens_DATE_NONPERIODIC[*]} ] ; then 
     
    1188912} 
    1189913 
    1190 function IGCM_ensemble_DatePeriodicStarts 
    1191 { 
    1192   IGCM_debug_PushStack "IGCM_ensemble_DatePeriodicStarts" 
    1193  
    1194   [ ${DatePeriodicStart} = false ] && return 
    1195  
    1196   echo 
    1197   IGCM_debug_Print 1 ">>>  MANAGE PERIODIC STARTS  <<<" 
    1198  
    1199 #.. Manage periodic starts .. 
    1200 #   ====================== 
    1201  
    1202   # - Build directory name 
    1203   StartDir="${ensemble_Ens_DATE_NAME}" 
    1204  
    1205   # - Create directory for current DateBegin 
    1206   if [ ! -d  ${StartDir} ] ; then 
    1207     IGCM_sys_Mkdir ${SUBMIT_DIR}/${StartDir} 
    1208     IGCM_sys_Cd ${SUBMIT_DIR}/${StartDir} 
    1209     ln -s ../../.resol . 
    1210     ln -s ../../.libmpi . 
    1211     IGCM_sys_Cd ${RUN_DIR} 
    1212   fi 
    1213  
    1214   # ... Loop over DateBegin ... 
    1215   eval DateBegin=\${ensemble_Ens_DATE_BEGIN_INIT} 
    1216   eval RestartDate=\${ensemble_Ens_DATE_BEGIN_RESTART} 
    1217  
    1218   DateNum=0 
    1219   while [ ${DateBegin} -le ${ensemble_Ens_DATE_END_INIT} ] ; do 
    1220     IGCM_date_GetYearMonth ${DateBegin} year month 
    1221  
    1222     echo "========================================================================" 
    1223     echo "New DateBegin = $DateBegin" 
    1224  
    1225   # - Determine number of day(s) in PERIODICITY 
    1226     PeriodLengthInDays=$( IGCM_date_DaysInCurrentPeriod ${DateBegin} ${ensemble_Ens_DATE_PERIODICITY} ) 
    1227  
    1228   # - Determine number of day(s) in LENGTH 
    1229     DureeLengthInDays=$(( $( IGCM_date_DaysInCurrentPeriod ${DateBegin} ${ensemble_Ens_DATE_LENGTH} ) - 1 )) 
    1230  
    1231   # - Determine DateEnd 
    1232     (( DateEnd = $( IGCM_date_AddDaysToGregorianDate ${DateBegin} ${DureeLengthInDays} ) )) 
    1233  
    1234     IGCM_debug_Print 2 "${DateBegin} => ${DateEnd} : ${StartDir}" 
    1235     echo "${DateBegin} ${DateEnd} ${StartDir}" >> ${RUN_DIR}/CreatedDir.txt 
    1236  
    1237   # - Loop over members (default =1 no member) 
    1238     i=0 
    1239     while [ $i -lt ${ensemble_Ens_DATE_MEMBER} ] ; do 
    1240       MemberDir="${ensemble_Ens_DATE_NAME}${DateNum}${Alpha[$i]}_per" 
    1241       echo 
    1242       IGCM_debug_Print 3 "${MemberDir}" 
    1243  
    1244       JobName="Job_${MemberDir}" 
    1245  
    1246     # * Create directory if it doesn't exist and copy/link files 
    1247       if [ ! -d  ${SUBMIT_DIR}/${StartDir}/${MemberDir} ] ; then 
    1248         IGCM_sys_Mkdir ${SUBMIT_DIR}/${StartDir}/${MemberDir} 
    1249         IGCM_sys_Cd ${SUBMIT_DIR}/${StartDir}/${MemberDir} 
    1250         ln -s ../../COMP 
    1251         ln -s ../../PARAM 
    1252         ln -s ../../POST 
    1253         ln -s ../../DRIVER 
    1254         IGCM_sys_Cd ${RUN_DIR} 
    1255         IGCM_sys_Cp config.card run.card.init ${SUBMIT_DIR}/${StartDir}/${MemberDir} 
    1256         IGCM_sys_Cp Job_${config_UserChoices_JobName} ${SUBMIT_DIR}/${StartDir}/${MemberDir}/${JobName} 
    1257  
    1258         # Dump command to be lauched 
    1259         echo "cd ${StartDir}/${MemberDir}/ ;"    >> ${RUN_DIR}/Qsub.${StartDir}.sh 
    1260         echo "${SUBMIT} ${JobName} ; cd -"       >> ${RUN_DIR}/Qsub.${StartDir}.sh 
    1261  
    1262         echo "cd ${StartDir}/${MemberDir}/ ;"    >> ${RUN_DIR}/Qclean.PeriodLength.${StartDir}.sh 
    1263         echo "${libIGCM}/clean_PeriodLength.job ; cd -"  >> ${RUN_DIR}/Qclean.PeriodLength.${StartDir}.sh 
    1264  
    1265         # * Update files : config.card, Job_, COMP/comp.card 
    1266         IGCM_ensemble_DateFilesUpdate ${DateBegin} ${DateEnd} ${RestartDate} 
    1267       fi 
    1268  
    1269       (( i = i + 1 )) 
    1270     done 
    1271  
    1272   # - Next DateBegin & RestartDate 
    1273     echo "$DateBegin  $PeriodLengthInDays" 
    1274     case ${ensemble_Ens_DATE_PERIODICITY} in 
    1275     *[Yy]|*[Mm]) 
    1276       (( DateBegin =   $( IGCM_date_AddDaysToGregorianDate ${DateBegin}   ${PeriodLengthInDays} ) )) 
    1277       (( RestartDate = $( IGCM_date_AddDaysToGregorianDate ${RestartDate} ${PeriodLengthInDays} ) )) 
    1278       ;; 
    1279     esac 
    1280  
    1281     (( DateNum = DateNum + 1 )) # increment number of restart date 
    1282   done 
    1283  
    1284   # Done. Save ${StartDir} submission text file 
    1285   IGCM_sys_Cp ${RUN_DIR}/Qsub.${StartDir}.sh ${SUBMIT_DIR} 
    1286   IGCM_sys_Cp ${RUN_DIR}/Qclean.PeriodLength.${StartDir}.sh ${SUBMIT_DIR} 
    1287  
    1288   IGCM_debug_PopStack "IGCM_ensemble_DatePeriodicStarts" 
    1289 } 
    1290  
    1291914function IGCM_ensemble_DateNonPeriodicStarts 
    1292915{ 
     
    1324947    InitFrom=${ensemble_Ens_DATE_INITFROM_NONPERIODIC[${DateNum}]} 
    1325948    InitPath=${ensemble_Ens_DATE_INITPATH_NONPERIODIC[${DateNum}]} 
    1326  
     949    (( ii=DateNum + 1 )) 
     950     
     951    MemberDir="${ensemble_Ens_DATE_NAME}${ii}" 
     952    IGCM_debug_Print 3 "${MemberDir}" 
     953    echo "Create: ${MemberDir}" 
     954     
    1327955  # - Determine number of day(s) in LENGTH_NONPERIODIC 
    1328956    IGCM_date_GetYearMonth ${DateBegin} year month 
     
    1337965    PeriodDateEnd=$( grep -m1 ${StartDir} ${RUN_DIR}/CreatedDir.txt | cut -f2 -d\  ) 
    1338966 
    1339   # - Loop over members 
    1340     i=0 
    1341     while [ $i -lt ${ensemble_Ens_DATE_MEMBER} ] ; do 
    1342       MemberDir="${ensemble_Ens_DATE_NAME}${DateNum}${Alpha[$i]}" 
    1343       IGCM_debug_Print 3 "${MemberDir}" 
    1344  
    1345       JobName="Job_${MemberDir}" 
    1346  
     967    JobName="Job_${MemberDir}" 
     968     
    1347969    # * Create directory if it doesn't exist and copy files 
    1348       if [ ! -d  ${SUBMIT_DIR}/${StartDir}/${MemberDir} ] ; then 
    1349         IGCM_sys_Mkdir ${SUBMIT_DIR}/${StartDir}/${MemberDir} 
    1350         IGCM_sys_Cd ${SUBMIT_DIR}/${StartDir}/${MemberDir} 
    1351         ln -s ../../COMP 
    1352         ln -s ../../PARAM 
    1353         ln -s ../../POST 
    1354         ln -s ../../DRIVER 
    1355         IGCM_sys_Cd ${RUN_DIR} 
    1356         IGCM_sys_Cp config.card run.card.init ${SUBMIT_DIR}/${StartDir}/${MemberDir} 
    1357         IGCM_sys_Cp Job_${config_UserChoices_JobName} ${SUBMIT_DIR}/${StartDir}/${MemberDir}/Job_${MemberDir} 
    1358  
    1359         # Dump command to be lauched 
    1360         echo "cd ${StartDir}/${MemberDir}/ ;"     >> ${RUN_DIR}/Qsub.${StartDir}.sh 
    1361         echo "${SUBMIT} ${JobName} ; cd -"        >> ${RUN_DIR}/Qsub.${StartDir}.sh 
    1362  
    1363         echo "cd ${StartDir}/${MemberDir}/ ;"     >> ${RUN_DIR}/Qclean.PeriodLength.${StartDir}.sh 
    1364         echo "${libIGCM}/clean_PeriodLength.job ; cd -"   >> ${RUN_DIR}/Qclean.PeriodLength.${StartDir}.sh 
    1365  
     970    if [ ! -d  ${SUBMIT_DIR}/${StartDir}/${MemberDir} ] ; then 
     971 
     972        # * Create ${SUBMIT_DIR}/${StartDir}/${MemberDir} directories 
     973        #   link COMP PARAM POST and DRIVER 
     974        #   cp config.card, run.card.init, Job_ 
     975        #   and Dump command to be launched  
     976        IGCM_ensemble_CreateMemberDir 
     977         
    1366978        # * Update files : config.card, Job_, COMP/comp.card 
    1367         IGCM_ensemble_DateFilesUpdate ${DateBegin} ${DateEnd} ${RestartDate} ${InitFrom} ${InitPath} 
    1368       fi 
    1369  
    1370       (( i = i + 1 )) 
    1371     done 
    1372  
     979        IGCM_ensemble_FilesUpdate "DATE" ${ii} ${DateBegin} ${DateEnd} ${RestartDate} ${InitFrom} ${InitPath} 
     980    fi 
     981     
    1373982    # Done. Save ${StartDir} submission text file 
    1374983    IGCM_sys_Cp ${RUN_DIR}/Qsub.${StartDir}.sh ${SUBMIT_DIR} 
    1375984    IGCM_sys_Cp ${RUN_DIR}/Qclean.PeriodLength.${StartDir}.sh ${SUBMIT_DIR} 
     985    IGCM_sys_Cp ${RUN_DIR}/Qclean.latestPackperiod.${StartDir}.sh ${SUBMIT_DIR} 
    1376986 
    1377987    (( DateNum = DateNum + 1 )) 
    1378988  done 
    1379989 
    1380   # Done. Save ${StartDir} submission text file 
    1381   IGCM_sys_Cp ${RUN_DIR}/Qsub.${StartDir}.sh ${SUBMIT_DIR} 
    1382   IGCM_sys_Cp ${RUN_DIR}/Qclean.month.${StartDir}.sh ${SUBMIT_DIR} 
    1383   IGCM_sys_Cp ${RUN_DIR}/Qclean.year.${StartDir}.sh ${SUBMIT_DIR} 
    1384  
    1385990  IGCM_debug_PopStack "IGCM_ensemble_DateNonPeriodicStarts" 
    1386991} 
    1387992 
    1388 function IGCM_ensemble_DateFilesUpdate 
    1389 { 
    1390   IGCM_debug_PushStack "IGCM_ensemble_DateFilesUpdate" 
    1391  
    1392   # Debug Print : 
    1393   echo 
    1394   IGCM_debug_Print 1 "IGCM_ensemble_DateFilesUpdate :" 
    1395  
    1396   HumanDateBegin=$(   IGCM_date_ConvertFormatToHuman ${1} ) 
    1397   HumanDateEnd=$(     IGCM_date_ConvertFormatToHuman ${2} ) 
    1398   HumanRestartDate=$( IGCM_date_ConvertFormatToHuman ${3} ) 
    1399   if [[ X${4} != "X" ]]; then 
    1400     initFrom=${4} # non periodic config (INITFROM could be different between members) 
    1401   else 
    1402     initFrom=${ensemble_Ens_DATE_INITFROM} # periodic (same INITFROM value) 
    1403   fi 
    1404  
    1405   if [[ X${5} != "X" ]]; then 
    1406     initPath=${5} # non periodic config (INITPATH could be different between members) 
    1407   else 
    1408     initPath=${ensemble_Ens_DATE_INITPATH} # periodic (same INITPATH value) 
    1409   fi 
    1410    
    1411   # ==> config.card 
    1412   # [ENSEMBLE] 
    1413   IGCM_card_WriteOption ${SUBMIT_DIR}/${StartDir}/${MemberDir}/config.card Ensemble EnsembleRun 'y' 
    1414   IGCM_card_WriteOption ${SUBMIT_DIR}/${StartDir}/${MemberDir}/config.card Ensemble EnsembleName ${ensemble_Ens_DATE_NAME} 
    1415   IGCM_card_WriteOption ${SUBMIT_DIR}/${StartDir}/${MemberDir}/config.card Ensemble EnsembleDate ${HumanDateBegin} 
    1416   IGCM_card_WriteOption ${SUBMIT_DIR}/${StartDir}/${MemberDir}/config.card Ensemble EnsembleType "Ens_DATE" 
    1417  
    1418   # [UserChoices] 
    1419   IGCM_card_WriteOption ${SUBMIT_DIR}/${StartDir}/${MemberDir}/config.card UserChoices JobName   ${MemberDir} 
    1420   IGCM_card_WriteOption ${SUBMIT_DIR}/${StartDir}/${MemberDir}/config.card UserChoices DateBegin ${HumanDateBegin} 
    1421   IGCM_card_WriteOption ${SUBMIT_DIR}/${StartDir}/${MemberDir}/config.card UserChoices DateEnd   ${HumanDateEnd} 
    1422  
    1423   # [Restarts] 
    1424   IGCM_card_WriteOption ${SUBMIT_DIR}/${StartDir}/${MemberDir}/config.card Restarts OverRule "y" 
    1425   IGCM_card_WriteOption ${SUBMIT_DIR}/${StartDir}/${MemberDir}/config.card Restarts RestartDate ${HumanRestartDate} 
    1426   IGCM_card_WriteOption ${SUBMIT_DIR}/${StartDir}/${MemberDir}/config.card Restarts RestartJobName ${initFrom} 
    1427   IGCM_card_WriteOption ${SUBMIT_DIR}/${StartDir}/${MemberDir}/config.card Restarts RestartPath ${initPath} 
    1428  
    1429     # [ATM/OCE/...] 
    1430   for comp in ${config_ListOfComponents[*]} ; do 
    1431     IGCM_card_WriteOption ${SUBMIT_DIR}/${StartDir}/${MemberDir}/config.card ${comp} Restart "n" 
    1432   done 
    1433   unset initFrom 
    1434  
    1435   # ==> Job 
    1436   sed -e "s/\(#.*Script_Output_\)${config_UserChoices_JobName}\(\.*\)/\1${MemberDir}\2/" \ 
    1437       -e "s/\(#.*\)${config_UserChoices_JobName}\(\.*\)/\1${MemberDir} \2/"            \ 
    1438       -e "s/^PeriodNb=.*/PeriodNb=5/"                                                   \ 
    1439       ${SUBMIT_DIR}/${StartDir}/${MemberDir}/Job_${MemberDir} > Job_${MemberDir}.tmp 
    1440   IGCM_sys_Mv Job_${MemberDir}.tmp ${SUBMIT_DIR}/${StartDir}/${MemberDir}/Job_${MemberDir} 
    1441  
    1442   IGCM_debug_PopStack "IGCM_ensemble_DateFilesUpdate" 
    1443 } 
    1444  
    1445 ############### Parametric ENSEMBLE ################# 
Note: See TracChangeset for help on using the changeset viewer.