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

Last change on this file since 1491 was 1354, checked in by heinze, 11 years ago

last commit documented

  • Property svn:keywords set to Id
File size: 4.7 KB
RevLine 
[1]1 SUBROUTINE calc_liquid_water_content
2
[1036]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!
[1310]17! Copyright 1997-2014 Leibniz Universitaet Hannover
[1036]18!--------------------------------------------------------------------------------!
19!
[484]20! Current revisions:
[1]21! -----------------
[1354]22!
23!
[1321]24! Former revisions:
25! -----------------
26! $Id: calc_liquid_water_content.f90 1354 2014-04-08 15:22:57Z heinze $
27!
[1354]28! 1353 2014-04-08 15:21:23Z heinze
29! REAL constants provided with KIND-attribute
30!
[1321]31! 1320 2014-03-20 08:40:49Z raasch
[1320]32! ONLY-attribute added to USE-statements,
33! kind-parameters added to all INTEGER and REAL declaration statements,
34! kinds are defined in new module kinds,
35! revision history before 2012 removed,
36! comment fields (!:) to be used for variable explanations added to
37! all variable declaration statements
[1]38!
[1254]39! 1253 2013-11-07 10:48:12Z fricke
40! Bugfix: q is set to qr in case that q is smaller than qr
41!
[1116]42! 1115 2013-03-26 18:16:16Z hoffmann
43! drizzle can be used independently from precipitation
44!
[1054]45! 1053 2012-11-13 17:11:03Z hoffmann
46! description expanded to the two-moment cloud scheme
47!
[1037]48! 1036 2012-10-22 13:43:42Z raasch
49! code put under GPL (PALM 3.9)
50!
[1]51! Revision 1.1  2000/04/13 14:50:45  schroeter
52! Initial revision
53!
54!
55!
56! Description:
57! ------------
[1053]58! Calculation of the liquid water content (0%-or-100%-scheme). This scheme is
59! used by the one and the two moment cloud physics scheme. Using the two moment
60! scheme, this calculation results in the cloud water content.
[1]61!------------------------------------------------------------------------------!
62
63
[1320]64    USE arrays_3d,                                                             &
65        ONLY:  hyp, pt, q, qc, ql, qr
66
67    USE cloud_parameters,                                                      &
68        ONLY:  l_d_cp, l_d_r, t_d_pt
69
70    USE control_parameters,                                                    &
71        ONLY:  icloud_scheme, precipitation
72
73    USE indices,                                                               &
74        ONLY:  nxlg, nxrg, nyng, nysg, nzb_s_inner, nzt
75
76    USE kinds
77
[1]78    USE pegrid
79
[1320]80
[1]81    IMPLICIT NONE
82
[1320]83    INTEGER(iwp) ::  i !:
84    INTEGER(iwp) ::  j !:
85    INTEGER(iwp) ::  k !:
[1]86
[1320]87    REAL(wp) ::  alpha !:
88    REAL(wp) ::  e_s   !:
89    REAL(wp) ::  q_s   !:
90    REAL(wp) ::  t_l   !:
[1]91
[667]92    DO  i = nxlg, nxrg
93       DO  j = nysg, nyng
[1115]94          DO  k = nzb_s_inner(j,i)+1, nzt
[1]95
96!
97!--          Compute the liquid water temperature
98             t_l = t_d_pt(k) * pt(k,j,i)
99
100!
101!--          Compute saturation water vapor pressure at t_l
[1353]102             e_s = 610.78_wp * EXP( 17.269_wp * ( t_l - 273.16_wp ) /          &
103                                                ( t_l - 35.86_wp ) )
[1]104
105!
106!--          Compute approximation of saturation humidity
[1353]107             q_s = 0.622_wp * e_s / ( hyp(k) - 0.378_wp * e_s )
[1]108
109!
110!--          Correction factor
[1353]111             alpha = 0.622_wp * l_d_r * l_d_cp / ( t_l * t_l )
[1]112
113!
114!--          Correction of the approximated value
115!--          (see: Cuijpers + Duynkerke, 1993, JAS, 23)
[1353]116             q_s = q_s * ( 1.0_wp + alpha * q(k,j,i) ) / ( 1.0_wp + alpha * q_s )
[1]117
118!
119!--          Compute the liquid water content
[1115]120             IF ( icloud_scheme == 0  .AND.  precipitation)  THEN
[1353]121                IF ( ( q(k,j,i) - q_s - qr(k,j,i) ) > 0.0_wp ) THEN
[1115]122                   qc(k,j,i) = q(k,j,i) - q_s - qr(k,j,i)
123                   ql(k,j,i) = qc(k,j,i) + qr(k,j,i)
124                ELSE
[1253]125                   IF ( q(k,j,i) < qr(k,j,i) )  q(k,j,i) = qr(k,j,i)
[1353]126                   qc(k,j,i) = 0.0_wp 
[1115]127                   ql(k,j,i) = qr(k,j,i)
128                ENDIF
129             ELSEIF ( icloud_scheme == 0  .AND.  .NOT. precipitation )  THEN
[1353]130                IF ( ( q(k,j,i) - q_s ) > 0.0_wp ) THEN
[1115]131                   qc(k,j,i) = q(k,j,i) - q_s
132                   ql(k,j,i) = qc(k,j,i)
133                ELSE
[1353]134                   qc(k,j,i) = 0.0_wp 
135                   ql(k,j,i) = 0.0_wp
[1115]136                ENDIF
[1]137             ELSE
[1353]138                IF ( ( q(k,j,i) - q_s ) > 0.0_wp ) THEN
[1115]139                   ql(k,j,i) = q(k,j,i) - q_s
140                ELSE
[1353]141                   ql(k,j,i) = 0.0_wp 
[1115]142                ENDIF
[1]143             ENDIF
144          ENDDO
145       ENDDO
146    ENDDO
147   
148 END SUBROUTINE calc_liquid_water_content
Note: See TracBrowser for help on using the repository browser.