Changeset 124
- Timestamp:
- 05/18/09 11:28:59 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libIGCM/libIGCM_config/libIGCM_config.ksh
r121 r124 206 206 IGCM_debug_PushStack "IGCM_config_Analyse_PeriodLength" 207 207 208 theyear=$1 209 themonth=$2 208 echo "config_UserChoices_PeriodLength : " ${config_UserChoices_PeriodLength} ${month} ${year} 209 210 typeset i 210 211 211 212 # Determine number of day(s) in PeriodLength : 212 213 case ${config_UserChoices_PeriodLength} in 213 214 *Y|*y) 215 #MM a enlever apres les tests 216 echo " ${config_UserChoices_PeriodLength} | gawk -F '[yY]' " '{print $1}' 214 217 PeriodLengthInYears=$( echo ${config_UserChoices_PeriodLength} | gawk -F '[yY]' '{print $1}' ) 215 218 IGCM_debug_Print 1 "Number of years for PeriodLength : ${PeriodLengthInYears}" … … 224 227 PeriodLengthInMonths=$( echo ${config_UserChoices_PeriodLength} | gawk -F '[mM]' '{print $1}' ) 225 228 IGCM_debug_Print 1 "Number of months for PeriodLength : ${PeriodLengthInMonths}" 226 typeset year1227 229 PeriodLengthInDays=0 228 year1=year229 230 i=0 230 231 until [ $i -ge $PeriodLengthInMonths ] ; do … … 269 270 270 271 IGCM_date_GetYearMonth $DateBegin year month 271 IGCM_config_Analyse_PeriodLength $year $month272 IGCM_config_Analyse_PeriodLength 272 273 273 274 eval PeriodDateBegin=${DateBegin} > /dev/null 2>&1 … … 331 332 332 333 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 368 335 369 336 IGCM_card_WriteOption ${SUBMIT_DIR}/run.card Configuration PeriodState "Running" … … 467 434 eval ExeNameIn=\${config_Executable_${comp}[0]} 468 435 eval ExeNameOut=\${config_Executable_${comp}[1]} 436 # Only if we really have an executable for the component : 469 437 if [ X${ExeNameIn} = X\"\" ] ; then 470 438 # If there is no exe file for this component … … 606 574 IGCM_date_GetYearMonth $PeriodDateBegin year month 607 575 608 IGCM_config_Analyse_PeriodLength $year $month576 IGCM_config_Analyse_PeriodLength 609 577 PeriodDateEnd=$( IGCM_date_AddDaysToGregorianDate ${PeriodDateBegin} $( expr ${PeriodLengthInDays} - 1 ) ) 610 578
Note: See TracChangeset
for help on using the changeset viewer.