anchor.diff:      logical :: variable_N
       logical :: smooth_nsq
       real    :: N_squared
  -    
  +
       !! unfortunately these have to be allocated every call because we could be calling on both the high-res
       !! domain and the low res domain (to "remove" the linear winds)
       real,                       allocatable,    dimension(:,:)  :: k, l, kl, sig
  
positive.code:             !$omp parallel default(shared) &
              !$omp private(i,j,k,z, u,v, layer_height)
              ! $omp private(lt_data_m)
              
              ! initialization has to happen in each thread so each thread has its own copy
              ! lt_data_m is a threadprivate variable, within initialization, there are omp critical sections for fftw calls
              call initialize_linear_theory_data(lt_data_m, fftnx, fftny, domain%dx)
  
negative.code:                         v = domain%v(vi,j,k)
                      endif
                      n = n * ((top-bottom)+1)
  
                      ! Calculate the direction of the current grid cell wind
                      dpos = 1
                      curdir = calc_direction( u, v )
  