subroutine kyspace(aky,ay) c c Transform a variable from y space (ay) into ky space (aky) keeping c only the dealiased part. The transform is done in place, so ay c is overwritten with its full transform. c implicit none include 'itg.par' include 'itg.cmn' integer l,m,n,index,imode complex aky(nzz,mz*lz) complex ay(mzz/2,nzz*lz) c c See comments on real-to-complex ffts in yspace.f c real scale integer isign scale=1./float(malias) isign=-1 c c Radial boundary conditions c if (iperiod.eq.0) then do n=1,nalias do m=1,malias imode=1+(n-1)*ldb ay(m,imode)=0.0 enddo enddo endif c call scfftm(isign,malias,ldb*nalias,scale, & ay,mzz,ay,mzz/2,tabley,worky,0) c c get ky=0 (m=1) component: c do n=1,nalias cfpp$ select (vector) do l=1,ldb imode=l+(n-1)*ldb aky(n,l)=ay(1,imode) enddo enddo c c get ky>0 components (factor of 2 for sin/cos vs. complex conventions). c do n=1,nalias do m=2,md cfpp$ select (vector) do l=1,ldb imode=l+(n-1)*ldb index=l+(m-1)*ldb aky(n,index)=ay(m,imode)*2. enddo enddo enddo c return end