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

Last change on this file since 1586 was 1360, checked in by hoffmann, 11 years ago

last commit documented

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