get_file_times Subroutine

subroutine get_file_times(file_metadata, num_times, time_series, time_interval, yymmdd, hhmmss, rc)

Arguments

Type IntentOptional Attributes Name
type(FileMetadataUtils), intent(inout) :: file_metadata
integer, intent(out) :: num_times
type(ESMF_Time), intent(inout), allocatable :: time_series(:)
integer, intent(out) :: time_interval
integer, intent(inout), allocatable :: yymmdd(:)
integer, intent(inout), allocatable :: hhmmss(:)
integer, intent(out), optional :: rc

Calls

proc~~get_file_times~~CallsGraph proc~get_file_times get_file_times ESMF_TimeGet ESMF_TimeGet proc~get_file_times->ESMF_TimeGet ESMF_TimeIntervalGet ESMF_TimeIntervalGet proc~get_file_times->ESMF_TimeIntervalGet none~get_dimension FileMetadata%get_dimension proc~get_file_times->none~get_dimension proc~get_time_info FileMetadataUtils%get_time_info proc~get_file_times->proc~get_time_info proc~get_var_attr_int32 FileMetadataUtils%get_var_attr_int32 proc~get_file_times->proc~get_var_attr_int32 proc~mapl_abort MAPL_abort proc~get_file_times->proc~mapl_abort proc~mapl_verify MAPL_Verify proc~get_file_times->proc~mapl_verify at at none~get_dimension->at find find none~get_dimension->find proc~mapl_return MAPL_Return none~get_dimension->proc~mapl_return proc~get_time_info->ESMF_TimeGet proc~get_time_info->proc~mapl_verify ESMF_TimeIntervalSet ESMF_TimeIntervalSet proc~get_time_info->ESMF_TimeIntervalSet ESMF_TimeSet ESMF_TimeSet proc~get_time_info->ESMF_TimeSet interface~mapl_assert MAPL_Assert proc~get_time_info->interface~mapl_assert none~get_attribute Variable%get_attribute proc~get_time_info->none~get_attribute none~get_coordinate_data CoordinateVariable%get_coordinate_data proc~get_time_info->none~get_coordinate_data none~get_coordinate_variable FileMetadata%get_coordinate_variable proc~get_time_info->none~get_coordinate_variable none~get_value UnlimitedEntity%get_value proc~get_time_info->none~get_value proc~get_coordinate_info FileMetadataUtils%get_coordinate_info proc~get_time_info->proc~get_coordinate_info proc~get_file_name FileMetadataUtils%get_file_name proc~get_time_info->proc~get_file_name proc~get_time_info->proc~mapl_return proc~get_var_attr_int32->proc~mapl_verify proc~get_var_attr_int32->interface~mapl_assert proc~get_var_attr_int32->none~get_attribute none~get_values~2 UnlimitedEntity%get_values proc~get_var_attr_int32->none~get_values~2 none~get_variable FileMetadata%get_variable proc~get_var_attr_int32->none~get_variable proc~get_var_attr_int32->proc~get_file_name proc~get_var_attr_int32->proc~mapl_return mpi_abort mpi_abort proc~mapl_abort->mpi_abort proc~mapl_throw_exception MAPL_throw_exception proc~mapl_verify->proc~mapl_throw_exception none~get_attribute->interface~mapl_assert none~get_attribute->proc~mapl_return none~at~226 StringAttributeMap%at none~get_attribute->none~at~226 none~get_coordinate_data->proc~mapl_return none~get_coordinate_variable->interface~mapl_assert none~get_coordinate_variable->proc~mapl_return none~at~139 StringVariableMap%at none~get_coordinate_variable->none~at~139 none~get_value->proc~mapl_return none~get_values~2->proc~mapl_return none~get_variable->proc~mapl_return none~get_variable->none~at~139 proc~get_coordinate_info->none~get_dimension proc~get_coordinate_info->proc~mapl_verify proc~get_coordinate_info->interface~mapl_assert proc~get_coordinate_info->none~get_attribute proc~get_coordinate_info->none~get_coordinate_data proc~get_coordinate_info->none~get_coordinate_variable proc~get_coordinate_info->none~get_value proc~get_coordinate_info->proc~get_file_name proc~get_coordinate_info->proc~mapl_return none~get_ith_dimension Variable%get_ith_dimension proc~get_coordinate_info->none~get_ith_dimension proc~var_has_attr FileMetadataUtils%var_has_attr proc~get_coordinate_info->proc~var_has_attr proc~get_file_name->proc~mapl_return proc~mapl_return->at proc~mapl_return->proc~mapl_throw_exception insert insert proc~mapl_return->insert none~find~35 StringVariableMap%find none~at~139->none~find~35 none~find~59 StringAttributeMap%find none~at~226->none~find~59 none~get_ith_dimension->at none~get_ith_dimension->proc~mapl_return proc~var_has_attr->proc~mapl_verify proc~var_has_attr->interface~mapl_assert proc~var_has_attr->none~get_variable proc~var_has_attr->proc~get_file_name proc~var_has_attr->proc~mapl_return none~is_attribute_present Variable%is_attribute_present proc~var_has_attr->none~is_attribute_present

Called by

proc~~get_file_times~~CalledByGraph proc~get_file_times get_file_times program~time_ave time_ave program~time_ave->proc~get_file_times

Source Code

   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