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

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

last commit documented

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