anchor.diff:  		!$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
  +		nrows=windowsize*2+1
  +		ncols=windowsize*2+1
   		!$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
  +				rowsums=inputwind(1:nx,j,1)*(windowsize+1)
   				do i=1,windowsize
  -					rowsums=rowsums+inputwind(:,j,i)
  +					rowsums=rowsums+inputwind(1:nx,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
  
positive.code: 					if ((k-windowsize)<=1) then
  						starty=1
  						endy  =k+windowsize
  						nrows =nrows+1
  						rowsums=rowsums+inputwind(:,j,endy)
  					! if we are pinned to the bottom edge
  					else if ((k+windowsize)>nz) then
  						starty=k-windowsize
  						endy  =nz
  						nrows=nrows-1
  						rowsums=rowsums-inputwind(:,j,starty-1)
  					! if we are in the middle (this is the most common)
  					else
  						starty=k-windowsize
  						endy  =k+windowsize
  						rowsums=rowsums-inputwind(:,j,starty-1)+inputwind(:,j,endy)
  					endif
  					if ((endy-starty+1)/=nrows) then
  						print*, "Y windowing error"
  						print*,endy,starty,nrows
  						print*,i,j,k
  					endif
  					rowmeans=rowsums/nrows
  					cursum=sum(rowmeans(1:windowsize))
  					ncols=windowsize
  				endif
  				
  				do i=1,nx
  
negative.code: 		nx=size(wind,1)
  		ny=size(wind,2) !note, this is Z for the high-res domain (ydim=3)
  		nz=size(wind,3) !note, this could be the Y or Z dimension depending on ydim
  		! this is ~20MB that has to be allocated deallocated every call...
  		allocate(inputwind(nx,ny,nz)) ! Can't be module level because nx,ny,nz could change between calls, 
  									  ! could be part of a "smoothable" object to avoid allocate-deallocating constantly
  ! 		nx=nx-1
  ! 		if (ydim==3) then
  ! 			nz=nz-1
  ! 		endif
  		inputwind=wind !make a copy so we always use the unsmoothed data when computing the smoothed data
  		if (((windowsize*2+1)>nx).and.(ydim==3)) then
  			write(*,*) "WARNING can not operate if windowsize*2+1 is larger than nx"
  