/[MITgcm]/MITgcm/pkg/generic_advdiff/gad_osc_hat_x.F
ViewVC logotype

Contents of /MITgcm/pkg/generic_advdiff/gad_osc_hat_x.F

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


Revision 1.1 - (show annotations) (download)
Sun Mar 13 01:44:02 2016 UTC (8 years, 1 month ago) by jmc
Branch: MAIN
CVS Tags: checkpoint66g, checkpoint66f, checkpoint66e, checkpoint66d, checkpoint66c, checkpoint66b, checkpoint66a, checkpoint66o, checkpoint66n, checkpoint66m, checkpoint66l, checkpoint66k, checkpoint66j, checkpoint66i, checkpoint66h, checkpoint65z, checkpoint65x, checkpoint65y, checkpoint65v, checkpoint65w, checkpoint65u, HEAD
- from Darren: add PPM and PQM advection schemes (number 40-42 and 50-52)
  with 2 types of limiter (see: Engwirda & Kelley, submit. to JCP);
  Note (from Darren): unlimited PPM/PQM scheme (40 & 50) are just for
  testing and not for actual use.

1 C $Header: $
2 C $Name: $
3
4 # include "GAD_OPTIONS.h"
5
6 C-- File gad_osc_hat_x.F: Routines ???
7 C-- Contents
8 C-- o GAD_OSC_LOC_X
9 C-- o GAD_OSC_HAT_X
10
11 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
12
13 SUBROUTINE GAD_OSC_LOC_X(ix,mask,fbar,ohat)
14
15 implicit none
16
17 C =============================================== global variables
18 # include "SIZE.h"
19
20 C ====================================================== arguments
21 integer ix
22 _RL mask(1-OLx:sNx+OLx)
23 _RL fbar(1-OLx:sNx+OLx)
24 _RL ohat(1:2,
25 & 1-OLx:sNx+OLx)
26
27 C ====================================================== variables
28 _RL floc(-2:+2)
29
30 if (ix.gt. +1-OLx .and.
31 & ix.lt.sNx+OLx) then
32
33 C ================ mask local stencil: expand from centre outwards
34
35 floc(+0) = fbar(+0+ix)
36
37 floc(-1) = floc(+0) +
38 & mask(ix-1)*(fbar(ix-1)-floc(+0))
39 floc(+1) = floc(+0) +
40 & mask(ix+1)*(fbar(ix+1)-floc(+0))
41
42 C ================ calc. 1st & 2nd derivatives over masked stencil
43
44 ohat(+1,ix) = floc(+1)*0.25 _d 0
45 & - floc(-1)*0.25 _d 0
46
47 ohat(+2,ix) = floc(+1)*0.25 _d 0
48 & - floc(+0)*0.50 _d 0
49 & + floc(-1)*0.25 _d 0
50
51 else
52
53 if (ix.eq. +1-OLx) then
54
55 C ================ mask local stencil: expand from centre outwards
56
57 floc(+0) = fbar(+0+ix)
58
59 floc(+1) = floc(+0) +
60 & mask(ix+1)*(fbar(ix+1)-floc(+0))
61 floc(+2) = floc(+1) +
62 & mask(ix+2)*(fbar(ix+2)-floc(+1))
63
64 C ================ calc. 1st & 2nd derivatives over masked stencil
65
66 ohat(+1,ix) = floc(+1)*0.50 _d 0
67 & - floc(+0)*0.50 _d 0
68
69 ohat(+2,ix) = floc(+2)*0.25 _d 0
70 & - floc(+1)*0.50 _d 0
71 & + floc(+0)*0.25 _d 0
72
73 end if
74
75 if (ix.eq.sNx+OLx) then
76
77 C ================ mask local stencil: expand from centre outwards
78
79 floc(+0) = fbar(+0+ix)
80
81 floc(-1) = floc(+0) +
82 & mask(ix-1)*(fbar(ix-1)-floc(+0))
83 floc(-2) = floc(-1) +
84 & mask(ix-2)*(fbar(ix-2)-floc(-1))
85
86 C ================ calc. 1st & 2nd derivatives over masked stencil
87
88 ohat(+1,ix) = floc(+0)*0.50 _d 0
89 & - floc(-1)*0.50 _d 0
90
91 ohat(+2,ix) = floc(+0)*0.25 _d 0
92 & - floc(-1)*0.50 _d 0
93 & + floc(-2)*0.25 _d 0
94
95 end if
96
97 end if
98
99 return
100
101 c end subroutine GAD_OSC_LOC_X
102 end
103
104 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
105
106 SUBROUTINE GAD_OSC_HAT_X(bi,bj,kk,iy,
107 & mask,fbar,ohat,myThid)
108 C |================================================================|
109 C | OSC_HAT_X: compute WENO oscillation derivatives in X. |
110 C |================================================================|
111
112 implicit none
113
114 C =============================================== global variables
115 # include "SIZE.h"
116
117 C ====================================================== arguments
118 integer bi,bj,kk,iy
119 _RL mask(1-OLx:sNx+OLx)
120 _RL fbar(1-OLx:sNx+OLx)
121 _RL ohat(1:2,
122 & 1-OLx:sNx+OLx)
123 integer myThid
124
125 C ====================================================== variables
126 integer ix
127
128 C ================================ derivatives for WENO indicators
129 do ix = 1-OLx+0, sNx+OLx-0
130
131 CALL GAD_OSC_LOC_X(ix,mask,fbar,ohat)
132
133 end do
134
135 return
136
137 c end subroutine GAD_OSC_HAT_X
138 end

  ViewVC Help
Powered by ViewVC 1.1.22