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

Last change on this file since 2318 was 2292, checked in by schwenkel, 7 years ago

implementation of new bulk microphysics scheme

  • Property svn:keywords set to Id
File size: 6.4 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
6! terms of the GNU General Public License as published by the Free Software
7! Foundation, either version 3 of the License, or (at your option) any later
8! 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-2017 Leibniz Universitaet Hannover
18!------------------------------------------------------------------------------!
19!
20! Current revisions:
21! -----------------
22!
23!
24! Former revisions:
25! -----------------
26! $Id: calc_liquid_water_content.f90 2292 2017-06-20 09:51:42Z suehring $
27! Implementation of new microphysic scheme: cloud_scheme = 'morrison'
28! includes two more prognostic equations for cloud drop concentration (nc) 
29! and cloud water content (qc).
30!
31! 2233 2017-05-30 18:08:54Z suehring
32!
33! 2232 2017-05-30 17:47:52Z suehring
34! Adjustments to new topography concept
35!
36! 2000 2016-08-20 18:09:15Z knoop
37! Forced header and separation lines into 80 columns
38!
39! 1822 2016-04-07 07:49:42Z hoffmann
40! icloud_scheme removed. microphysics_seifert added.
41!
42! 1682 2015-10-07 23:56:08Z knoop
43! Code annotations made doxygen readable
44!
45! 1353 2014-04-08 15:21:23Z heinze
46! REAL constants provided with KIND-attribute
47!
48! 1320 2014-03-20 08:40:49Z raasch
49! ONLY-attribute added to USE-statements,
50! kind-parameters added to all INTEGER and REAL declaration statements,
51! kinds are defined in new module kinds,
52! revision history before 2012 removed,
53! comment fields (!:) to be used for variable explanations added to
54! all variable declaration statements
55!
56! 1253 2013-11-07 10:48:12Z fricke
57! Bugfix: q is set to qr in case that q is smaller than qr
58!
59! 1115 2013-03-26 18:16:16Z hoffmann
60! drizzle can be used independently from precipitation
61!
62! 1053 2012-11-13 17:11:03Z hoffmann
63! description expanded to the two-moment cloud scheme
64!
65! 1036 2012-10-22 13:43:42Z raasch
66! code put under GPL (PALM 3.9)
67!
68! Revision 1.1  2000/04/13 14:50:45  schroeter
69! Initial revision
70!
71!
72!
73! Description:
74! ------------
75!> Calculation of the liquid water content (0%-or-100%-scheme). This scheme is
76!> used by the one and the two moment cloud physics scheme. Using the two moment
77!> scheme, this calculation results in the cloud water content.
78!------------------------------------------------------------------------------!
79 SUBROUTINE calc_liquid_water_content
80 
81
82
83    USE arrays_3d,                                                             &
84        ONLY:  hyp, pt, q, qc, ql, qr
85
86    USE cloud_parameters,                                                      &
87        ONLY:  l_d_cp, l_d_r, t_d_pt
88
89    USE control_parameters,                                                    &
90        ONLY:  microphysics_morrison, microphysics_seifert
91
92    USE indices,                                                               &
93        ONLY:  nxlg, nxrg, nyng, nysg, nzb, nzt, wall_flags_0
94
95    USE kinds
96
97    USE pegrid
98
99
100    IMPLICIT NONE
101
102    INTEGER(iwp) ::  i !<
103    INTEGER(iwp) ::  j !<
104    INTEGER(iwp) ::  k !<
105
106    REAL(wp) ::  alpha !<
107    REAL(wp) ::  e_s   !<
108    REAL(wp) ::  q_s   !<
109    REAL(wp) ::  t_l   !<
110
111    DO  i = nxlg, nxrg
112       DO  j = nysg, nyng
113          DO  k = nzb+1, nzt
114
115!
116!--          Compute the liquid water temperature
117             t_l = t_d_pt(k) * pt(k,j,i)
118
119!
120!--          Compute saturation water vapor pressure at t_l
121             e_s = 610.78_wp * EXP( 17.269_wp * ( t_l - 273.16_wp ) /          &
122                                                ( t_l - 35.86_wp ) )
123
124!
125!--          Compute approximation of saturation humidity
126             q_s = 0.622_wp * e_s / ( hyp(k) - 0.378_wp * e_s )
127
128!
129!--          Correction factor
130             alpha = 0.622_wp * l_d_r * l_d_cp / ( t_l * t_l )
131
132!
133!--          Correction of the approximated value
134!--          (see: Cuijpers + Duynkerke, 1993, JAS, 23)
135             q_s = q_s * ( 1.0_wp + alpha * q(k,j,i) ) / ( 1.0_wp + alpha * q_s )
136
137!
138!--          Compute the liquid water content
139             IF ( microphysics_seifert  .AND.  .NOT. microphysics_morrison )   &
140             THEN
141                IF ( ( q(k,j,i) - q_s - qr(k,j,i) ) > 0.0_wp )  THEN
142                   qc(k,j,i) = ( q(k,j,i) - q_s - qr(k,j,i) )                  &
143                                      * MERGE( 1.0_wp, 0.0_wp,                 &
144                                               BTEST( wall_flags_0(k,j,i), 0 ) )
145                   ql(k,j,i) = ( qc(k,j,i) + qr(k,j,i) )                       &
146                                      * MERGE( 1.0_wp, 0.0_wp,                 &
147                                               BTEST( wall_flags_0(k,j,i), 0 ) )
148                ELSE
149                   IF ( q(k,j,i) < qr(k,j,i) )  q(k,j,i) = qr(k,j,i)
150                   qc(k,j,i) = 0.0_wp 
151                   ql(k,j,i) = qr(k,j,i)                                       &
152                                      * MERGE( 1.0_wp, 0.0_wp,                 &
153                                               BTEST( wall_flags_0(k,j,i), 0 ) )
154                ENDIF
155             ELSEIF ( microphysics_morrison )  THEN
156                ql(k,j,i) = qc(k,j,i) + qr(k,j,i)                              &
157                                      * MERGE( 1.0_wp, 0.0_wp,                 &
158                                               BTEST( wall_flags_0(k,j,i), 0 ) )
159             ELSE
160                IF ( ( q(k,j,i) - q_s ) > 0.0_wp )  THEN
161                   qc(k,j,i) = ( q(k,j,i) - q_s )                              &
162                                      * MERGE( 1.0_wp, 0.0_wp,                 &
163                                               BTEST( wall_flags_0(k,j,i), 0 ) )
164                   ql(k,j,i) = qc(k,j,i)                                       &
165                                      * MERGE( 1.0_wp, 0.0_wp,                 &
166                                               BTEST( wall_flags_0(k,j,i), 0 ) )
167                ELSE
168                   qc(k,j,i) = 0.0_wp
169                   ql(k,j,i) = 0.0_wp
170                ENDIF
171             ENDIF
172          ENDDO
173       ENDDO
174    ENDDO
175   
176 END SUBROUTINE calc_liquid_water_content
Note: See TracBrowser for help on using the repository browser.