ESMF_InfoDescribeInitialize Subroutine

public subroutine ESMF_InfoDescribeInitialize(self, addBaseAddress, addObjectInfo, createInfo, searchCriteria, vmIdMap, rc)

Type Bound

ESMF_InfoDescribe

Arguments

Type IntentOptional Attributes Name
class(ESMF_InfoDescribe), intent(inout) :: self
logical, intent(in), optional :: addBaseAddress
logical, intent(in), optional :: addObjectInfo
logical, intent(in), optional :: createInfo
type(ESMF_Info), intent(in), optional, target :: searchCriteria
type(ESMF_VMId), intent(in), optional, dimension(:), pointer :: vmIdMap
integer, intent(inout), optional :: rc

Source Code

subroutine ESMF_InfoDescribeInitialize(self, addBaseAddress, addObjectInfo, createInfo, &
    searchCriteria, vmIdMap, rc)
  class(ESMF_InfoDescribe), intent(inout) :: self
  logical, intent(in), optional :: addBaseAddress
  logical, intent(in), optional :: addObjectInfo
  logical, intent(in), optional :: createInfo
  type(ESMF_Info), target, intent(in), optional :: searchCriteria
  type(ESMF_VMId), dimension(:), pointer, intent(in), optional :: vmIdMap
  integer, intent(inout), optional :: rc
  integer :: localrc

  localrc = ESMF_FAILURE
  if (present(rc)) rc = ESMF_RC_NOT_IMPL

  if (self%is_initialized) then
    if (ESMF_LogFoundError(ESMF_FAILURE, msg="Object already initialized", ESMF_CONTEXT, rcToReturn=rc)) return
  endif


  nullify(self%searchCriteria)
  nullify(self%vmIdMap)
  if (present(searchCriteria)) then
    self%addBaseAddress = .true.
    self%addObjectInfo = .true.
    self%createInfo = .true.
    self%searchCriteria => searchCriteria
  else
    if (present(addBaseAddress)) self%addBaseAddress = addBaseAddress
    if (present(addObjectInfo)) self%addObjectInfo = addObjectInfo
    if (present(createInfo)) self%createInfo = createInfo
  end if
  if (self%createInfo) then
    self%info = ESMF_InfoCreate(rc=localrc)
    if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, ESMF_CONTEXT, rcToReturn=rc)) return
  end if
  if (present(vmIdMap)) then
    if (associated(vmIdMap)) then
      self%vmIdMap => vmIdMap
    else
      if (ESMF_LogFoundError(ESMF_FAILURE, msg="vmIdMap pointer provided but it is not associated", &
        ESMF_CONTEXT, rcToReturn=rc)) return
    end if
  end if

  self%is_initialized = .true.

  if (present(rc)) rc = ESMF_SUCCESS
end subroutine ESMF_InfoDescribeInitialize