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

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

former files/routines cpu_log and cpu_statistics combined to one module,
which also includes the former data module cpulog from the modules-file,
module interfaces removed

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