1 | !> @file advec_w_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 |
---|
6 | ! terms of the GNU General Public License as published by the Free Software |
---|
7 | ! Foundation, either version 3 of the License, or (at your option) any later |
---|
8 | ! 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-2020 Leibniz Universitaet Hannover |
---|
18 | !------------------------------------------------------------------------------! |
---|
19 | ! |
---|
20 | ! Current revisions: |
---|
21 | ! ----------------- |
---|
22 | ! |
---|
23 | ! |
---|
24 | ! Former revisions: |
---|
25 | ! ----------------- |
---|
26 | ! $Id: advec_w_pw.f90 4360 2020-01-07 11:25:50Z maronga $ |
---|
27 | ! Corrected "Former revisions" section |
---|
28 | ! |
---|
29 | ! 3655 2019-01-07 16:51:22Z knoop |
---|
30 | ! variables documented |
---|
31 | ! |
---|
32 | ! Revision 1.1 1997/08/11 06:10:29 raasch |
---|
33 | ! Initial revision |
---|
34 | ! |
---|
35 | ! |
---|
36 | ! Description: |
---|
37 | ! ------------ |
---|
38 | !> Advection term for w velocity-component using Piacsek and Williams. |
---|
39 | !> Vertical advection at the first grid point above the surface is done with |
---|
40 | !> normal centred differences, because otherwise no information from the surface |
---|
41 | !> would be communicated upwards due to w=0 at k=nzb. |
---|
42 | !------------------------------------------------------------------------------! |
---|
43 | MODULE advec_w_pw_mod |
---|
44 | |
---|
45 | |
---|
46 | PRIVATE |
---|
47 | PUBLIC advec_w_pw |
---|
48 | |
---|
49 | INTERFACE advec_w_pw |
---|
50 | MODULE PROCEDURE advec_w_pw |
---|
51 | MODULE PROCEDURE advec_w_pw_ij |
---|
52 | END INTERFACE advec_w_pw |
---|
53 | |
---|
54 | CONTAINS |
---|
55 | |
---|
56 | |
---|
57 | !------------------------------------------------------------------------------! |
---|
58 | ! Description: |
---|
59 | ! ------------ |
---|
60 | !> Call for all grid points |
---|
61 | !------------------------------------------------------------------------------! |
---|
62 | SUBROUTINE advec_w_pw |
---|
63 | |
---|
64 | USE arrays_3d, & |
---|
65 | ONLY: ddzu, tend, u, v, w |
---|
66 | |
---|
67 | USE control_parameters, & |
---|
68 | ONLY: u_gtrans, v_gtrans |
---|
69 | |
---|
70 | USE grid_variables, & |
---|
71 | ONLY: ddx, ddy |
---|
72 | |
---|
73 | USE indices, & |
---|
74 | ONLY: nxl, nxr, nyn, nys, nzb, nzt |
---|
75 | |
---|
76 | USE kinds |
---|
77 | |
---|
78 | |
---|
79 | IMPLICIT NONE |
---|
80 | |
---|
81 | INTEGER(iwp) :: i !< grid index along x-direction |
---|
82 | INTEGER(iwp) :: j !< grid index along y-direction |
---|
83 | INTEGER(iwp) :: k !< grid index along z-direction |
---|
84 | |
---|
85 | REAL(wp) :: gu !< Galilei-transformation velocity along x |
---|
86 | REAL(wp) :: gv !< Galilei-transformation velocity along y |
---|
87 | |
---|
88 | |
---|
89 | gu = 2.0_wp * u_gtrans |
---|
90 | gv = 2.0_wp * v_gtrans |
---|
91 | DO i = nxl, nxr |
---|
92 | DO j = nys, nyn |
---|
93 | DO k = nzb+1, nzt |
---|
94 | tend(k,j,i) = tend(k,j,i) - 0.25_wp * ( & |
---|
95 | ( w(k,j,i+1) * ( u(k+1,j,i+1) + u(k,j,i+1) - gu ) & |
---|
96 | - w(k,j,i-1) * ( u(k+1,j,i) + u(k,j,i) - gu ) ) * ddx & |
---|
97 | + ( w(k,j+1,i) * ( v(k+1,j+1,i) + v(k,j+1,i) - gv ) & |
---|
98 | - w(k,j-1,i) * ( v(k+1,j,i) + v(k,j,i) - gv ) ) * ddy & |
---|
99 | + ( w(k+1,j,i) * ( w(k+1,j,i) + w(k,j,i) ) & |
---|
100 | - w(k-1,j,i) * ( w(k,j,i) + w(k-1,j,i) ) ) & |
---|
101 | * ddzu(k+1) & |
---|
102 | ) |
---|
103 | ENDDO |
---|
104 | ENDDO |
---|
105 | ENDDO |
---|
106 | |
---|
107 | END SUBROUTINE advec_w_pw |
---|
108 | |
---|
109 | |
---|
110 | !------------------------------------------------------------------------------! |
---|
111 | ! Description: |
---|
112 | ! ------------ |
---|
113 | !> Call for grid point i,j |
---|
114 | !------------------------------------------------------------------------------! |
---|
115 | SUBROUTINE advec_w_pw_ij( i, j ) |
---|
116 | |
---|
117 | USE arrays_3d, & |
---|
118 | ONLY: ddzu, tend, u, v, w |
---|
119 | |
---|
120 | USE control_parameters, & |
---|
121 | ONLY: u_gtrans, v_gtrans |
---|
122 | |
---|
123 | USE grid_variables, & |
---|
124 | ONLY: ddx, ddy |
---|
125 | |
---|
126 | USE indices, & |
---|
127 | ONLY: nzb, nzt |
---|
128 | |
---|
129 | USE kinds |
---|
130 | |
---|
131 | |
---|
132 | IMPLICIT NONE |
---|
133 | |
---|
134 | INTEGER(iwp) :: i !< grid index along x-direction |
---|
135 | INTEGER(iwp) :: j !< grid index along y-direction |
---|
136 | INTEGER(iwp) :: k !< grid index along z-direction |
---|
137 | |
---|
138 | REAL(wp) :: gu !< Galilei-transformation velocity along x |
---|
139 | REAL(wp) :: gv !< Galilei-transformation velocity along y |
---|
140 | |
---|
141 | gu = 2.0_wp * u_gtrans |
---|
142 | gv = 2.0_wp * v_gtrans |
---|
143 | DO k = nzb+1, nzt |
---|
144 | tend(k,j,i) = tend(k,j,i) - 0.25_wp * ( & |
---|
145 | ( w(k,j,i+1) * ( u(k+1,j,i+1) + u(k,j,i+1) - gu ) & |
---|
146 | - w(k,j,i-1) * ( u(k+1,j,i) + u(k,j,i) - gu ) ) * ddx & |
---|
147 | + ( w(k,j+1,i) * ( v(k+1,j+1,i) + v(k,j+1,i) - gv ) & |
---|
148 | - w(k,j-1,i) * ( v(k+1,j,i) + v(k,j,i) - gv ) ) * ddy & |
---|
149 | + ( w(k+1,j,i) * ( w(k+1,j,i) + w(k,j,i) ) & |
---|
150 | - w(k-1,j,i) * ( w(k,j,i) + w(k-1,j,i) ) ) & |
---|
151 | * ddzu(k+1) & |
---|
152 | ) |
---|
153 | ENDDO |
---|
154 | END SUBROUTINE advec_w_pw_ij |
---|
155 | |
---|
156 | END MODULE advec_w_pw_mod |
---|