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

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

Code annotations made doxygen readable

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