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

Last change on this file since 1426 was 1354, checked in by heinze, 10 years ago

last commit documented

  • Property svn:keywords set to Id
File size: 6.4 KB
Line 
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 1354 2014-04-08 15:22:57Z knoop $
27!
28! 1353 2014-04-08 15:21:23Z heinze
29! REAL constants provided with KIND-attribute
30!
31! 1320 2014-03-20 08:40:49Z raasch
32! ONLY-attribute added to USE-statements,
33! kind-parameters added to all INTEGER and REAL declaration statements,
34! kinds are defined in new module kinds,
35! revision history before 2012 removed,
36! comment fields (!:) to be used for variable explanations added to
37! all variable declaration statements
38!
39! 1036 2012-10-22 13:43:42Z raasch
40! code put under GPL (PALM 3.9)
41!
42! Revision 1.1  2000/04/13 14:45:22  schroeter
43! Initial revision
44!
45!
46!
47! Description:
48! ------------
49! Calculate the change of total water content due to precipitation
50! (simplified Kessler scheme)
51!------------------------------------------------------------------------------!
52
53    PRIVATE
54    PUBLIC calc_precipitation
55
56    INTERFACE calc_precipitation
57       MODULE PROCEDURE calc_precipitation
58       MODULE PROCEDURE calc_precipitation_ij
59    END INTERFACE calc_precipitation
60
61 CONTAINS
62
63
64!------------------------------------------------------------------------------!
65! Call for all grid points
66!------------------------------------------------------------------------------!
67    SUBROUTINE calc_precipitation
68
69       USE arrays_3d,                                                          &
70           ONLY:  dzw, ql, tend
71
72       USE cloud_parameters,                                                   &
73           ONLY:  precipitation_amount, precipitation_rate, prec_time_const,   &
74                  ql_crit
75
76       USE control_parameters,                                                 &
77           ONLY:  dt_do2d_xy, dt_3d,                                           &
78                  intermediate_timestep_count, intermediate_timestep_count_max,&
79                  precipitation_amount_interval, time_do2d_xy
80
81       USE indices,                                                            &
82           ONLY:  nxl, nxr, nyn, nys, nzb_2d, nzt
83
84       USE kinds
85
86
87       IMPLICIT NONE
88
89       INTEGER(iwp) ::  i !:
90       INTEGER(iwp) ::  j !:
91       INTEGER(iwp) ::  k !:
92       
93       REAL(wp)    ::  dqdt_precip !:
94
95       precipitation_rate = 0.0_wp
96
97       DO  i = nxl, nxr
98          DO  j = nys, nyn
99             DO  k = nzb_2d(j,i)+1, nzt
100
101                IF ( ql(k,j,i) > ql_crit )  THEN
102                   dqdt_precip = prec_time_const * ( ql(k,j,i) - ql_crit )
103                ELSE
104                   dqdt_precip = 0.0_wp
105                ENDIF
106                tend(k,j,i) = tend(k,j,i) - dqdt_precip
107!
108!--             Precipitation rate in kg / m**2 / s (= mm/s)
109                precipitation_rate(j,i) = precipitation_rate(j,i) +            &
110                                          dqdt_precip * dzw(k)
111
112             ENDDO
113!
114!--          Sum up the precipitation amount, unit kg / m**2 (= mm)
115             IF ( intermediate_timestep_count ==                               &
116                  intermediate_timestep_count_max  .AND.                       &
117                  ( dt_do2d_xy-time_do2d_xy ) < precipitation_amount_interval )&
118             THEN
119                precipitation_amount(j,i) = precipitation_amount(j,i) +        &
120                                            precipitation_rate(j,i) * dt_3d
121             ENDIF
122          ENDDO
123       ENDDO
124
125    END SUBROUTINE calc_precipitation
126
127
128!------------------------------------------------------------------------------!
129! Call for grid point i,j
130!------------------------------------------------------------------------------!
131    SUBROUTINE calc_precipitation_ij( i, j )
132
133       USE arrays_3d,                                                          &
134           ONLY:  dzw, ql, tend
135
136       USE cloud_parameters,                                                   &
137           ONLY:  precipitation_amount, precipitation_rate, prec_time_const,   &
138                  ql_crit
139
140       USE control_parameters,                                                 &
141           ONLY:  dt_do2d_xy, dt_3d,                                           &
142                  intermediate_timestep_count, intermediate_timestep_count_max,&
143                  precipitation_amount_interval, time_do2d_xy
144
145       USE indices,                                                            &
146           ONLY:  nzb_2d, nzt
147
148       USE kinds
149
150
151       IMPLICIT NONE
152
153       INTEGER(iwp) ::  i !:
154       INTEGER(iwp) ::  j !:
155       INTEGER(iwp) ::  k !:
156       
157       REAL(wp)    ::  dqdt_precip !:       
158
159       precipitation_rate(j,i) = 0.0_wp
160
161!
162!--    Ghostpoints are included (although not needed for tend) to avoid a later
163!--    exchange of these data for the precipitation amount/rate arrays
164       DO  k = nzb_2d(j,i)+1, nzt
165
166          IF ( ql(k,j,i) > ql_crit )  THEN
167             dqdt_precip = prec_time_const * ( ql(k,j,i) - ql_crit )
168          ELSE
169             dqdt_precip = 0.0_wp
170          ENDIF
171          tend(k,j,i) = tend(k,j,i) - dqdt_precip
172
173!
174!--       Precipitation rate in kg / m**2 / s (= mm/s)
175          precipitation_rate(j,i) = precipitation_rate(j,i) + dqdt_precip *    &
176                                                              dzw(k)
177
178       ENDDO
179
180!
181!--    Sum up the precipitation amount , unit kg / m**2 (= mm)
182       IF ( intermediate_timestep_count == intermediate_timestep_count_max     &
183            .AND. ( dt_do2d_xy-time_do2d_xy ) < precipitation_amount_interval )&
184       THEN
185          precipitation_amount(j,i) = precipitation_amount(j,i) +              &
186                                      precipitation_rate(j,i) * dt_3d
187       ENDIF
188
189    END SUBROUTINE calc_precipitation_ij
190
191 END MODULE calc_precipitation_mod
Note: See TracBrowser for help on using the repository browser.