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

Last change on this file since 1255 was 1254, checked in by fricke, 11 years ago

last commit documented

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