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

Last change on this file since 3170 was 2719, checked in by maronga, 7 years ago

bugfix for last commit

  • Property svn:keywords set to Id
File size: 6.2 KB
RevLine 
[1682]1!> @file calc_liquid_water_content.f90
[2000]2!------------------------------------------------------------------------------!
[2696]3! This file is part of the PALM model system.
[1036]4!
[2000]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.
[1036]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!
[2718]17! Copyright 1997-2018 Leibniz Universitaet Hannover
[2000]18!------------------------------------------------------------------------------!
[1036]19!
[484]20! Current revisions:
[1]21! -----------------
[1354]22!
[2233]23!
[1321]24! Former revisions:
25! -----------------
26! $Id: calc_liquid_water_content.f90 2719 2018-01-02 09:02:06Z suehring $
[2719]27! Bugfix for last change.
28!
29! 2718 2018-01-02 08:49:38Z maronga
[2716]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
[2608]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
[2292]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
[1321]46!
[2233]47! 2232 2017-05-30 17:47:52Z suehring
48! Adjustments to new topography concept
49!
[2001]50! 2000 2016-08-20 18:09:15Z knoop
51! Forced header and separation lines into 80 columns
52!
[1823]53! 1822 2016-04-07 07:49:42Z hoffmann
54! icloud_scheme removed. microphysics_seifert added.
55!
[1683]56! 1682 2015-10-07 23:56:08Z knoop
57! Code annotations made doxygen readable
58!
[1354]59! 1353 2014-04-08 15:21:23Z heinze
60! REAL constants provided with KIND-attribute
61!
[1321]62! 1320 2014-03-20 08:40:49Z raasch
[1320]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
[1]69!
[1254]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!
[1116]73! 1115 2013-03-26 18:16:16Z hoffmann
74! drizzle can be used independently from precipitation
75!
[1054]76! 1053 2012-11-13 17:11:03Z hoffmann
77! description expanded to the two-moment cloud scheme
78!
[1037]79! 1036 2012-10-22 13:43:42Z raasch
80! code put under GPL (PALM 3.9)
81!
[1]82! Revision 1.1  2000/04/13 14:50:45  schroeter
83! Initial revision
84!
85!
86!
87! Description:
88! ------------
[1682]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.
[1]92!------------------------------------------------------------------------------!
[1682]93 SUBROUTINE calc_liquid_water_content
94 
[1]95
96
[1320]97    USE arrays_3d,                                                             &
[2608]98        ONLY:  q, qc, ql, qr
[1320]99
100    USE control_parameters,                                                    &
[2292]101        ONLY:  microphysics_morrison, microphysics_seifert
[1320]102
[2608]103    USE diagnostic_quantities_mod,                                             &
104        ONLY:  e_s, magnus, q_s, sat, supersaturation, t_l
105
[1320]106    USE indices,                                                               &
[2232]107        ONLY:  nxlg, nxrg, nyng, nysg, nzb, nzt, wall_flags_0
[1320]108
109    USE kinds
110
[1]111    USE pegrid
112
[1320]113
[1]114    IMPLICIT NONE
115
[1682]116    INTEGER(iwp) ::  i !<
117    INTEGER(iwp) ::  j !<
118    INTEGER(iwp) ::  k !<
[1]119
120
[667]121    DO  i = nxlg, nxrg
122       DO  j = nysg, nyng
[2232]123          DO  k = nzb+1, nzt
[1]124
125!
[2608]126!--          Call calculation of supersaturation located
127!--          in diagnostic_quantities_mod
128             CALL supersaturation ( i, j, k )
[1]129
130!
131!--          Compute the liquid water content
[2292]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
[2232]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 ) )
[1115]141                ELSE
[1253]142                   IF ( q(k,j,i) < qr(k,j,i) )  q(k,j,i) = qr(k,j,i)
[1353]143                   qc(k,j,i) = 0.0_wp 
[2232]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 ) )
[1115]147                ENDIF
[2292]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 ) )
[1822]152             ELSE
[2292]153                IF ( ( q(k,j,i) - q_s ) > 0.0_wp )  THEN
[2232]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 ) )
[1115]160                ELSE
[1822]161                   qc(k,j,i) = 0.0_wp
[1353]162                   ql(k,j,i) = 0.0_wp
[1115]163                ENDIF
[1]164             ENDIF
165          ENDDO
166       ENDDO
167    ENDDO
168   
169 END SUBROUTINE calc_liquid_water_content
Note: See TracBrowser for help on using the repository browser.