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

Last change on this file since 1320 was 1320, checked in by raasch, 7 years ago

ONLY-attribute added to USE-statements,
kind-parameters added to all INTEGER and REAL declaration statements,
kinds are defined in new module kinds,
old module precision_kind is removed,
revision history before 2012 removed,
comment fields (!:) to be used for variable explanations added to all variable declaration statements

  • Property svn:keywords set to Id
File size: 4.6 KB
Line 
1 SUBROUTINE 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! ONLY-attribute added to USE-statements,
23! kind-parameters added to all INTEGER and REAL declaration statements,
24! kinds are defined in new module kinds,
25! revision history before 2012 removed,
26! comment fields (!:) to be used for variable explanations added to
27! all variable declaration statements
28!
29! Former revisions:
30! -----------------
31! $Id: calc_liquid_water_content.f90 1320 2014-03-20 08:40:49Z raasch $
32!
33! 1253 2013-11-07 10:48:12Z fricke
34! Bugfix: q is set to qr in case that q is smaller than qr
35!
36! 1115 2013-03-26 18:16:16Z hoffmann
37! drizzle can be used independently from precipitation
38!
39! 1053 2012-11-13 17:11:03Z hoffmann
40! description expanded to the two-moment cloud scheme
41!
42! 1036 2012-10-22 13:43:42Z raasch
43! code put under GPL (PALM 3.9)
44!
45! Revision 1.1  2000/04/13 14:50:45  schroeter
46! Initial revision
47!
48!
49!
50! Description:
51! ------------
52! Calculation of the liquid water content (0%-or-100%-scheme). This scheme is
53! used by the one and the two moment cloud physics scheme. Using the two moment
54! scheme, this calculation results in the cloud water content.
55!------------------------------------------------------------------------------!
56
57
58    USE arrays_3d,                                                             &
59        ONLY:  hyp, pt, q, qc, ql, qr
60
61    USE cloud_parameters,                                                      &
62        ONLY:  l_d_cp, l_d_r, t_d_pt
63
64    USE control_parameters,                                                    &
65        ONLY:  icloud_scheme, precipitation
66
67    USE indices,                                                               &
68        ONLY:  nxlg, nxrg, nyng, nysg, nzb_s_inner, nzt
69
70    USE kinds
71
72    USE pegrid
73
74
75    IMPLICIT NONE
76
77    INTEGER(iwp) ::  i !:
78    INTEGER(iwp) ::  j !:
79    INTEGER(iwp) ::  k !:
80
81    REAL(wp) ::  alpha !:
82    REAL(wp) ::  e_s   !:
83    REAL(wp) ::  q_s   !:
84    REAL(wp) ::  t_l   !:
85
86    DO  i = nxlg, nxrg
87       DO  j = nysg, nyng
88          DO  k = nzb_s_inner(j,i)+1, nzt
89
90!
91!--          Compute the liquid water temperature
92             t_l = t_d_pt(k) * pt(k,j,i)
93
94!
95!--          Compute saturation water vapor pressure at t_l
96             e_s = 610.78 * EXP( 17.269 * ( t_l - 273.16 ) /                   &
97                                          ( t_l - 35.86 ) )
98
99!
100!--          Compute approximation of saturation humidity
101             q_s = 0.622 * e_s / ( hyp(k) - 0.378 * e_s )
102
103!
104!--          Correction factor
105             alpha = 0.622 * l_d_r * l_d_cp / ( t_l * t_l )
106
107!
108!--          Correction of the approximated value
109!--          (see: Cuijpers + Duynkerke, 1993, JAS, 23)
110             q_s = q_s * ( 1.0 + alpha * q(k,j,i) ) / ( 1.0 + alpha * q_s )
111
112!
113!--          Compute the liquid water content
114             IF ( icloud_scheme == 0  .AND.  precipitation)  THEN
115                IF ( ( q(k,j,i) - q_s - qr(k,j,i) ) > 0.0 ) THEN
116                   qc(k,j,i) = q(k,j,i) - q_s - qr(k,j,i)
117                   ql(k,j,i) = qc(k,j,i) + qr(k,j,i)
118                ELSE
119                   IF ( q(k,j,i) < qr(k,j,i) )  q(k,j,i) = qr(k,j,i)
120                   qc(k,j,i) = 0.0 
121                   ql(k,j,i) = qr(k,j,i)
122                ENDIF
123             ELSEIF ( icloud_scheme == 0  .AND.  .NOT. precipitation )  THEN
124                IF ( ( q(k,j,i) - q_s ) > 0.0 ) THEN
125                   qc(k,j,i) = q(k,j,i) - q_s
126                   ql(k,j,i) = qc(k,j,i)
127                ELSE
128                   qc(k,j,i) = 0.0 
129                   ql(k,j,i) = 0.0
130                ENDIF
131             ELSE
132                IF ( ( q(k,j,i) - q_s ) > 0.0 ) THEN
133                   ql(k,j,i) = q(k,j,i) - q_s
134                ELSE
135                   ql(k,j,i) = 0.0 
136                ENDIF
137             ENDIF
138          ENDDO
139       ENDDO
140    ENDDO
141   
142 END SUBROUTINE calc_liquid_water_content
Note: See TracBrowser for help on using the repository browser.