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