1 | MODULE advec_v_pw_mod |
---|
2 | |
---|
3 | !------------------------------------------------------------------------------! |
---|
4 | ! Actual revisions: |
---|
5 | ! ----------------- |
---|
6 | ! |
---|
7 | ! |
---|
8 | ! Former revisions: |
---|
9 | ! ----------------- |
---|
10 | ! $Log: advec_v_pw.f90,v $ |
---|
11 | ! Revision 1.15 2006/02/23 09:46:08 raasch |
---|
12 | ! nzb_2d replaced by nzb_v_inner |
---|
13 | ! |
---|
14 | ! Revision 1.14 2005/03/26 14:52:51 raasch |
---|
15 | ! Extension of horizontal loop upper bounds for non-cyclic boundary conditions |
---|
16 | ! |
---|
17 | ! Revision 1.13 2004/01/30 10:12:25 raasch |
---|
18 | ! Scalar lower k index nzb replaced by 2d-array nzb_2d |
---|
19 | ! |
---|
20 | ! Revision 1.12 2003/03/12 16:18:19 raasch |
---|
21 | ! Full code replaced in the call for all gridpoints instead of calling the |
---|
22 | ! _ij version (required by NEC, because otherwise no vectorization) |
---|
23 | ! |
---|
24 | ! Revision 1.11 2002/06/11 12:26:18 raasch |
---|
25 | ! Former subroutine changed to a module which allows to be called for all grid |
---|
26 | ! points of a single vertical column with index i,j or for all grid points by |
---|
27 | ! using function overloading. |
---|
28 | ! |
---|
29 | ! Revision 1.10 2001/03/29 17:36:06 raasch |
---|
30 | ! Translation of remaining German identifiers (variables, subroutines, etc.) |
---|
31 | ! |
---|
32 | ! Revision 1.9 2001/01/22 05:14:48 raasch |
---|
33 | ! Module test_variables removed |
---|
34 | ! |
---|
35 | ! Revision 1.8 2000/01/20 10:16:37 letzel |
---|
36 | ! All comments translated into English |
---|
37 | ! |
---|
38 | ! Revision 1.7 1998/08/05 06:49:43 raasch |
---|
39 | ! Alle Gitterpunkte gleich behandelt (keine zentralen Differenzenquotienten mehr |
---|
40 | ! bei Vertikaladvektion bei k=1) |
---|
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 = nys, nyn+vynp |
---|
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 | |
---|