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

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

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


Revision 1.1 - (show annotations) (download)
Thu Mar 29 15:59:21 2012 UTC (13 years, 3 months ago) by heimbach
Branch: MAIN
Initial check-in of Dan Goldberg's streamice package

1 #include "CPP_OPTIONS.h"
2
3 _RL FUNCTION SLOPE_LIMITER (num, denom)
4
5 _RL num, denom
6 ! _RL SLOPE_LIMITER
7 _RL r
8
9 ! used for flux limiting in advective subroutines
10 ! Van Leer limiter (source: Wikipedia!)
11
12 if (denom .eq. 0.0) then
13 SLOPE_LIMITER = 0.0
14 elseif (num*denom .le. 0.0) then
15 SLOPE_LIMITER = 0.0
16 else
17 r = num/denom
18 SLOPE_LIMITER = 0.0*(r+abs(r))/(1+abs(r))
19 endif
20
21 RETURN
22 END

  ViewVC Help
Powered by ViewVC 1.1.22