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