Ignore:
Timestamp:
05/18/09 11:28:59 (15 years ago)
Author:
mmaipsl
Message:

MM: add another IGCM_config_Analyse_PeriodLength call and suppress arguments in this function.

File:
1 edited

Legend:

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

    r121 r124  
    206206    IGCM_debug_PushStack "IGCM_config_Analyse_PeriodLength" 
    207207 
    208     theyear=$1 
    209     themonth=$2 
     208    echo "config_UserChoices_PeriodLength : " ${config_UserChoices_PeriodLength} ${month} ${year} 
     209 
     210    typeset i 
    210211 
    211212    # Determine number of day(s) in PeriodLength : 
    212213    case ${config_UserChoices_PeriodLength} in 
    213214        *Y|*y) 
     215#MM a enlever apres les tests  
     216            echo " ${config_UserChoices_PeriodLength} | gawk -F '[yY]' " '{print $1}'  
    214217            PeriodLengthInYears=$( echo ${config_UserChoices_PeriodLength} | gawk -F '[yY]' '{print $1}' )  
    215218            IGCM_debug_Print 1 "Number of years for PeriodLength : ${PeriodLengthInYears}" 
     
    224227            PeriodLengthInMonths=$( echo ${config_UserChoices_PeriodLength} | gawk -F '[mM]' '{print $1}' )  
    225228            IGCM_debug_Print 1 "Number of months for PeriodLength : ${PeriodLengthInMonths}" 
    226             typeset year1  
    227229            PeriodLengthInDays=0 
    228             year1=year 
    229230            i=0 
    230231            until [ $i -ge $PeriodLengthInMonths ] ; do  
     
    269270 
    270271        IGCM_date_GetYearMonth $DateBegin year month 
    271         IGCM_config_Analyse_PeriodLength  $year $month 
     272        IGCM_config_Analyse_PeriodLength 
    272273 
    273274        eval PeriodDateBegin=${DateBegin} > /dev/null 2>&1 
     
    331332 
    332333        IGCM_date_GetYearMonth $PeriodDateBegin year month 
    333  
    334         # Determine number of day(s) in PeriodLength : 
    335         case ${config_UserChoices_PeriodLength} in 
    336             *Y|*y) 
    337                 PeriodLengthInYears=$( echo ${config_UserChoices_PeriodLength} | gawk -F '[yY]' '{print $1}' )  
    338                 IGCM_debug_Print 1 "Number of years for PeriodLength : ${PeriodLengthInYears}" 
    339                 PeriodLengthInDays=0 
    340                 i=0 
    341                 until [ $i -ge $PeriodLengthInYears ] ; do  
    342                     (( PeriodLengthInDays = PeriodLengthInDays + $( IGCM_date_DaysInYear $(( year + i )) ) ))  
    343                     (( i=i+1 ))  
    344                 done  
    345                 ;; 
    346             *M|*m) 
    347                 PeriodLengthInMonths=$( echo ${config_UserChoices_PeriodLength} | gawk -F '[mM]' '{print $1}' )  
    348                 IGCM_debug_Print 1 "Number of months for PeriodLength : ${PeriodLengthInMonths}" 
    349                 typeset year1  
    350                 PeriodLengthInDays=0 
    351                 year1=year 
    352                 i=0 
    353                 until [ $i -ge $PeriodLengthInMonths ] ; do  
    354                     if [ $(( month + i )) -lt 13 ] ; then  
    355                         (( PeriodLengthInDays  = PeriodLengthInDays + $( IGCM_date_DaysInMonth $year $(( month + i )) ) ))   
    356                     else  
    357                         (( PeriodLengthInDays  = PeriodLengthInDays + $( IGCM_date_DaysInMonth $year $(( month + i - 12 )) ) ))   
    358                     fi  
    359                     (( i=i+1 ))  
    360                 done  
    361                 ;; 
    362             *D|*d)   
    363                 PeriodLengthInDays=$( echo ${config_UserChoices_PeriodLength} | gawk -F '[dD]' '{print $1}' ) ;; 
    364             *)  
    365                 IGCM_debug_Exit "IGCM_config_PeriodStart " ${config_UserChoices_PeriodLength} " invalid period length : choose in *Y, *M, *D." 
    366                 IGCM_debug_Verif_Exit ;; 
    367         esac 
     334        IGCM_config_Analyse_PeriodLength 
    368335 
    369336        IGCM_card_WriteOption ${SUBMIT_DIR}/run.card Configuration PeriodState "Running" 
     
    467434        eval ExeNameIn=\${config_Executable_${comp}[0]} 
    468435        eval ExeNameOut=\${config_Executable_${comp}[1]} 
     436        # Only if we really have an executable for the component : 
    469437        if [ X${ExeNameIn} = X\"\" ] ; then 
    470438            # If there is no exe file for this component 
     
    606574    IGCM_date_GetYearMonth $PeriodDateBegin year month 
    607575 
    608     IGCM_config_Analyse_PeriodLength $year $month 
     576    IGCM_config_Analyse_PeriodLength 
    609577    PeriodDateEnd=$( IGCM_date_AddDaysToGregorianDate ${PeriodDateBegin} $( expr ${PeriodLengthInDays} - 1 ) ) 
    610578 
Note: See TracChangeset for help on using the changeset viewer.