anchor.diff:  		else
   ! 			else load data from the first Boundary conditions file
   			boundary_value=.False.
  -			nx=size(domain%u,1)
  -			ny=size(domain%u,3)
  +			nx=size(domain%p,1)
  +			ny=size(domain%p,3)
   			if (options%external_winds) then
   				call ext_winds_init(domain,bc,options)
   ! 				call smooth_wind(domain%u,1,3)
  
positive.code: 		!$omp shared(wind,inputwind)
  		allocate(rowsums(nx)) !this is only used when ydim=3, so nz is really ny
  		allocate(rowmeans(nx)) !this is only used when ydim=3, so nz is really ny
  		!$omp do schedule(static)
  		do j=1,ny
  			
  			! so we pre-compute the sum over rows for each column in the current window
  			if (ydim==3) then
  				rowsums=0
  				do i=1,windowsize
  					rowsums=rowsums+inputwind(:,j,i)
  				enddo
  				nrows=windowsize
  			endif
  			! don't parallelize over this loop because it is much more efficient to be able to assume
  			! that you ran the previous row in serial for the slow (ydim=3) case
  
negative.code: 					if ((k-windowsize)<=1) then
  						starty=1
  						endy  =k+windowsize
  						rowsums=rowsums-inputwind(1:nx,j,starty)+inputwind(1:nx,j,endy)
  					! if we are pinned to the bottom edge
  					else if ((k+windowsize)>nz) then
  						starty=k-windowsize
  						endy  =nz
  						rowsums=rowsums-inputwind(1:nx,j,starty-1)+inputwind(1:nx,j,endy)
  					! if we are in the middle (this is the most common)
  					else
  						starty=k-windowsize
  						endy  =k+windowsize
  						rowsums=rowsums-inputwind(1:nx,j,starty-1)+inputwind(:,j,endy)
  					endif
  					rowmeans=rowsums/nrows
  					cursum=sum(rowmeans(1:windowsize))+rowmeans(1)*(windowsize+1)
  				endif
  				
  				do i=1,nx
  