Ignore:
Timestamp:
02/18/13 15:24:22 (11 years ago)
Author:
sdipsl
Message:

For Josefine, add CyclicYear? variable to be used by comp.card to periodically loop over a forcing.

File:
1 edited

Legend:

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

    r786 r799  
    408408  typeset i 
    409409 
     410  # When Cyclic is active, the simulation MUST start with the same year as the CyclicBegin year. 
     411  if ( [ ! X${config_UserChoices_CyclicBegin} = X ] && [ ! X${config_UserChoices_CyclicEnd} = X ] ) ; then 
     412    IGCM_debug_Print 1 "Check coherence between CyclicBegin year and DateBegin year" 
     413    if [ ${InitYear} -ne ${config_UserChoices_CyclicBegin} ] ; then 
     414      IGCM_debug_Print 1 "The simulation MUST start with the same year as the CyclicBegin year" 
     415      IGCM_debug_Exit "Check your CyclicBegin option in config.card UserChoices section" 
     416    fi 
     417  fi 
     418 
    410419  # Check RebuildFrequency against key frequencies : PeriodLength ; PackFrequency ; TimeSeriesFrequency ; SeasonalFrequency 
    411420  if ( [ ! X${config_Post_RebuildFrequency} = X${NULL_STR} ] && [ ! X${config_Post_RebuildFrequency} = XNONE ] ) ; then 
     
    628637  #IGCM_debug_Print 1 "jg 1 calculate yyyymm_m1 = ${yyyymm_m1} " 
    629638  #IGCM_debug_Print 1 "jg 1 calculate yyyymm_p1 = ${yyyymm_p1} " 
     639 
     640  #===================================================================# 
     641  # Calculate CyclicYear to be used for looping over a given forcing  # 
     642  # period. Add CyclicBegin and CyclicEnd in config.card UserChoices. # 
     643  #===================================================================# 
     644 
     645  # To use the variable CyclicYear, one must add in config.card CyclicBegin and CyclicEnd. 
     646  # CyclicBegin is the first year in the cycle. CyclicEnd is the last year included in the cycle. 
     647  # The simulation MUST start with the same year as the CyclicBegin year. 
     648  if ( [ ! X${config_UserChoices_CyclicBegin} = X ] && [ ! X${config_UserChoices_CyclicEnd} = X ] ) ; then 
     649    CycleNb=$(( ${config_UserChoices_CyclicEnd} - ${config_UserChoices_CyclicBegin} + 1 )) 
     650    CyclicYear=$(( ( ( ${year} - ${config_UserChoices_CyclicBegin} ) % ${CycleNb} ) + ${config_UserChoices_CyclicBegin} )) 
     651    IGCM_debug_Print 1 "CyclicYear   = ${CyclicYear} current year=$year" 
     652  else 
     653    CyclicYear="ERROR_CyclicYear_Variable_Not_Defined" 
     654    IGCM_debug_Print 1 "CyclicYear not possible to use without adding CyclicBegin and CyclicEnd in config.card" 
     655  fi 
    630656 
    631657  # END: SHOULD GO IN A FUNCTION FROM libIGCM_date.ksh 
Note: See TracChangeset for help on using the changeset viewer.