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

Last change on this file since 2809 was 2718, checked in by maronga, 7 years ago

deleting of deprecated files; headers updated where needed

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