[1682] | 1 | !> @file calc_liquid_water_content.f90 |
---|
[1036] | 2 | !--------------------------------------------------------------------------------! |
---|
| 3 | ! This file is part of PALM. |
---|
| 4 | ! |
---|
| 5 | ! PALM is free software: you can redistribute it and/or modify it under the terms |
---|
| 6 | ! of the GNU General Public License as published by the Free Software Foundation, |
---|
| 7 | ! either version 3 of the License, or (at your option) any later version. |
---|
| 8 | ! |
---|
| 9 | ! PALM is distributed in the hope that it will be useful, but WITHOUT ANY |
---|
| 10 | ! WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR |
---|
| 11 | ! A PARTICULAR PURPOSE. See the GNU General Public License for more details. |
---|
| 12 | ! |
---|
| 13 | ! You should have received a copy of the GNU General Public License along with |
---|
| 14 | ! PALM. If not, see <http://www.gnu.org/licenses/>. |
---|
| 15 | ! |
---|
[1310] | 16 | ! Copyright 1997-2014 Leibniz Universitaet Hannover |
---|
[1036] | 17 | !--------------------------------------------------------------------------------! |
---|
| 18 | ! |
---|
[484] | 19 | ! Current revisions: |
---|
[1] | 20 | ! ----------------- |
---|
[1354] | 21 | ! |
---|
[1683] | 22 | ! |
---|
[1321] | 23 | ! Former revisions: |
---|
| 24 | ! ----------------- |
---|
| 25 | ! $Id: calc_liquid_water_content.f90 1683 2015-10-07 23:57:51Z gronemeier $ |
---|
| 26 | ! |
---|
[1683] | 27 | ! 1682 2015-10-07 23:56:08Z knoop |
---|
| 28 | ! Code annotations made doxygen readable |
---|
| 29 | ! |
---|
[1354] | 30 | ! 1353 2014-04-08 15:21:23Z heinze |
---|
| 31 | ! REAL constants provided with KIND-attribute |
---|
| 32 | ! |
---|
[1321] | 33 | ! 1320 2014-03-20 08:40:49Z raasch |
---|
[1320] | 34 | ! ONLY-attribute added to USE-statements, |
---|
| 35 | ! kind-parameters added to all INTEGER and REAL declaration statements, |
---|
| 36 | ! kinds are defined in new module kinds, |
---|
| 37 | ! revision history before 2012 removed, |
---|
| 38 | ! comment fields (!:) to be used for variable explanations added to |
---|
| 39 | ! all variable declaration statements |
---|
[1] | 40 | ! |
---|
[1254] | 41 | ! 1253 2013-11-07 10:48:12Z fricke |
---|
| 42 | ! Bugfix: q is set to qr in case that q is smaller than qr |
---|
| 43 | ! |
---|
[1116] | 44 | ! 1115 2013-03-26 18:16:16Z hoffmann |
---|
| 45 | ! drizzle can be used independently from precipitation |
---|
| 46 | ! |
---|
[1054] | 47 | ! 1053 2012-11-13 17:11:03Z hoffmann |
---|
| 48 | ! description expanded to the two-moment cloud scheme |
---|
| 49 | ! |
---|
[1037] | 50 | ! 1036 2012-10-22 13:43:42Z raasch |
---|
| 51 | ! code put under GPL (PALM 3.9) |
---|
| 52 | ! |
---|
[1] | 53 | ! Revision 1.1 2000/04/13 14:50:45 schroeter |
---|
| 54 | ! Initial revision |
---|
| 55 | ! |
---|
| 56 | ! |
---|
| 57 | ! |
---|
| 58 | ! Description: |
---|
| 59 | ! ------------ |
---|
[1682] | 60 | !> Calculation of the liquid water content (0%-or-100%-scheme). This scheme is |
---|
| 61 | !> used by the one and the two moment cloud physics scheme. Using the two moment |
---|
| 62 | !> scheme, this calculation results in the cloud water content. |
---|
[1] | 63 | !------------------------------------------------------------------------------! |
---|
[1682] | 64 | SUBROUTINE calc_liquid_water_content |
---|
| 65 | |
---|
[1] | 66 | |
---|
| 67 | |
---|
[1320] | 68 | USE arrays_3d, & |
---|
| 69 | ONLY: hyp, pt, q, qc, ql, qr |
---|
| 70 | |
---|
| 71 | USE cloud_parameters, & |
---|
| 72 | ONLY: l_d_cp, l_d_r, t_d_pt |
---|
| 73 | |
---|
| 74 | USE control_parameters, & |
---|
| 75 | ONLY: icloud_scheme, precipitation |
---|
| 76 | |
---|
| 77 | USE indices, & |
---|
| 78 | ONLY: nxlg, nxrg, nyng, nysg, nzb_s_inner, nzt |
---|
| 79 | |
---|
| 80 | USE kinds |
---|
| 81 | |
---|
[1] | 82 | USE pegrid |
---|
| 83 | |
---|
[1320] | 84 | |
---|
[1] | 85 | IMPLICIT NONE |
---|
| 86 | |
---|
[1682] | 87 | INTEGER(iwp) :: i !< |
---|
| 88 | INTEGER(iwp) :: j !< |
---|
| 89 | INTEGER(iwp) :: k !< |
---|
[1] | 90 | |
---|
[1682] | 91 | REAL(wp) :: alpha !< |
---|
| 92 | REAL(wp) :: e_s !< |
---|
| 93 | REAL(wp) :: q_s !< |
---|
| 94 | REAL(wp) :: t_l !< |
---|
[1] | 95 | |
---|
[667] | 96 | DO i = nxlg, nxrg |
---|
| 97 | DO j = nysg, nyng |
---|
[1115] | 98 | DO k = nzb_s_inner(j,i)+1, nzt |
---|
[1] | 99 | |
---|
| 100 | ! |
---|
| 101 | !-- Compute the liquid water temperature |
---|
| 102 | t_l = t_d_pt(k) * pt(k,j,i) |
---|
| 103 | |
---|
| 104 | ! |
---|
| 105 | !-- Compute saturation water vapor pressure at t_l |
---|
[1353] | 106 | e_s = 610.78_wp * EXP( 17.269_wp * ( t_l - 273.16_wp ) / & |
---|
| 107 | ( t_l - 35.86_wp ) ) |
---|
[1] | 108 | |
---|
| 109 | ! |
---|
| 110 | !-- Compute approximation of saturation humidity |
---|
[1353] | 111 | q_s = 0.622_wp * e_s / ( hyp(k) - 0.378_wp * e_s ) |
---|
[1] | 112 | |
---|
| 113 | ! |
---|
| 114 | !-- Correction factor |
---|
[1353] | 115 | alpha = 0.622_wp * l_d_r * l_d_cp / ( t_l * t_l ) |
---|
[1] | 116 | |
---|
| 117 | ! |
---|
| 118 | !-- Correction of the approximated value |
---|
| 119 | !-- (see: Cuijpers + Duynkerke, 1993, JAS, 23) |
---|
[1353] | 120 | q_s = q_s * ( 1.0_wp + alpha * q(k,j,i) ) / ( 1.0_wp + alpha * q_s ) |
---|
[1] | 121 | |
---|
| 122 | ! |
---|
| 123 | !-- Compute the liquid water content |
---|
[1115] | 124 | IF ( icloud_scheme == 0 .AND. precipitation) THEN |
---|
[1353] | 125 | IF ( ( q(k,j,i) - q_s - qr(k,j,i) ) > 0.0_wp ) THEN |
---|
[1115] | 126 | qc(k,j,i) = q(k,j,i) - q_s - qr(k,j,i) |
---|
| 127 | ql(k,j,i) = qc(k,j,i) + qr(k,j,i) |
---|
| 128 | ELSE |
---|
[1253] | 129 | IF ( q(k,j,i) < qr(k,j,i) ) q(k,j,i) = qr(k,j,i) |
---|
[1353] | 130 | qc(k,j,i) = 0.0_wp |
---|
[1115] | 131 | ql(k,j,i) = qr(k,j,i) |
---|
| 132 | ENDIF |
---|
| 133 | ELSEIF ( icloud_scheme == 0 .AND. .NOT. precipitation ) THEN |
---|
[1353] | 134 | IF ( ( q(k,j,i) - q_s ) > 0.0_wp ) THEN |
---|
[1115] | 135 | qc(k,j,i) = q(k,j,i) - q_s |
---|
| 136 | ql(k,j,i) = qc(k,j,i) |
---|
| 137 | ELSE |
---|
[1353] | 138 | qc(k,j,i) = 0.0_wp |
---|
| 139 | ql(k,j,i) = 0.0_wp |
---|
[1115] | 140 | ENDIF |
---|
[1] | 141 | ELSE |
---|
[1353] | 142 | IF ( ( q(k,j,i) - q_s ) > 0.0_wp ) THEN |
---|
[1115] | 143 | ql(k,j,i) = q(k,j,i) - q_s |
---|
| 144 | ELSE |
---|
[1353] | 145 | ql(k,j,i) = 0.0_wp |
---|
[1115] | 146 | ENDIF |
---|
[1] | 147 | ENDIF |
---|
| 148 | ENDDO |
---|
| 149 | ENDDO |
---|
| 150 | ENDDO |
---|
| 151 | |
---|
| 152 | END SUBROUTINE calc_liquid_water_content |
---|