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

Last change on this file since 2636 was 2101, checked in by suehring, 8 years ago

last commit documented

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