anchor.diff:  
       end function
   
  +    !>----------------------------------------------------------
  +    !! Compute a spatially variable linear wind perturbation
  +    !! based off of look uptables computed in via setup
  +    !! for each grid point, find the closest LUT data in U and V space
  +    !! then bilinearly interpolate the nearest LUT values for that points linear wind field
  +    !!
  +    !!----------------------------------------------------------
       subroutine spatial_winds(domain,reverse, vsmooth, winsz)
  -        ! compute a spatially variable linear wind perturbation
  -        ! based off of look uptables computed in via setup
  -        ! for each grid point, find the closest LUT data in U and V space
  -        ! then bilinearly interpolate the nearest LUT values for that points linear wind field
           implicit none
           class(linearizable_type),intent(inout)::domain
           logical, intent(in) :: reverse
  
positive.code:         logical, save :: debug=.True.
          real::stability
  
          if (present(reverse)) then
              rev=reverse
          else
              rev=.False.
          endif
          ! these probably need to get moved to options...
          if (present(useDensity)) then
              useD=useDensity
          else
              useD=.False.
          endif
          ! this is a little trickier, because it does have to be domain dependant... could at least be stored in the domain though...
          if (rev) then
              linear_contribution = options%lt_options%rm_linear_contribution
  
negative.code: 
      end subroutine spatial_winds
  
      !>----------------------------------------------------------
      !! Copy options from the options data structure into module level variables
      !!
      !!----------------------------------------------------------
      subroutine set_module_options(options)
          implicit none
          type(options_type), intent(in) :: options
  
          original_buffer       = options%lt_options%buffer
          variable_N            = options%lt_options%variable_N
          smooth_nsq            = options%lt_options%smooth_nsq
  
          stability_window_size = options%lt_options%stability_window_size        ! window to average nsq over
          max_stability         = options%lt_options%max_stability                ! limits on the calculated Brunt Vaisala Frequency
          min_stability         = options%lt_options%min_stability                ! these may need to be a little narrower.
          linear_contribution   = options%lt_options%linear_contribution          ! multiplier on uhat,vhat before adding to u,v
                                                                                  ! =fractional contribution of linear perturbation to wind field
          ! these are defined per call to permit different values for low res and high res domains
          ! N_squared              = options%lt_options%N_squared                 ! static Brunt Vaisala Frequency (N^2) to use
          ! rm_N_squared           = options%lt_options%rm_N_squared              ! static BV Frequency (N^2) to use in removing linear wind field
          ! rm_linear_contribution = options%lt_options%rm_linear_contribution    ! fractional contribution of linear perturbation to remove wind field
          ! remove_lowres_linear   = options%lt_options%remove_lowres_linear      ! remove the linear mountain wave from low res forcing model
  
          linear_update_fraction    = options%lt_options%linear_update_fraction   ! controls the rate at which the linearfield updates
                                                                                  ! =fraction of linear perturbation to add each time step
  