ESMF_LogFinalize Subroutine

public subroutine ESMF_LogFinalize(rc)

Arguments

Type IntentOptional Attributes Name
integer, intent(out), optional :: rc

Source Code

      subroutine ESMF_LogFinalize(rc)
!
! !ARGUMENTS:
      integer, intent(out), optional  :: rc

! !DESCRIPTION:
!      This routine finalizes the global Log.  The default Log will be flushed
!      and closed.  All user logs will also be closed.
!
!      The arguments are:
!      \begin{description}
!
!      \item [{[rc]}]
!            Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
!      \end{description}
!
!EOPI

        integer :: rc2,k
        type(ESMF_Log)                                    :: log

    ! Initialize return code; assume routine not implemented
    if (present(rc)) rc = ESMF_RC_NOT_IMPL

        ESMF_INIT_CHECK_SET_SHALLOW(ESMF_LogGetInit,ESMF_LogInit,log)

        ! Loop through all ESMF_LogTable(*) and close the files
        do k = 1,ESMF_LogTableCount
          log%logTableIndex = k
          call ESMF_LogClose(log, rc=rc)
        enddo

        call c_ESMC_LogFinalize(rc2)

end subroutine ESMF_LogFinalize