1 | MODULE calc_precipitation_mod |
---|
2 | |
---|
3 | !--------------------------------------------------------------------------------! |
---|
4 | ! This file is part of PALM. |
---|
5 | ! |
---|
6 | ! PALM is free software: you can redistribute it and/or modify it under the terms |
---|
7 | ! of the GNU General Public License as published by the Free Software Foundation, |
---|
8 | ! either version 3 of the License, or (at your option) any later version. |
---|
9 | ! |
---|
10 | ! PALM is distributed in the hope that it will be useful, but WITHOUT ANY |
---|
11 | ! WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR |
---|
12 | ! A PARTICULAR PURPOSE. See the GNU General Public License for more details. |
---|
13 | ! |
---|
14 | ! You should have received a copy of the GNU General Public License along with |
---|
15 | ! PALM. If not, see <http://www.gnu.org/licenses/>. |
---|
16 | ! |
---|
17 | ! Copyright 1997-2014 Leibniz Universitaet Hannover |
---|
18 | !--------------------------------------------------------------------------------! |
---|
19 | ! |
---|
20 | ! Current revisions: |
---|
21 | ! ----------------- |
---|
22 | ! |
---|
23 | ! |
---|
24 | ! Former revisions: |
---|
25 | ! ----------------- |
---|
26 | ! $Id: calc_precipitation.f90 1321 2014-03-20 09:40:40Z raasch $ |
---|
27 | ! |
---|
28 | ! 1320 2014-03-20 08:40:49Z raasch |
---|
29 | ! ONLY-attribute added to USE-statements, |
---|
30 | ! kind-parameters added to all INTEGER and REAL declaration statements, |
---|
31 | ! kinds are defined in new module kinds, |
---|
32 | ! revision history before 2012 removed, |
---|
33 | ! comment fields (!:) to be used for variable explanations added to |
---|
34 | ! all variable declaration statements |
---|
35 | ! |
---|
36 | ! 1036 2012-10-22 13:43:42Z raasch |
---|
37 | ! code put under GPL (PALM 3.9) |
---|
38 | ! |
---|
39 | ! Revision 1.1 2000/04/13 14:45:22 schroeter |
---|
40 | ! Initial revision |
---|
41 | ! |
---|
42 | ! |
---|
43 | ! |
---|
44 | ! Description: |
---|
45 | ! ------------ |
---|
46 | ! Calculate the change of total water content due to precipitation |
---|
47 | ! (simplified Kessler scheme) |
---|
48 | !------------------------------------------------------------------------------! |
---|
49 | |
---|
50 | PRIVATE |
---|
51 | PUBLIC calc_precipitation |
---|
52 | |
---|
53 | INTERFACE calc_precipitation |
---|
54 | MODULE PROCEDURE calc_precipitation |
---|
55 | MODULE PROCEDURE calc_precipitation_ij |
---|
56 | END INTERFACE calc_precipitation |
---|
57 | |
---|
58 | CONTAINS |
---|
59 | |
---|
60 | |
---|
61 | !------------------------------------------------------------------------------! |
---|
62 | ! Call for all grid points |
---|
63 | !------------------------------------------------------------------------------! |
---|
64 | SUBROUTINE calc_precipitation |
---|
65 | |
---|
66 | USE arrays_3d, & |
---|
67 | ONLY: dzw, ql, tend |
---|
68 | |
---|
69 | USE cloud_parameters, & |
---|
70 | ONLY: precipitation_amount, precipitation_rate, prec_time_const, & |
---|
71 | ql_crit |
---|
72 | |
---|
73 | USE control_parameters, & |
---|
74 | ONLY: dt_do2d_xy, dt_3d, & |
---|
75 | intermediate_timestep_count, intermediate_timestep_count_max,& |
---|
76 | precipitation_amount_interval, time_do2d_xy |
---|
77 | |
---|
78 | USE indices, & |
---|
79 | ONLY: nxl, nxr, nyn, nys, nzb_2d, nzt |
---|
80 | |
---|
81 | USE kinds |
---|
82 | |
---|
83 | |
---|
84 | IMPLICIT NONE |
---|
85 | |
---|
86 | INTEGER(iwp) :: i !: |
---|
87 | INTEGER(iwp) :: j !: |
---|
88 | INTEGER(iwp) :: k !: |
---|
89 | |
---|
90 | REAL(wp) :: dqdt_precip !: |
---|
91 | |
---|
92 | precipitation_rate = 0.0 |
---|
93 | |
---|
94 | DO i = nxl, nxr |
---|
95 | DO j = nys, nyn |
---|
96 | DO k = nzb_2d(j,i)+1, nzt |
---|
97 | |
---|
98 | IF ( ql(k,j,i) > ql_crit ) THEN |
---|
99 | dqdt_precip = prec_time_const * ( ql(k,j,i) - ql_crit ) |
---|
100 | ELSE |
---|
101 | dqdt_precip = 0.0 |
---|
102 | ENDIF |
---|
103 | tend(k,j,i) = tend(k,j,i) - dqdt_precip |
---|
104 | ! |
---|
105 | !-- Precipitation rate in kg / m**2 / s (= mm/s) |
---|
106 | precipitation_rate(j,i) = precipitation_rate(j,i) + & |
---|
107 | dqdt_precip * dzw(k) |
---|
108 | |
---|
109 | ENDDO |
---|
110 | ! |
---|
111 | !-- Sum up the precipitation amount, unit kg / m**2 (= mm) |
---|
112 | IF ( intermediate_timestep_count == & |
---|
113 | intermediate_timestep_count_max .AND. & |
---|
114 | ( dt_do2d_xy-time_do2d_xy ) < precipitation_amount_interval )& |
---|
115 | THEN |
---|
116 | precipitation_amount(j,i) = precipitation_amount(j,i) + & |
---|
117 | precipitation_rate(j,i) * dt_3d |
---|
118 | ENDIF |
---|
119 | ENDDO |
---|
120 | ENDDO |
---|
121 | |
---|
122 | END SUBROUTINE calc_precipitation |
---|
123 | |
---|
124 | |
---|
125 | !------------------------------------------------------------------------------! |
---|
126 | ! Call for grid point i,j |
---|
127 | !------------------------------------------------------------------------------! |
---|
128 | SUBROUTINE calc_precipitation_ij( i, j ) |
---|
129 | |
---|
130 | USE arrays_3d, & |
---|
131 | ONLY: dzw, ql, tend |
---|
132 | |
---|
133 | USE cloud_parameters, & |
---|
134 | ONLY: precipitation_amount, precipitation_rate, prec_time_const, & |
---|
135 | ql_crit |
---|
136 | |
---|
137 | USE control_parameters, & |
---|
138 | ONLY: dt_do2d_xy, dt_3d, & |
---|
139 | intermediate_timestep_count, intermediate_timestep_count_max,& |
---|
140 | precipitation_amount_interval, time_do2d_xy |
---|
141 | |
---|
142 | USE indices, & |
---|
143 | ONLY: nzb_2d, nzt |
---|
144 | |
---|
145 | USE kinds |
---|
146 | |
---|
147 | |
---|
148 | IMPLICIT NONE |
---|
149 | |
---|
150 | INTEGER(iwp) :: i !: |
---|
151 | INTEGER(iwp) :: j !: |
---|
152 | INTEGER(iwp) :: k !: |
---|
153 | |
---|
154 | REAL(wp) :: dqdt_precip !: |
---|
155 | |
---|
156 | precipitation_rate(j,i) = 0.0 |
---|
157 | |
---|
158 | ! |
---|
159 | !-- Ghostpoints are included (although not needed for tend) to avoid a later |
---|
160 | !-- exchange of these data for the precipitation amount/rate arrays |
---|
161 | DO k = nzb_2d(j,i)+1, nzt |
---|
162 | |
---|
163 | IF ( ql(k,j,i) > ql_crit ) THEN |
---|
164 | dqdt_precip = prec_time_const * ( ql(k,j,i) - ql_crit ) |
---|
165 | ELSE |
---|
166 | dqdt_precip = 0.0 |
---|
167 | ENDIF |
---|
168 | tend(k,j,i) = tend(k,j,i) - dqdt_precip |
---|
169 | |
---|
170 | ! |
---|
171 | !-- Precipitation rate in kg / m**2 / s (= mm/s) |
---|
172 | precipitation_rate(j,i) = precipitation_rate(j,i) + dqdt_precip * & |
---|
173 | dzw(k) |
---|
174 | |
---|
175 | ENDDO |
---|
176 | |
---|
177 | ! |
---|
178 | !-- Sum up the precipitation amount , unit kg / m**2 (= mm) |
---|
179 | IF ( intermediate_timestep_count == intermediate_timestep_count_max & |
---|
180 | .AND. ( dt_do2d_xy-time_do2d_xy ) < precipitation_amount_interval )& |
---|
181 | THEN |
---|
182 | precipitation_amount(j,i) = precipitation_amount(j,i) + & |
---|
183 | precipitation_rate(j,i) * dt_3d |
---|
184 | ENDIF |
---|
185 | |
---|
186 | END SUBROUTINE calc_precipitation_ij |
---|
187 | |
---|
188 | END MODULE calc_precipitation_mod |
---|