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