MOM6
mom_time_manager Module Reference

Detailed Description

Wraps the FMS time manager functions.

Functions/Subroutines

type(time_type) function, public real_to_time (x, err_msg)
 This is an alternate implementation of the FMS function real_to_time_type that is accurate over a larger range of input values. With 32 bit signed integers, this version should work over the entire valid range (2^31 days or ~5.8835 million years) of time_types, whereas the standard version in the FMS time_manager stops working for conversions of times greater than 2^31 seconds, or ~68.1 years. More...
 

Function/Subroutine Documentation

◆ real_to_time()

type(time_type) function, public mom_time_manager::real_to_time ( real, intent(in)  x,
character(len=*), intent(out), optional  err_msg 
)

This is an alternate implementation of the FMS function real_to_time_type that is accurate over a larger range of input values. With 32 bit signed integers, this version should work over the entire valid range (2^31 days or ~5.8835 million years) of time_types, whereas the standard version in the FMS time_manager stops working for conversions of times greater than 2^31 seconds, or ~68.1 years.

Returns
The output time as a time_type
Parameters
[in]xThe input time in real seconds.
[out]err_msgAn optional returned error message.

Definition at line 47 of file MOM_time_manager.F90.

47  type(time_type) :: real_to_time !< The output time as a time_type
48  real, intent(in) :: x !< The input time in real seconds.
49  character(len=*), intent(out), optional :: err_msg !< An optional returned error message.
50 
51  ! Local variables
52  integer :: seconds, days, ticks
53  real :: real_subsecond_remainder
54 
55  days = floor(x/86400.)
56  seconds = floor(x - 86400.*days)
57  real_subsecond_remainder = x - (days*86400. + seconds)
58  ticks = nint(real_subsecond_remainder * get_ticks_per_second())
59 
60  real_to_time = set_time(seconds=seconds, days=days, ticks=ticks, err_msg=err_msg)

Referenced by mom_ice_shelf::add_shelf_flux(), mom_controlled_forcing::apply_ctrl_forcing(), mom_barotropic::btstep(), mom_diabatic_driver::diabatic(), mom_main(), and mom_dynamics_unsplit::step_mom_dyn_unsplit().

Here is the caller graph for this function: