source: palm/tags/release-3.9/SOURCE/calc_liquid_water_content.f90

Last change on this file was 1037, checked in by raasch, 11 years ago

last commit documented

  • Property svn:keywords set to Id
File size: 3.0 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! Former revisions:
24! -----------------
25! $Id: calc_liquid_water_content.f90 1037 2012-10-22 14:10:22Z banzhafs $
26!
27! 1036 2012-10-22 13:43:42Z raasch
28! code put under GPL (PALM 3.9)
29!
30! 667 2010-12-23 12:06:00Z suehring/gyschka
31! nxl-1, nxr+1, nys-1, nyn+1 replaced by nxlg, nxrg, nysg, nyng
32!
33! 95 2007-06-02 16:48:38Z raasch
34! hydro_press renamed hyp
35!
36! 19 2007-02-23 04:53:48Z raasch
37! Old comment removed
38!
39! RCS Log replace by Id keyword, revision history cleaned up
40!
41! Revision 1.5  2005/03/26 15:22:06  raasch
42! Arguments for non-cyclic boundary conditions added to argument list of
43! routine exchange_horiz,
44! ql calculated for the ghost points, exchange of ghost points removed
45!
46! Revision 1.1  2000/04/13 14:50:45  schroeter
47! Initial revision
48!
49!
50!
51! Description:
52! ------------
53! Calculation of the liquid water content (0%-or-100%-scheme)
54!------------------------------------------------------------------------------!
55
56
57    USE arrays_3d
58    USE cloud_parameters
59    USE constants
60    USE grid_variables
61    USE indices
62    USE pegrid
63
64    IMPLICIT NONE
65
66    INTEGER :: i, j, k
67
68    REAL :: alpha, e_s, q_s, t_l
69
70    DO  i = nxlg, nxrg
71       DO  j = nysg, nyng
72          DO  k = nzb_2d(j,i)+1, nzt
73
74!
75!--          Compute the liquid water temperature
76             t_l = t_d_pt(k) * pt(k,j,i)
77
78!
79!--          Compute saturation water vapor pressure at t_l
80             e_s = 610.78 * EXP( 17.269 * ( t_l - 273.16 ) / &
81                                          ( t_l - 35.86 ) )
82
83!
84!--          Compute approximation of saturation humidity
85             q_s = 0.622 * e_s / ( hyp(k) - 0.378 * e_s )
86
87!
88!--          Correction factor
89             alpha = 0.622 * l_d_r * l_d_cp / ( t_l * t_l )
90
91!
92!--          Correction of the approximated value
93!--          (see: Cuijpers + Duynkerke, 1993, JAS, 23)
94             q_s = q_s * ( 1.0 + alpha * q(k,j,i) ) / ( 1.0 + alpha * q_s )
95
96!
97!--          Compute the liquid water content
98             IF ( ( q(k,j,i) - q_s ) > 0.0 ) THEN
99                ql(k,j,i) = q(k,j,i) - q_s
100             ELSE
101                ql(k,j,i) = 0.0 
102             ENDIF
103
104          ENDDO
105       ENDDO
106    ENDDO
107   
108 END SUBROUTINE calc_liquid_water_content
Note: See TracBrowser for help on using the repository browser.