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~2 FileMetadataUtils%get_dimension proc~get_file_times->none~get_dimension~2 none~get_time_info FileMetadataUtils%get_time_info proc~get_file_times->none~get_time_info none~get_var_attr_int32 FileMetadataUtils%get_var_attr_int32 proc~get_file_times->none~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 none~get_dimension~2->proc~mapl_verify none~get_dimension FileMetadata%get_dimension none~get_dimension~2->none~get_dimension proc~mapl_return MAPL_Return none~get_dimension~2->proc~mapl_return none~get_time_info->ESMF_TimeGet none~get_time_info->proc~mapl_verify ESMF_TimeIntervalSet ESMF_TimeIntervalSet none~get_time_info->ESMF_TimeIntervalSet ESMF_TimeSet ESMF_TimeSet none~get_time_info->ESMF_TimeSet interface~mapl_assert MAPL_Assert none~get_time_info->interface~mapl_assert none~get_attribute Variable%get_attribute none~get_time_info->none~get_attribute none~get_coordinate_data CoordinateVariable%get_coordinate_data none~get_time_info->none~get_coordinate_data none~get_coordinate_info FileMetadataUtils%get_coordinate_info none~get_time_info->none~get_coordinate_info none~get_coordinate_variable~2 FileMetadataUtils%get_coordinate_variable none~get_time_info->none~get_coordinate_variable~2 none~get_file_name FileMetadataUtils%get_file_name none~get_time_info->none~get_file_name none~get_value UnlimitedEntity%get_value none~get_time_info->none~get_value none~get_time_info->proc~mapl_return none~get_var_attr_int32->proc~mapl_verify none~get_var_attr_int32->interface~mapl_assert none~get_var_attr_int32->none~get_attribute none~get_var_attr_int32->none~get_file_name none~get_values UnlimitedEntity%get_values none~get_var_attr_int32->none~get_values none~get_variable~2 FileMetadataUtils%get_variable none~get_var_attr_int32->none~get_variable~2 none~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~85 StringAttributeMap%at none~get_attribute->none~at~85 none~get_coordinate_data->proc~mapl_return none~get_coordinate_info->none~get_dimension~2 none~get_coordinate_info->proc~mapl_verify none~get_coordinate_info->interface~mapl_assert none~get_coordinate_info->none~get_attribute none~get_coordinate_info->none~get_coordinate_data none~get_coordinate_info->none~get_coordinate_variable~2 none~get_coordinate_info->none~get_file_name none~get_coordinate_info->none~get_value none~get_coordinate_info->proc~mapl_return none~get_ith_dimension Variable%get_ith_dimension none~get_coordinate_info->none~get_ith_dimension none~var_has_attr FileMetadataUtils%var_has_attr none~get_coordinate_info->none~var_has_attr none~get_coordinate_variable~2->proc~mapl_verify none~get_coordinate_variable~2->proc~mapl_return none~get_coordinate_variable FileMetadata%get_coordinate_variable none~get_coordinate_variable~2->none~get_coordinate_variable none~get_dimension->proc~mapl_return at at none~get_dimension->at find find none~get_dimension->find none~get_file_name->proc~mapl_return none~get_value->proc~mapl_return none~get_values->proc~mapl_return none~get_variable~2->proc~mapl_verify none~get_variable~2->proc~mapl_return none~get_variable FileMetadata%get_variable none~get_variable~2->none~get_variable proc~mapl_return->proc~mapl_throw_exception proc~mapl_return->at insert insert proc~mapl_return->insert

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