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