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

Last change on this file since 1115 was 1115, checked in by hoffmann, 11 years ago

optimization of two-moments cloud physics

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