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