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

Last change on this file since 1036 was 1036, checked in by raasch, 11 years ago

code has been put under the GNU General Public License (v3)

  • Property svn:keywords set to Id
File size: 5.0 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-2012  Leibniz University Hannover
18!--------------------------------------------------------------------------------!
19!
20! Current revisions:
21! -----------------
22!
23!
24! Former revisions:
25! -----------------
26! $Id: calc_precipitation.f90 484 2010-02-05 07:36:54Z raasch
27!
28! 403 2009-10-22 13:57:16Z franke
29! Bugfix in calculation of precipitation_rate(j,i)
30!
31! 73 2007-03-20 08:33:14Z raasch
32! Precipitation rate and amount are calculated/stored,
33! + module control_parameters
34!
35! 19 2007-02-23 04:53:48Z raasch
36! Calculation extended for gridpoint nzt
37!
38! RCS Log replace by Id keyword, revision history cleaned up
39!
40! Revision 1.5  2004/01/30 10:15:57  raasch
41! Scalar lower k index nzb replaced by 2d-array nzb_2d
42!
43! Revision 1.1  2000/04/13 14:45:22  schroeter
44! Initial revision
45!
46!
47!
48! Description:
49! ------------
50! Calculate the change of total water content due to precipitation
51! (simplified Kessler scheme)
52!------------------------------------------------------------------------------!
53
54    PRIVATE
55    PUBLIC calc_precipitation
56
57    INTERFACE calc_precipitation
58       MODULE PROCEDURE calc_precipitation
59       MODULE PROCEDURE calc_precipitation_ij
60    END INTERFACE calc_precipitation
61
62 CONTAINS
63
64
65!------------------------------------------------------------------------------!
66! Call for all grid points
67!------------------------------------------------------------------------------!
68    SUBROUTINE calc_precipitation
69
70       USE arrays_3d
71       USE cloud_parameters
72       USE constants
73       USE control_parameters
74       USE indices
75
76       IMPLICIT NONE
77
78       INTEGER ::  i, j, k
79       REAL    ::  dqdt_precip
80
81       precipitation_rate = 0.0
82
83       DO  i = nxl, nxr
84          DO  j = nys, nyn
85             DO  k = nzb_2d(j,i)+1, nzt
86
87                IF ( ql(k,j,i) > ql_crit )  THEN
88                   dqdt_precip = prec_time_const * ( ql(k,j,i) - ql_crit )
89                ELSE
90                   dqdt_precip = 0.0
91                ENDIF
92                tend(k,j,i) = tend(k,j,i) - dqdt_precip
93!
94!--             Precipitation rate in kg / m**2 / s (= mm/s)
95                precipitation_rate(j,i) = precipitation_rate(j,i) + &
96                                          dqdt_precip * dzw(k)
97
98             ENDDO
99!
100!--          Sum up the precipitation amount, unit kg / m**2 (= mm)
101             IF ( intermediate_timestep_count ==         &
102                  intermediate_timestep_count_max  .AND. &
103                  ( dt_do2d_xy-time_do2d_xy ) < precipitation_amount_interval )&
104             THEN
105                precipitation_amount(j,i) = precipitation_amount(j,i) + &
106                                            precipitation_rate(j,i) * dt_3d
107             ENDIF
108          ENDDO
109       ENDDO
110
111    END SUBROUTINE calc_precipitation
112
113
114!------------------------------------------------------------------------------!
115! Call for grid point i,j
116!------------------------------------------------------------------------------!
117    SUBROUTINE calc_precipitation_ij( i, j )
118
119       USE arrays_3d
120       USE cloud_parameters
121       USE constants
122       USE control_parameters
123       USE indices
124
125       IMPLICIT NONE
126
127       INTEGER ::  i, j, k
128       REAL    ::  dqdt_precip
129
130       precipitation_rate(j,i) = 0.0
131
132!
133!--    Ghostpoints are included (although not needed for tend) to avoid a later
134!--    exchange of these data for the precipitation amount/rate arrays
135       DO  k = nzb_2d(j,i)+1, nzt
136
137          IF ( ql(k,j,i) > ql_crit )  THEN
138             dqdt_precip = prec_time_const * ( ql(k,j,i) - ql_crit )
139          ELSE
140             dqdt_precip = 0.0
141          ENDIF
142          tend(k,j,i) = tend(k,j,i) - dqdt_precip
143
144!
145!--       Precipitation rate in kg / m**2 / s (= mm/s)
146          precipitation_rate(j,i) = precipitation_rate(j,i) + dqdt_precip * &
147                                                              dzw(k)
148
149       ENDDO
150
151!
152!--    Sum up the precipitation amount , unit kg / m**2 (= mm)
153       IF ( intermediate_timestep_count == intermediate_timestep_count_max     &
154            .AND. ( dt_do2d_xy-time_do2d_xy ) < precipitation_amount_interval )&
155       THEN
156          precipitation_amount(j,i) = precipitation_amount(j,i) + &
157                                      precipitation_rate(j,i) * dt_3d
158       ENDIF
159
160    END SUBROUTINE calc_precipitation_ij
161
162 END MODULE calc_precipitation_mod
Note: See TracBrowser for help on using the repository browser.