subroutine get_file_times(file_metadata,num_times,time_series,time_interval,yymmdd,hhmmss,rc)
type(FileMetadataUtils), intent(inout) :: file_metadata
integer, intent(out) :: num_times
type(ESMF_Time), allocatable, intent(inout) :: time_series(:)
integer, intent(inout), allocatable :: yymmdd(:)
integer, intent(inout), allocatable :: hhmmss(:)
integer, intent(out) :: time_interval
integer, intent(out), optional :: rc
integer :: status
type(ESMF_TimeInterval) :: esmf_time_interval
integer :: hour, minute, second, year, month, day, i
num_times = file_metadata%get_dimension('time',_RC)
call file_metadata%get_time_info(timeVector=time_series,_RC)
if (num_times == 1) then
time_interval = file_metadata%get_var_attr_int32('time','time_increment',_RC)
else if (num_times > 1) then
esmf_time_interval = time_series(2)-time_series(1)
call ESMF_TimeIntervalGet(esmf_time_interval,h=hour,m=minute,s=second,_RC)
time_interval = hour*10000+minute*100+second
end if
allocate(yymmdd(num_times),hhmmss(num_times))
do i = 1,num_times
call ESMF_TimeGet(time_series(i),yy=year,mm=month,dd=day,h=hour,m=minute,s=second,_RC)
yymmdd(i)=year*10000+month*100+day
hhmmss(i)=hour*10000+minute*100+second
enddo
if (present(rc)) then
rc=_SUCCESS
end if
end subroutine get_file_times