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

Last change on this file since 1817 was 1683, checked in by knoop, 9 years ago

last commit documented

  • Property svn:keywords set to Id
File size: 4.9 KB
Line 
1!> @file calc_liquid_water_content.f90
2!--------------------------------------------------------------------------------!
3! This file is part of PALM.
4!
5! PALM is free software: you can redistribute it and/or modify it under the terms
6! of the GNU General Public License as published by the Free Software Foundation,
7! either version 3 of the License, or (at your option) any later version.
8!
9! PALM is distributed in the hope that it will be useful, but WITHOUT ANY
10! WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
11! A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
12!
13! You should have received a copy of the GNU General Public License along with
14! PALM. If not, see <http://www.gnu.org/licenses/>.
15!
16! Copyright 1997-2014 Leibniz Universitaet Hannover
17!--------------------------------------------------------------------------------!
18!
19! Current revisions:
20! -----------------
21!
22!
23! Former revisions:
24! -----------------
25! $Id: calc_liquid_water_content.f90 1683 2015-10-07 23:57:51Z maronga $
26!
27! 1682 2015-10-07 23:56:08Z knoop
28! Code annotations made doxygen readable
29!
30! 1353 2014-04-08 15:21:23Z heinze
31! REAL constants provided with KIND-attribute
32!
33! 1320 2014-03-20 08:40:49Z raasch
34! ONLY-attribute added to USE-statements,
35! kind-parameters added to all INTEGER and REAL declaration statements,
36! kinds are defined in new module kinds,
37! revision history before 2012 removed,
38! comment fields (!:) to be used for variable explanations added to
39! all variable declaration statements
40!
41! 1253 2013-11-07 10:48:12Z fricke
42! Bugfix: q is set to qr in case that q is smaller than qr
43!
44! 1115 2013-03-26 18:16:16Z hoffmann
45! drizzle can be used independently from precipitation
46!
47! 1053 2012-11-13 17:11:03Z hoffmann
48! description expanded to the two-moment cloud scheme
49!
50! 1036 2012-10-22 13:43:42Z raasch
51! code put under GPL (PALM 3.9)
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 SUBROUTINE calc_liquid_water_content
65 
66
67
68    USE arrays_3d,                                                             &
69        ONLY:  hyp, pt, q, qc, ql, qr
70
71    USE cloud_parameters,                                                      &
72        ONLY:  l_d_cp, l_d_r, t_d_pt
73
74    USE control_parameters,                                                    &
75        ONLY:  icloud_scheme, precipitation
76
77    USE indices,                                                               &
78        ONLY:  nxlg, nxrg, nyng, nysg, nzb_s_inner, nzt
79
80    USE kinds
81
82    USE pegrid
83
84
85    IMPLICIT NONE
86
87    INTEGER(iwp) ::  i !<
88    INTEGER(iwp) ::  j !<
89    INTEGER(iwp) ::  k !<
90
91    REAL(wp) ::  alpha !<
92    REAL(wp) ::  e_s   !<
93    REAL(wp) ::  q_s   !<
94    REAL(wp) ::  t_l   !<
95
96    DO  i = nxlg, nxrg
97       DO  j = nysg, nyng
98          DO  k = nzb_s_inner(j,i)+1, nzt
99
100!
101!--          Compute the liquid water temperature
102             t_l = t_d_pt(k) * pt(k,j,i)
103
104!
105!--          Compute saturation water vapor pressure at t_l
106             e_s = 610.78_wp * EXP( 17.269_wp * ( t_l - 273.16_wp ) /          &
107                                                ( t_l - 35.86_wp ) )
108
109!
110!--          Compute approximation of saturation humidity
111             q_s = 0.622_wp * e_s / ( hyp(k) - 0.378_wp * e_s )
112
113!
114!--          Correction factor
115             alpha = 0.622_wp * l_d_r * l_d_cp / ( t_l * t_l )
116
117!
118!--          Correction of the approximated value
119!--          (see: Cuijpers + Duynkerke, 1993, JAS, 23)
120             q_s = q_s * ( 1.0_wp + alpha * q(k,j,i) ) / ( 1.0_wp + alpha * q_s )
121
122!
123!--          Compute the liquid water content
124             IF ( icloud_scheme == 0  .AND.  precipitation)  THEN
125                IF ( ( q(k,j,i) - q_s - qr(k,j,i) ) > 0.0_wp ) THEN
126                   qc(k,j,i) = q(k,j,i) - q_s - qr(k,j,i)
127                   ql(k,j,i) = qc(k,j,i) + qr(k,j,i)
128                ELSE
129                   IF ( q(k,j,i) < qr(k,j,i) )  q(k,j,i) = qr(k,j,i)
130                   qc(k,j,i) = 0.0_wp 
131                   ql(k,j,i) = qr(k,j,i)
132                ENDIF
133             ELSEIF ( icloud_scheme == 0  .AND.  .NOT. precipitation )  THEN
134                IF ( ( q(k,j,i) - q_s ) > 0.0_wp ) THEN
135                   qc(k,j,i) = q(k,j,i) - q_s
136                   ql(k,j,i) = qc(k,j,i)
137                ELSE
138                   qc(k,j,i) = 0.0_wp 
139                   ql(k,j,i) = 0.0_wp
140                ENDIF
141             ELSE
142                IF ( ( q(k,j,i) - q_s ) > 0.0_wp ) THEN
143                   ql(k,j,i) = q(k,j,i) - q_s
144                ELSE
145                   ql(k,j,i) = 0.0_wp 
146                ENDIF
147             ENDIF
148          ENDDO
149       ENDDO
150    ENDDO
151   
152 END SUBROUTINE calc_liquid_water_content
Note: See TracBrowser for help on using the repository browser.