5 use fms_mod,
only: uppercase
6 use mpp_mod,
only: mpp_error, fatal
7 use time_manager_mod,
only: time_type, set_time, set_date, get_date
8 use time_manager_mod,
only: gregorian, julian, noleap, thirty_day_months, no_calendar
9 use time_manager_mod,
only: fms_get_calendar_type => get_calendar_type
11 use esmf,
only: esmf_calkind_flag, esmf_calkind_gregorian
12 use esmf,
only: esmf_calkind_julian, esmf_calkind_noleap
13 use esmf,
only: esmf_calkind_360day, esmf_calkind_nocalendar
14 use esmf,
only: esmf_time, esmf_timeget, esmf_logfounderror
15 use esmf,
only: esmf_logerr_passthru,esmf_timeinterval
16 use esmf,
only: esmf_timeintervalget, esmf_timeset, esmf_success
18 implicit none;
private
42 character(len=*),
intent(in) :: calendar
44 select case( uppercase(trim(calendar)) )
56 call mpp_error(fatal, &
57 'ocean_solo: ocean_solo_nml entry calendar must be one of GREGORIAN|JULIAN|NOLEAP|THIRTY_DAY|NO_CALENDAR.' )
64 integer,
intent(in) :: calendar
67 case(thirty_day_months)
83 type(esmf_time),
intent(in) :: time
86 integer :: yy, mm, dd, h, m, s
87 type(esmf_calkind_flag) :: calkind
91 call esmf_timeget(time, yy=yy, mm=mm, dd=dd, h=h, m=m, s=s, &
92 calkindflag=calkind, rc=rc)
93 if (esmf_logfounderror(rctocheck=rc, msg=esmf_logerr_passthru, &
105 type(esmf_timeinterval),
intent(in):: timestep
109 type(esmf_calkind_flag) :: calkind
113 call esmf_timeintervalget(timestep, s=s, calkindflag=calkind, rc=rc)
114 if (esmf_logfounderror(rctocheck=rc, msg=esmf_logerr_passthru, &
126 type(time_type),
intent(in) :: time
127 type(esmf_calkind_flag),
intent(in),
optional :: calkind
130 integer :: yy, mm, d, h, m, s
131 type(esmf_calkind_flag) :: l_calkind
135 if(
present(calkind))
then
141 call get_date(time, yy, mm, d, h, m, s)
143 call esmf_timeset(
fms2esmf_time, yy=yy, mm=mm, d=d, h=h, m=m, s=s, &
144 calkindflag=l_calkind, rc=rc)
145 if (esmf_logfounderror(rctocheck=rc, msg=esmf_logerr_passthru, &
155 character(len=15),
intent(in) :: string
156 integer,
intent(out),
optional :: rc
160 integer :: yr,mon,day,hr,min,sec
162 if(
present(rc)) rc = esmf_success
164 read(string,
'(I4.4,I2.2,I2.2,".",I2.2,I2.2,I2.2)') yr, mon, day, hr, min, sec