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

Last change on this file since 3196 was 3026, checked in by schwenkel, 6 years ago

Changed the name specific humidity to mixing ratio

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