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

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

last commit documented

  • Property svn:keywords set to Id
File size: 6.6 KB
RevLine 
[1682]1!> @file calc_precipitation.f90
[1036]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!
[1310]16! Copyright 1997-2014 Leibniz Universitaet Hannover
[1036]17!--------------------------------------------------------------------------------!
18!
[484]19! Current revisions:
[1]20! -----------------
[1354]21!
[1683]22!
[1321]23! Former revisions:
24! -----------------
25! $Id: calc_precipitation.f90 1683 2015-10-07 23:57:51Z raasch $
26!
[1683]27! 1682 2015-10-07 23:56:08Z knoop
28! Code annotations made doxygen readable
29!
[1354]30! 1353 2014-04-08 15:21:23Z heinze
31! REAL constants provided with KIND-attribute
32!
[1321]33! 1320 2014-03-20 08:40:49Z raasch
[1320]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
[1]40!
[1037]41! 1036 2012-10-22 13:43:42Z raasch
42! code put under GPL (PALM 3.9)
43!
[1]44! Revision 1.1  2000/04/13 14:45:22  schroeter
45! Initial revision
46!
47!
48!
49! Description:
50! ------------
[1682]51!> Calculate the change of total water content due to precipitation
52!> (simplified Kessler scheme)
[1]53!------------------------------------------------------------------------------!
[1682]54 MODULE calc_precipitation_mod
55 
[1]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
[403]64
[1]65 CONTAINS
66
67
68!------------------------------------------------------------------------------!
[1682]69! Description:
70! ------------
71!> Call for all grid points
[1]72!------------------------------------------------------------------------------!
73    SUBROUTINE calc_precipitation
74
[1320]75       USE arrays_3d,                                                          &
76           ONLY:  dzw, ql, tend
[1]77
[1320]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
[1]93       IMPLICIT NONE
94
[1682]95       INTEGER(iwp) ::  i !<
96       INTEGER(iwp) ::  j !<
97       INTEGER(iwp) ::  k !<
[1320]98       
[1682]99       REAL(wp)    ::  dqdt_precip !<
[1]100
[1353]101       precipitation_rate = 0.0_wp
[72]102
[1]103       DO  i = nxl, nxr
104          DO  j = nys, nyn
[19]105             DO  k = nzb_2d(j,i)+1, nzt
[1]106
107                IF ( ql(k,j,i) > ql_crit )  THEN
[72]108                   dqdt_precip = prec_time_const * ( ql(k,j,i) - ql_crit )
[1]109                ELSE
[1353]110                   dqdt_precip = 0.0_wp
[1]111                ENDIF
[72]112                tend(k,j,i) = tend(k,j,i) - dqdt_precip
113!
[73]114!--             Precipitation rate in kg / m**2 / s (= mm/s)
[1320]115                precipitation_rate(j,i) = precipitation_rate(j,i) +            &
[73]116                                          dqdt_precip * dzw(k)
[1]117
118             ENDDO
[72]119!
[73]120!--          Sum up the precipitation amount, unit kg / m**2 (= mm)
[1320]121             IF ( intermediate_timestep_count ==                               &
122                  intermediate_timestep_count_max  .AND.                       &
[72]123                  ( dt_do2d_xy-time_do2d_xy ) < precipitation_amount_interval )&
124             THEN
[1320]125                precipitation_amount(j,i) = precipitation_amount(j,i) +        &
[72]126                                            precipitation_rate(j,i) * dt_3d
127             ENDIF
[1]128          ENDDO
129       ENDDO
130
131    END SUBROUTINE calc_precipitation
132
133
134!------------------------------------------------------------------------------!
[1682]135! Description:
136! ------------
137!> Call for grid point i,j
[1]138!------------------------------------------------------------------------------!
139    SUBROUTINE calc_precipitation_ij( i, j )
140
[1320]141       USE arrays_3d,                                                          &
142           ONLY:  dzw, ql, tend
[403]143
[1320]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
[1]159       IMPLICIT NONE
160
[1682]161       INTEGER(iwp) ::  i !<
162       INTEGER(iwp) ::  j !<
163       INTEGER(iwp) ::  k !<
[1320]164       
[1682]165       REAL(wp)    ::  dqdt_precip !<       
[1]166
[1353]167       precipitation_rate(j,i) = 0.0_wp
[1]168
[72]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
[19]172       DO  k = nzb_2d(j,i)+1, nzt
[1]173
174          IF ( ql(k,j,i) > ql_crit )  THEN
[72]175             dqdt_precip = prec_time_const * ( ql(k,j,i) - ql_crit )
[1]176          ELSE
[1353]177             dqdt_precip = 0.0_wp
[1]178          ENDIF
[72]179          tend(k,j,i) = tend(k,j,i) - dqdt_precip
[1]180
[72]181!
[403]182!--       Precipitation rate in kg / m**2 / s (= mm/s)
[1320]183          precipitation_rate(j,i) = precipitation_rate(j,i) + dqdt_precip *    &
[403]184                                                              dzw(k)
[72]185
[1]186       ENDDO
187
[72]188!
[403]189!--    Sum up the precipitation amount , unit kg / m**2 (= mm)
[72]190       IF ( intermediate_timestep_count == intermediate_timestep_count_max     &
191            .AND. ( dt_do2d_xy-time_do2d_xy ) < precipitation_amount_interval )&
192       THEN
[1320]193          precipitation_amount(j,i) = precipitation_amount(j,i) +              &
[72]194                                      precipitation_rate(j,i) * dt_3d
195       ENDIF
196
[1]197    END SUBROUTINE calc_precipitation_ij
198
199 END MODULE calc_precipitation_mod
Note: See TracBrowser for help on using the repository browser.