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

Last change on this file since 2675 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
RevLine 
[1682]1!> @file calc_liquid_water_content.f90
[2000]2!------------------------------------------------------------------------------!
[1036]3! This file is part of PALM.
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!
[2101]17! Copyright 1997-2017 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 2608 2017-11-13 14:04:26Z basit $
[2608]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
[2292]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
[1321]37!
[2233]38! 2232 2017-05-30 17:47:52Z suehring
39! Adjustments to new topography concept
40!
[2001]41! 2000 2016-08-20 18:09:15Z knoop
42! Forced header and separation lines into 80 columns
43!
[1823]44! 1822 2016-04-07 07:49:42Z hoffmann
45! icloud_scheme removed. microphysics_seifert added.
46!
[1683]47! 1682 2015-10-07 23:56:08Z knoop
48! Code annotations made doxygen readable
49!
[1354]50! 1353 2014-04-08 15:21:23Z heinze
51! REAL constants provided with KIND-attribute
52!
[1321]53! 1320 2014-03-20 08:40:49Z raasch
[1320]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
[1]60!
[1254]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!
[1116]64! 1115 2013-03-26 18:16:16Z hoffmann
65! drizzle can be used independently from precipitation
66!
[1054]67! 1053 2012-11-13 17:11:03Z hoffmann
68! description expanded to the two-moment cloud scheme
69!
[1037]70! 1036 2012-10-22 13:43:42Z raasch
71! code put under GPL (PALM 3.9)
72!
[1]73! Revision 1.1  2000/04/13 14:50:45  schroeter
74! Initial revision
75!
76!
77!
78! Description:
79! ------------
[1682]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.
[1]83!------------------------------------------------------------------------------!
[1682]84 SUBROUTINE calc_liquid_water_content
85 
[1]86
87
[1320]88    USE arrays_3d,                                                             &
[2608]89        ONLY:  q, qc, ql, qr
[1320]90
91    USE control_parameters,                                                    &
[2292]92        ONLY:  microphysics_morrison, microphysics_seifert
[1320]93
[2608]94    USE diagnostic_quantities_mod,                                             &
95        ONLY:  e_s, magnus, q_s, sat, supersaturation, t_l
96
[1320]97    USE indices,                                                               &
[2232]98        ONLY:  nxlg, nxrg, nyng, nysg, nzb, nzt, wall_flags_0
[1320]99
100    USE kinds
101
[1]102    USE pegrid
103
[1320]104
[1]105    IMPLICIT NONE
106
[1682]107    INTEGER(iwp) ::  i !<
108    INTEGER(iwp) ::  j !<
109    INTEGER(iwp) ::  k !<
[1]110
111
[667]112    DO  i = nxlg, nxrg
113       DO  j = nysg, nyng
[2232]114          DO  k = nzb+1, nzt
[1]115
116!
[2608]117!--          Call calculation of supersaturation located
118!--          in diagnostic_quantities_mod
119             CALL supersaturation ( i, j, k )
[1]120
121!
122!--          Compute the liquid water content
[2292]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
[2232]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 ) )
[1115]132                ELSE
[1253]133                   IF ( q(k,j,i) < qr(k,j,i) )  q(k,j,i) = qr(k,j,i)
[1353]134                   qc(k,j,i) = 0.0_wp 
[2232]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 ) )
[1115]138                ENDIF
[2292]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 ) )
[1822]143             ELSE
[2292]144                IF ( ( q(k,j,i) - q_s ) > 0.0_wp )  THEN
[2232]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 ) )
[1115]151                ELSE
[1822]152                   qc(k,j,i) = 0.0_wp
[1353]153                   ql(k,j,i) = 0.0_wp
[1115]154                ENDIF
[1]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.