6 use time_manager_mod,
only : time_type, get_time, set_time
7 use time_manager_mod,
only : time_type_to_real, real_to_time_type
8 use time_manager_mod,
only :
operator(+),
operator(-),
operator(*),
operator(/)
9 use time_manager_mod,
only :
operator(>),
operator(<),
operator(>=),
operator(<=)
10 use time_manager_mod,
only :
operator(==),
operator(/=),
operator(//)
11 use time_manager_mod,
only : set_ticks_per_second , get_ticks_per_second
12 use time_manager_mod,
only : get_date, set_date, increment_date
13 use time_manager_mod,
only : days_in_month, month_name
14 use time_manager_mod,
only : set_calendar_type, get_calendar_type
15 use time_manager_mod,
only : julian, noleap, thirty_day_months, gregorian
16 use time_manager_mod,
only : no_calendar
17 use time_interp_external_mod,
only : init_external_field, time_interp_external, time_interp_external_init
18 use time_interp_external_mod,
only : get_external_field_size
19 use time_interp_external_mod,
only : get_external_field_axes, get_external_field_missing
21 implicit none ;
private
23 public :: time_type, get_time, set_time
24 public :: time_type_to_real, real_to_time_type,
real_to_time
25 public :: set_ticks_per_second, get_ticks_per_second
26 public ::
operator(+),
operator(-),
operator(*),
operator(/)
27 public ::
operator(>),
operator(<),
operator(>=),
operator(<=)
28 public ::
operator(==),
operator(/=),
operator(//)
29 public :: get_date, set_date, increment_date, month_name, days_in_month
30 public :: julian, noleap, thirty_day_months, gregorian, no_calendar
31 public :: set_calendar_type, get_calendar_type
32 public :: init_external_field
33 public :: time_interp_external
34 public :: time_interp_external_init
35 public :: get_external_field_size
36 public :: get_external_field_axes
37 public :: get_external_field_missing
49 character(len=*),
intent(out),
optional :: err_msg
52 integer :: seconds, days, ticks
53 real :: real_subsecond_remainder
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())
60 real_to_time = set_time(seconds=seconds, days=days, ticks=ticks, err_msg=err_msg)