!> Numerical slope limiters for high-resolution TVD schemes.
!!
!! This module provides placeholder implementations for standard TVD flux limiters 
!! (e.g., Minmod, Superbee, van Leer) used during spatial reconstruction.
module mod_limiters
   use mod_precision, only : rk, zero, one
   implicit none

   private
   public :: minmod, superbee

contains

   !> Standard minmod limiter function.
   pure real(rk) function minmod(a, b)
      real(rk), intent(in) :: a, b
      if (a * b <= zero) then
         minmod = zero
      else
         minmod = sign(one, a) * min(abs(a), abs(b))
      end if
   end function minmod

   !> Standard superbee limiter function.
   pure real(rk) function superbee(a, b)
      real(rk), intent(in) :: a, b
      real(rk) :: r
      if (a * b <= zero) then
         superbee = zero
      else
         r = a / b
         superbee = max(zero, min(2.0_rk * r, one), min(r, 2.0_rk))
      end if
   end function superbee

end module mod_limiters
