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

Last change on this file since 2716 was 2716, checked in by kanani, 6 years ago

Correction of "Former revisions" section

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