source: palm/trunk/SOURCE/lpm_calc_liquid_water_content.f90 @ 1822

Last change on this file since 1822 was 1822, checked in by hoffmann, 8 years ago

changes in LPM and bulk cloud microphysics

  • Property svn:keywords set to Id
File size: 4.5 KB
Line 
1!> @file lpm_calc_liquid_water_content.f90
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!
16! Copyright 1997-2016 Leibniz Universitaet Hannover
17!--------------------------------------------------------------------------------!
18!
19! Current revisions:
20! ------------------
21! Unused variables removed.
22!
23! Former revisions:
24! -----------------
25! $Id: lpm_calc_liquid_water_content.f90 1822 2016-04-07 07:49:42Z hoffmann $
26!
27! 1682 2015-10-07 23:56:08Z knoop
28! Code annotations made doxygen readable
29!
30! 1359 2014-04-11 17:15:14Z hoffmann
31! New particle structure integrated.
32! Kind definition added to all floating point numbers.
33!
34! 1320 2014-03-20 08:40:49Z raasch
35! ONLY-attribute added to USE-statements,
36! kind-parameters added to all INTEGER and REAL declaration statements,
37! kinds are defined in new module kinds,
38! comment fields (!:) to be used for variable explanations added to
39! all variable declaration statements
40!
41! 1036 2012-10-22 13:43:42Z raasch
42! code put under GPL (PALM 3.9)
43!
44! 849 2012-03-15 10:35:09Z raasch
45! initial revision (former part of advec_particles)
46!
47!
48! Description:
49! ------------
50!> Calculate the liquid water content for each grid box.
51!------------------------------------------------------------------------------!
52 SUBROUTINE lpm_calc_liquid_water_content
53 
54
55    USE arrays_3d,                                                             &
56        ONLY:  ql, ql_v, ql_vp
57
58    USE cloud_parameters,                                                      &
59        ONLY:  rho_l
60
61    USE constants,                                                             &
62        ONLY:  pi
63
64    USE control_parameters,                                                    &
65        ONLY:  dz, message_string, rho_surface
66
67    USE cpulog,                                                                &
68        ONLY:  cpu_log, log_point_s
69
70    USE grid_variables,                                                        &
71        ONLY:  dx, dy
72
73    USE indices,                                                               &
74        ONLY:  nxl, nxr, nyn, nys, nzb, nzt
75
76    USE kinds
77
78    USE particle_attributes,                                                   &
79        ONLY:  grid_particles, number_of_particles, particles, prt_count
80
81    IMPLICIT NONE
82
83    INTEGER(iwp) ::  i   !<
84    INTEGER(iwp) ::  j   !<
85    INTEGER(iwp) ::  k   !<
86    INTEGER(iwp) ::  n   !<
87
88    CALL cpu_log( log_point_s(45), 'lpm_calc_ql', 'start' )
89
90!
91!-- Set water content initially to zero
92    ql = 0.0_wp;  ql_v = 0.0_wp;  ql_vp = 0.0_wp
93
94!
95!-- Calculate for each grid box
96    DO  i = nxl, nxr
97       DO  j = nys, nyn
98          DO  k = nzb+1, nzt
99
100             number_of_particles = prt_count(k,j,i)
101             IF ( number_of_particles <= 0 )  CYCLE
102             particles => grid_particles(k,j,i)%particles(1:number_of_particles)
103
104!
105!--          Calculate the total volume in the boxes (ql_v, weighting factor
106!--          has to beincluded)
107             DO  n = 1, prt_count(k,j,i)
108                ql_v(k,j,i)  = ql_v(k,j,i)  + particles(n)%weight_factor *  &
109                                              particles(n)%radius**3
110             ENDDO
111
112!
113!--          Calculate the liquid water content
114             IF ( ql_v(k,j,i) /= 0.0_wp )  THEN
115                ql(k,j,i) = ql(k,j,i) + rho_l * 1.33333333_wp * pi *           &
116                                        ql_v(k,j,i) /                       &
117                                        ( rho_surface * dx * dy * dz )
118
119                IF ( ql(k,j,i) < 0.0_wp )  THEN
120                   WRITE( message_string, * )  'LWC out of range: ' , &
121                                               ql(k,j,i),i,j,k
122                   CALL message( 'lpm_calc_liquid_water_content', '', 2, 2, &
123                                 -1, 6, 1 )
124                ENDIF
125
126             ELSE
127
128                ql(k,j,i) = 0.0_wp
129
130             ENDIF
131
132          ENDDO
133       ENDDO
134    ENDDO
135
136    CALL cpu_log( log_point_s(45), 'lpm_calc_ql', 'stop' )
137
138
139 END SUBROUTINE lpm_calc_liquid_water_content
Note: See TracBrowser for help on using the repository browser.