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

Last change on this file since 3272 was 3241, checked in by raasch, 6 years ago

various changes to avoid compiler warnings (mainly removal of unused variables)

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