!OCL NOEVAL
SUBROUTINE TRANSDIR_NHCONVPRHS(PSPD,PSP)

!* TRANSDIR_NHCONVPRHS
!  - Conversion of NH variables (model to file and vice-versa)
!    Direct spectral transforms.
!    Part of the conversion relevant if LRWSDLR=T, to convert quantities
!    based on "prehyd" towards quantities based on "presim" (or the reverse
!    one).

! Purpose
! -------

! Interface
! ---------
!  * INPUT: 
!    PSPD            : NH pressure departure variable
!    PSP             : log(prehyds)

! Externals
! ---------

! Method
! ------
!   See documentation

! Reference
! ---------
!        ECMWF Research Department documentation of the IFS
!        ARPEGE documentation (IDEUL)
!        Wood and Staniforth, 2003 (in QJRMS)

! Author
! ------
!   March-2008 K. Yessad (METEO-FRANCE/CNRM/GMAP)

! Modifications
! -------------
! End Modifications
!------------------------------------------------------------------------------

USE PARKIND1 , ONLY : JPIM     ,JPRB
USE YOMHOOK  , ONLY : LHOOK    ,DR_HOOK
USE YOMDIM   , ONLY : NFLSUR   ,NFLEVG
USE YOMGEM   , ONLY : NGPTOT
USE YOMSP    , ONLY : SPSPD    ,SPSP

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

IMPLICIT NONE

REAL(KIND=JPRB),INTENT(IN) :: PSPD(NGPTOT,NFLEVG)
REAL(KIND=JPRB),INTENT(IN) :: PSP(NGPTOT)

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

REAL(KIND=JPRB) :: ZHOOK_HANDLE

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

#include "reespe.intfb.h"

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

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

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

!* 1. TRANSFORM NH FIELDS BACK TO SPECTRAL SPACE
!     ------------------------------------------

! * pressure departure variable
CALL REESPE(NFLSUR,NFLEVG,SPSPD,PSPD)

! * surface pressure 
CALL REESPE(1,1,SPSP,PSP)

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

IF (LHOOK) CALL DR_HOOK('TRANSDIR_NHCONVPRHS',1,ZHOOK_HANDLE)

END SUBROUTINE TRANSDIR_NHCONVPRHS

