MODULE SUFFT_MOD
CONTAINS
SUBROUTINE SUFFT

USE PARKIND1  ,ONLY : JPIM     ,JPRB

USE TPM_DIM
USE TPM_GEN
USE TPM_DISTR
USE TPM_GEOMETRY
USE TPM_FFT

IMPLICIT NONE

INTEGER(KIND=JPIM) :: JGL,IGLG
LOGICAL :: LLP1,LLP2

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

LLP1 = NPRINTLEV>0
LLP2 = NPRINTLEV>1
IF(LLP1) WRITE(NOUT,*) '=== ENTER ROUTINE SUFFT ==='

ALLOCATE(T%TRIGS(R%NDLON,D%NDGL_FS))
IF(LLP2)WRITE(NOUT,9) 'T%TRIGS    ',SIZE(T%TRIGS),SHAPE(T%TRIGS)
ALLOCATE(T%NFAX(19,D%NDGL_FS))
IF(LLP2)WRITE(NOUT,9) 'T%NFAX     ',SIZE(T%NFAX),SHAPE(T%NFAX)

DO JGL=1,D%NDGL_FS
  IGLG = D%NPTRLS(MYSETW)+JGL-1
  CALL SET99(T%TRIGS(1,JGL),T%NFAX(1,JGL),G%NLOEN(IGLG))
ENDDO

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

9 FORMAT(1X,'ARRAY ',A10,' ALLOCATED ',8I8)

END SUBROUTINE SUFFT
END MODULE SUFFT_MOD
