ESMF_InfoPrint Subroutine

public subroutine ESMF_InfoPrint(info, keywordEnforcer, indent, preString, unit, rc)

Arguments

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

Calls

proc~~esmf_infoprint~~CallsGraph proc~esmf_infoprint ESMF_InfoPrint proc~esmf_infodump ESMF_InfoDump proc~esmf_infoprint->proc~esmf_infodump proc~esmf_logfounderror ESMF_LogFoundError proc~esmf_infoprint->proc~esmf_logfounderror proc~esmf_infodump->proc~esmf_logfounderror interface~c_info_dump c_info_dump proc~esmf_infodump->interface~c_info_dump interface~c_info_dump_len c_info_dump_len proc~esmf_infodump->interface~c_info_dump_len esmf_breakpoint esmf_breakpoint proc~esmf_logfounderror->esmf_breakpoint proc~esmf_logrc2msg ESMF_LogRc2Msg proc~esmf_logfounderror->proc~esmf_logrc2msg proc~esmf_logwrite ESMF_LogWrite proc~esmf_logfounderror->proc~esmf_logwrite c_esmc_loggeterrormsg c_esmc_loggeterrormsg proc~esmf_logrc2msg->c_esmc_loggeterrormsg c_esmc_vmwtime c_esmc_vmwtime proc~esmf_logwrite->c_esmc_vmwtime proc~esmf_logclose ESMF_LogClose proc~esmf_logwrite->proc~esmf_logclose proc~esmf_logflush ESMF_LogFlush proc~esmf_logwrite->proc~esmf_logflush proc~esmf_logopenfile ESMF_LogOpenFile proc~esmf_logwrite->proc~esmf_logopenfile proc~esmf_utiliounitflush ESMF_UtilIOUnitFlush proc~esmf_logwrite->proc~esmf_utiliounitflush proc~esmf_utilstring2array ESMF_UtilString2Array proc~esmf_logwrite->proc~esmf_utilstring2array proc~esmf_logclose->proc~esmf_logflush proc~esmf_logflush->proc~esmf_utiliounitflush proc~esmf_utilarray2string ESMF_UtilArray2String proc~esmf_logflush->proc~esmf_utilarray2string proc~esmf_logopenfile->proc~esmf_utiliounitflush proc~esmf_utiliounitget ESMF_UtilIOUnitGet proc~esmf_logopenfile->proc~esmf_utiliounitget

Called by

proc~~esmf_infoprint~~CalledByGraph proc~esmf_infoprint ESMF_InfoPrint proc~esmf_infodescribeprint ESMF_InfoDescribe%ESMF_InfoDescribePrint proc~esmf_infodescribeprint->proc~esmf_infoprint program~esmf_infotutorial ESMF_InfoTutorial program~esmf_infotutorial->proc~esmf_infoprint program~esmf_infoutest ESMF_InfoUTest program~esmf_infoutest->proc~esmf_infoprint

Source Code

subroutine ESMF_InfoPrint(info, keywordEnforcer, indent, preString, unit, rc)
! !ARGUMENTS:
  type(ESMF_Info), intent(in) :: info
type(ESMF_KeywordEnforcer), optional:: keywordEnforcer ! must use keywords below
  character(*), intent(in), optional :: preString
  character(*), intent(out), optional :: unit
  integer, intent(in), optional :: indent
  integer, intent(out), optional :: rc
!
! !DESCRIPTION:
!     Print \texttt{ESMF\_Info} contents in JSON format.
!
!     The arguments are:
!     \begin{description}
!     \item [info]
!       Target \texttt{ESMF\_Info} object.
!     \item [{[indent]}]
!       Default is 0. Specify a "pretty print" indentation for the JSON output string.
!     \item [{[preString]}]
!       Optionally prepended string. Default to empty string.
!     \item [{[unit]}]
!       Internal unit, i.e. a string. Default to printing to stdout.
!     \item [{[rc]}]
!       Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
!     \end{description}
!EOP

  integer :: localrc, local_indent
  character(:), allocatable :: output, local_preString

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

  if (present(indent)) then
    local_indent = indent
  else
    local_indent = 4
  end if
  if (present(preString)) then
    local_preString = preString
  else
    local_preString = ""
  endif

  output = ESMF_InfoDump(info, indent=local_indent, rc=localrc)
  if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, ESMF_CONTEXT, rcToReturn=rc)) return

  if (present(unit)) then
    unit = local_preString//output
  else
    print *, local_preString//output
  endif

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