SUBROUTINE PRT_CONV_DIAGS

!     Purpose.
!     --------
!        Print convergence diagnostics.

!     Author.
!     -------
!        Y.Tremolet

!     Modifications.
!     --------------
!        Original : 03-Nov-2004
! ------------------------------------------------------------------

USE PARKIND1, ONLY: JPIM, JPRB
USE YOMHOOK , ONLY: LHOOK, DR_HOOK
USE YOMLUN  , ONLY: NULOUT
USE YOMCVA  , ONLY: YVAZX
USE YOMVCGL , ONLY: NVCGLEV, YVCGLEV, RCGLEV, NVCGLPC, YVCGLPC

IMPLICIT NONE

INTEGER(KIND=JPIM) :: jj
REAL(KIND=JPRB) :: ZHOOK_HANDLE

#include "prt_ctlvec_norms.intfb.h"
#include "prt_ctlvec_max.intfb.h"

! ------------------------------------------------------------------

IF (LHOOK) CALL DR_HOOK('PRT_CONV_DIAGS',0,ZHOOK_HANDLE)

! Control vector
! --------------
WRITE(NULOUT,*)'PRT_CONV_DIAGS: Control Vector'
CALL PRT_CTLVEC_NORMS(YVAZX,'VAZX')

! Preconditioning vectors
! -----------------------
WRITE(NULOUT,*)'PRT_CONV_DIAGS: Preconditioning vectors NVCGLPC=',NVCGLPC
DO jj=1,NVCGLPC
  WRITE(NULOUT,*)'Preconditioning vector',jj
  CALL PRT_CTLVEC_MAX(YVCGLPC(jj),'PC')
ENDDO

! Eigenvectors
! ------------
WRITE(NULOUT,*)'PRT_CONV_DIAGS: Converged eigenvectors NVCGLEV=',NVCGLEV
DO jj=1,NVCGLEV
  WRITE(NULOUT,*)'Eigenvector',jj,'Eigenvalue=',RCGLEV(jj)
  CALL PRT_CTLVEC_MAX(YVCGLEV(jj),'EV')
ENDDO

IF (LHOOK) CALL DR_HOOK('PRT_CONV_DIAGS',1,ZHOOK_HANDLE)
END SUBROUTINE PRT_CONV_DIAGS
