SUBROUTINE CPPFTTCDIR(KGL1,KGL2,KOFF,&
 & PBASCO,PBASSI,&
 & PRAB3C,PRAB4C,PRAB6C,PRAB3N,PRAB4N,PRAB6N,&
 & PRAT1C,PRAT2C,PRAT3C,PRAT4C,PRAT5C,&
 & PRAT1N,PRAT2N,PRAT3N,PRAT4N,PRAT5N,&
 & PCOR,PAC,&
 & PFORAB3C,PFORAB4C,PFORAB6C,PFORAB3N,PFORAB4N,PFORAB6N,&
 & PFORAT1C,PFORAT2C,PFORAT3C,PFORAT4C,PFORAT5C,&
 & PFORAT1N,PFORAT2N,PFORAT3N,PFORAT4N,PFORAT5N,&
 & PFOCOR,PFOAC)  

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

USE YOMCT0   , ONLY : NSTOP    ,LRPLANE  ,LRGPTCNORM
USE YOMCT3   , ONLY : NSTEP
USE YOMDIM   , ONLY : NTCMAX   ,NPROMM   ,NFLEVG   ,NDLSUR &
 & ,NDLUNL   ,NDLUXL   ,NDLUXG   ,NDGLG  
USE YOMGEM   , ONLY : NSTAGP   ,NMENTC   ,NTSTAGP
USE YOMLUN   , ONLY : NULOUT
USE YOMMP    , ONLY : MYSETB   ,NONL     ,MYLATS   ,NPTRFLOFF

!**** *CPPFTTCDIR - Direct slow Fourier transforms for transmission
!                   coefficients.

!     Purpose.
!     --------

!     Direct slow Fourier transforms for transmission coefficients.
!     Can be used only when the NPROMM-packets contain complete latitudes.

!     This routine can compute a temporal average of Fourier coefficients,
!     which is more useful and representative of a good input to simplified
!     radiation, than an instantaneous field (which contains fast evoluting
!     small scale features).
!     In this case one assumes that:
!     - the first call of CPPFTTCDIR is done for NSTEP=1;
!       for this call the Fourier coefficients are setup to zero.
!     - the last call of CPPFTTCDIR is done for NSTEP=NSTOP-1;
!       for this call the sum of Fourier coefficients is divided
!       by NSTOP-1, that provides the temporal average.
!     - for all timesteps between 1 and NSTOP-1, the direct transforms
!       are done and added to the previous ones. 

!**   Interface.
!     ----------
!        *CALL* *CPPFTTCDIR(...)

!        Explicit arguments :
!        --------------------

!        INPUT:
!          KGL1      - lower DM-local latitude for this NPROMM-packet.
!          KGL2      - upper DM-local latitude for this NPROMM-packet.
!          KOFF      - index offset between NPROMM-arrays and NGPTOT-arrays.
!          PBASCO    - basis of cosinus.
!          PBASSI    - basis of sinus.

!          ==  PRAB3C to PAC: grid-point values ==
!          PRAB3C    - clear-sky parallel/diffuse reflectivity.
!          PRAB4C    - clear-sky diffuse transmissivity.
!          PRAB6C    - clear-sky diffuse reflectivity.
!          PRAB3N    - cloudy parallel/diffuse reflectivity.
!          PRAB4N    - cloudy diffuse transmissivity.
!          PRAB6N    - cloudy diffuse reflectivity.
!          PRAT1C    - clear-sky parallel transmissivity.
!          PRAT2C    - clear-sky parallel/diffuse transmissivity.
!          PRAT3C    - clear-sky parallel/diffuse reflectivity.
!          PRAT4C    - clear-sky diffuse transmissivity.
!          PRAT5C    - clear-sky diffuse reflectivity.
!          PRAT1N    - cloudy parallel transmissivity.
!          PRAT2N    - cloudy parallel/diffuse transmissivity.
!          PRAT3N    - cloudy parallel/diffuse reflectivity.
!          PRAT4N    - cloudy diffuse transmissivity.
!          PRAT5N    - cloudy diffuse reflectivity.
!          PCOR      - correction for cloudiness for thermal radiation.
!          PAC       - Curtis matrix for thermal radiation for clear sky.

!        INPUT/OUTPUT (OUTPUT if NSTEP=1):
!          ==  PFORAB3C to PFOAC: Fourier coefficients values ==
!          PFORAB3C  - clear-sky parallel/diffuse reflectivity.
!          PFORAB4C  - clear-sky diffuse transmissivity.
!          PFORAB6C  - clear-sky diffuse reflectivity.
!          PFORAB3N  - cloudy parallel/diffuse reflectivity.
!          PFORAB4N  - cloudy diffuse transmissivity.
!          PFORAB6N  - cloudy diffuse reflectivity.
!          PFORAT1C  - clear-sky parallel transmissivity.
!          PFORAT2C  - clear-sky parallel/diffuse transmissivity.
!          PFORAT3C  - clear-sky parallel/diffuse reflectivity.
!          PFORAT4C  - clear-sky diffuse transmissivity.
!          PFORAT5C  - clear-sky diffuse reflectivity.
!          PFORAT1N  - cloudy parallel transmissivity.
!          PFORAT2N  - cloudy parallel/diffuse transmissivity.
!          PFORAT3N  - cloudy parallel/diffuse reflectivity.
!          PFORAT4N  - cloudy diffuse transmissivity.
!          PFORAT5N  - cloudy diffuse reflectivity.
!          PFOCOR    - correction for cloudiness for thermal radiation.
!          PFOAC     - Curtis matrix for thermal radiation for clear sky.

!        Implicit arguments : none.
!        --------------------

!     Method.
!     -------
!        See documentation about spectral transforms.

!     Externals.
!     ----------
!        MXMAOP,GPTCNORM
!        ETIBIHIE for ALADIN.

!     Reference.
!     ----------

!     Author.
!     -------
!        K. YESSAD (CNRM/GMAP).

!     Modifications.
!     --------------
!        Original : FEB 1999
!        Modified by G> Radnoti 99/11/07  ALADIN geometry
!        27 Aug 2002 by K. YESSAD: bug correction.
!        K. YESSAD (10-2002): allow to compute a temporal
!         average of transmission coefficients.
!        M.Hamrud      01-Oct-2003 CY28 Cleaning
!        A. Stanesic   18-Apr-2008 Externalise biperiodicisation
!     ------------------------------------------------------------------

IMPLICIT NONE

