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 1037 2012-10-22 14:10:22Z fuhrmann $ |
---|
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 interfaces |
---|
48 | USE particle_attributes |
---|
49 | |
---|
50 | IMPLICIT NONE |
---|
51 | |
---|
52 | INTEGER :: i, j, k, n, psi |
---|
53 | |
---|
54 | |
---|
55 | CALL cpu_log( log_point_s(45), 'lpm_calc_ql', 'start' ) |
---|
56 | |
---|
57 | ! |
---|
58 | !-- Set water content initially to zero |
---|
59 | ql = 0.0; ql_v = 0.0; ql_vp = 0.0 |
---|
60 | |
---|
61 | ! |
---|
62 | !-- Calculate for each grid box |
---|
63 | DO i = nxl, nxr |
---|
64 | DO j = nys, nyn |
---|
65 | DO k = nzb, nzt+1 |
---|
66 | |
---|
67 | ! |
---|
68 | !-- Calculate the total volume in the boxes (ql_v, weighting factor |
---|
69 | !-- has to beincluded) |
---|
70 | psi = prt_start_index(k,j,i) |
---|
71 | DO n = psi, psi+prt_count(k,j,i)-1 |
---|
72 | ql_v(k,j,i) = ql_v(k,j,i) + particles(n)%weight_factor * & |
---|
73 | particles(n)%radius**3 |
---|
74 | ENDDO |
---|
75 | |
---|
76 | ! |
---|
77 | !-- Calculate the liquid water content |
---|
78 | IF ( ql_v(k,j,i) /= 0.0 ) THEN |
---|
79 | ql(k,j,i) = ql(k,j,i) + rho_l * 1.33333333 * pi * & |
---|
80 | ql_v(k,j,i) / & |
---|
81 | ( rho_surface * dx * dy * dz ) |
---|
82 | |
---|
83 | IF ( ql(k,j,i) < 0.0 ) THEN |
---|
84 | WRITE( message_string, * ) 'LWC out of range: ' , & |
---|
85 | ql(k,j,i) |
---|
86 | CALL message( 'lpm_calc_liquid_water_content', '', 2, 2, & |
---|
87 | -1, 6, 1 ) |
---|
88 | ENDIF |
---|
89 | |
---|
90 | ELSE |
---|
91 | |
---|
92 | ql(k,j,i) = 0.0 |
---|
93 | |
---|
94 | ENDIF |
---|
95 | |
---|
96 | ENDDO |
---|
97 | ENDDO |
---|
98 | ENDDO |
---|
99 | |
---|
100 | CALL cpu_log( log_point_s(45), 'lpm_calc_ql', 'stop' ) |
---|
101 | |
---|
102 | |
---|
103 | END SUBROUTINE lpm_calc_liquid_water_content |
---|