anchor.diff:          real, intent(in) :: T,mr  ! inputs T in K (?) and mr in kg/kg
           real :: L
           real :: sat_lapse
  -        
  +
           L=LH_vaporization ! short cut for imported parameter
           sat_lapse = gravity*((1 + (L*mr) / (Rd*T))          &
                       / (cp + (L*L*mr*(Rd/Rw)) / (Rd*T*T) ))
  
positive.code:                 direction = atan(u/v) + (2*pi)
              endif
          endif
          
      end function calc_direction
      
      ! calculate the strength of the u wind field given a direction [0-2*pi] and magnitude
      pure function calc_speed(u, v) result(speed)
          implicit none
          real, intent(in) :: u,v
          real :: speed
          
          speed = sqrt(u**2 + v**2)
      end function calc_speed
      
      ! calculate the strength of the u wind field given a direction [0-2*pi] and magnitude
      pure function calc_u(direction, magnitude) result(u)
          implicit none
          real, intent(in) :: direction, magnitude
          real :: u
          
          u = sin(direction) * magnitude
      end function calc_u
      
      ! calculate the strength of the v wind field given a direction [0-2*pi] and magnitude
      pure function calc_v(direction, magnitude) result(v)
          implicit none
          real, intent(in) :: direction, magnitude
          real :: v
          
          v = cos(direction) * magnitude
      end function calc_v
  
  
negative.code:         !$omp parallel default(shared), private(k,l,kl,sig,denom,m,msq,mimag,ineta,z,gain,offset,i,U,V) &
          !$omp firstprivate(nx,ny,nz, zaxis_is_third, Nsq, realnx,realny, realnx_u, realny_v) &
          !$omp firstprivate(useDensity, debug, staggered, reverse, buffer)
  
          ! these should be stored in a separate data structure... and allocated/deallocated in a subroutine
          ! for now these are reallocated/deallocated everytime so we can use it for different sized domains (e.g. coarse and fine)
          ! maybe linear winds need to be embedded in an object instead of a module to avoid this problem...
  