updateWithState Subroutine

public recursive subroutine updateWithState(self, state, root_key, keywordEnforcer, rc)

Type Bound

ESMF_InfoDescribe

Arguments

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

Source Code

recursive subroutine updateWithState(self, state, root_key, keywordEnforcer, rc)
  class(ESMF_InfoDescribe), intent(inout) :: self
  type(ESMF_State), intent(in) :: state
  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(:), allocatable :: uname

  if (present(rc)) rc = ESMF_RC_NOT_IMPL

  call ESMF_StateGet(state, name=name, rc=localrc)
  if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, ESMF_CONTEXT, rcToReturn=rc)) return

  call self%updateGeneric(root_key, name, "State", state%statep%base, uname=uname, rc=localrc)
  if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, ESMF_CONTEXT, rcToReturn=rc)) return

  if (self%createInfo) then
    call self%FillMembers(state, root_key//"/"//uname//"/members", rc=localrc)
    if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, ESMF_CONTEXT, rcToReturn=rc)) return
    deallocate(uname)
  end if

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