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-2012 Leibniz University Hannover |
---|
18 | !--------------------------------------------------------------------------------! |
---|
19 | ! |
---|
20 | ! Current revisions: |
---|
21 | ! ----------------- |
---|
22 | ! |
---|
23 | ! |
---|
24 | ! Former revisions: |
---|
25 | ! ----------------- |
---|
26 | ! $Id: advec_v_pw.f90 1037 2012-10-22 14:10:22Z hoffmann $ |
---|
27 | ! |
---|
28 | ! 1036 2012-10-22 13:43:42Z raasch |
---|
29 | ! code put under GPL (PALM 3.9) |
---|
30 | ! |
---|
31 | ! 106 2007-08-16 14:30:26Z raasch |
---|
32 | ! j loop is starting from nysv (needed for non-cyclic boundary conditions) |
---|
33 | ! |
---|
34 | ! 75 2007-03-22 09:54:05Z raasch |
---|
35 | ! vynp eliminated |
---|
36 | ! |
---|
37 | ! RCS Log replace by Id keyword, revision history cleaned up |
---|
38 | ! |
---|
39 | ! Revision 1.15 2006/02/23 09:46:08 raasch |
---|
40 | ! nzb_2d replaced by nzb_v_inner |
---|
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 | USE control_parameters |
---|
72 | USE grid_variables |
---|
73 | USE indices |
---|
74 | |
---|
75 | IMPLICIT NONE |
---|
76 | |
---|
77 | INTEGER :: i, j, k |
---|
78 | REAL :: gu, gv |
---|
79 | |
---|
80 | |
---|
81 | gu = 2.0 * u_gtrans |
---|
82 | gv = 2.0 * v_gtrans |
---|
83 | DO i = nxl, nxr |
---|
84 | DO j = nysv, nyn |
---|
85 | DO k = nzb_v_inner(j,i)+1, nzt |
---|
86 | tend(k,j,i) = tend(k,j,i) - 0.25 * ( & |
---|
87 | ( v(k,j,i+1) * ( u(k,j-1,i+1) + u(k,j,i+1) - gu ) & |
---|
88 | - v(k,j,i-1) * ( u(k,j-1,i) + u(k,j,i) - gu ) ) * ddx & |
---|
89 | + ( v(k,j+1,i) * ( v(k,j+1,i) + v(k,j,i) - gv ) & |
---|
90 | - v(k,j-1,i) * ( v(k,j,i) + v(k,j-1,i) - gv ) ) * ddy & |
---|
91 | + ( v(k+1,j,i) * ( w(k,j-1,i) + w(k,j,i) ) & |
---|
92 | - v(k-1,j,i) * ( w(k-1,j-1,i) + w(k-1,j,i) ) ) & |
---|
93 | * ddzw(k) & |
---|
94 | ) |
---|
95 | ENDDO |
---|
96 | ENDDO |
---|
97 | ENDDO |
---|
98 | |
---|
99 | END SUBROUTINE advec_v_pw |
---|
100 | |
---|
101 | |
---|
102 | !------------------------------------------------------------------------------! |
---|
103 | ! Call for grid point i,j |
---|
104 | !------------------------------------------------------------------------------! |
---|
105 | SUBROUTINE advec_v_pw_ij( i, j ) |
---|
106 | |
---|
107 | USE arrays_3d |
---|
108 | USE control_parameters |
---|
109 | USE grid_variables |
---|
110 | USE indices |
---|
111 | |
---|
112 | IMPLICIT NONE |
---|
113 | |
---|
114 | INTEGER :: i, j, k |
---|
115 | REAL :: gu, gv |
---|
116 | |
---|
117 | |
---|
118 | gu = 2.0 * u_gtrans |
---|
119 | gv = 2.0 * v_gtrans |
---|
120 | DO k = nzb_v_inner(j,i)+1, nzt |
---|
121 | tend(k,j,i) = tend(k,j,i) - 0.25 * ( & |
---|
122 | ( v(k,j,i+1) * ( u(k,j-1,i+1) + u(k,j,i+1) - gu ) & |
---|
123 | - v(k,j,i-1) * ( u(k,j-1,i) + u(k,j,i) - gu ) ) * ddx & |
---|
124 | + ( v(k,j+1,i) * ( v(k,j+1,i) + v(k,j,i) - gv ) & |
---|
125 | - v(k,j-1,i) * ( v(k,j,i) + v(k,j-1,i) - gv ) ) * ddy & |
---|
126 | + ( v(k+1,j,i) * ( w(k,j-1,i) + w(k,j,i) ) & |
---|
127 | - v(k-1,j,i) * ( w(k-1,j-1,i) + w(k-1,j,i) ) ) & |
---|
128 | * ddzw(k) & |
---|
129 | ) |
---|
130 | ENDDO |
---|
131 | |
---|
132 | END SUBROUTINE advec_v_pw_ij |
---|
133 | |
---|
134 | END MODULE advec_v_pw_mod |
---|
135 | |
---|