SUBROUTINE SID2(KDUM,PU,PV)

!***  *SID2* - change to orthonormal basis

!**   Purpose.
!     --------
!            go from the initial basis to the orthonormal basis
!            (with respect to the inner product).

!**   Interface.
!     *CALL* *SID2(KDUM,PU,PV)* (from M1QN3A)

!        Explicit arguments :
!        --------------------
!        KDUM   : dimension of the problem
!        PU     : in initial basis
!        PV     : in final basis

!        Implicit arguments :
!        --------------------

!     Method.
!     -------
!        See documentation : The modules M1QN2,N1QN2,M1QN3,N1QN3
!                            version 1.1.b (February 1989)
!                            J.C Gilbert and C. Lemarechal

!     Externals.
!     ----------
!      none

!     Reference.
!     ----------
!        ECMWF research department documentation of the IFS

!     Author.
!     -------
!        Jean-Noel Thepaut *ECMWF*

!     Modifications.
!     --------------
!        Original : 91-09-19
!        E.Andersson : 96-08-01 - Use pre-calculated SQRT of SCALP
!        M.Hamrud    : 98-01-10 - Minimisation parallelized
!        M.Fisher    : 02-07-15 - Don't call PRECOND if LAVCGL.OR.LCONGRAD
!        Y.Tremolet  : 02-08-05 - Use control_vectors.
!        M.Hamrud    : 03-10-01 - CY28 Cleaning
!        F.Taillefer : 05-04-06 - creation of SID2 (~ CTONB from CY15 with SCALP=1)
!     ------------------------------------------------------------------

USE PARKIND1  ,ONLY : JPIM     ,JPRB
USE YOMHOOK   ,ONLY : LHOOK,   DR_HOOK

IMPLICIT NONE

INTEGER(KIND=JPIM),INTENT(IN) :: KDUM
REAL(KIND=JPRB),INTENT(IN)    :: PU(:)
REAL(KIND=JPRB),INTENT(INOUT) :: PV(:)

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

!     --------------------------------------------------
!*    1.  CHANGE BASIS
!         ------------

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

DO J=1,KDUM
  PV(J)=PU(J)
ENDDO

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

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