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

Last change on this file since 1359 was 1359, checked in by hoffmann, 10 years ago

new Lagrangian particle structure integrated

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