[1682] | 1 | !> @file calc_liquid_water_content.f90 |
---|
[2000] | 2 | !------------------------------------------------------------------------------! |
---|
[2696] | 3 | ! This file is part of the PALM model system. |
---|
[1036] | 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 | ! |
---|
[2718] | 17 | ! Copyright 1997-2018 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 3241 2018-09-12 15:02:00Z knoop $ |
---|
[3241] | 27 | ! unused variables removed |
---|
| 28 | ! |
---|
| 29 | ! 2719 2018-01-02 09:02:06Z maronga |
---|
[2719] | 30 | ! Bugfix for last change. |
---|
| 31 | ! |
---|
| 32 | ! 2718 2018-01-02 08:49:38Z maronga |
---|
[2716] | 33 | ! Corrected "Former revisions" section |
---|
| 34 | ! |
---|
| 35 | ! 2696 2017-12-14 17:12:51Z kanani |
---|
| 36 | ! Change in file header (GPL part) |
---|
| 37 | ! |
---|
| 38 | ! 2608 2017-11-13 14:04:26Z schwenkel |
---|
[2608] | 39 | ! Calculation of supersaturation in external module (diagnostic_quantities_mod). |
---|
| 40 | ! Change: correct calculation of saturation specific humidity to saturation |
---|
| 41 | ! mixing ratio (the factor of 0.378 vanishes). |
---|
| 42 | ! |
---|
| 43 | ! 2292 2017-06-20 09:51:42Z schwenkel |
---|
[2292] | 44 | ! Implementation of new microphysic scheme: cloud_scheme = 'morrison' |
---|
| 45 | ! includes two more prognostic equations for cloud drop concentration (nc) |
---|
| 46 | ! and cloud water content (qc). |
---|
| 47 | ! |
---|
| 48 | ! 2233 2017-05-30 18:08:54Z suehring |
---|
[1321] | 49 | ! |
---|
[2233] | 50 | ! 2232 2017-05-30 17:47:52Z suehring |
---|
| 51 | ! Adjustments to new topography concept |
---|
| 52 | ! |
---|
[2001] | 53 | ! 2000 2016-08-20 18:09:15Z knoop |
---|
| 54 | ! Forced header and separation lines into 80 columns |
---|
| 55 | ! |
---|
[1823] | 56 | ! 1822 2016-04-07 07:49:42Z hoffmann |
---|
| 57 | ! icloud_scheme removed. microphysics_seifert added. |
---|
| 58 | ! |
---|
[1683] | 59 | ! 1682 2015-10-07 23:56:08Z knoop |
---|
| 60 | ! Code annotations made doxygen readable |
---|
| 61 | ! |
---|
[1354] | 62 | ! 1353 2014-04-08 15:21:23Z heinze |
---|
| 63 | ! REAL constants provided with KIND-attribute |
---|
| 64 | ! |
---|
[1321] | 65 | ! 1320 2014-03-20 08:40:49Z raasch |
---|
[1320] | 66 | ! ONLY-attribute added to USE-statements, |
---|
| 67 | ! kind-parameters added to all INTEGER and REAL declaration statements, |
---|
| 68 | ! kinds are defined in new module kinds, |
---|
| 69 | ! revision history before 2012 removed, |
---|
| 70 | ! comment fields (!:) to be used for variable explanations added to |
---|
| 71 | ! all variable declaration statements |
---|
[1] | 72 | ! |
---|
[1254] | 73 | ! 1253 2013-11-07 10:48:12Z fricke |
---|
| 74 | ! Bugfix: q is set to qr in case that q is smaller than qr |
---|
| 75 | ! |
---|
[1116] | 76 | ! 1115 2013-03-26 18:16:16Z hoffmann |
---|
| 77 | ! drizzle can be used independently from precipitation |
---|
| 78 | ! |
---|
[1054] | 79 | ! 1053 2012-11-13 17:11:03Z hoffmann |
---|
| 80 | ! description expanded to the two-moment cloud scheme |
---|
| 81 | ! |
---|
[1037] | 82 | ! 1036 2012-10-22 13:43:42Z raasch |
---|
| 83 | ! code put under GPL (PALM 3.9) |
---|
| 84 | ! |
---|
[1] | 85 | ! Revision 1.1 2000/04/13 14:50:45 schroeter |
---|
| 86 | ! Initial revision |
---|
| 87 | ! |
---|
| 88 | ! |
---|
| 89 | ! Description: |
---|
| 90 | ! ------------ |
---|
[1682] | 91 | !> Calculation of the liquid water content (0%-or-100%-scheme). This scheme is |
---|
| 92 | !> used by the one and the two moment cloud physics scheme. Using the two moment |
---|
| 93 | !> scheme, this calculation results in the cloud water content. |
---|
[1] | 94 | !------------------------------------------------------------------------------! |
---|
[1682] | 95 | SUBROUTINE calc_liquid_water_content |
---|
| 96 | |
---|
[1] | 97 | |
---|
[1320] | 98 | USE arrays_3d, & |
---|
[2608] | 99 | ONLY: q, qc, ql, qr |
---|
[1320] | 100 | |
---|
| 101 | USE control_parameters, & |
---|
[2292] | 102 | ONLY: microphysics_morrison, microphysics_seifert |
---|
[1320] | 103 | |
---|
[2608] | 104 | USE diagnostic_quantities_mod, & |
---|
[3241] | 105 | ONLY: magnus, q_s, supersaturation |
---|
[2608] | 106 | |
---|
[1320] | 107 | USE indices, & |
---|
[2232] | 108 | ONLY: nxlg, nxrg, nyng, nysg, nzb, nzt, wall_flags_0 |
---|
[1320] | 109 | |
---|
| 110 | USE kinds |
---|
| 111 | |
---|
[1] | 112 | USE pegrid |
---|
| 113 | |
---|
[1320] | 114 | |
---|
[1] | 115 | IMPLICIT NONE |
---|
| 116 | |
---|
[1682] | 117 | INTEGER(iwp) :: i !< |
---|
| 118 | INTEGER(iwp) :: j !< |
---|
| 119 | INTEGER(iwp) :: k !< |
---|
[1] | 120 | |
---|
| 121 | |
---|
[667] | 122 | DO i = nxlg, nxrg |
---|
| 123 | DO j = nysg, nyng |
---|
[2232] | 124 | DO k = nzb+1, nzt |
---|
[1] | 125 | |
---|
| 126 | ! |
---|
[2608] | 127 | !-- Call calculation of supersaturation located |
---|
| 128 | !-- in diagnostic_quantities_mod |
---|
[3241] | 129 | CALL supersaturation( i, j, k ) |
---|
[1] | 130 | |
---|
| 131 | ! |
---|
| 132 | !-- Compute the liquid water content |
---|
[2292] | 133 | IF ( microphysics_seifert .AND. .NOT. microphysics_morrison ) & |
---|
| 134 | THEN |
---|
| 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 |
---|
[2292] | 149 | ELSEIF ( microphysics_morrison ) THEN |
---|
| 150 | ql(k,j,i) = qc(k,j,i) + qr(k,j,i) & |
---|
| 151 | * MERGE( 1.0_wp, 0.0_wp, & |
---|
| 152 | BTEST( wall_flags_0(k,j,i), 0 ) ) |
---|
[1822] | 153 | ELSE |
---|
[2292] | 154 | IF ( ( q(k,j,i) - q_s ) > 0.0_wp ) THEN |
---|
[2232] | 155 | qc(k,j,i) = ( q(k,j,i) - q_s ) & |
---|
| 156 | * MERGE( 1.0_wp, 0.0_wp, & |
---|
| 157 | BTEST( wall_flags_0(k,j,i), 0 ) ) |
---|
| 158 | ql(k,j,i) = qc(k,j,i) & |
---|
| 159 | * MERGE( 1.0_wp, 0.0_wp, & |
---|
| 160 | BTEST( wall_flags_0(k,j,i), 0 ) ) |
---|
[1115] | 161 | ELSE |
---|
[1822] | 162 | qc(k,j,i) = 0.0_wp |
---|
[1353] | 163 | ql(k,j,i) = 0.0_wp |
---|
[1115] | 164 | ENDIF |
---|
[1] | 165 | ENDIF |
---|
| 166 | ENDDO |
---|
| 167 | ENDDO |
---|
| 168 | ENDDO |
---|
| 169 | |
---|
| 170 | END SUBROUTINE calc_liquid_water_content |
---|