anchor.diff:              u_perturbation=>hi_u_perturbation
               v_perturbation=>hi_v_perturbation
           endif
  +
           if (reverse) print*, "WARNING using fixed nsq for linear wind removal: 3e-6"
           !$omp parallel firstprivate(nx,ny,nz, reverse, vsmooth, winsz), default(none), &
           !$omp private(i,j,k,step, uk, vi, east, west, north, south, top, bottom), &
           !$omp private(spos, dpos, npos, nexts,nextd, nextn,n, smoothz, u, v), &
           !$omp private(wind_first, wind_second, curspd, curdir, curnsq, sweight,dweight, nweight), &
  -        !$omp shared(domain, spd_values, dir_values, nsq_values, u_LUT, v_LUT), &
  +        !$omp shared(domain, spd_values, dir_values, nsq_values, u_LUT, v_LUT, linear_mask), &
           !$omp shared(u_perturbation, v_perturbation, linear_update_fraction, linear_contribution, nsq_calibration), &
           !$omp shared(min_stability, max_stability, n_dir_values, n_spd_values, n_nsq_values, smooth_nsq)
           !$omp do
           do k=1,ny
               do j=1,nz
                   do i=1,nx
  +                    
                       ! look up vsmooth gridcells up to nz at the maximum
                       top = min(j+vsmooth, nz)
                       ! if (top-j)/=vsmooth, then look down enough layers to make the window vsmooth in size
  
positive.code:             endif
              u_LUT=>hi_u_LUT
              v_LUT=>hi_v_LUT
          endif
  
          if (options%debug) then
  
negative.code:                                     + linear_update_fraction * (sweight*wind_first + (1-sweight)*wind_second)
  
                          if (reverse) then
                              domain%v(i,j,k) = domain%v(i,j,k) - v_perturbation(i,j,k) * linear_contribution
                          else
                              ! for the high res domain, linear_mask should incorporate linear_contribution
                              domain%v(i,j,k) = domain%v(i,j,k) + v_perturbation(i,j,k) * linear_mask(min(nx,i),min(ny,k))
                          endif
                      endif
                  end do
  