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

Last change on this file since 1202 was 1116, checked in by hoffmann, 12 years ago

last commit documented

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