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