!-------------------------------------- LICENCE BEGIN ------------------------------------
!Environment Canada - Atmospheric Science and Technology License/Disclaimer,
! version 3; Last Modified: May 7, 2008.
!This is free but copyrighted software; you can use/redistribute/modify it under the terms
!of the Environment Canada - Atmospheric Science and Technology License/Disclaimer
!version 3 or (at your option) any later version that should be found at:
!http://collaboration.cmc.ec.gc.ca/science/rpn.comm/license.html
!
!This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
!without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
!See the above mentioned License/Disclaimer for more details.
!You should have received a copy of the License/Disclaimer along with this software;
!if not, you can write to: EC-RPN COMM Group, 2121 TransCanada, suite 500, Dorval (Quebec),
!CANADA, H9P 1J3; or send e-mail to service.rpn@ec.gc.ca
!-------------------------------------- LICENCE END --------------------------------------
!
!
! X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X
!
subroutine dft1d(psp,pgd,pdft1d,klen1d,kni) 2,1
!
!Author: Luc Fillion - CGD/NCAR - 24 sept 2002
!
!Revision : L. Fillion - MSC - 06 jul 04
! - Update to NCAR fft: fftpack5
!
IMPLICIT NONE
#include "comdim.cdk"
#include "comfftla.cdk"
#include "taglam4d.cdk"
integer kni,klen1d
real*8 pgd(kni)
real*8 psp(kni/2+1,2) ! fourier coefficients
real*8 pdft1d(klen1d)
!
integer ji,jj,ila,ilenwrk,ind,ier
real*8 za(2*(kni/2+1))
real*8 zwork(2*(kni/2+1))
!
!!
do ji=1,kni
za(ji)=pgd(ji)
enddo
ilenwrk=2*(kni/2+1)
call rfft2f_8
(2*(kni/2+1),kni,1,za,pdft1d,klen1d,zwork,
& ilenwrk,ier)
!
do ji=1,kni/2+1
ind=2*(ji-1)+1
psp(ji,1)=za(ind)
psp(ji,2)=za(ind+1)
enddo
!
return
end