1 | MODULE advec_s_pw_mod |
---|
2 | |
---|
3 | !------------------------------------------------------------------------------! |
---|
4 | ! Actual revisions: |
---|
5 | ! ----------------- |
---|
6 | ! |
---|
7 | ! |
---|
8 | ! Former revisions: |
---|
9 | ! ----------------- |
---|
10 | ! $Id: advec_s_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.12 2006/02/23 09:42:55 raasch |
---|
14 | ! nzb_2d replaced by nzb_s_inner |
---|
15 | ! |
---|
16 | ! Revision 1.1 1997/08/29 08:54:20 raasch |
---|
17 | ! Initial revision |
---|
18 | ! |
---|
19 | ! |
---|
20 | ! Description: |
---|
21 | ! ------------ |
---|
22 | ! Advection term for scalar variables using the Piacsek and Williams scheme |
---|
23 | ! (form C3). Contrary to PW itself, for reasons of accuracy their scheme is |
---|
24 | ! slightly modified as follows: the values of those scalars that are used for |
---|
25 | ! the computation of the flux divergence are reduced by the value of the |
---|
26 | ! relevant scalar at the location where the difference is computed (sk(k,j,i)). |
---|
27 | ! NOTE: at the first grid point above the surface computation still takes place! |
---|
28 | !------------------------------------------------------------------------------! |
---|
29 | |
---|
30 | PRIVATE |
---|
31 | PUBLIC advec_s_pw |
---|
32 | |
---|
33 | INTERFACE advec_s_pw |
---|
34 | MODULE PROCEDURE advec_s_pw |
---|
35 | MODULE PROCEDURE advec_s_pw_ij |
---|
36 | END INTERFACE |
---|
37 | |
---|
38 | CONTAINS |
---|
39 | |
---|
40 | |
---|
41 | !------------------------------------------------------------------------------! |
---|
42 | ! Call for all grid points |
---|
43 | !------------------------------------------------------------------------------! |
---|
44 | SUBROUTINE advec_s_pw( sk ) |
---|
45 | |
---|
46 | USE arrays_3d |
---|
47 | USE control_parameters |
---|
48 | USE grid_variables |
---|
49 | USE indices |
---|
50 | |
---|
51 | IMPLICIT NONE |
---|
52 | |
---|
53 | INTEGER :: i, j, k |
---|
54 | |
---|
55 | REAL, DIMENSION(:,:,:), POINTER :: sk |
---|
56 | |
---|
57 | |
---|
58 | DO i = nxl, nxr |
---|
59 | DO j = nys, nyn |
---|
60 | DO k = nzb_s_inner(j,i)+1, nzt-1 |
---|
61 | tend(k,j,i) = tend(k,j,i) & |
---|
62 | -0.5 * ( ( u(k,j,i+1) - u_gtrans ) * ( sk(k,j,i+1) - sk(k,j,i) ) & |
---|
63 | - ( u(k,j,i) - u_gtrans ) * ( sk(k,j,i-1) - sk(k,j,i) ) & |
---|
64 | ) * ddx & |
---|
65 | -0.5 * ( ( v(k,j+1,i) - v_gtrans ) * ( sk(k,j+1,i) - sk(k,j,i) ) & |
---|
66 | - ( v(k,j,i) - v_gtrans ) * ( sk(k,j-1,i) - sk(k,j,i) ) & |
---|
67 | ) * ddy & |
---|
68 | - ( w(k,j,i) * ( sk(k+1,j,i) - sk(k,j,i) ) & |
---|
69 | - w(k-1,j,i) * ( sk(k-1,j,i) - sk(k,j,i) ) & |
---|
70 | ) * dd2zu(k) |
---|
71 | ENDDO |
---|
72 | ENDDO |
---|
73 | ENDDO |
---|
74 | |
---|
75 | END SUBROUTINE advec_s_pw |
---|
76 | |
---|
77 | |
---|
78 | !------------------------------------------------------------------------------! |
---|
79 | ! Call for grid point i,j |
---|
80 | !------------------------------------------------------------------------------! |
---|
81 | SUBROUTINE advec_s_pw_ij( i, j, sk ) |
---|
82 | |
---|
83 | USE arrays_3d |
---|
84 | USE control_parameters |
---|
85 | USE grid_variables |
---|
86 | USE indices |
---|
87 | |
---|
88 | IMPLICIT NONE |
---|
89 | |
---|
90 | INTEGER :: i, j, k |
---|
91 | |
---|
92 | REAL, DIMENSION(:,:,:), POINTER :: sk |
---|
93 | |
---|
94 | |
---|
95 | DO k = nzb_s_inner(j,i)+1, nzt-1 |
---|
96 | tend(k,j,i) = tend(k,j,i) & |
---|
97 | -0.5 * ( ( u(k,j,i+1) - u_gtrans ) * ( sk(k,j,i+1) - sk(k,j,i) ) & |
---|
98 | - ( u(k,j,i) - u_gtrans ) * ( sk(k,j,i-1) - sk(k,j,i) ) & |
---|
99 | ) * ddx & |
---|
100 | -0.5 * ( ( v(k,j+1,i) - v_gtrans ) * ( sk(k,j+1,i) - sk(k,j,i) ) & |
---|
101 | - ( v(k,j,i) - v_gtrans ) * ( sk(k,j-1,i) - sk(k,j,i) ) & |
---|
102 | ) * ddy & |
---|
103 | - ( w(k,j,i) * ( sk(k+1,j,i) - sk(k,j,i) ) & |
---|
104 | - w(k-1,j,i) * ( sk(k-1,j,i) - sk(k,j,i) ) & |
---|
105 | ) * dd2zu(k) |
---|
106 | ENDDO |
---|
107 | |
---|
108 | END SUBROUTINE advec_s_pw_ij |
---|
109 | |
---|
110 | END MODULE advec_s_pw_mod |
---|