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

Last change on this file since 1504 was 1354, checked in by heinze, 11 years ago

last commit documented

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