ESMF_InfoCreateByKey Function

private function ESMF_InfoCreateByKey(info, key, keywordEnforcer, rc)

Arguments

Type IntentOptional Attributes Name
type(ESMF_Info), intent(in) :: info
character(len=*), intent(in) :: key
type(ESMF_KeywordEnforcer), optional :: keywordEnforcer
integer, intent(out), optional :: rc

Return Value type(ESMF_Info)


Source Code

function ESMF_InfoCreateByKey(info, key, keywordEnforcer, rc)
! !ARGUMENTS:
  type(ESMF_Info), intent(in) :: info
  character(len=*), intent(in) :: key
type(ESMF_KeywordEnforcer), optional:: keywordEnforcer ! must use keywords below
  integer, intent(out), optional :: rc
! !RETURN VALUE:
  type(ESMF_Info) :: ESMF_InfoCreateByKey
!
! !DESCRIPTION:
!     Create an \texttt{ESMF\_Info} object from a location in \textit{info}
!     defined by \textit{key}. Returned object is a deep copy. The value associated
!     with \texttt{key} must be a nested object (i.e. a collection of key/value
!     pairs).
!
!     The arguments are:
!     \begin{description}
!     \item [info]
!       The \texttt{ESMF\_Info} object providing source data.
!     \item [key]
!       String key to access in \texttt{ESMF\_Info} storage. See section \ref{info_key_format}
!       for an overview of the key format.
!     \item [{[rc]}]
!       Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
!     \end{description}
!EOP

  integer :: localrc

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

  ESMF_InfoCreateByKey%ptr = c_info_create_by_key(info%ptr, trim(key)//C_NULL_CHAR, localrc)
  if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, ESMF_CONTEXT, rcToReturn=rc)) return

  if (present(rc)) rc = ESMF_SUCCESS
end function ESMF_InfoCreateByKey