/[MITgcm]/MITgcm_contrib/dgoldberg/streamice/slope_limiter.F
ViewVC logotype

Annotation of /MITgcm_contrib/dgoldberg/streamice/slope_limiter.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.3 - (hide annotations) (download)
Tue Jun 11 20:19:45 2013 UTC (12 years, 1 month ago) by dgoldberg
Branch: MAIN
Changes since 1.2: +19 -12 lines
rewrite to make like GAD_FLUX_LIMITER, but as function not header

1 heimbach 1.1 #include "CPP_OPTIONS.h"
2    
3 dgoldberg 1.3 ! _RL FUNCTION SLOPE_LIMITER (num, denom)
4    
5     _RL FUNCTION SLOPE_LIMITER (Cr)
6    
7     ! _RL num, denom
8 heimbach 1.1 ! _RL SLOPE_LIMITER
9 dgoldberg 1.3 ! _RL r
10     _RL Cr
11 heimbach 1.1
12     ! used for flux limiting in advective subroutines
13     ! Van Leer limiter (source: Wikipedia!)
14    
15 dgoldberg 1.3 ! if (denom .eq. 0.0) then
16     ! SLOPE_LIMITER = 0.0
17     ! elseif (num*denom .le. 0.0) then
18     ! SLOPE_LIMITER = 0.0
19     ! else
20     ! r = num/denom
21     ! SLOPE_LIMITER = (r+abs(r))/(1+abs(r))
22     ! endif
23    
24     SLOPE_LIMITER = max(0.D0,max(min(1.D0,2.D0*Cr),
25     & min(2.D0,Cr)))
26    
27 heimbach 1.1
28     RETURN
29     END

  ViewVC Help
Powered by ViewVC 1.1.22