anchor.diff:      ! Check that depth is negative - it must be less than zero
       if (minval(depth) .lt. 0) then
         print *, "depths must be positive - fix this and try again"
  -      STOP
  +      stop
       endif
     endif
   
  
positive.code: 
    end do
  
    OPEN(UNIT=10, FILE='run_finished.txt', ACTION="write", STATUS="unknown", &
        FORM="formatted", POSITION = "append")
    write(10,1112) n
  1112 format( "run finished at time step ", 1i10.10)
    CLOSE(UNIT=10)
  
    print *, 'Execution ended normally'
  
    stop 0
  
  END PROGRAM MIM
  
  
  ! ------------------------- Beginning of the subroutines ----------------------
  
negative.code:         close(10)
        endif
  
        if (DumpWind .eqv. .true.) then
          open(unit = 10, status='replace',file='output/wind_x.'//num, &
              form='unformatted')
          write(10) wind_x(1:nx+1,1:ny)
  