subroutine fftcr (hcdat,nhcpts,signex,rltrn,nrlpts,work,lwrk,ierr) c complex hcdat(nhcpts) real rltrn(nrlpts) ,work(lwrk) dimension nscrt(1) c the following call is for gathering statistics on library use at ncar c logical q8q4 c save q8q4 c data q8q4 /.true./ c if (q8q4) then c call q8qst4('loclib','fft','fftcr','version 08') c q8q4 = .false. c endif ierr = 0 if (nrlpts .lt. 2) go to 103 if (nhcpts .ne. nrlpts/2+1) go to 105 if (lwrk .lt. 4*nrlpts) go to 106 nc = 2*nrlpts+4 work(1) = real(hcdat(1)) work(2) = 0. do 101 k=2,nhcpts work(2*k-1) = real(hcdat(k)) nc2 = nc-2*k-1 work(nc2) = real(hcdat(k)) work(2*k) = aimag(hcdat(k)) nc2 = nc-2*k work(nc2) = -aimag(hcdat(k)) 101 continue isign = signex nscrt(1) = nrlpts call fourt (work,nscrt,1,isign,1,work(2*nrlpts+1)) do 102 j=1,nrlpts rltrn(j) = work(2*j-1) 102 continue return 103 if (nrlpts .lt. 1) go to 104 if (nhcpts .ne. 1) go to 105 rltrn(1) = real(hcdat(1)) return 104 ierr = 101 call uliber (ierr,25h fftcr nrlpts is .lt. 1,25) return 105 ierr = 102 call uliber (ierr,33h fftcr nhcpts is not nrlpts/2+1,33) return 106 ierr = 103 call uliber (ierr,55h fftcr insufficient workspace - lwrk is .lt 1. 4*nrlpts ,55) return end