anchor.diff:              if (counter .eq. 1) then
                 ! Write a file saying that the layer thickness value
                 ! dropped below hmin and this line has been used.
  -              OPEN(UNIT=10, FILE='layer thickness dropped below hmin.txt', &
  -                  ACTION="write", STATUS="unknown", &
  -                  FORM="formatted", POSITION = "append")
  +              open(unit=10, file='layer thickness dropped below hmin.txt', &
  +                  action="write", status="unknown", &
  +                  form="formatted", position = "append")
                 write(10,1111) n
   1111          format("layer thickness dropped below hmin at time step ", 1i10.10)
  -              CLOSE(UNIT=10)
  +              close(unit=10)
               endif
             endif
           end do
  
positive.code:     ! 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
      endif
    endif
  
  
negative.code:   implicit none
  
    ! ----- variables for portable seed setting -----
    integer :: i_seed
    integer, dimension(:), allocatable :: a_seed
    integer, dimension(1:8) :: dt_seed
    ! ----- end of variables for seed setting -----
  
    ! ----- Set up random seed portably -----
    call random_seed(size=i_seed)
    allocate(a_seed(1:i_seed))
    call random_seed(get=a_seed)
    call date_and_time(values=dt_seed)
    a_seed(i_seed)=dt_seed(8); a_seed(1)=dt_seed(8)*dt_seed(7)*dt_seed(6)
    call random_seed(put=a_seed)
    return
  