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

Last change on this file since 1336 was 1321, checked in by raasch, 11 years ago

last commit documented

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