INTEGER(KIND=JPIM),INTENT(IN)    :: KGL1 
INTEGER(KIND=JPIM),INTENT(IN)    :: KGL2 
INTEGER(KIND=JPIM),INTENT(IN)    :: KOFF 
REAL(KIND=JPRB)   ,INTENT(IN)    :: PBASCO(NTCMAX,NPROMM) 
REAL(KIND=JPRB)   ,INTENT(IN)    :: PBASSI(NTCMAX,NPROMM) 
REAL(KIND=JPRB)   ,INTENT(IN)    :: PRAB3C(NPROMM,NFLEVG) 
REAL(KIND=JPRB)   ,INTENT(IN)    :: PRAB4C(NPROMM,NFLEVG) 
REAL(KIND=JPRB)   ,INTENT(IN)    :: PRAB6C(NPROMM,NFLEVG) 
REAL(KIND=JPRB)   ,INTENT(IN)    :: PRAB3N(NPROMM,NFLEVG) 
REAL(KIND=JPRB)   ,INTENT(IN)    :: PRAB4N(NPROMM,NFLEVG) 
REAL(KIND=JPRB)   ,INTENT(IN)    :: PRAB6N(NPROMM,NFLEVG) 
REAL(KIND=JPRB)   ,INTENT(IN)    :: PRAT1C(NPROMM,NFLEVG) 
REAL(KIND=JPRB)   ,INTENT(IN)    :: PRAT2C(NPROMM,NFLEVG) 
REAL(KIND=JPRB)   ,INTENT(IN)    :: PRAT3C(NPROMM,NFLEVG) 
REAL(KIND=JPRB)   ,INTENT(IN)    :: PRAT4C(NPROMM,NFLEVG) 
REAL(KIND=JPRB)   ,INTENT(IN)    :: PRAT5C(NPROMM,NFLEVG) 
REAL(KIND=JPRB)   ,INTENT(IN)    :: PRAT1N(NPROMM,NFLEVG) 
REAL(KIND=JPRB)   ,INTENT(IN)    :: PRAT2N(NPROMM,NFLEVG) 
REAL(KIND=JPRB)   ,INTENT(IN)    :: PRAT3N(NPROMM,NFLEVG) 
REAL(KIND=JPRB)   ,INTENT(IN)    :: PRAT4N(NPROMM,NFLEVG) 
REAL(KIND=JPRB)   ,INTENT(IN)    :: PRAT5N(NPROMM,NFLEVG) 
REAL(KIND=JPRB)   ,INTENT(IN)    :: PCOR(NPROMM,NFLEVG) 
REAL(KIND=JPRB)   ,INTENT(IN)    :: PAC(NPROMM,(NFLEVG+1)*(NFLEVG+1)) 
REAL(KIND=JPRB)   ,INTENT(INOUT) :: PFORAB3C(NFLEVG,0:2*NTCMAX,KGL1:KGL2) 
REAL(KIND=JPRB)   ,INTENT(INOUT) :: PFORAB4C(NFLEVG,0:2*NTCMAX,KGL1:KGL2) 
REAL(KIND=JPRB)   ,INTENT(INOUT) :: PFORAB6C(NFLEVG,0:2*NTCMAX,KGL1:KGL2) 
REAL(KIND=JPRB)   ,INTENT(INOUT) :: PFORAB3N(NFLEVG,0:2*NTCMAX,KGL1:KGL2) 
REAL(KIND=JPRB)   ,INTENT(INOUT) :: PFORAB4N(NFLEVG,0:2*NTCMAX,KGL1:KGL2) 
REAL(KIND=JPRB)   ,INTENT(INOUT) :: PFORAB6N(NFLEVG,0:2*NTCMAX,KGL1:KGL2) 
REAL(KIND=JPRB)   ,INTENT(INOUT) :: PFORAT1C(NFLEVG,0:2*NTCMAX,KGL1:KGL2) 
REAL(KIND=JPRB)   ,INTENT(INOUT) :: PFORAT2C(NFLEVG,0:2*NTCMAX,KGL1:KGL2) 
REAL(KIND=JPRB)   ,INTENT(INOUT) :: PFORAT3C(NFLEVG,0:2*NTCMAX,KGL1:KGL2) 
REAL(KIND=JPRB)   ,INTENT(INOUT) :: PFORAT4C(NFLEVG,0:2*NTCMAX,KGL1:KGL2) 
REAL(KIND=JPRB)   ,INTENT(INOUT) :: PFORAT5C(NFLEVG,0:2*NTCMAX,KGL1:KGL2) 
REAL(KIND=JPRB)   ,INTENT(INOUT) :: PFORAT1N(NFLEVG,0:2*NTCMAX,KGL1:KGL2) 
REAL(KIND=JPRB)   ,INTENT(INOUT) :: PFORAT2N(NFLEVG,0:2*NTCMAX,KGL1:KGL2) 
REAL(KIND=JPRB)   ,INTENT(INOUT) :: PFORAT3N(NFLEVG,0:2*NTCMAX,KGL1:KGL2) 
REAL(KIND=JPRB)   ,INTENT(INOUT) :: PFORAT4N(NFLEVG,0:2*NTCMAX,KGL1:KGL2) 
REAL(KIND=JPRB)   ,INTENT(INOUT) :: PFORAT5N(NFLEVG,0:2*NTCMAX,KGL1:KGL2) 
REAL(KIND=JPRB)   ,INTENT(INOUT) :: PFOCOR(NFLEVG,0:2*NTCMAX,KGL1:KGL2) 
REAL(KIND=JPRB)   ,INTENT(INOUT) :: PFOAC((NFLEVG+1)*(NFLEVG+1),0:2*NTCMAX,KGL1:KGL2) 

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

INTEGER(KIND=JPIM) :: IFLEVG
INTEGER(KIND=JPIM) :: IGLG
INTEGER(KIND=JPIM) :: ILONG
INTEGER(KIND=JPIM) :: ILONGG(NDGLG)
INTEGER(KIND=JPIM) :: INSTEP_DEB
INTEGER(KIND=JPIM) :: INSTEP_FIN
INTEGER(KIND=JPIM) :: INUMF
INTEGER(KIND=JPIM) :: IROF0
INTEGER(KIND=JPIM) :: JGL
INTEGER(KIND=JPIM) :: JLEV
INTEGER(KIND=JPIM) :: JLON
INTEGER(KIND=JPIM) :: JM
INTEGER(KIND=JPIM) :: IARR0(NDGLG)

