      subroutine wavenumber()
use fft
      implicit none
      include 'dimen.h'
      integer jx,jy

      do jx=1,lh-1
        kx(jx,:) = dble(jx-1)
      end do

      do jy=1,ny
        ky(:,jy) = dble(modulo(jy - 1 + ny/2,ny) - ny/2)
      end do

! Nyquist: makes doing derivatives easier
      kx(lh,:)=0.
      ky(lh,:)=0.
      kx(:,ny/2+1)=0.
      ky(:,ny/2+1)=0.

! for the aspect ratio change
      kx=two_pi_over_Lx*kx   
      ky=two_pi_over_Ly*ky

! magnitude squared: will have 0's around the edge
      k2 = kx*kx + ky*ky

      return
      end
