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

Last change on this file since 1817 was 1683, checked in by knoop, 9 years ago

last commit documented

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