1 | MODULE coriolis_mod |
---|
2 | |
---|
3 | !------------------------------------------------------------------------------! |
---|
4 | ! Current revisions: |
---|
5 | ! ----------------- |
---|
6 | ! Output of messages replaced by message handling routine. |
---|
7 | ! |
---|
8 | ! |
---|
9 | ! Former revisions: |
---|
10 | ! ----------------- |
---|
11 | ! $Id: coriolis.f90 254 2009-03-05 15:33:42Z heinze $ |
---|
12 | ! |
---|
13 | ! 106 2007-08-16 14:30:26Z raasch |
---|
14 | ! loops for u and v are starting from index nxlu, nysv, respectively (needed |
---|
15 | ! for non-cyclic boundary conditions) |
---|
16 | ! |
---|
17 | ! 75 2007-03-22 09:54:05Z raasch |
---|
18 | ! uxrp, vynp eliminated |
---|
19 | ! |
---|
20 | ! RCS Log replace by Id keyword, revision history cleaned up |
---|
21 | ! |
---|
22 | ! Revision 1.12 2006/02/23 10:08:57 raasch |
---|
23 | ! nzb_2d replaced by nzb_u/v/w_inner |
---|
24 | ! |
---|
25 | ! Revision 1.1 1997/08/29 08:57:38 raasch |
---|
26 | ! Initial revision |
---|
27 | ! |
---|
28 | ! |
---|
29 | ! Description: |
---|
30 | ! ------------ |
---|
31 | ! Computation of all Coriolis terms in the equations of motion. |
---|
32 | !------------------------------------------------------------------------------! |
---|
33 | |
---|
34 | PRIVATE |
---|
35 | PUBLIC coriolis |
---|
36 | |
---|
37 | INTERFACE coriolis |
---|
38 | MODULE PROCEDURE coriolis |
---|
39 | MODULE PROCEDURE coriolis_ij |
---|
40 | END INTERFACE coriolis |
---|
41 | |
---|
42 | CONTAINS |
---|
43 | |
---|
44 | |
---|
45 | !------------------------------------------------------------------------------! |
---|
46 | ! Call for all grid points |
---|
47 | !------------------------------------------------------------------------------! |
---|
48 | SUBROUTINE coriolis( component ) |
---|
49 | |
---|
50 | USE arrays_3d |
---|
51 | USE control_parameters |
---|
52 | USE indices |
---|
53 | USE pegrid |
---|
54 | |
---|
55 | IMPLICIT NONE |
---|
56 | |
---|
57 | INTEGER :: component, i, j, k |
---|
58 | |
---|
59 | |
---|
60 | ! |
---|
61 | !-- Compute Coriolis terms for the three velocity components |
---|
62 | SELECT CASE ( component ) |
---|
63 | |
---|
64 | ! |
---|
65 | !-- u-component |
---|
66 | CASE ( 1 ) |
---|
67 | DO i = nxlu, nxr |
---|
68 | DO j = nys, nyn |
---|
69 | DO k = nzb_u_inner(j,i)+1, nzt |
---|
70 | tend(k,j,i) = tend(k,j,i) + f * ( 0.25 * & |
---|
71 | ( v(k,j,i-1) + v(k,j,i) + v(k,j+1,i-1) + & |
---|
72 | v(k,j+1,i) ) - vg(k) ) & |
---|
73 | - fs * ( 0.25 * & |
---|
74 | ( w(k-1,j,i-1) + w(k-1,j,i) + w(k,j,i-1) + & |
---|
75 | w(k,j,i) ) & |
---|
76 | ) |
---|
77 | ENDDO |
---|
78 | ENDDO |
---|
79 | ENDDO |
---|
80 | |
---|
81 | ! |
---|
82 | !-- v-component |
---|
83 | CASE ( 2 ) |
---|
84 | DO i = nxl, nxr |
---|
85 | DO j = nysv, nyn |
---|
86 | DO k = nzb_v_inner(j,i)+1, nzt |
---|
87 | tend(k,j,i) = tend(k,j,i) - f * ( 0.25 * & |
---|
88 | ( u(k,j-1,i) + u(k,j,i) + u(k,j-1,i+1) + & |
---|
89 | u(k,j,i+1) ) - ug(k) ) |
---|
90 | ENDDO |
---|
91 | ENDDO |
---|
92 | ENDDO |
---|
93 | |
---|
94 | ! |
---|
95 | !-- w-component |
---|
96 | CASE ( 3 ) |
---|
97 | DO i = nxl, nxr |
---|
98 | DO j = nys, nyn |
---|
99 | DO k = nzb_w_inner(j,i)+1, nzt |
---|
100 | tend(k,j,i) = tend(k,j,i) + fs * 0.25 * & |
---|
101 | ( u(k,j,i) + u(k+1,j,i) + u(k,j,i+1) + & |
---|
102 | u(k+1,j,i+1) ) |
---|
103 | ENDDO |
---|
104 | ENDDO |
---|
105 | ENDDO |
---|
106 | |
---|
107 | CASE DEFAULT |
---|
108 | |
---|
109 | WRITE( message_string, * ) ' wrong component: ', component |
---|
110 | CALL message( 'coriolis', 'PA0173', 1, 2, 0, 6, 0 ) |
---|
111 | |
---|
112 | END SELECT |
---|
113 | |
---|
114 | END SUBROUTINE coriolis |
---|
115 | |
---|
116 | |
---|
117 | !------------------------------------------------------------------------------! |
---|
118 | ! Call for grid point i,j |
---|
119 | !------------------------------------------------------------------------------! |
---|
120 | SUBROUTINE coriolis_ij( i, j, component ) |
---|
121 | |
---|
122 | USE arrays_3d |
---|
123 | USE control_parameters |
---|
124 | USE indices |
---|
125 | USE pegrid |
---|
126 | |
---|
127 | IMPLICIT NONE |
---|
128 | |
---|
129 | INTEGER :: component, i, j, k |
---|
130 | |
---|
131 | ! |
---|
132 | !-- Compute Coriolis terms for the three velocity components |
---|
133 | SELECT CASE ( component ) |
---|
134 | |
---|
135 | ! |
---|
136 | !-- u-component |
---|
137 | CASE ( 1 ) |
---|
138 | DO k = nzb_u_inner(j,i)+1, nzt |
---|
139 | tend(k,j,i) = tend(k,j,i) + f * ( 0.25 * & |
---|
140 | ( v(k,j,i-1) + v(k,j,i) + v(k,j+1,i-1) + & |
---|
141 | v(k,j+1,i) ) - vg(k) ) & |
---|
142 | - fs * ( 0.25 * & |
---|
143 | ( w(k-1,j,i-1) + w(k-1,j,i) + w(k,j,i-1) + & |
---|
144 | w(k,j,i) ) & |
---|
145 | ) |
---|
146 | ENDDO |
---|
147 | |
---|
148 | ! |
---|
149 | !-- v-component |
---|
150 | CASE ( 2 ) |
---|
151 | DO k = nzb_v_inner(j,i)+1, nzt |
---|
152 | tend(k,j,i) = tend(k,j,i) - f * ( 0.25 * & |
---|
153 | ( u(k,j-1,i) + u(k,j,i) + u(k,j-1,i+1) + & |
---|
154 | u(k,j,i+1) ) - ug(k) ) |
---|
155 | ENDDO |
---|
156 | |
---|
157 | ! |
---|
158 | !-- w-component |
---|
159 | CASE ( 3 ) |
---|
160 | DO k = nzb_w_inner(j,i)+1, nzt |
---|
161 | tend(k,j,i) = tend(k,j,i) + fs * 0.25 * & |
---|
162 | ( u(k,j,i) + u(k+1,j,i) + u(k,j,i+1) + & |
---|
163 | u(k+1,j,i+1) ) |
---|
164 | ENDDO |
---|
165 | |
---|
166 | CASE DEFAULT |
---|
167 | |
---|
168 | WRITE( message_string, * ) ' wrong component: ', component |
---|
169 | CALL message( 'coriolis', 'PA0173', 1, 2, 0, 6, 0 ) |
---|
170 | |
---|
171 | END SELECT |
---|
172 | |
---|
173 | END SUBROUTINE coriolis_ij |
---|
174 | |
---|
175 | END MODULE coriolis_mod |
---|