anchor.diff:      integer nx,ny
   
       ! wrap array around for periodicity
  -    array(0,:,) = array(nx,:,)
  -    array(nx+1,:,) = array(1,:,)
  -    array(:,0,) = array(:,ny,)
  -    array(:,ny+1,) = array(:,1,)
  +    array(0,:) = array(nx,:)
  +    array(nx+1,:) = array(1,:)
  +    array(:,0) = array(:,ny)
  +    array(:,ny+1) = array(:,1)
   
       return
       end
  
positive.code:     end do
  
  ! wrap fields around for periodic simulations
      wrap_fields_3D(unew,nx,ny,layers)
      wrap_fields_3D(vnew,nx,ny,layers)
      wrap_fields_3D(hnew,nx,ny,layers)
      wrap_fields_2D(etanew,nx,ny)
  
  
  !    Accumulate average fields
  
negative.code:     enddo
  
  ! wrap fields around for periodic simulations
      call wrap_fields_3D(u,nx,ny,layers)
      call wrap_fields_3D(v,nx,ny,layers)
      call wrap_fields_3D(h,nx,ny,layers)
  
  !    Now the model is ready to start.
  !    We have h, u, v at the zeroth time step, and the tendencies at two older time steps.
  