anchor.diff:              domain%u=savedU
               domain%v=savedV
           end if
  -        
  +
           deallocate(savedU,savedV)
  -        
  +
           if (options%lt_options%write_LUT) then
               if (options%lt_options%read_LUT) then
                   print*, "Not writing Linear Theory LUT to file because LUT was read from file"
               else
                   print*, "Writing u-LUT to file: ", trim(options%lt_options%u_LUT_Filename)
  -                error = write_LUT(options%lt_options%u_LUT_Filename, hi_u_LUT, hi_u_LUT, options%lt_options)
  -            endif
  -        endif            
  -        
  +                error = write_LUT(options%lt_options%u_LUT_Filename, hi_u_LUT, hi_v_LUT, options%lt_options)
  +            endif
  +        endif
  +
       end subroutine initialize_spatial_winds
   
  -! Code to test that the direction calculation works.     
  +! Code to test that the direction calculation works.
   !     if ((k==n_spd_values).and.(j==1)) then
   !         print*, "Direction:", &
   !             dir_values(i), "Calc=", calc_direction(domain%u(1,1,1), domain%v(1,1,1)), &
  
positive.code:         real, intent(in) :: t_top, t_bot, z_top, z_bot, qv_top, qv_bot, qc
          real :: t,qv, dz, sat_lapse
          real :: BV_freq
          
          t  = ( t_top +  t_bot)/2
          qv = (qv_top + qv_bot)/2
          dz = ( z_top - z_bot)
          sat_lapse = calc_sat_lapse_rate(t,qv)
          
          BV_freq = (gravity/t) * ((t_top-t_bot)/dz + sat_lapse) * &
                    (1 + (LH_vaporization*qv)/(Rd*t)) - (gravity/(1+qv+qc) * (qv_top-qv_bot)/dz)
      end function calc_moist_stability
  
negative.code:         n_dir_values = options%lt_options%n_dir_values
          n_nsq_values = options%lt_options%n_nsq_values
          n_spd_values = options%lt_options%n_spd_values
  
      end subroutine set_module_options
  
      ! called from linear_perturb the first time perturb is called
      ! compute FFT(terrain), and dzdx,dzdy components
      subroutine setup_linwinds(domain,options,reverse,useDensity)
  