[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 2233 2017-05-30 18:08:54Z sward $ |
---|
| 27 | ! |
---|
[2233] | 28 | ! 2232 2017-05-30 17:47:52Z suehring |
---|
| 29 | ! Adjustments to new topography concept |
---|
| 30 | ! |
---|
[2001] | 31 | ! 2000 2016-08-20 18:09:15Z knoop |
---|
| 32 | ! Forced header and separation lines into 80 columns |
---|
| 33 | ! |
---|
[1823] | 34 | ! 1822 2016-04-07 07:49:42Z hoffmann |
---|
| 35 | ! icloud_scheme removed. microphysics_seifert added. |
---|
| 36 | ! |
---|
[1683] | 37 | ! 1682 2015-10-07 23:56:08Z knoop |
---|
| 38 | ! Code annotations made doxygen readable |
---|
| 39 | ! |
---|
[1354] | 40 | ! 1353 2014-04-08 15:21:23Z heinze |
---|
| 41 | ! REAL constants provided with KIND-attribute |
---|
| 42 | ! |
---|
[1321] | 43 | ! 1320 2014-03-20 08:40:49Z raasch |
---|
[1320] | 44 | ! ONLY-attribute added to USE-statements, |
---|
| 45 | ! kind-parameters added to all INTEGER and REAL declaration statements, |
---|
| 46 | ! kinds are defined in new module kinds, |
---|
| 47 | ! revision history before 2012 removed, |
---|
| 48 | ! comment fields (!:) to be used for variable explanations added to |
---|
| 49 | ! all variable declaration statements |
---|
[1] | 50 | ! |
---|
[1254] | 51 | ! 1253 2013-11-07 10:48:12Z fricke |
---|
| 52 | ! Bugfix: q is set to qr in case that q is smaller than qr |
---|
| 53 | ! |
---|
[1116] | 54 | ! 1115 2013-03-26 18:16:16Z hoffmann |
---|
| 55 | ! drizzle can be used independently from precipitation |
---|
| 56 | ! |
---|
[1054] | 57 | ! 1053 2012-11-13 17:11:03Z hoffmann |
---|
| 58 | ! description expanded to the two-moment cloud scheme |
---|
| 59 | ! |
---|
[1037] | 60 | ! 1036 2012-10-22 13:43:42Z raasch |
---|
| 61 | ! code put under GPL (PALM 3.9) |
---|
| 62 | ! |
---|
[1] | 63 | ! Revision 1.1 2000/04/13 14:50:45 schroeter |
---|
| 64 | ! Initial revision |
---|
| 65 | ! |
---|
| 66 | ! |
---|
| 67 | ! |
---|
| 68 | ! Description: |
---|
| 69 | ! ------------ |
---|
[1682] | 70 | !> Calculation of the liquid water content (0%-or-100%-scheme). This scheme is |
---|
| 71 | !> used by the one and the two moment cloud physics scheme. Using the two moment |
---|
| 72 | !> scheme, this calculation results in the cloud water content. |
---|
[1] | 73 | !------------------------------------------------------------------------------! |
---|
[1682] | 74 | SUBROUTINE calc_liquid_water_content |
---|
| 75 | |
---|
[1] | 76 | |
---|
| 77 | |
---|
[1320] | 78 | USE arrays_3d, & |
---|
| 79 | ONLY: hyp, pt, q, qc, ql, qr |
---|
| 80 | |
---|
| 81 | USE cloud_parameters, & |
---|
| 82 | ONLY: l_d_cp, l_d_r, t_d_pt |
---|
| 83 | |
---|
| 84 | USE control_parameters, & |
---|
[1822] | 85 | ONLY: microphysics_seifert |
---|
[1320] | 86 | |
---|
| 87 | USE indices, & |
---|
[2232] | 88 | ONLY: nxlg, nxrg, nyng, nysg, nzb, nzt, wall_flags_0 |
---|
[1320] | 89 | |
---|
| 90 | USE kinds |
---|
| 91 | |
---|
[1] | 92 | USE pegrid |
---|
| 93 | |
---|
[1320] | 94 | |
---|
[1] | 95 | IMPLICIT NONE |
---|
| 96 | |
---|
[1682] | 97 | INTEGER(iwp) :: i !< |
---|
| 98 | INTEGER(iwp) :: j !< |
---|
| 99 | INTEGER(iwp) :: k !< |
---|
[1] | 100 | |
---|
[1682] | 101 | REAL(wp) :: alpha !< |
---|
| 102 | REAL(wp) :: e_s !< |
---|
| 103 | REAL(wp) :: q_s !< |
---|
| 104 | REAL(wp) :: t_l !< |
---|
[1] | 105 | |
---|
[667] | 106 | DO i = nxlg, nxrg |
---|
| 107 | DO j = nysg, nyng |
---|
[2232] | 108 | DO k = nzb+1, nzt |
---|
[1] | 109 | |
---|
| 110 | ! |
---|
| 111 | !-- Compute the liquid water temperature |
---|
| 112 | t_l = t_d_pt(k) * pt(k,j,i) |
---|
| 113 | |
---|
| 114 | ! |
---|
| 115 | !-- Compute saturation water vapor pressure at t_l |
---|
[1353] | 116 | e_s = 610.78_wp * EXP( 17.269_wp * ( t_l - 273.16_wp ) / & |
---|
| 117 | ( t_l - 35.86_wp ) ) |
---|
[1] | 118 | |
---|
| 119 | ! |
---|
| 120 | !-- Compute approximation of saturation humidity |
---|
[1353] | 121 | q_s = 0.622_wp * e_s / ( hyp(k) - 0.378_wp * e_s ) |
---|
[1] | 122 | |
---|
| 123 | ! |
---|
| 124 | !-- Correction factor |
---|
[1353] | 125 | alpha = 0.622_wp * l_d_r * l_d_cp / ( t_l * t_l ) |
---|
[1] | 126 | |
---|
| 127 | ! |
---|
| 128 | !-- Correction of the approximated value |
---|
| 129 | !-- (see: Cuijpers + Duynkerke, 1993, JAS, 23) |
---|
[1353] | 130 | q_s = q_s * ( 1.0_wp + alpha * q(k,j,i) ) / ( 1.0_wp + alpha * q_s ) |
---|
[1] | 131 | |
---|
| 132 | ! |
---|
| 133 | !-- Compute the liquid water content |
---|
[1822] | 134 | IF ( microphysics_seifert ) THEN |
---|
[1353] | 135 | IF ( ( q(k,j,i) - q_s - qr(k,j,i) ) > 0.0_wp ) THEN |
---|
[2232] | 136 | qc(k,j,i) = ( q(k,j,i) - q_s - qr(k,j,i) ) & |
---|
| 137 | * MERGE( 1.0_wp, 0.0_wp, & |
---|
| 138 | BTEST( wall_flags_0(k,j,i), 0 ) ) |
---|
| 139 | ql(k,j,i) = ( qc(k,j,i) + qr(k,j,i) ) & |
---|
| 140 | * MERGE( 1.0_wp, 0.0_wp, & |
---|
| 141 | BTEST( wall_flags_0(k,j,i), 0 ) ) |
---|
[1115] | 142 | ELSE |
---|
[1253] | 143 | IF ( q(k,j,i) < qr(k,j,i) ) q(k,j,i) = qr(k,j,i) |
---|
[1353] | 144 | qc(k,j,i) = 0.0_wp |
---|
[2232] | 145 | ql(k,j,i) = qr(k,j,i) & |
---|
| 146 | * MERGE( 1.0_wp, 0.0_wp, & |
---|
| 147 | BTEST( wall_flags_0(k,j,i), 0 ) ) |
---|
[1115] | 148 | ENDIF |
---|
[1822] | 149 | ELSE |
---|
[1353] | 150 | IF ( ( q(k,j,i) - q_s ) > 0.0_wp ) THEN |
---|
[2232] | 151 | qc(k,j,i) = ( q(k,j,i) - q_s ) & |
---|
| 152 | * MERGE( 1.0_wp, 0.0_wp, & |
---|
| 153 | BTEST( wall_flags_0(k,j,i), 0 ) ) |
---|
| 154 | ql(k,j,i) = qc(k,j,i) & |
---|
| 155 | * MERGE( 1.0_wp, 0.0_wp, & |
---|
| 156 | BTEST( wall_flags_0(k,j,i), 0 ) ) |
---|
[1115] | 157 | ELSE |
---|
[1822] | 158 | qc(k,j,i) = 0.0_wp |
---|
[1353] | 159 | ql(k,j,i) = 0.0_wp |
---|
[1115] | 160 | ENDIF |
---|
[1] | 161 | ENDIF |
---|
| 162 | ENDDO |
---|
| 163 | ENDDO |
---|
| 164 | ENDDO |
---|
| 165 | |
---|
| 166 | END SUBROUTINE calc_liquid_water_content |
---|