source: palm/trunk/SOURCE/calc_precipitation.f90 @ 1695

Last change on this file since 1695 was 1683, checked in by knoop, 9 years ago

last commit documented

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