source: palm/trunk/SOURCE/calc_liquid_water_content.f90 @ 1682

Last change on this file since 1682 was 1682, checked in by knoop, 9 years ago

Code annotations made doxygen readable

  • Property svn:keywords set to Id
File size: 4.8 KB
Line 
1!> @file calc_liquid_water_content.f90
2!--------------------------------------------------------------------------------!
3! This file is part of PALM.
4!
5! PALM is free software: you can redistribute it and/or modify it under the terms
6! of the GNU General Public License as published by the Free Software Foundation,
7! either version 3 of the License, or (at your option) any later version.
8!
9! PALM is distributed in the hope that it will be useful, but WITHOUT ANY
10! WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
11! A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
12!
13! You should have received a copy of the GNU General Public License along with
14! PALM. If not, see <http://www.gnu.org/licenses/>.
15!
16! Copyright 1997-2014 Leibniz Universitaet Hannover
17!--------------------------------------------------------------------------------!
18!
19! Current revisions:
20! -----------------
21! Code annotations made doxygen readable
22!
23! Former revisions:
24! -----------------
25! $Id: calc_liquid_water_content.f90 1682 2015-10-07 23:56:08Z knoop $
26!
27! 1353 2014-04-08 15:21:23Z heinze
28! REAL constants provided with KIND-attribute
29!
30! 1320 2014-03-20 08:40:49Z raasch
31! ONLY-attribute added to USE-statements,
32! kind-parameters added to all INTEGER and REAL declaration statements,
33! kinds are defined in new module kinds,
34! revision history before 2012 removed,
35! comment fields (!:) to be used for variable explanations added to
36! all variable declaration statements
37!
38! 1253 2013-11-07 10:48:12Z fricke
39! Bugfix: q is set to qr in case that q is smaller than qr
40!
41! 1115 2013-03-26 18:16:16Z hoffmann
42! drizzle can be used independently from precipitation
43!
44! 1053 2012-11-13 17:11:03Z hoffmann
45! description expanded to the two-moment cloud scheme
46!
47! 1036 2012-10-22 13:43:42Z raasch
48! code put under GPL (PALM 3.9)
49!
50! Revision 1.1  2000/04/13 14:50:45  schroeter
51! Initial revision
52!
53!
54!
55! Description:
56! ------------
57!> Calculation of the liquid water content (0%-or-100%-scheme). This scheme is
58!> used by the one and the two moment cloud physics scheme. Using the two moment
59!> scheme, this calculation results in the cloud water content.
60!------------------------------------------------------------------------------!
61 SUBROUTINE calc_liquid_water_content
62 
63
64
65    USE arrays_3d,                                                             &
66        ONLY:  hyp, pt, q, qc, ql, qr
67
68    USE cloud_parameters,                                                      &
69        ONLY:  l_d_cp, l_d_r, t_d_pt
70
71    USE control_parameters,                                                    &
72        ONLY:  icloud_scheme, precipitation
73
74    USE indices,                                                               &
75        ONLY:  nxlg, nxrg, nyng, nysg, nzb_s_inner, nzt
76
77    USE kinds
78
79    USE pegrid
80
81
82    IMPLICIT NONE
83
84    INTEGER(iwp) ::  i !<
85    INTEGER(iwp) ::  j !<
86    INTEGER(iwp) ::  k !<
87
88    REAL(wp) ::  alpha !<
89    REAL(wp) ::  e_s   !<
90    REAL(wp) ::  q_s   !<
91    REAL(wp) ::  t_l   !<
92
93    DO  i = nxlg, nxrg
94       DO  j = nysg, nyng
95          DO  k = nzb_s_inner(j,i)+1, nzt
96
97!
98!--          Compute the liquid water temperature
99             t_l = t_d_pt(k) * pt(k,j,i)
100
101!
102!--          Compute saturation water vapor pressure at t_l
103             e_s = 610.78_wp * EXP( 17.269_wp * ( t_l - 273.16_wp ) /          &
104                                                ( t_l - 35.86_wp ) )
105
106!
107!--          Compute approximation of saturation humidity
108             q_s = 0.622_wp * e_s / ( hyp(k) - 0.378_wp * e_s )
109
110!
111!--          Correction factor
112             alpha = 0.622_wp * l_d_r * l_d_cp / ( t_l * t_l )
113
114!
115!--          Correction of the approximated value
116!--          (see: Cuijpers + Duynkerke, 1993, JAS, 23)
117             q_s = q_s * ( 1.0_wp + alpha * q(k,j,i) ) / ( 1.0_wp + alpha * q_s )
118
119!
120!--          Compute the liquid water content
121             IF ( icloud_scheme == 0  .AND.  precipitation)  THEN
122                IF ( ( q(k,j,i) - q_s - qr(k,j,i) ) > 0.0_wp ) THEN
123                   qc(k,j,i) = q(k,j,i) - q_s - qr(k,j,i)
124                   ql(k,j,i) = qc(k,j,i) + qr(k,j,i)
125                ELSE
126                   IF ( q(k,j,i) < qr(k,j,i) )  q(k,j,i) = qr(k,j,i)
127                   qc(k,j,i) = 0.0_wp 
128                   ql(k,j,i) = qr(k,j,i)
129                ENDIF
130             ELSEIF ( icloud_scheme == 0  .AND.  .NOT. precipitation )  THEN
131                IF ( ( q(k,j,i) - q_s ) > 0.0_wp ) THEN
132                   qc(k,j,i) = q(k,j,i) - q_s
133                   ql(k,j,i) = qc(k,j,i)
134                ELSE
135                   qc(k,j,i) = 0.0_wp 
136                   ql(k,j,i) = 0.0_wp
137                ENDIF
138             ELSE
139                IF ( ( q(k,j,i) - q_s ) > 0.0_wp ) THEN
140                   ql(k,j,i) = q(k,j,i) - q_s
141                ELSE
142                   ql(k,j,i) = 0.0_wp 
143                ENDIF
144             ENDIF
145          ENDDO
146       ENDDO
147    ENDDO
148   
149 END SUBROUTINE calc_liquid_water_content
Note: See TracBrowser for help on using the repository browser.