anchor.diff:                                  ! hi_v_LUT(k,i,j,:,z,:) = real( real(                                                    &
                                   !         lt_data_m%v_perturb(1+buffer:fftnx-buffer,     1+buffer:fftny-buffer) ))
                               endif
  -                            !$omp critical
  -                            sync all
  -                            !$omp end critical
  +
  +                            !$omp critical (print_lock)
  +                            loops_completed = loops_completed+1
  +                            !$omp end critical (print_lock)
                           enddo
  +                        !$omp critical
  +                        sync all
  +                        !$omp end critical
   
                       ! end do
  -                    !$omp critical (print_lock)
  -                    loops_completed = loops_completed+1
  -                    !$omp end critical (print_lock)
                   ! end do
   
               end do
  -            !$omp end do
  +            ! $omp end do
               ! memory needs to be freed so this structure can be used again when removing linear winds
               call destroy_linear_theory_data(lt_data_m)
  -            !$omp end parallel
  -            if (this_image()==1) write(*,"(A,f5.1,A$)") char(13), loops_completed/real(n_dir_values*n_spd_values)*100," %"
  +            ! $omp end parallel
  +
  +            sync all
  +
  +            if (this_image()==1) write(*,"(f5.1,A)") loops_completed/real(z*(stop_pos-start_pos+1))*100," %"
               if (this_image()==1) write(*,*) char(10),"--------  Linear wind look up table generation complete ---------"
           endif
   
           if (this_image()==1) print*, "    Not writing Linear Theory LUT to file, not implemented yet"
  +
  +        print*, this_image(), maxval(hi_u_LUT), maxval(hi_v_LUT)
  +
  +        call io_write("u_"//trim(options%lt_options%u_LUT_Filename)//trim(str(this_image()))//".nc","ulut",hi_u_LUT)
  +        call io_write("v_"//trim(options%lt_options%u_LUT_Filename)//trim(str(this_image()))//".nc","vlut",hi_v_LUT)
           ! if ((options%lt_options%write_LUT).and.(.not.reverse)) then
           !     if ((options%lt_options%read_LUT) .and. (error == 0)) then
           !         print*, "    Not writing Linear Theory LUT to file because LUT was read from file"
  
positive.code:                 i = ik/n_spd_values + 1
                  k = mod(ik,n_spd_values) + 1
  
                  ! do k=1, n_spd_values
  
                      ! print the current status if this is being run "interactively"
                      if (options%parameters%interactive.and.(this_image()==1)) then
                          !$omp critical (print_lock)
                          write(*,"(A,f5.1,A$)") char(13), loops_completed/real(stop_pos-start_pos+1)*100," %"
                          !$omp end critical (print_lock)
                      endif
                      ! do j=1, n_nsq_values
                          u = calc_u( dir_values(i), spd_values(k) )
                          v = calc_v( dir_values(i), spd_values(k) )
  
                          ! calculate the linear wind field for the current u and v values
                          do z=1,nz
                              ! if (reverse) then
                              !     layer_height        = domain%z(1,1,z) - domain%terrain%data_2d(1,1)
                              !     layer_height_bottom = layer_height - (options%parameters%dz_levels(z) / 2)
                              !     layer_height_top    = layer_height + (options%parameters%dz_levels(z) / 2)
                              ! else
                                  layer_height = domain%z%data_3d(1,z,1) - domain%terrain%data_2d(1,1)
                                  layer_height_bottom = layer_height - (options%parameters%dz_levels(z) / 2)
                                  layer_height_top    = layer_height + (options%parameters%dz_levels(z) / 2)
                              ! endif
  
negative.code: 
                              ! need to handle stagger (nxu /= nx) and the buffer around edges of the domain
                              if (nxu /= nx) then
                                  temporary_u(1:fftnx-2*buffer-1,:,z) = real( real(                                              &
                                          ( lt_data_m%u_perturb(1+buffer:fftnx-buffer-1,   1+buffer:fftny-buffer)           &
                                          + lt_data_m%u_perturb(2+buffer:fftnx-buffer,     1+buffer:fftny-buffer)) )) / 2
  
                                  temporary_v(:,1:fftny-2*buffer-1,z) = real( real(                                              &
                                          ( lt_data_m%v_perturb(1+buffer:fftnx-buffer,     1+buffer:fftny-buffer-1)         &
                                          + lt_data_m%v_perturb(1+buffer:fftnx-buffer,     2+buffer:fftny-buffer)) )) / 2
  
  