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

Last change on this file since 1320 was 1320, checked in by raasch, 7 years ago

ONLY-attribute added to USE-statements,
kind-parameters added to all INTEGER and REAL declaration statements,
kinds are defined in new module kinds,
old module precision_kind is removed,
revision history before 2012 removed,
comment fields (!:) to be used for variable explanations added to all variable declaration statements

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