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

Last change on this file since 1036 was 1036, checked in by raasch, 9 years ago

code has been put under the GNU General Public License (v3)

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