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

Last change on this file since 2000 was 2000, checked in by knoop, 8 years ago

Forced header and separation lines into 80 columns

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