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

Last change on this file since 2629 was 2608, checked in by schwenkel, 7 years ago

Inital revision of diagnostic_quantities_mod allows unified calculation of magnus equation and saturion mixing ratio

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