Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions src/framework/mpas_forcing.F
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ module mpas_forcing
#define FORCING_WARNING_WRITE(M) call mpas_log_write( M , messageType=MPAS_LOG_WARN)
#define FORCING_ERROR_WRITE(M) call mpas_log_write( M , messageType=MPAS_LOG_ERR)

use mpas_kind_types
use mpas_derived_types
use mpas_field_routines
use mpas_pool_routines
Expand Down Expand Up @@ -250,7 +251,7 @@ subroutine mpas_forcing_init_field(&!{{{
! forward variable interval function
interface
function variable_interval_forward(currentTime) result(variableInterval)
use mpas_timekeeping
use mpas_derived_types
type(MPAS_Time_type), intent(in) :: currentTime
type(MPAS_TimeInterval_type) :: variableInterval
end function variable_interval_forward
Expand All @@ -259,7 +260,7 @@ end function variable_interval_forward
! backward variable interval function
interface
function variable_interval_backward(currentTime) result(variableInterval)
use mpas_timekeeping
use mpas_derived_types
type(MPAS_Time_type), intent(in) :: currentTime
type(MPAS_TimeInterval_type) :: variableInterval
end function variable_interval_backward
Expand Down Expand Up @@ -424,7 +425,7 @@ subroutine create_new_forcing_stream(&!{{{
! forward variable interval function
interface
function variable_interval_forward(currentTime) result(variableInterval)
use mpas_timekeeping
use mpas_derived_types
type(MPAS_Time_type), intent(in) :: currentTime
type(MPAS_TimeInterval_type) :: variableInterval
end function variable_interval_forward
Expand All @@ -433,7 +434,7 @@ end function variable_interval_forward
! backward variable interval function
interface
function variable_interval_backward(currentTime) result(variableInterval)
use mpas_timekeeping
use mpas_derived_types
type(MPAS_Time_type), intent(in) :: currentTime
type(MPAS_TimeInterval_type) :: variableInterval
end function variable_interval_backward
Expand Down Expand Up @@ -587,7 +588,7 @@ subroutine add_forcing_field_to_forcing_stream(&!{{{
! forward variable interval function
interface
function variable_interval_forward(currentTime) result(variableInterval)
use mpas_timekeeping
use mpas_derived_types
type(MPAS_Time_type), intent(in) :: currentTime
type(MPAS_TimeInterval_type) :: variableInterval
end function variable_interval_forward
Expand All @@ -596,7 +597,7 @@ end function variable_interval_forward
! backward variable interval function
interface
function variable_interval_backward(currentTime) result(variableInterval)
use mpas_timekeeping
use mpas_derived_types
type(MPAS_Time_type), intent(in) :: currentTime
type(MPAS_TimeInterval_type) :: variableInterval
end function variable_interval_backward
Expand Down
64 changes: 57 additions & 7 deletions src/framework/mpas_timekeeping.F
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,65 @@ module mpas_timekeeping
use ESMF_TimeMod
use ESMF_TimeIntervalMod

private :: mpas_calibrate_alarms
private :: mpas_in_ringing_envelope

integer :: TheCalendar
private

! public members
public :: &
mpas_timekeeping_init, &
mpas_timekeeping_finalize, &
mpas_timekeeping_set_year_width, &
mpas_create_clock, &
mpas_destroy_clock, &
mpas_is_clock_start_time, &
mpas_is_clock_stop_time, &
mpas_set_clock_direction, &
mpas_get_clock_direction, &
mpas_set_clock_timestep, &
mpas_get_clock_timestep, &
mpas_advance_clock, &
mpas_set_clock_time, &
mpas_get_clock_time, &
mpas_add_clock_alarm, &
mpas_remove_clock_alarm, &
mpas_is_alarm_defined, &
mpas_alarm_interval, &
mpas_minimum_alarm_interval, &
mpas_alarm_get_next_ring_time, &
mpas_print_alarm, &
mpas_is_alarm_ringing, &
mpas_get_clock_ringing_alarms, &
mpas_reset_clock_alarm, &
mpas_adjust_alarm_to_reference_time, &
mpas_set_time, &
mpas_get_time, &
mpas_set_timeInterval, &
mpas_get_timeInterval, &
mpas_interval_division, &
mpas_split_string, &
mpas_get_month_day, &
isLeapYear, &
mpas_expand_string, &
abs

public :: &
operator(+), &
operator(-), &
operator(*), &
operator(/), &
operator(.EQ.), &
operator(.NE.), &
operator(.LT.), &
operator(.GT.), &
operator(.LE.), &
operator(.GE.)

integer, dimension(12), parameter, public :: daysInMonth = (/31,28,31,30,31,30,31,31,30,31,30,31/)
integer, dimension(12), parameter, public :: daysInMonthLeap = (/31,29,31,30,31,30,31,31,30,31,30,31/)

! local members
integer :: TheCalendar
integer :: yearWidth

integer, dimension(12), parameter :: daysInMonth = (/31,28,31,30,31,30,31,31,30,31,30,31/)
integer, dimension(12), parameter :: daysInMonthLeap = (/31,29,31,30,31,30,31,31,30,31,30,31/)

interface operator (+)
module procedure add_t_ti
module procedure add_ti_ti
Expand Down