LOGICAL :: LLGPTCNORM

REAL(KIND=JPRB) :: ZFOITC(17*NFLEVG+(NFLEVG+1)*(NFLEVG+1),NTCMAX)
REAL(KIND=JPRB) :: ZFORTC(17*NFLEVG+(NFLEVG+1)*(NFLEVG+1),NTCMAX)
REAL(KIND=JPRB) :: ZGPTC(NDLSUR,17*NFLEVG+(NFLEVG+1)*(NFLEVG+1))
REAL(KIND=JPRB) :: ZMOTC(17*NFLEVG+(NFLEVG+1)*(NFLEVG+1))
REAL(KIND=JPRB) :: ZNUM
REAL(KIND=JPRB) :: ZUS_NUMBERSTEPS
REAL(KIND=JPRB) :: ZHOOK_HANDLE

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

INTERFACE
#include "mxmaop.h"
#include "etibihie.h"
END INTERFACE

#include "gptcnorm.intfb.h"

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

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

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

!*  1. PRELIMINARY SET TO ZERO.
!   ---------------------------

INSTEP_DEB=1
INSTEP_FIN=NSTOP-1

IF (NSTEP == INSTEP_DEB) THEN
  PFORAB3C=0.0_JPRB
  PFORAB4C=0.0_JPRB
  PFORAB6C=0.0_JPRB
  PFORAB3N=0.0_JPRB
  PFORAB4N=0.0_JPRB
  PFORAB6N=0.0_JPRB
  PFORAT1C=0.0_JPRB
  PFORAT2C=0.0_JPRB
  PFORAT3C=0.0_JPRB
  PFORAT4C=0.0_JPRB
  PFORAT5C=0.0_JPRB
  PFORAT1N=0.0_JPRB
  PFORAT2N=0.0_JPRB
  PFORAT3N=0.0_JPRB
  PFORAT4N=0.0_JPRB
  PFORAT5N=0.0_JPRB
  PFOCOR=0.0_JPRB
  PFOAC=0.0_JPRB
ENDIF
IARR0(:)=0

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

!*  2. FOR EACH LATITUDE: MEMORY TRANSFERS AND TRANSFORMS.
!   ------------------------------------------------------

LLGPTCNORM=LRGPTCNORM(1).OR.LRGPTCNORM(2).OR.LRGPTCNORM(3)

DO JGL=KGL1,KGL2

  IGLG=MYLATS(JGL)
  IF (LRPLANE) THEN
    IROF0=NTSTAGP(JGL)-KOFF
  ELSE
    IROF0=NSTAGP(JGL)-KOFF
  ENDIF

! * for ALADIN: ILONG does not include the extension zone, ILONGG includes it.
!   for ARPEGE ILONGG=ILONG.
  ILONGG(IGLG)=NONL(NPTRFLOFF+JGL,MYSETB)
  IF (LRPLANE) THEN
    ILONG=NDLUXL(NPTRFLOFF+JGL,MYSETB)-NDLUNL(NPTRFLOFF+JGL,MYSETB)+1  
  ELSE
    ILONG=ILONGG(IGLG)
  ENDIF

  ZGPTC=0.0_JPRB

!*  2.1 MEMORY TRANSFERS FOR GRID-POINT ARRAYS.

  INUMF=0 

! * clear-sky parallel/diffuse reflectivity.
  DO JLEV=1,NFLEVG
    ZGPTC(1:ILONG,INUMF+JLEV)=PRAB3C(IROF0+1:IROF0+ILONG,JLEV)
  ENDDO
  IF (LRPLANE) THEN
    CALL ETIBIHIE(ILONGG(IGLG),1,NFLEVG,NDLUXG,1,1, &
     & NDLSUR,ZGPTC(1,INUMF+1),.TRUE.,.FALSE.,0)  
  ENDIF
  IF (LLGPTCNORM) THEN
    CALL GPTCNORM(LRGPTCNORM,NULOUT,NFLEVG,IGLG,IGLG,NDLSUR,&
     & NDLSUR,IARR0(IGLG),ILONGG(IGLG),'  RAB3C',ZGPTC(1,INUMF+1))  
  ENDIF
  INUMF=INUMF+NFLEVG

! * clear-sky diffuse transmissivity.
  DO JLEV=1,NFLEVG
    ZGPTC(1:ILONG,INUMF+JLEV)=PRAB4C(IROF0+1:IROF0+ILONG,JLEV)
  ENDDO
  IF (LRPLANE) THEN
    CALL ETIBIHIE(ILONGG(IGLG),1,NFLEVG,NDLUXG,1,1, &
     & NDLSUR,ZGPTC(1,INUMF+1),.TRUE.,.FALSE.,0)  
  ENDIF
  IF (LLGPTCNORM) THEN
    CALL GPTCNORM(LRGPTCNORM,NULOUT,NFLEVG,IGLG,IGLG,NDLSUR,&
     & NDLSUR,IARR0(IGLG),ILONGG(IGLG),'  RAB4C',ZGPTC(1,INUMF+1))  
  ENDIF
  INUMF=INUMF+NFLEVG

! * clear-sky diffuse reflectivity.
  DO JLEV=1,NFLEVG
    ZGPTC(1:ILONG,INUMF+JLEV)=PRAB6C(IROF0+1:IROF0+ILONG,JLEV)
  ENDDO
  IF (LRPLANE) THEN
    CALL ETIBIHIE(ILONGG(IGLG),1,NFLEVG,NDLUXG,1,1, &
     & NDLSUR,ZGPTC(1,INUMF+1),.TRUE.,.FALSE.,0)  
  ENDIF
  IF (LLGPTCNORM) THEN
    CALL GPTCNORM(LRGPTCNORM,NULOUT,NFLEVG,IGLG,IGLG,NDLSUR,&
     & NDLSUR,IARR0(IGLG),ILONGG(IGLG),'  RAB6C',ZGPTC(1,INUMF+1))  
  ENDIF
  INUMF=INUMF+NFLEVG

