ESMF_InfoSetINFO Subroutine

private subroutine ESMF_InfoSetINFO(info, key, value, keywordEnforcer, force, rc)

Arguments

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

Source Code

subroutine ESMF_InfoSetINFO(info, key, value, keywordEnforcer, force, rc)
! !ARGUMENTS:
  type(ESMF_Info), intent(inout) :: info
  character(len=*), intent(in) :: key
  type(ESMF_Info), intent(in) :: value
type(ESMF_KeywordEnforcer), optional:: keywordEnforcer ! must use keywords below
  logical, intent(in), optional :: force
  integer, intent(out), optional :: rc
!
! !DESCRIPTION:
!     Set a value to the contents of an \texttt{ESMF\_Info} object. A copy of
!     the source contents is made.
!
!     The arguments are:
!     \begin{description}
!     \item [info]
!       Target \texttt{ESMF\_Info} object.
!     \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 [value]
!       The \texttt{ESMF\_Info} object to use as source data.
!     \item [{[force]}]
!       Default is true. When true, insert the key even if it already exists in
!       storage. If false, \textit{rc} will not return {\tt ESMF\_SUCCESS} if the
!       key already exists.
!     \item [{[rc]}]
!       Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
!     \end{description}
!EOP

  integer :: localrc
  logical(C_BOOL) :: local_force

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

  if (present(force)) then
    local_force = force
  else
    local_force = .true.
  end if

  call c_info_set_INFO(&
    info%ptr, &
    trim(key)//C_NULL_CHAR, &
    value%ptr, &
    local_force, &
    localrc)
  if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, ESMF_CONTEXT, rcToReturn=rc)) return

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