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