ESMF_InfoWriteJSON Subroutine

public subroutine ESMF_InfoWriteJSON(info, filename, keywordEnforcer, rc)

Arguments

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

Source Code

subroutine ESMF_InfoWriteJSON(info, filename, keywordEnforcer, rc)
! !ARGUMENTS:
  type(ESMF_Info), intent(in) :: info
  character(len=*), intent(in) :: filename
type(ESMF_KeywordEnforcer), optional:: keywordEnforcer ! must use keywords below
  integer, intent(out), optional :: rc
!
! !DESCRIPTION:
!     Write \texttt{ESMF\_Info} contents to file using the JSON format.
!
!     The arguments are:
!     \begin{description}
!     \item [info]
!       Target \texttt{ESMF\_Info} object.
!     \item [filename]
!       Path to the output file.
!     \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

  call c_info_write_json(info%ptr, trim(filename)//C_NULL_CHAR, localrc)
  if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, ESMF_CONTEXT, rcToReturn=rc)) return

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