1 | MODULE advec_u_pw_mod |
---|
2 | |
---|
3 | !------------------------------------------------------------------------------! |
---|
4 | ! Actual revisions: |
---|
5 | ! ----------------- |
---|
6 | ! |
---|
7 | ! |
---|
8 | ! Former revisions: |
---|
9 | ! ----------------- |
---|
10 | ! $Id: advec_u_pw.f90 4 2007-02-13 11:33:16Z raasch $ |
---|
11 | ! RCS Log replace by Id keyword, revision history cleaned up |
---|
12 | ! |
---|
13 | ! Revision 1.15 2006/02/23 09:44:21 raasch |
---|
14 | ! nzb_2d replaced by nzb_u_inner |
---|
15 | ! |
---|
16 | ! Revision 1.1 1997/08/11 06:09:21 raasch |
---|
17 | ! Initial revision |
---|
18 | ! |
---|
19 | ! |
---|
20 | ! Description: |
---|
21 | ! ------------ |
---|
22 | ! Advection term for u velocity-component using Piacsek and Williams. |
---|
23 | ! Vertical advection at the first grid point above the surface is done with |
---|
24 | ! normal centred differences, because otherwise no information from the surface |
---|
25 | ! would be communicated upwards due to w=0 at K=nzb. |
---|
26 | !------------------------------------------------------------------------------! |
---|
27 | |
---|
28 | PRIVATE |
---|
29 | PUBLIC advec_u_pw |
---|
30 | |
---|
31 | INTERFACE advec_u_pw |
---|
32 | MODULE PROCEDURE advec_u_pw |
---|
33 | MODULE PROCEDURE advec_u_pw_ij |
---|
34 | END INTERFACE advec_u_pw |
---|
35 | |
---|
36 | CONTAINS |
---|
37 | |
---|
38 | |
---|
39 | !------------------------------------------------------------------------------! |
---|
40 | ! Call for all grid points |
---|
41 | !------------------------------------------------------------------------------! |
---|
42 | SUBROUTINE advec_u_pw |
---|
43 | |
---|
44 | USE arrays_3d |
---|
45 | USE control_parameters |
---|
46 | USE grid_variables |
---|
47 | USE indices |
---|
48 | |
---|
49 | IMPLICIT NONE |
---|
50 | |
---|
51 | INTEGER :: i, j, k |
---|
52 | REAL :: gu, gv |
---|
53 | |
---|
54 | gu = 2.0 * u_gtrans |
---|
55 | gv = 2.0 * v_gtrans |
---|
56 | DO i = nxl, nxr+uxrp |
---|
57 | DO j = nys, nyn |
---|
58 | DO k = nzb_u_inner(j,i)+1, nzt |
---|
59 | tend(k,j,i) = tend(k,j,i) - 0.25 * ( & |
---|
60 | ( u(k,j,i+1) * ( u(k,j,i+1) + u(k,j,i) - gu ) & |
---|
61 | - u(k,j,i-1) * ( u(k,j,i) + u(k,j,i-1) - gu ) ) * ddx & |
---|
62 | + ( u(k,j+1,i) * ( v(k,j+1,i) + v(k,j+1,i-1) - gv ) & |
---|
63 | - u(k,j-1,i) * ( v(k,j,i) + v(k,j,i-1) - gv ) ) * ddy & |
---|
64 | + ( u(k+1,j,i) * ( w(k,j,i) + w(k,j,i-1) ) & |
---|
65 | - u(k-1,j,i) * ( w(k-1,j,i) + w(k-1,j,i-1) ) ) & |
---|
66 | * ddzw(k) & |
---|
67 | ) |
---|
68 | ENDDO |
---|
69 | ENDDO |
---|
70 | ENDDO |
---|
71 | |
---|
72 | END SUBROUTINE advec_u_pw |
---|
73 | |
---|
74 | |
---|
75 | !------------------------------------------------------------------------------! |
---|
76 | ! Call for grid point i,j |
---|
77 | !------------------------------------------------------------------------------! |
---|
78 | SUBROUTINE advec_u_pw_ij( i, j ) |
---|
79 | |
---|
80 | USE arrays_3d |
---|
81 | USE control_parameters |
---|
82 | USE grid_variables |
---|
83 | USE indices |
---|
84 | |
---|
85 | IMPLICIT NONE |
---|
86 | |
---|
87 | INTEGER :: i, j, k |
---|
88 | REAL :: gu, gv |
---|
89 | |
---|
90 | gu = 2.0 * u_gtrans |
---|
91 | gv = 2.0 * v_gtrans |
---|
92 | DO k = nzb_u_inner(j,i)+1, nzt |
---|
93 | tend(k,j,i) = tend(k,j,i) - 0.25 * ( & |
---|
94 | ( u(k,j,i+1) * ( u(k,j,i+1) + u(k,j,i) - gu ) & |
---|
95 | - u(k,j,i-1) * ( u(k,j,i) + u(k,j,i-1) - gu ) ) * ddx & |
---|
96 | + ( u(k,j+1,i) * ( v(k,j+1,i) + v(k,j+1,i-1) - gv ) & |
---|
97 | - u(k,j-1,i) * ( v(k,j,i) + v(k,j,i-1) - gv ) ) * ddy & |
---|
98 | + ( u(k+1,j,i) * ( w(k,j,i) + w(k,j,i-1) ) & |
---|
99 | - u(k-1,j,i) * ( w(k-1,j,i) + w(k-1,j,i-1) ) ) & |
---|
100 | * ddzw(k) & |
---|
101 | ) |
---|
102 | ENDDO |
---|
103 | |
---|
104 | END SUBROUTINE advec_u_pw_ij |
---|
105 | |
---|
106 | END MODULE advec_u_pw_mod |
---|