! * cloudy parallel/diffuse reflectivity.
  DO JLEV=1,NFLEVG
    ZGPTC(1:ILONG,INUMF+JLEV)=PRAB3N(IROF0+1:IROF0+ILONG,JLEV)
  ENDDO
  IF (LRPLANE) THEN
    CALL ETIBIHIE(ILONGG(IGLG),1,NFLEVG,NDLUXG,1,1, &
     & NDLSUR,ZGPTC(1,INUMF+1),.TRUE.,.FALSE.,0)  
  ENDIF
  IF (LLGPTCNORM) THEN
    CALL GPTCNORM(LRGPTCNORM,NULOUT,NFLEVG,IGLG,IGLG,NDLSUR,&
     & NDLSUR,IARR0(IGLG),ILONGG(IGLG),'  RAB3N',ZGPTC(1,INUMF+1))  
  ENDIF
  INUMF=INUMF+NFLEVG

! * cloudy diffuse transmissivity.
  DO JLEV=1,NFLEVG
    ZGPTC(1:ILONG,INUMF+JLEV)=PRAB4N(IROF0+1:IROF0+ILONG,JLEV)
  ENDDO
  IF (LRPLANE) THEN
    CALL ETIBIHIE(ILONGG(IGLG),1,NFLEVG,NDLUXG,1,1, &
     & NDLSUR,ZGPTC(1,INUMF+1),.TRUE.,.FALSE.,0)  
  ENDIF
  IF (LLGPTCNORM) THEN
    CALL GPTCNORM(LRGPTCNORM,NULOUT,NFLEVG,IGLG,IGLG,NDLSUR,&
     & NDLSUR,IARR0(IGLG),ILONGG(IGLG),'  RAB4N',ZGPTC(1,INUMF+1))  
  ENDIF
  INUMF=INUMF+NFLEVG

! * cloudy diffuse reflectivity.
  DO JLEV=1,NFLEVG
    ZGPTC(1:ILONG,INUMF+JLEV)=PRAB6N(IROF0+1:IROF0+ILONG,JLEV)
  ENDDO
  IF (LRPLANE) THEN
    CALL ETIBIHIE(ILONGG(IGLG),1,NFLEVG,NDLUXG,1,1, &
     & NDLSUR,ZGPTC(1,INUMF+1),.TRUE.,.FALSE.,0)  
  ENDIF
  IF (LLGPTCNORM) THEN
    CALL GPTCNORM(LRGPTCNORM,NULOUT,NFLEVG,IGLG,IGLG,NDLSUR,&
     & NDLSUR,IARR0(IGLG),ILONGG(IGLG),'  RAB6N',ZGPTC(1,INUMF+1))  
  ENDIF
  INUMF=INUMF+NFLEVG

! * clear-sky parallel transmissivity.
  DO JLEV=1,NFLEVG
    ZGPTC(1:ILONG,INUMF+JLEV)=PRAT1C(IROF0+1:IROF0+ILONG,JLEV)
  ENDDO
  IF (LRPLANE) THEN
    CALL ETIBIHIE(ILONGG(IGLG),1,NFLEVG,NDLUXG,1,1, &
     & NDLSUR,ZGPTC(1,INUMF+1),.TRUE.,.FALSE.,0)  
  ENDIF
  IF (LLGPTCNORM) THEN
    CALL GPTCNORM(LRGPTCNORM,NULOUT,NFLEVG,IGLG,IGLG,NDLSUR,&
     & NDLSUR,IARR0(IGLG),ILONGG(IGLG),'  RAT1C',ZGPTC(1,INUMF+1))  
  ENDIF
  INUMF=INUMF+NFLEVG

! * clear-sky parallel/diffuse transmissivity.
  DO JLEV=1,NFLEVG
    ZGPTC(1:ILONG,INUMF+JLEV)=PRAT2C(IROF0+1:IROF0+ILONG,JLEV)
  ENDDO
  IF (LRPLANE) THEN
    CALL ETIBIHIE(ILONGG(IGLG),1,NFLEVG,NDLUXG,1,1, &
     & NDLSUR,ZGPTC(1,INUMF+1),.TRUE.,.FALSE.,0)  
  ENDIF
  IF (LLGPTCNORM) THEN
    CALL GPTCNORM(LRGPTCNORM,NULOUT,NFLEVG,IGLG,IGLG,NDLSUR,&
     & NDLSUR,IARR0(IGLG),ILONGG(IGLG),'  RAT2C',ZGPTC(1,INUMF+1))  
  ENDIF
  INUMF=INUMF+NFLEVG

! * clear-sky parallel/diffuse reflectivity.
  DO JLEV=1,NFLEVG
    ZGPTC(1:ILONG,INUMF+JLEV)=PRAT3C(IROF0+1:IROF0+ILONG,JLEV)
  ENDDO
  IF (LRPLANE) THEN
    CALL ETIBIHIE(ILONGG(IGLG),1,NFLEVG,NDLUXG,1,1, &
     & NDLSUR,ZGPTC(1,INUMF+1),.TRUE.,.FALSE.,0)  
  ENDIF
  IF (LLGPTCNORM) THEN
    CALL GPTCNORM(LRGPTCNORM,NULOUT,NFLEVG,IGLG,IGLG,NDLSUR,&
     & NDLSUR,IARR0(IGLG),ILONGG(IGLG),'  RAT3C',ZGPTC(1,INUMF+1))  
  ENDIF
  INUMF=INUMF+NFLEVG

! * clear-sky diffuse transmissivity.
  DO JLEV=1,NFLEVG
    ZGPTC(1:ILONG,INUMF+JLEV)=PRAT4C(IROF0+1:IROF0+ILONG,JLEV)
  ENDDO
  IF (LRPLANE) THEN
    CALL ETIBIHIE(ILONGG(IGLG),1,NFLEVG,NDLUXG,1,1, &
     & NDLSUR,ZGPTC(1,INUMF+1),.TRUE.,.FALSE.,0)  
  ENDIF
  IF (LLGPTCNORM) THEN
    CALL GPTCNORM(LRGPTCNORM,NULOUT,NFLEVG,IGLG,IGLG,NDLSUR,&
     & NDLSUR,IARR0(IGLG),ILONGG(IGLG),'  RAT4C',ZGPTC(1,INUMF+1))  
  ENDIF
  INUMF=INUMF+NFLEVG

! * clear-sky diffuse reflectivity.
  DO JLEV=1,NFLEVG
    ZGPTC(1:ILONG,INUMF+JLEV)=PRAT5C(IROF0+1:IROF0+ILONG,JLEV)
  ENDDO
  IF (LRPLANE) THEN
    CALL ETIBIHIE(ILONGG(IGLG),1,NFLEVG,NDLUXG,1,1, &
     & NDLSUR,ZGPTC(1,INUMF+1),.TRUE.,.FALSE.,0)  
  ENDIF
  IF (LLGPTCNORM) THEN
    CALL GPTCNORM(LRGPTCNORM,NULOUT,NFLEVG,IGLG,IGLG,NDLSUR,&
     & NDLSUR,IARR0(IGLG),ILONGG(IGLG),'  RAT5C',ZGPTC(1,INUMF+1))  
  ENDIF
  INUMF=INUMF+NFLEVG

