cable_timing_mod Module

Module for handling timing in CABLE.



Variables

Type Visibility Attributes Name Initial
integer, public, parameter :: seconds_per_hour = 3600
integer, public, parameter :: hours_per_day = 24
integer, public, parameter :: seconds_per_day = 86400
integer, public, parameter :: months_in_year = 12
integer, private, parameter, dimension(months_in_year) :: last_day = [31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365]

Cumulative day of year at the end of each month for a non-leap year.

integer, private, parameter, dimension(months_in_year) :: last_day_leap = [31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366]

Cumulative day of year at the end of each month for a leap year.

integer, private, parameter :: START_YEAR_UNDEFINED = -1
integer, private :: start_year = START_YEAR_UNDEFINED

Start year of the simulation.


Functions

public function cable_timing_frequency_matches(dels, ktau, frequency) result(match)

Determines whether the current time step matches the specified frequency.

Arguments

Type IntentOptional Attributes Name
real, intent(in) :: dels

Model time step in seconds

integer, intent(in) :: ktau

Current time step index

character(len=*), intent(in) :: frequency

Frequency string: 'all', 'user', 'daily', 'monthly'

Return Value logical

public function cable_timing_frequency_is_greater_than(freq_a, freq_b, dels) result(freq_a_greater_than_b)

Utility function to determine whether one frequency is greater than another following the ordering "all" > "user" > "daily" > "monthly".

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: freq_a

The first frequency to compare, one of "all", "user", "daily", or "monthly".

character(len=*), intent(in) :: freq_b

The second frequency to compare, one of "all", "user", "daily", or "monthly".

real, intent(in) :: dels

Model time step in seconds, used for comparing against "user" frequencies.

Return Value logical


Subroutines

public subroutine cable_timing_set_start_year(year)

Set the start year of the simulation. This is used for calculating monthly timing.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: year