anchor.diff:          end do
       end do
   
  +    !norm_old = norm0
  +
   
       do nit = 1,maxits
  +        !norm_old = norm
           norm=0.d0
           do i=1,nx-1
               do j=1,ny-1
  
positive.code:     call calc_eta_star(ub,vb,eta,etastar,freesurfFac,nx,ny,dx,dy,dt)
  !print *, maxval(abs(etastar))
  
      call SOR_solver(a,etanew,etastar,freesurfFac,nx,ny, &
          dt,rjac,eps,maxits,n)
  !print *, maxval(abs(etanew))
  
negative.code:         endif
        
          if (nit.gt.1.and.norm.lt.eps*norm0) then
              ! print 10014,  eps,  nit
              ! 10014   format('Res less than eps of original. eps, iteration: ', F5.4, I7)
              return
          ! elseif (nit.gt.1.and.abs(norm - norm_old).lt.norm_old*eps) then
          !     print *, 'change in residual less than eps of previous residual. iteration:', eps, nit
          !     return
          ! This was not a good way of exiting the solver - it would occasionally leave after 2 or 3 iterations.
          endif
      end do
  
  