anchor.diff:          class(linearizable_type),intent(inout)::domain
   		integer :: nx,ny
   		
  -		ny=size(domain%terrain,1)
  -		nx=size(domain%terrain,2)
  +		nx=size(domain%terrain,1)
  +		ny=size(domain%terrain,2)
   ! 		compute u at x mid-point
  -		domain%u(:,:,1:nx-1)=(domain%u(:,:,1:nx-1)+domain%u(:,:,2:nx))/2
  +		domain%u(1:nx-1,:,:)=(domain%u(1:nx-1,:,:)+domain%u(2:nx,:,:))/2
   ! 		compute v at y mid-point
  -		domain%v(1:ny-1,:,:)=(domain%v(1:ny-1,:,:)+domain%v(2:ny,:,:))/2
  +		domain%v(:,:,1:ny-1)=(domain%v(:,:,1:ny-1)+domain%v(:,:,2:ny))/2
   		
   	end subroutine stagger_winds
   	
  
positive.code:             vhat=l*ineta
  
  !           pull it back out of fourier space. 
  ! 			plan = fftw_plan_dft_2d(nx,ny, what,w_hat, FFTW_BACKWARD,FFTW_ESTIMATE)
  ! 			call fftw_execute_dft(plan, what,w_hat)
  ! 			call fftw_destroy_plan(plan)
  			
  ! 			it should be possible to store the plan and execute it everytime rather than recreating it everytime, doesn't matter too much 
              plan = fftw_plan_dft_2d(ny,nx, uhat,u_hat, FFTW_BACKWARD,FFTW_ESTIMATE)
  
negative.code: 			endif
  		end do
  ! 		finally deallocate all temporary arrays that were created... should be a datastructure and a subroutine...
  		deallocate(k,l,kl,sig,denom,uhat,u_hat,vhat,v_hat,m,ineta,msq,mimag)
      end subroutine linear_winds
      
      
  