anchor.diff:          complex,parameter :: j= (0,1)
           real::gain,offset !used in setting up k and l arrays
           integer::nx,ny,nz,i,midpoint,z,realnx,realny,realnx_u,realny_v,x,y,bottom,top
  -		logical :: staggered
  +		logical :: staggered, zaxis_is_third
           real::U,V
   		real,dimension(:),allocatable::U_layers,V_layers,preU_layers,preV_layers
   		real,parameter::pi=3.1415927
  
positive.code: 			if ((abs(U)+abs(V))>0.5) then
  	            sig  = U*k+V*l
  	            where(sig==0.0) sig=1e-15
  	            denom = sig**2!-f**2
  			
  				! 	where(denom.eq.0) denom=1e-20
  				! # two possible non-hydrostatic versions
  
negative.code: 	            m = sqrt(msq)         ! # % vertical wave number, hydrostatic
  				where(sig<0) m=m*(-1)   ! equivilant to m=m*sign(sig)
  	    		where(real(msq)<0) m=mimag
  				
  				if (zaxis_is_third) then
  		            ineta=j*domain%fzs*exp(j*m* &
  							sum(domain%z(:,:,z)-domain%z(:,:,1)) / (realnx*realny))
  				else
  		            ineta=j*domain%fzs*exp(j*m* &
  							sum(domain%z(:,z,:)-domain%z(:,1,:)) / (realnx*realny))
  				endif
  				!  what=sig*ineta
  
  				!# with coriolis : [+/-]j*[l/k]*f
  