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