! * cloudy parallel transmissivity.
  DO JLEV=1,NFLEVG
    ZGPTC(1:ILONG,INUMF+JLEV)=PRAT1N(IROF0+1:IROF0+ILONG,JLEV)
  ENDDO
  IF (LRPLANE) THEN
    CALL ETIBIHIE(ILONGG(IGLG),1,NFLEVG,NDLUXG,1,1, &
     & NDLSUR,ZGPTC(1,INUMF+1),.TRUE.,.FALSE.,0)  
  ENDIF
  IF (LLGPTCNORM) THEN
    CALL GPTCNORM(LRGPTCNORM,NULOUT,NFLEVG,IGLG,IGLG,NDLSUR,&
     & NDLSUR,IARR0(IGLG),ILONGG(IGLG),'  RAT1N',ZGPTC(1,INUMF+1))  
  ENDIF
  INUMF=INUMF+NFLEVG

! * cloudy parallel/diffuse transmissivity.
  DO JLEV=1,NFLEVG
    ZGPTC(1:ILONG,INUMF+JLEV)=PRAT2N(IROF0+1:IROF0+ILONG,JLEV)
  ENDDO
  IF (LRPLANE) THEN
    CALL ETIBIHIE(ILONGG(IGLG),1,NFLEVG,NDLUXG,1,1, &
     & NDLSUR,ZGPTC(1,INUMF+1),.TRUE.,.FALSE.,0)  
  ENDIF
  IF (LLGPTCNORM) THEN
    CALL GPTCNORM(LRGPTCNORM,NULOUT,NFLEVG,IGLG,IGLG,NDLSUR,&
     & NDLSUR,IARR0(IGLG),ILONGG(IGLG),'  RAT2N',ZGPTC(1,INUMF+1))  
  ENDIF
  INUMF=INUMF+NFLEVG

! * cloudy parallel/diffuse reflectivity.
  DO JLEV=1,NFLEVG
    ZGPTC(1:ILONG,INUMF+JLEV)=PRAT3N(IROF0+1:IROF0+ILONG,JLEV)
  ENDDO
  IF (LRPLANE) THEN
    CALL ETIBIHIE(ILONGG(IGLG),1,NFLEVG,NDLUXG,1,1, &
     & NDLSUR,ZGPTC(1,INUMF+1),.TRUE.,.FALSE.,0)  
  ENDIF
  IF (LLGPTCNORM) THEN
    CALL GPTCNORM(LRGPTCNORM,NULOUT,NFLEVG,IGLG,IGLG,NDLSUR,&
     & NDLSUR,IARR0(IGLG),ILONGG(IGLG),'  RAT3N',ZGPTC(1,INUMF+1))  
  ENDIF
  INUMF=INUMF+NFLEVG

! * cloudy diffuse transmissivity.
  DO JLEV=1,NFLEVG
    ZGPTC(1:ILONG,INUMF+JLEV)=PRAT4N(IROF0+1:IROF0+ILONG,JLEV)
  ENDDO
  IF (LRPLANE) THEN
    CALL ETIBIHIE(ILONGG(IGLG),1,NFLEVG,NDLUXG,1,1, &
     & NDLSUR,ZGPTC(1,INUMF+1),.TRUE.,.FALSE.,0)  
  ENDIF
  IF (LLGPTCNORM) THEN
    CALL GPTCNORM(LRGPTCNORM,NULOUT,NFLEVG,IGLG,IGLG,NDLSUR,&
     & NDLSUR,IARR0(IGLG),ILONGG(IGLG),'  RAT4N',ZGPTC(1,INUMF+1))  
  ENDIF
  INUMF=INUMF+NFLEVG

! * cloudy diffuse reflectivity.
  DO JLEV=1,NFLEVG
    ZGPTC(1:ILONG,INUMF+JLEV)=PRAT5N(IROF0+1:IROF0+ILONG,JLEV)
  ENDDO
  IF (LRPLANE) THEN
    CALL ETIBIHIE(ILONGG(IGLG),1,NFLEVG,NDLUXG,1,1, &
     & NDLSUR,ZGPTC(1,INUMF+1),.TRUE.,.FALSE.,0)  
  ENDIF
  IF (LLGPTCNORM) THEN
    CALL GPTCNORM(LRGPTCNORM,NULOUT,NFLEVG,IGLG,IGLG,NDLSUR,&
     & NDLSUR,IARR0(IGLG),ILONGG(IGLG),'  RAT5N',ZGPTC(1,INUMF+1))  
  ENDIF
  INUMF=INUMF+NFLEVG

! * correction for cloudiness for thermal radiation.
  DO JLEV=1,NFLEVG
    ZGPTC(1:ILONG,INUMF+JLEV)=PCOR(IROF0+1:IROF0+ILONG,JLEV)
  ENDDO
  IF (LRPLANE) THEN
    CALL ETIBIHIE(ILONGG(IGLG),1,NFLEVG,NDLUXG,1,1, &
     & NDLSUR,ZGPTC(1,INUMF+1),.TRUE.,.FALSE.,0)  
  ENDIF
  IF (LLGPTCNORM) THEN
    CALL GPTCNORM(LRGPTCNORM,NULOUT,NFLEVG,IGLG,IGLG,NDLSUR,&
     & NDLSUR,IARR0(IGLG),ILONGG(IGLG),'  COR  ',ZGPTC(1,INUMF+1))  
  ENDIF
  INUMF=INUMF+NFLEVG

! * Curtis matrix for thermal radiation for clear sky.
  IFLEVG=(NFLEVG+1)*(NFLEVG+1)
  DO JLEV=1,IFLEVG
    ZGPTC(1:ILONG,INUMF+JLEV)=PAC(IROF0+1:IROF0+ILONG,JLEV)
  ENDDO
  IF (LRPLANE) THEN
    CALL ETIBIHIE(ILONGG(IGLG),1,IFLEVG,NDLUXG,1,1, &
     & NDLSUR,ZGPTC(1,INUMF+1),.TRUE.,.FALSE.,0)  
  ENDIF
  IF (LLGPTCNORM) THEN
    CALL GPTCNORM(LRGPTCNORM,NULOUT,IFLEVG,IGLG,IGLG,NDLSUR,&
     & NDLSUR,IARR0(IGLG),ILONGG(IGLG),'  AC   ',ZGPTC(1,INUMF+1))  
  ENDIF
  INUMF=INUMF+IFLEVG

