recursive subroutine ESMF_CompPrint(compp, rc)
!
!
! !ARGUMENTS:
type(ESMF_CompClass), pointer :: compp
integer, intent(out), optional :: rc
!
! !DESCRIPTION:
! Routine to print information about a component. \\
!
! Note: Many {\tt ESMF\_<class>Print} methods are implemented in C++.
! On some platforms/compilers there is a potential issue with interleaving
! Fortran and C++ output to {\tt stdout} such that it doesn't appear in
! the expected order. If this occurs, the {\tt ESMF\_IOUnitFlush()} method
! may be used on unit 6 to get coherent output. \\
!
!EOPI
!------------------------------------------------------------------------------
integer :: localrc ! local return code
character(len=6) :: defaultopts
character(len=ESMF_MAXSTR) :: cname
type(ESMF_Status) :: baseStatus
! Initialize return code; assume not implemented until success is certain
localrc = ESMF_RC_NOT_IMPL
if (present(rc)) rc = ESMF_RC_NOT_IMPL
defaultopts = "brief"
if (.not.associated(compp)) then
!nsc call ESMF_LogWrite("Invalid or uninitialized Component", &
!nsc ESMF_LOGMSG_INFO)
write (ESMF_UtilIOStdout,*) "Invalid or uninitialized Component"
return
endif
! Check init status of arguments
ESMF_INIT_CHECK_DEEP(ESMF_CompClassGetInit, compp, rc)
call ESMF_BaseGetStatus(compp%base, baseStatus, rc=localrc)
if (ESMF_LogFoundError(localrc, &
ESMF_ERR_PASSTHRU, &
ESMF_CONTEXT, rcToReturn=rc)) return
if (baseStatus /= ESMF_STATUS_READY) then
!nsc call ESMF_LogWrite("Invalid or uninitialized Component", &
!nsc ESMF_LOGMSG_INFO)
write (ESMF_UtilIOStdout,*) "Invalid or uninitialized Component"
return
endif
call ESMF_GetName(compp%base, cname, rc=localrc)
if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, &
ESMF_CONTEXT, rcToReturn=rc)) return
write (ESMF_UtilIOStdout,*) " Component name = ", trim(cname)
! TODO: add more info here
! Return successfully
if (present(rc)) rc = ESMF_SUCCESS
end subroutine ESMF_CompPrint