Changeset 819
- Timestamp:
- 03/06/13 18:55:34 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libIGCM/libIGCM_config/libIGCM_config.ksh
r812 r819 411 411 typeset i 412 412 413 # When Cyclic is active, the simulation MUST start with the same year as the CyclicBegin year.414 if ( [ ! X${config_UserChoices_CyclicBegin} = X ] && [ ! X${config_UserChoices_CyclicEnd} = X ] ) ; then415 IGCM_debug_Print 1 "Check coherence between CyclicBegin year and DateBegin year"416 if [ ${InitYear} -ne ${config_UserChoices_CyclicBegin} ] ; then417 IGCM_debug_Print 1 "The simulation MUST start with the same year as the CyclicBegin year"418 IGCM_debug_Exit "Check your CyclicBegin option in config.card UserChoices section"419 fi420 fi421 422 413 # Check RebuildFrequency against key frequencies : PeriodLength ; PackFrequency ; TimeSeriesFrequency ; SeasonalFrequency 423 414 if ( [ ! X${config_Post_RebuildFrequency} = X${NULL_STR} ] && [ ! X${config_Post_RebuildFrequency} = XNONE ] ) ; then … … 648 639 # To use the variable CyclicYear, one must add in config.card CyclicBegin and CyclicEnd. 649 640 # CyclicBegin is the first year in the cycle. CyclicEnd is the last year included in the cycle. 650 # The simulation MUST start with the same year as the CyclicBegin year.651 641 if ( [ ! X${config_UserChoices_CyclicBegin} = X ] && [ ! X${config_UserChoices_CyclicEnd} = X ] ) ; then 652 642 CycleNb=$(( ${config_UserChoices_CyclicEnd} - ${config_UserChoices_CyclicBegin} + 1 )) 653 CyclicYear=$(( ( ( ${year} - ${config_UserChoices_CyclicBegin} ) % ${CycleNb} ) + ${config_UserChoices_CyclicBegin} )) 654 CyclicYear_p1=$(( ( ( ${year} + 1 - ${config_UserChoices_CyclicBegin} ) % ${CycleNb} ) + ${config_UserChoices_CyclicBegin} )) 643 CyclicYear_p1=NOTDEFINED 644 645 # For current year 646 yeartmp=$year 647 diffy=$(( $yeartmp - ${config_UserChoices_CyclicBegin} )) 648 while [ $diffy -lt 0 ] ; do 649 yeartmp=$(( ${yeartmp} + ${CycleNb} )) 650 diffy=$(( $yeartmp - ${config_UserChoices_CyclicBegin} )) 651 done 652 CyclicYear=$(( ( ${diffy} % ${CycleNb} ) + ${config_UserChoices_CyclicBegin} )) 653 654 # For next coming year 655 yeartmp=$(( $year + 1 )) 656 diffy=$(( $yeartmp - ${config_UserChoices_CyclicBegin} )) 657 while [ $diffy -lt 0 ] ; do 658 yeartmp=$(( ${yeartmp} + ${CycleNb} )) 659 diffy=$(( $yeartmp - ${config_UserChoices_CyclicBegin} )) 660 done 661 CyclicYear_p1=$(( ( ${diffy} % ${CycleNb} ) + ${config_UserChoices_CyclicBegin} )) 662 655 663 IGCM_debug_Print 1 "CyclicYear = ${CyclicYear}, CyclicYear_p1 = ${CyclicYear_p1}, current year=$year" 656 664 else 657 665 CyclicYear="ERROR_CyclicYear_Variable_Not_Defined" 658 666 CyclicYear_p1="ERROR_CyclicYear_p1_Variable_Not_Defined" 659 IGCM_debug_Print 1 "CyclicYear not possible touse without adding CyclicBegin and CyclicEnd in config.card"667 IGCM_debug_Print 1 "CyclicYear wont be use without adding CyclicBegin and CyclicEnd in config.card" 660 668 fi 661 669
Note: See TracChangeset
for help on using the changeset viewer.