!*  2.2 DIRECT FOURIER TRANSFORM.

! * Zonal mean.
  ZNUM=1.0_JPRB/REAL(ILONGG(IGLG),JPRB)
  INUMF=17*NFLEVG+(NFLEVG+1)*(NFLEVG+1)
  ZMOTC(1:INUMF)=0.0_JPRB
  DO JLON=1,ILONGG(IGLG)
    ZMOTC(1:INUMF)=ZMOTC(1:INUMF)+ZGPTC(JLON,1:INUMF)
  ENDDO
  ZMOTC(1:INUMF)=ZMOTC(1:INUMF)*ZNUM

! * Real part (ZFORTC = PBASCO times ZGPTC) for m > 1.
  ZFORTC=0.0_JPRB
  IF (NTCMAX >= 1) THEN
    CALL MXMAOP(PBASCO(1,IROF0+1),1,NTCMAX,&
     & ZGPTC(1,1),1,NDLSUR,&
     & ZFORTC(1,1),INUMF,1,&
     & NMENTC(IGLG),ILONGG(IGLG),INUMF)  
    ZFORTC=ZFORTC/REAL(ILONGG(IGLG),JPRB)
  ENDIF
! * Imaginary part (ZFOITC = - PBASSI times ZGPTC) for m > 1.
  ZFOITC=0.0_JPRB
  IF (NTCMAX >= 1) THEN
    CALL MXMAOP(PBASSI(1,IROF0+1),1,NTCMAX,&
     & ZGPTC(1,1),1,NDLSUR,&
     & ZFOITC(1,1),INUMF,1,&
     & NMENTC(IGLG),ILONGG(IGLG),INUMF)  
    ZFOITC=-ZFOITC/REAL(ILONGG(IGLG),JPRB)
  ENDIF

!*  2.3 MEMORY TRANSFERS FOR FOURIER COEFFICIENTS ARRAYS.

  INUMF=0 

! * clear-sky parallel/diffuse reflectivity.
  PFORAB3C(1:NFLEVG,0,JGL)=PFORAB3C(1:NFLEVG,0,JGL)+ZMOTC(INUMF+1:INUMF+NFLEVG)
!OCL NOVREC
  DO JM=1,NMENTC(IGLG)
    PFORAB3C(1:NFLEVG,2*JM-1,JGL)=&
     & PFORAB3C(1:NFLEVG,2*JM-1,JGL)+ZFORTC(INUMF+1:INUMF+NFLEVG,JM)  
    PFORAB3C(1:NFLEVG,2*JM  ,JGL)=&
     & PFORAB3C(1:NFLEVG,2*JM  ,JGL)+ZFOITC(INUMF+1:INUMF+NFLEVG,JM)  
  ENDDO
  INUMF=INUMF+NFLEVG

! * clear-sky diffuse transmissivity.
  PFORAB4C(1:NFLEVG,0,JGL)=PFORAB4C(1:NFLEVG,0,JGL)+ZMOTC(INUMF+1:INUMF+NFLEVG)
!OCL NOVREC
  DO JM=1,NMENTC(IGLG)
    PFORAB4C(1:NFLEVG,2*JM-1,JGL)=&
     & PFORAB4C(1:NFLEVG,2*JM-1,JGL)+ZFORTC(INUMF+1:INUMF+NFLEVG,JM)  
    PFORAB4C(1:NFLEVG,2*JM  ,JGL)=&
     & PFORAB4C(1:NFLEVG,2*JM  ,JGL)+ZFOITC(INUMF+1:INUMF+NFLEVG,JM)  
  ENDDO
  INUMF=INUMF+NFLEVG

! * clear-sky diffuse reflectivity.
  PFORAB6C(1:NFLEVG,0,JGL)=PFORAB6C(1:NFLEVG,0,JGL)+ZMOTC(INUMF+1:INUMF+NFLEVG)
!OCL NOVREC
  DO JM=1,NMENTC(IGLG)
    PFORAB6C(1:NFLEVG,2*JM-1,JGL)=&
     & PFORAB6C(1:NFLEVG,2*JM-1,JGL)+ZFORTC(INUMF+1:INUMF+NFLEVG,JM)  
    PFORAB6C(1:NFLEVG,2*JM  ,JGL)=&
     & PFORAB6C(1:NFLEVG,2*JM  ,JGL)+ZFOITC(INUMF+1:INUMF+NFLEVG,JM)  
  ENDDO
  INUMF=INUMF+NFLEVG

! * cloudy parallel/diffuse reflectivity.
  PFORAB3N(1:NFLEVG,0,JGL)=PFORAB3N(1:NFLEVG,0,JGL)+ZMOTC(INUMF+1:INUMF+NFLEVG)
!OCL NOVREC
  DO JM=1,NMENTC(IGLG)
    PFORAB3N(1:NFLEVG,2*JM-1,JGL)=&
     & PFORAB3N(1:NFLEVG,2*JM-1,JGL)+ZFORTC(INUMF+1:INUMF+NFLEVG,JM)  
    PFORAB3N(1:NFLEVG,2*JM  ,JGL)=&
     & PFORAB3N(1:NFLEVG,2*JM  ,JGL)+ZFOITC(INUMF+1:INUMF+NFLEVG,JM)  
  ENDDO
  INUMF=INUMF+NFLEVG

! * cloudy diffuse transmissivity.
  PFORAB4N(1:NFLEVG,0,JGL)=PFORAB4N(1:NFLEVG,0,JGL)+ZMOTC(INUMF+1:INUMF+NFLEVG)
!OCL NOVREC
  DO JM=1,NMENTC(IGLG)
    PFORAB4N(1:NFLEVG,2*JM-1,JGL)=&
     & PFORAB4N(1:NFLEVG,2*JM-1,JGL)+ZFORTC(INUMF+1:INUMF+NFLEVG,JM)  
    PFORAB4N(1:NFLEVG,2*JM  ,JGL)=&
     & PFORAB4N(1:NFLEVG,2*JM  ,JGL)+ZFOITC(INUMF+1:INUMF+NFLEVG,JM)  
  ENDDO
  INUMF=INUMF+NFLEVG

