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

Last change on this file since 1319 was 1319, checked in by raasch, 10 years ago

last commit documented

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