get_var_attr_real32 Function

public function get_var_attr_real32(this, var_name, attr_name, rc) result(attr_real32)

Type Bound

FileMetadataUtils

Arguments

Type IntentOptional Attributes Name
class(FileMetadataUtils), intent(inout) :: this
character(len=*), intent(in) :: var_name
character(len=*), intent(in) :: attr_name
integer, intent(out), optional :: rc

Return Value real(kind=REAL32)


Calls

proc~~get_var_attr_real32~~CallsGraph proc~get_var_attr_real32 FileMetadataUtils%get_var_attr_real32 interface~mapl_assert MAPL_Assert proc~get_var_attr_real32->interface~mapl_assert none~get_attribute Variable%get_attribute proc~get_var_attr_real32->none~get_attribute none~get_values UnlimitedEntity%get_values proc~get_var_attr_real32->none~get_values none~get_variable FileMetadata%get_variable proc~get_var_attr_real32->none~get_variable proc~get_file_name FileMetadataUtils%get_file_name proc~get_var_attr_real32->proc~get_file_name proc~mapl_return MAPL_Return proc~get_var_attr_real32->proc~mapl_return proc~mapl_verify MAPL_Verify proc~get_var_attr_real32->proc~mapl_verify none~get_attribute->interface~mapl_assert none~get_attribute->proc~mapl_return none~at~140 StringAttributeMap%at none~get_attribute->none~at~140 none~get_values->proc~mapl_return none~get_variable->proc~mapl_return none~at~5 StringVariableMap%at none~get_variable->none~at~5 proc~get_file_name->proc~mapl_return at at proc~mapl_return->at insert insert proc~mapl_return->insert proc~mapl_throw_exception MAPL_throw_exception proc~mapl_return->proc~mapl_throw_exception proc~mapl_verify->proc~mapl_throw_exception none~find~39 StringAttributeMap%find none~at~140->none~find~39 none~find~2 StringVariableMap%find none~at~5->none~find~2

Called by

proc~~get_var_attr_real32~~CalledByGraph proc~get_var_attr_real32 FileMetadataUtils%get_var_attr_real32 proc~var_get_missing_value FileMetadataUtils%var_get_missing_value proc~var_get_missing_value->proc~get_var_attr_real32 none~swap_undef_value MAPL_GriddedIO%swap_undef_value none~swap_undef_value->proc~var_get_missing_value program~time_ave time_ave program~time_ave->proc~var_get_missing_value none~process_data_from_file MAPL_GriddedIO%process_data_from_file none~process_data_from_file->none~swap_undef_value proc~mapl_read_bundle MAPL_read_bundle proc~mapl_read_bundle->none~process_data_from_file

Source Code

   function get_var_attr_real32(this,var_name,attr_name,rc) result(attr_real32)
      real(REAL32) :: attr_real32
      class(FileMetadataUtils), intent(inout) :: this
      character(len=*), intent(in) :: var_name
      character(len=*), intent(in) :: attr_name
      integer, optional, intent(out) :: rc

      real(REAL32) :: tmp(1)
      real(REAL64) :: tmpd(1)
      integer :: status
      character(:), allocatable :: fname
      type(Attribute), pointer :: attr
      type(Variable), pointer :: var
      class(*), pointer :: attr_val(:)

      fname = this%get_file_name(_RC)
      var => this%get_variable(var_name,_RC)
      _ASSERT(associated(var),"no variable named "//var_name//" in "//fname)
      attr => var%get_attribute(attr_name,_RC)
      _ASSERT(associated(attr),"no attribute named "//attr_name//" in "//var_name//" in "//fname)
      attr_val => attr%get_values()
      select type(attr_val)
      type is(real(kind=REAL32))
         tmp = attr_val
         attr_real32 = tmp(1)
      type is(real(kind=REAL64))
         tmpd = attr_val
         attr_real32 = REAL(tmpd(1))
      class default
         _FAIL('unsupported subclass (not real32) for units of attribute named '//attr_name//' in '//var_name//' in '//fname)
      end select

      _RETURN(_SUCCESS)
   end function get_var_attr_real32