c Mahc_Evolve: Numerical Evolution of the General Relativistic Hydro Equations c Copyright (C) 2001 Mark Miller /*@@ @file slopelim.F @date December 1999 @author Mark Miller @desc Slope limiters. @enddesc @@*/ #include "cctk.h" /*@@ @routine vis_contrib @date December 1999 @author Mark Miller @desc Slope limiters. @enddesc @calls @calledby @history @endhistory @@*/ subroutine slopelim(slopel,sloper,order,fm1,f,fp1,fp2,tvd) implicit none CCTK_REAL slopel,sloper,fm1,f,fp1,fp2 integer order,tvd c LOCAL VARS CCTK_REAL m_mhalf,m_phalf,m_p3half,half,mprod half = 0.5d0 if (order .eq. 1) then slopel = 0.0d0 sloper = 0.0d0 return endif m_mhalf = f - fm1 m_phalf = fp1 - f m_p3half = fp2 - fp1 if (tvd .eq. 1) then c left slope mprod = m_mhalf * m_phalf slopel = (half + sign(half,mprod)) if(mprod .eq. 0.0d0) slopel = 0.0d0 if(m_mhalf .ge. 0.0d0) then slopel = slopel * min(m_mhalf,m_phalf) else slopel = slopel * max(m_mhalf,m_phalf) endif c right slope mprod = m_p3half * m_phalf sloper = (half + sign(half,mprod)) if(mprod .eq. 0.0d0) sloper = 0.0d0 if(m_p3half .ge. 0.0d0) then sloper = sloper * min(m_phalf,m_p3half) else sloper = sloper * max(m_phalf,m_p3half) endif else slopel = m_phalf sloper = m_phalf endif return end