subroutine ESMF_InfoCacheUpdateFields(self, target, vmIdMap, rc)
! !ARGUMENTS:
class(ESMF_InfoCache), intent(inout) :: self
type(ESMF_State), intent(in) :: target
type(ESMF_VMId), dimension(:), pointer, intent(in) :: vmIdMap
integer, intent(out) :: rc
!
! !DESCRIPTION:
! Traverse the object hierarchy of \textit{target} updating Field attributes
! for StateReconcile optimizations.
!
! The arguments are:
! \begin{description}
! \item [self]
! Class instance.
! \item [target]
! Target \texttt{ESMF\_State} to traverse recursively.
! \item [vmIdMap]
! An \texttt{ESMF\_VMId} map as computed by \texttt{ESMF\_VMTranslateVMId}.
! \item [rc]
! Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
! \end{description}
!EOPI
type(ESMF_InfoDescribe) :: idesc
call idesc%Initialize(createInfo=.true., addBaseAddress=.true., vmIdMap=vmIdMap, rc=rc)
if (ESMF_LogFoundError(rc, ESMF_ERR_PASSTHRU, ESMF_CONTEXT, rcToReturn=rc)) return
call idesc%Update(target, "", rc=rc)
if (ESMF_LogFoundError(rc, ESMF_ERR_PASSTHRU, ESMF_CONTEXT, rcToReturn=rc)) return
rc = c_infocache_updatefields(self%ptr, idesc%info%ptr)
if (ESMF_LogFoundError(rc, ESMF_ERR_PASSTHRU, ESMF_CONTEXT, rcToReturn=rc)) return
call idesc%Destroy(rc=rc)
if (ESMF_LogFoundError(rc, ESMF_ERR_PASSTHRU, ESMF_CONTEXT, rcToReturn=rc)) return
end subroutine ESMF_InfoCacheUpdateFields