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

Last change on this file since 1289 was 1037, checked in by raasch, 12 years ago

last commit documented

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