! * cloudy diffuse reflectivity.
  PFORAB6N(1:NFLEVG,0,JGL)=PFORAB6N(1:NFLEVG,0,JGL)+ZMOTC(INUMF+1:INUMF+NFLEVG)
!OCL NOVREC
  DO JM=1,NMENTC(IGLG)
    PFORAB6N(1:NFLEVG,2*JM-1,JGL)=&
     & PFORAB6N(1:NFLEVG,2*JM-1,JGL)+ZFORTC(INUMF+1:INUMF+NFLEVG,JM)  
    PFORAB6N(1:NFLEVG,2*JM  ,JGL)=&
     & PFORAB6N(1:NFLEVG,2*JM  ,JGL)+ZFOITC(INUMF+1:INUMF+NFLEVG,JM)  
  ENDDO
  INUMF=INUMF+NFLEVG

! * clear-sky parallel transmissivity.
  PFORAT1C(1:NFLEVG,0,JGL)=PFORAT1C(1:NFLEVG,0,JGL)+ZMOTC(INUMF+1:INUMF+NFLEVG)
!OCL NOVREC
  DO JM=1,NMENTC(IGLG)
    PFORAT1C(1:NFLEVG,2*JM-1,JGL)=&
     & PFORAT1C(1:NFLEVG,2*JM-1,JGL)+ZFORTC(INUMF+1:INUMF+NFLEVG,JM)  
    PFORAT1C(1:NFLEVG,2*JM  ,JGL)=&
     & PFORAT1C(1:NFLEVG,2*JM  ,JGL)+ZFOITC(INUMF+1:INUMF+NFLEVG,JM)  
  ENDDO
  INUMF=INUMF+NFLEVG

! * clear-sky parallel/diffuse transmissivity.
  PFORAT2C(1:NFLEVG,0,JGL)=PFORAT2C(1:NFLEVG,0,JGL)+ZMOTC(INUMF+1:INUMF+NFLEVG)
!OCL NOVREC
  DO JM=1,NMENTC(IGLG)
    PFORAT2C(1:NFLEVG,2*JM-1,JGL)=&
     & PFORAT2C(1:NFLEVG,2*JM-1,JGL)+ZFORTC(INUMF+1:INUMF+NFLEVG,JM)  
    PFORAT2C(1:NFLEVG,2*JM  ,JGL)=&
     & PFORAT2C(1:NFLEVG,2*JM  ,JGL)+ZFOITC(INUMF+1:INUMF+NFLEVG,JM)  
  ENDDO
  INUMF=INUMF+NFLEVG

! * clear-sky parallel/diffuse reflectivity.
  PFORAT3C(1:NFLEVG,0,JGL)=PFORAT3C(1:NFLEVG,0,JGL)+ZMOTC(INUMF+1:INUMF+NFLEVG)
!OCL NOVREC
  DO JM=1,NMENTC(IGLG)
    PFORAT3C(1:NFLEVG,2*JM-1,JGL)=&
     & PFORAT3C(1:NFLEVG,2*JM-1,JGL)+ZFORTC(INUMF+1:INUMF+NFLEVG,JM)  
    PFORAT3C(1:NFLEVG,2*JM  ,JGL)=&
     & PFORAT3C(1:NFLEVG,2*JM  ,JGL)+ZFOITC(INUMF+1:INUMF+NFLEVG,JM)  
  ENDDO
  INUMF=INUMF+NFLEVG

! * clear-sky diffuse transmissivity.
  PFORAT4C(1:NFLEVG,0,JGL)=PFORAT4C(1:NFLEVG,0,JGL)+ZMOTC(INUMF+1:INUMF+NFLEVG)
!OCL NOVREC
  DO JM=1,NMENTC(IGLG)
    PFORAT4C(1:NFLEVG,2*JM-1,JGL)=&
     & PFORAT4C(1:NFLEVG,2*JM-1,JGL)+ZFORTC(INUMF+1:INUMF+NFLEVG,JM)  
    PFORAT4C(1:NFLEVG,2*JM  ,JGL)=&
     & PFORAT4C(1:NFLEVG,2*JM  ,JGL)+ZFOITC(INUMF+1:INUMF+NFLEVG,JM)  
  ENDDO
  INUMF=INUMF+NFLEVG

! * clear-sky diffuse reflectivity.
  PFORAT5C(1:NFLEVG,0,JGL)=PFORAT5C(1:NFLEVG,0,JGL)+ZMOTC(INUMF+1:INUMF+NFLEVG)
!OCL NOVREC
  DO JM=1,NMENTC(IGLG)
    PFORAT5C(1:NFLEVG,2*JM-1,JGL)=&
     & PFORAT5C(1:NFLEVG,2*JM-1,JGL)+ZFORTC(INUMF+1:INUMF+NFLEVG,JM)  
    PFORAT5C(1:NFLEVG,2*JM  ,JGL)=&
     & PFORAT5C(1:NFLEVG,2*JM  ,JGL)+ZFOITC(INUMF+1:INUMF+NFLEVG,JM)  
  ENDDO
  INUMF=INUMF+NFLEVG

! * cloudy parallel transmissivity.
  PFORAT1N(1:NFLEVG,0,JGL)=PFORAT1N(1:NFLEVG,0,JGL)+ZMOTC(INUMF+1:INUMF+NFLEVG)
!OCL NOVREC
  DO JM=1,NMENTC(IGLG)
    PFORAT1N(1:NFLEVG,2*JM-1,JGL)=&
     & PFORAT1N(1:NFLEVG,2*JM-1,JGL)+ZFORTC(INUMF+1:INUMF+NFLEVG,JM)  
    PFORAT1N(1:NFLEVG,2*JM  ,JGL)=&
     & PFORAT1N(1:NFLEVG,2*JM  ,JGL)+ZFOITC(INUMF+1:INUMF+NFLEVG,JM)  
  ENDDO
  INUMF=INUMF+NFLEVG

! * cloudy parallel/diffuse transmissivity.
  PFORAT2N(1:NFLEVG,0,JGL)=PFORAT2N(1:NFLEVG,0,JGL)+ZMOTC(INUMF+1:INUMF+NFLEVG)
