source: palm/trunk/SOURCE/diagnostic_quantities_mod.f90 @ 3013

Last change on this file since 3013 was 2839, checked in by schwenkel, 7 years ago

Bugfix for Kessler microphysics

  • Property svn:keywords set to Id
File size: 4.6 KB
RevLine 
[2608]1!> @file diagnostic_quantities_mod.f90
2!------------------------------------------------------------------------------!
[2696]3! This file is part of the PALM model system.
[2608]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!
[2718]17! Copyright 1997-2018 Leibniz Universitaet Hannover
[2608]18!------------------------------------------------------------------------------!
19!
20! Current revisions:
21! -----------------
22!
23!
24! Former revisions:
25! -----------------!
26! $Id: diagnostic_quantities_mod.f90 2839 2018-02-27 09:49:06Z Giersch $
[2839]27! Bugfix for Kessler microphysics
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! Initial revision
37!
38!
39! Description:
40! ------------
41!> This module contains subroutines and functions for the calculation of
42!> diagnostic quantities. Especially moisture quantities such as the saturation
43!> mixining ratio is calculated
44!------------------------------------------------------------------------------!
45MODULE diagnostic_quantities_mod
46 
47
48   USE kinds
49   
50   IMPLICIT NONE
51
52   REAL(wp) ::  alpha   !< correction factor
53   REAL(wp) ::  e_s     !< saturation water vapor pressure
54   REAL(wp) ::  q_s     !< saturation mixing ratio
55   REAL(wp) ::  sat     !< supersaturation
56   REAL(wp) ::  t_l     !< actual temperature
57
58   PRIVATE
59   PUBLIC  e_s, magnus, q_s, sat, supersaturation, t_l
60
61    INTERFACE supersaturation
62       MODULE PROCEDURE supersaturation
63    END INTERFACE supersaturation
64
65 CONTAINS
66 
67!------------------------------------------------------------------------------!
68! Description:
69! ------------
70!> Computation of the diagnostic supersaturation sat, actual temperature t_l
71!< and saturation water vapor mixing ratio q_
72!------------------------------------------------------------------------------!
73    SUBROUTINE supersaturation ( i,j,k )
74
75       USE arrays_3d,                                                          &
76           ONLY:  hyp, pt, q, qc, qr
77
78       USE cloud_parameters,                                                   &
[2839]79           ONLY:  l_d_cp, l_d_r, t_d_pt       
[2608]80
[2839]81       USE control_parameters,                                                 &
82           ONLY:  microphysics_kessler                                       
83
[2608]84       IMPLICIT NONE
85
86       INTEGER(iwp) ::  i                 !<
87       INTEGER(iwp) ::  j                 !<
88       INTEGER(iwp) ::  k                 !<
89!
90!--    Actual liquid water temperature:
91       t_l = t_d_pt(k) * pt(k,j,i)
92!
93!--    Calculate water vapor saturation pressure
94       e_s = magnus( t_l )
95!
96!--    Computation of saturation humidity:
97       q_s   = 0.622_wp * e_s / ( hyp(k) - e_s )
98!
99!--    Correction factor
100       alpha = 0.622_wp * l_d_r * l_d_cp / ( t_l * t_l )
101!
102!--    Correction of the approximated value
103!--    (see: Cuijpers + Duynkerke, 1993, JAS, 23)
104       q_s   = q_s * ( 1.0_wp + alpha * q(k,j,i) ) / ( 1.0_wp + alpha * q_s )
[2839]105
[2608]106!
107!--    Supersaturation:
[2839]108!--    Not in case of microphysics_kessler since qr is unallocated
109       IF ( .NOT. microphysics_kessler ) THEN
110          sat   = ( q(k,j,i) - qr(k,j,i) - qc(k,j,i) ) / q_s - 1.0_wp
111       ENDIF
[2608]112
113    END SUBROUTINE supersaturation
114
115 
116!------------------------------------------------------------------------------!
117! Description:
118! ------------
119!> This function computes the magnus function (Press et al., 1992).
120!> The magnus formula is needed to calculate the saturation vapor pressure
121!------------------------------------------------------------------------------!
122
123    FUNCTION magnus( temperature )
124
125       IMPLICIT NONE
126
127       REAL(wp)     ::  magnus            !<
128       REAL(wp)     ::  temperature       !<
129
130!
131!--    Saturation vapor pressure at t_l:
132       magnus =  611.2_wp * EXP( 17.62_wp * ( temperature - 273.15_wp ) /      & 
133                                            ( temperature - 29.65_wp  ) )
134
135!        magnus = 610.78_wp * EXP( 17.269_wp * ( temperature - 273.16_wp ) /     &
136!                                              ( temperature - 35.86_wp )        &
137!                                )
138
139    END FUNCTION magnus
140
141
142END MODULE diagnostic_quantities_mod
Note: See TracBrowser for help on using the repository browser.