1 | MODULE advec_v_pw_mod |
---|
2 | |
---|
3 | !--------------------------------------------------------------------------------! |
---|
4 | ! This file is part of PALM. |
---|
5 | ! |
---|
6 | ! PALM is free software: you can redistribute it and/or modify it under the terms |
---|
7 | ! of the GNU General Public License as published by the Free Software Foundation, |
---|
8 | ! either version 3 of the License, or (at your option) any later version. |
---|
9 | ! |
---|
10 | ! PALM is distributed in the hope that it will be useful, but WITHOUT ANY |
---|
11 | ! WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR |
---|
12 | ! A PARTICULAR PURPOSE. See the GNU General Public License for more details. |
---|
13 | ! |
---|
14 | ! You should have received a copy of the GNU General Public License along with |
---|
15 | ! PALM. If not, see <http://www.gnu.org/licenses/>. |
---|
16 | ! |
---|
17 | ! Copyright 1997-2014 Leibniz Universitaet Hannover |
---|
18 | !--------------------------------------------------------------------------------! |
---|
19 | ! |
---|
20 | ! Current revisions: |
---|
21 | ! ----------------- |
---|
22 | ! |
---|
23 | ! |
---|
24 | ! Former revisions: |
---|
25 | ! ----------------- |
---|
26 | ! $Id: advec_v_pw.f90 1354 2014-04-08 15:22:57Z letzel $ |
---|
27 | ! |
---|
28 | ! 1353 2014-04-08 15:21:23Z heinze |
---|
29 | ! REAL constants provided with KIND-attribute |
---|
30 | ! |
---|
31 | ! 1320 2014-03-20 08:40:49Z raasch |
---|
32 | ! ONLY-attribute added to USE-statements, |
---|
33 | ! kind-parameters added to all INTEGER and REAL declaration statements, |
---|
34 | ! kinds are defined in new module kinds, |
---|
35 | ! revision history before 2012 removed, |
---|
36 | ! comment fields (!:) to be used for variable explanations added to |
---|
37 | ! all variable declaration statements |
---|
38 | ! |
---|
39 | ! 1036 2012-10-22 13:43:42Z raasch |
---|
40 | ! code put under GPL (PALM 3.9) |
---|
41 | ! |
---|
42 | ! Revision 1.1 1997/08/11 06:09:57 raasch |
---|
43 | ! Initial revision |
---|
44 | ! |
---|
45 | ! |
---|
46 | ! Description: |
---|
47 | ! ------------ |
---|
48 | ! Advection term for v velocity-component using Piacsek and Williams. |
---|
49 | ! Vertical advection at the first grid point above the surface is done with |
---|
50 | ! normal centred differences, because otherwise no information from the surface |
---|
51 | ! would be communicated upwards due to w=0 at K=nzb. |
---|
52 | !------------------------------------------------------------------------------! |
---|
53 | |
---|
54 | PRIVATE |
---|
55 | PUBLIC advec_v_pw |
---|
56 | |
---|
57 | INTERFACE advec_v_pw |
---|
58 | MODULE PROCEDURE advec_v_pw |
---|
59 | MODULE PROCEDURE advec_v_pw_ij |
---|
60 | END INTERFACE advec_v_pw |
---|
61 | |
---|
62 | CONTAINS |
---|
63 | |
---|
64 | |
---|
65 | !------------------------------------------------------------------------------! |
---|
66 | ! Call for all grid points |
---|
67 | !------------------------------------------------------------------------------! |
---|
68 | SUBROUTINE advec_v_pw |
---|
69 | |
---|
70 | USE arrays_3d, & |
---|
71 | ONLY: ddzw, tend, u, v, w |
---|
72 | |
---|
73 | USE control_parameters, & |
---|
74 | ONLY: u_gtrans, v_gtrans |
---|
75 | |
---|
76 | USE grid_variables, & |
---|
77 | ONLY: ddx, ddy |
---|
78 | |
---|
79 | USE indices, & |
---|
80 | ONLY: nxl, nxr, nyn, nysv, nzb_v_inner, nzt |
---|
81 | |
---|
82 | USE kinds |
---|
83 | |
---|
84 | |
---|
85 | IMPLICIT NONE |
---|
86 | |
---|
87 | INTEGER(iwp) :: i !: |
---|
88 | INTEGER(iwp) :: j !: |
---|
89 | INTEGER(iwp) :: k !: |
---|
90 | |
---|
91 | REAL(wp) :: gu !: |
---|
92 | REAL(wp) :: gv !: |
---|
93 | |
---|
94 | |
---|
95 | gu = 2.0_wp * u_gtrans |
---|
96 | gv = 2.0_wp * v_gtrans |
---|
97 | DO i = nxl, nxr |
---|
98 | DO j = nysv, nyn |
---|
99 | DO k = nzb_v_inner(j,i)+1, nzt |
---|
100 | tend(k,j,i) = tend(k,j,i) - 0.25_wp * ( & |
---|
101 | ( v(k,j,i+1) * ( u(k,j-1,i+1) + u(k,j,i+1) - gu ) & |
---|
102 | - v(k,j,i-1) * ( u(k,j-1,i) + u(k,j,i) - gu ) ) * ddx & |
---|
103 | + ( v(k,j+1,i) * ( v(k,j+1,i) + v(k,j,i) - gv ) & |
---|
104 | - v(k,j-1,i) * ( v(k,j,i) + v(k,j-1,i) - gv ) ) * ddy & |
---|
105 | + ( v(k+1,j,i) * ( w(k,j-1,i) + w(k,j,i) ) & |
---|
106 | - v(k-1,j,i) * ( w(k-1,j-1,i) + w(k-1,j,i) ) ) & |
---|
107 | * ddzw(k) & |
---|
108 | ) |
---|
109 | ENDDO |
---|
110 | ENDDO |
---|
111 | ENDDO |
---|
112 | |
---|
113 | END SUBROUTINE advec_v_pw |
---|
114 | |
---|
115 | |
---|
116 | !------------------------------------------------------------------------------! |
---|
117 | ! Call for grid point i,j |
---|
118 | !------------------------------------------------------------------------------! |
---|
119 | SUBROUTINE advec_v_pw_ij( i, j ) |
---|
120 | |
---|
121 | USE arrays_3d, & |
---|
122 | ONLY: ddzw, tend, u, v, w |
---|
123 | |
---|
124 | USE control_parameters, & |
---|
125 | ONLY: u_gtrans, v_gtrans |
---|
126 | |
---|
127 | USE grid_variables, & |
---|
128 | ONLY: ddx, ddy |
---|
129 | |
---|
130 | USE indices, & |
---|
131 | ONLY: nzb_v_inner, nzt |
---|
132 | |
---|
133 | USE kinds |
---|
134 | |
---|
135 | |
---|
136 | IMPLICIT NONE |
---|
137 | |
---|
138 | INTEGER(iwp) :: i !: |
---|
139 | INTEGER(iwp) :: j !: |
---|
140 | INTEGER(iwp) :: k !: |
---|
141 | |
---|
142 | REAL(wp) :: gu !: |
---|
143 | REAL(wp) :: gv !: |
---|
144 | |
---|
145 | |
---|
146 | gu = 2.0_wp * u_gtrans |
---|
147 | gv = 2.0_wp * v_gtrans |
---|
148 | DO k = nzb_v_inner(j,i)+1, nzt |
---|
149 | tend(k,j,i) = tend(k,j,i) - 0.25_wp * ( & |
---|
150 | ( v(k,j,i+1) * ( u(k,j-1,i+1) + u(k,j,i+1) - gu ) & |
---|
151 | - v(k,j,i-1) * ( u(k,j-1,i) + u(k,j,i) - gu ) ) * ddx & |
---|
152 | + ( v(k,j+1,i) * ( v(k,j+1,i) + v(k,j,i) - gv ) & |
---|
153 | - v(k,j-1,i) * ( v(k,j,i) + v(k,j-1,i) - gv ) ) * ddy & |
---|
154 | + ( v(k+1,j,i) * ( w(k,j-1,i) + w(k,j,i) ) & |
---|
155 | - v(k-1,j,i) * ( w(k-1,j-1,i) + w(k-1,j,i) ) ) & |
---|
156 | * ddzw(k) & |
---|
157 | ) |
---|
158 | ENDDO |
---|
159 | |
---|
160 | END SUBROUTINE advec_v_pw_ij |
---|
161 | |
---|
162 | END MODULE advec_v_pw_mod |
---|
163 | |
---|