1 | MODULE advec_w_pw_mod |
---|
2 | |
---|
3 | !------------------------------------------------------------------------------! |
---|
4 | ! Current revisions: |
---|
5 | ! ----------------- |
---|
6 | ! |
---|
7 | ! |
---|
8 | ! Former revisions: |
---|
9 | ! ----------------- |
---|
10 | ! $Id: advec_w_pw.f90 484 2010-02-05 07:36:54Z suehring $ |
---|
11 | ! RCS Log replace by Id keyword, revision history cleaned up |
---|
12 | ! |
---|
13 | ! Revision 1.15 2006/02/23 09:47:01 raasch |
---|
14 | ! nzb_2d replaced by nzb_w_inner |
---|
15 | ! |
---|
16 | ! Revision 1.1 1997/08/11 06:10:29 raasch |
---|
17 | ! Initial revision |
---|
18 | ! |
---|
19 | ! |
---|
20 | ! Description: |
---|
21 | ! ------------ |
---|
22 | ! Advection term for w 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_w_pw |
---|
30 | |
---|
31 | INTERFACE advec_w_pw |
---|
32 | MODULE PROCEDURE advec_w_pw |
---|
33 | MODULE PROCEDURE advec_w_pw_ij |
---|
34 | END INTERFACE advec_w_pw |
---|
35 | |
---|
36 | CONTAINS |
---|
37 | |
---|
38 | |
---|
39 | !------------------------------------------------------------------------------! |
---|
40 | ! Call for all grid points |
---|
41 | !------------------------------------------------------------------------------! |
---|
42 | SUBROUTINE advec_w_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 | |
---|
55 | gu = 2.0 * u_gtrans |
---|
56 | gv = 2.0 * v_gtrans |
---|
57 | DO i = nxl, nxr |
---|
58 | DO j = nys, nyn |
---|
59 | DO k = nzb_w_inner(j,i)+1, nzt |
---|
60 | tend(k,j,i) = tend(k,j,i) - 0.25 * ( & |
---|
61 | ( w(k,j,i+1) * ( u(k+1,j,i+1) + u(k,j,i+1) - gu ) & |
---|
62 | - w(k,j,i-1) * ( u(k+1,j,i) + u(k,j,i) - gu ) ) * ddx & |
---|
63 | + ( w(k,j+1,i) * ( v(k+1,j+1,i) + v(k,j+1,i) - gv ) & |
---|
64 | - w(k,j-1,i) * ( v(k+1,j,i) + v(k,j,i) - gv ) ) * ddy & |
---|
65 | + ( w(k+1,j,i) * ( w(k+1,j,i) + w(k,j,i) ) & |
---|
66 | - w(k-1,j,i) * ( w(k,j,i) + w(k-1,j,i) ) ) & |
---|
67 | * ddzu(k+1) & |
---|
68 | ) |
---|
69 | ENDDO |
---|
70 | ENDDO |
---|
71 | ENDDO |
---|
72 | |
---|
73 | END SUBROUTINE advec_w_pw |
---|
74 | |
---|
75 | |
---|
76 | !------------------------------------------------------------------------------! |
---|
77 | ! Call for grid point i,j |
---|
78 | !------------------------------------------------------------------------------! |
---|
79 | SUBROUTINE advec_w_pw_ij( i, j ) |
---|
80 | |
---|
81 | USE arrays_3d |
---|
82 | USE control_parameters |
---|
83 | USE grid_variables |
---|
84 | USE indices |
---|
85 | |
---|
86 | IMPLICIT NONE |
---|
87 | |
---|
88 | INTEGER :: i, j, k |
---|
89 | REAL :: gu, gv |
---|
90 | |
---|
91 | |
---|
92 | gu = 2.0 * u_gtrans |
---|
93 | gv = 2.0 * v_gtrans |
---|
94 | DO k = nzb_w_inner(j,i)+1, nzt |
---|
95 | tend(k,j,i) = tend(k,j,i) - 0.25 * ( & |
---|
96 | ( w(k,j,i+1) * ( u(k+1,j,i+1) + u(k,j,i+1) - gu ) & |
---|
97 | - w(k,j,i-1) * ( u(k+1,j,i) + u(k,j,i) - gu ) ) * ddx & |
---|
98 | + ( w(k,j+1,i) * ( v(k+1,j+1,i) + v(k,j+1,i) - gv ) & |
---|
99 | - w(k,j-1,i) * ( v(k+1,j,i) + v(k,j,i) - gv ) ) * ddy & |
---|
100 | + ( w(k+1,j,i) * ( w(k+1,j,i) + w(k,j,i) ) & |
---|
101 | - w(k-1,j,i) * ( w(k,j,i) + w(k-1,j,i) ) ) & |
---|
102 | * ddzu(k+1) & |
---|
103 | ) |
---|
104 | ENDDO |
---|
105 | |
---|
106 | END SUBROUTINE advec_w_pw_ij |
---|
107 | |
---|
108 | END MODULE advec_w_pw_mod |
---|