!OCL NOVREC
  DO JM=1,NMENTC(IGLG)
    PFORAT2N(1:NFLEVG,2*JM-1,JGL)=&
     & PFORAT2N(1:NFLEVG,2*JM-1,JGL)+ZFORTC(INUMF+1:INUMF+NFLEVG,JM)  
    PFORAT2N(1:NFLEVG,2*JM  ,JGL)=&
     & PFORAT2N(1:NFLEVG,2*JM  ,JGL)+ZFOITC(INUMF+1:INUMF+NFLEVG,JM)  
  ENDDO
  INUMF=INUMF+NFLEVG

! * cloudy parallel/diffuse reflectivity.
  PFORAT3N(1:NFLEVG,0,JGL)=PFORAT3N(1:NFLEVG,0,JGL)+ZMOTC(INUMF+1:INUMF+NFLEVG)
!OCL NOVREC
  DO JM=1,NMENTC(IGLG)
    PFORAT3N(1:NFLEVG,2*JM-1,JGL)=&
     & PFORAT3N(1:NFLEVG,2*JM-1,JGL)+ZFORTC(INUMF+1:INUMF+NFLEVG,JM)  
    PFORAT3N(1:NFLEVG,2*JM  ,JGL)=&
     & PFORAT3N(1:NFLEVG,2*JM  ,JGL)+ZFOITC(INUMF+1:INUMF+NFLEVG,JM)  
  ENDDO
  INUMF=INUMF+NFLEVG

! * cloudy diffuse transmissivity.
  PFORAT4N(1:NFLEVG,0,JGL)=PFORAT4N(1:NFLEVG,0,JGL)+ZMOTC(INUMF+1:INUMF+NFLEVG)
!OCL NOVREC
  DO JM=1,NMENTC(IGLG)
    PFORAT4N(1:NFLEVG,2*JM-1,JGL)=&
     & PFORAT4N(1:NFLEVG,2*JM-1,JGL)+ZFORTC(INUMF+1:INUMF+NFLEVG,JM)  
    PFORAT4N(1:NFLEVG,2*JM  ,JGL)=&
     & PFORAT4N(1:NFLEVG,2*JM  ,JGL)+ZFOITC(INUMF+1:INUMF+NFLEVG,JM)  
  ENDDO
  INUMF=INUMF+NFLEVG

! * cloudy diffuse reflectivity.
  PFORAT5N(1:NFLEVG,0,JGL)=PFORAT5N(1:NFLEVG,0,JGL)+ZMOTC(INUMF+1:INUMF+NFLEVG)
!OCL NOVREC
  DO JM=1,NMENTC(IGLG)
    PFORAT5N(1:NFLEVG,2*JM-1,JGL)=&
     & PFORAT5N(1:NFLEVG,2*JM-1,JGL)+ZFORTC(INUMF+1:INUMF+NFLEVG,JM)  
    PFORAT5N(1:NFLEVG,2*JM  ,JGL)=&
     & PFORAT5N(1:NFLEVG,2*JM  ,JGL)+ZFOITC(INUMF+1:INUMF+NFLEVG,JM)  
  ENDDO
  INUMF=INUMF+NFLEVG

! * correction for cloudiness for thermal radiation.
  PFOCOR(1:NFLEVG,0,JGL)=PFOCOR(1:NFLEVG,0,JGL)+ZMOTC(INUMF+1:INUMF+NFLEVG)
!OCL NOVREC
  DO JM=1,NMENTC(IGLG)
    PFOCOR(1:NFLEVG,2*JM-1,JGL)=&
     & PFOCOR(1:NFLEVG,2*JM-1,JGL)+ZFORTC(INUMF+1:INUMF+NFLEVG,JM)  
    PFOCOR(1:NFLEVG,2*JM  ,JGL)=&
     & PFOCOR(1:NFLEVG,2*JM  ,JGL)+ZFOITC(INUMF+1:INUMF+NFLEVG,JM)  
  ENDDO
  INUMF=INUMF+NFLEVG

! * Curtis matrix for thermal radiation for clear sky.
  IFLEVG=(NFLEVG+1)*(NFLEVG+1)
  PFOAC(1:IFLEVG,0,JGL)=PFOAC(1:IFLEVG,0,JGL)+ZMOTC(INUMF+1:INUMF+IFLEVG)
!OCL NOVREC
  DO JM=1,NMENTC(IGLG)
    PFOAC(1:IFLEVG,2*JM-1,JGL)=&
     & PFOAC(1:IFLEVG,2*JM-1,JGL)+ZFORTC(INUMF+1:INUMF+IFLEVG,JM)  
    PFOAC(1:IFLEVG,2*JM  ,JGL)=&
     & PFOAC(1:IFLEVG,2*JM  ,JGL)+ZFOITC(INUMF+1:INUMF+IFLEVG,JM)  
  ENDDO
  INUMF=INUMF+(NFLEVG+1)*(NFLEVG+1)

ENDDO

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

!*  3. FINAL DIVISION BY THE NUMBER OF TIMESTEPS.
!   ---------------------------------------------

ZUS_NUMBERSTEPS=1.0_JPRB/REAL(INSTEP_FIN-INSTEP_DEB+1,JPRB)

IF (NSTEP == INSTEP_FIN) THEN
  PFORAB3C=PFORAB3C*ZUS_NUMBERSTEPS
  PFORAB4C=PFORAB4C*ZUS_NUMBERSTEPS
  PFORAB6C=PFORAB6C*ZUS_NUMBERSTEPS
  PFORAB3N=PFORAB3N*ZUS_NUMBERSTEPS
  PFORAB4N=PFORAB4N*ZUS_NUMBERSTEPS
  PFORAB6N=PFORAB6N*ZUS_NUMBERSTEPS
  PFORAT1C=PFORAT1C*ZUS_NUMBERSTEPS
  PFORAT2C=PFORAT2C*ZUS_NUMBERSTEPS
  PFORAT3C=PFORAT3C*ZUS_NUMBERSTEPS
  PFORAT4C=PFORAT4C*ZUS_NUMBERSTEPS
  PFORAT5C=PFORAT5C*ZUS_NUMBERSTEPS
  PFORAT1N=PFORAT1N*ZUS_NUMBERSTEPS
  PFORAT2N=PFORAT2N*ZUS_NUMBERSTEPS
  PFORAT3N=PFORAT3N*ZUS_NUMBERSTEPS
  PFORAT4N=PFORAT4N*ZUS_NUMBERSTEPS
  PFORAT5N=PFORAT5N*ZUS_NUMBERSTEPS
  PFOCOR=PFOCOR*ZUS_NUMBERSTEPS
  PFOAC=PFOAC*ZUS_NUMBERSTEPS
ENDIF

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

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