updateWithFieldBundle Subroutine

public subroutine updateWithFieldBundle(self, target, root_key, keywordEnforcer, rc)

Type Bound

ESMF_InfoDescribe

Arguments

Type IntentOptional Attributes Name
class(ESMF_InfoDescribe), intent(inout) :: self
type(ESMF_FieldBundle), intent(in) :: target
character(len=*), intent(in) :: root_key
type(ESMF_KeywordEnforcer), optional :: keywordEnforcer
integer, intent(inout), optional :: rc

Source Code

subroutine updateWithFieldBundle(self, target, root_key, keywordEnforcer, rc)
  class(ESMF_InfoDescribe), intent(inout) :: self
  type(ESMF_FieldBundle), intent(in) :: target
  character(*), intent(in) :: root_key
type(ESMF_KeywordEnforcer), optional:: keywordEnforcer ! must use keywords below
  integer, intent(inout), optional :: rc
  character(ESMF_MAXSTR) :: name
  integer :: localrc
  character(*), parameter :: etype = "FieldBundle"
  character(:), allocatable :: uname
  logical :: isPacked
  type(ESMF_Info) :: infoh

  if (present(rc)) rc = ESMF_RC_NOT_IMPL

  call ESMF_FieldBundleGet(target, name=name, isPacked=isPacked, rc=localrc)
  if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, ESMF_CONTEXT, rcToReturn=rc)) return

  call self%updateGeneric(root_key, name, etype, target%this%base, uname=uname, rc=localrc)
  if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, ESMF_CONTEXT, rcToReturn=rc)) return

  if (self%createInfo) then
    call ESMF_InfoSet(self%info, root_key//"/"//uname//"/is_packed", isPacked, rc=localrc)
    if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, ESMF_CONTEXT, rcToReturn=rc)) return

    if (.not. isPacked) then
      call self%FillMembers(target, root_key//"/"//uname//"/members", rc=localrc)
      if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, ESMF_CONTEXT, rcToReturn=rc)) return
      deallocate(uname)
    endif
  endif

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