[1873] | 1 | !> @file interaction_droplets_ptq.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 | ! ----------------- |
---|
[1846] | 22 | ! |
---|
[2233] | 23 | ! |
---|
[1] | 24 | ! Former revisions: |
---|
| 25 | ! ----------------- |
---|
[3] | 26 | ! $Id: interaction_droplets_ptq.f90 3040 2018-05-25 10:22:08Z schwenkel $ |
---|
[3040] | 27 | ! Changed the name specific humidity to mixing ratio |
---|
| 28 | ! |
---|
| 29 | ! 2718 2018-01-02 08:49:38Z maronga |
---|
[2716] | 30 | ! Corrected "Former revisions" section |
---|
| 31 | ! |
---|
| 32 | ! 2696 2017-12-14 17:12:51Z kanani |
---|
| 33 | ! Change in file header (GPL part) |
---|
[800] | 34 | ! |
---|
[2716] | 35 | ! 2233 2017-05-30 18:08:54Z suehring |
---|
| 36 | ! |
---|
[2233] | 37 | ! 2232 2017-05-30 17:47:52Z suehring |
---|
| 38 | ! Adjustments to new topography concept |
---|
| 39 | ! |
---|
[2001] | 40 | ! 2000 2016-08-20 18:09:15Z knoop |
---|
| 41 | ! Forced header and separation lines into 80 columns |
---|
| 42 | ! |
---|
[1874] | 43 | ! 1873 2016-04-18 14:50:06Z maronga |
---|
| 44 | ! Module renamed (removed _mod) |
---|
| 45 | ! |
---|
| 46 | ! |
---|
[1851] | 47 | ! 1850 2016-04-08 13:29:27Z maronga |
---|
| 48 | ! Module renamed |
---|
| 49 | ! |
---|
| 50 | ! |
---|
[1846] | 51 | ! 1845 2016-04-08 08:29:13Z raasch |
---|
| 52 | ! nzb_2d replaced by nzb_s_inner |
---|
| 53 | ! |
---|
[1823] | 54 | ! 1822 2016-04-07 07:49:42Z hoffmann |
---|
| 55 | ! Unused variables removed. |
---|
| 56 | ! |
---|
[1780] | 57 | ! 1779 2016-03-03 08:01:28Z raasch |
---|
| 58 | ! bugfix: module procedure names shortened to avoid Intel compiler warnings |
---|
| 59 | ! about too long names |
---|
| 60 | ! |
---|
[1683] | 61 | ! 1682 2015-10-07 23:56:08Z knoop |
---|
| 62 | ! Code annotations made doxygen readable |
---|
| 63 | ! |
---|
[1321] | 64 | ! 1320 2014-03-20 08:40:49Z raasch |
---|
| 65 | ! ONLY-attribute added to USE-statements, |
---|
| 66 | ! kind-parameters added to all INTEGER and REAL declaration statements, |
---|
| 67 | ! kinds are defined in new module kinds, |
---|
| 68 | ! revision history before 2012 removed, |
---|
| 69 | ! comment fields (!:) to be used for variable explanations added to |
---|
| 70 | ! all variable declaration statements |
---|
| 71 | ! |
---|
[1037] | 72 | ! 1036 2012-10-22 13:43:42Z raasch |
---|
| 73 | ! code put under GPL (PALM 3.9) |
---|
| 74 | ! |
---|
[800] | 75 | ! 799 2011-12-21 17:48:03Z franke |
---|
| 76 | ! Bugfix: pt_d_t(k) was missing in calculation of pt_p |
---|
| 77 | ! |
---|
[3] | 78 | ! RCS Log replace by Id keyword, revision history cleaned up |
---|
| 79 | ! |
---|
[1] | 80 | ! Revision 1.1 2005/06/26 19:57:47 raasch |
---|
| 81 | ! Initial revision |
---|
| 82 | ! |
---|
| 83 | ! |
---|
| 84 | ! Description: |
---|
| 85 | ! ------------ |
---|
[3040] | 86 | !> Release of latent heat and change of mixing ratio due to condensation / |
---|
[1682] | 87 | !> evaporation of droplets. |
---|
[1] | 88 | !------------------------------------------------------------------------------! |
---|
[1682] | 89 | MODULE interaction_droplets_ptq_mod |
---|
| 90 | |
---|
[1] | 91 | |
---|
| 92 | PRIVATE |
---|
| 93 | PUBLIC interaction_droplets_ptq |
---|
| 94 | |
---|
| 95 | INTERFACE interaction_droplets_ptq |
---|
[1779] | 96 | ! |
---|
| 97 | !-- Internal names shortened in order ro avoid Intel compiler messages |
---|
| 98 | !-- about too long names |
---|
| 99 | MODULE PROCEDURE i_droplets_ptq |
---|
| 100 | MODULE PROCEDURE i_droplets_ptq_ij |
---|
[1] | 101 | END INTERFACE interaction_droplets_ptq |
---|
| 102 | |
---|
| 103 | CONTAINS |
---|
| 104 | |
---|
| 105 | |
---|
| 106 | !------------------------------------------------------------------------------! |
---|
[1682] | 107 | ! Description: |
---|
| 108 | ! ------------ |
---|
| 109 | !> Call for all grid points |
---|
[1] | 110 | !------------------------------------------------------------------------------! |
---|
[1779] | 111 | SUBROUTINE i_droplets_ptq |
---|
[1] | 112 | |
---|
[1320] | 113 | USE arrays_3d, & |
---|
| 114 | ONLY: pt_p, ql_c, q_p |
---|
| 115 | |
---|
| 116 | USE cloud_parameters, & |
---|
| 117 | ONLY: l_d_cp, pt_d_t |
---|
| 118 | |
---|
| 119 | USE indices, & |
---|
[2232] | 120 | ONLY: nxl, nxr, nyn, nys, nzb, nzt, wall_flags_0 |
---|
[1320] | 121 | |
---|
| 122 | USE kinds |
---|
[1] | 123 | |
---|
| 124 | USE pegrid |
---|
| 125 | |
---|
| 126 | IMPLICIT NONE |
---|
| 127 | |
---|
[2232] | 128 | INTEGER(iwp) :: i !< running index x direction |
---|
| 129 | INTEGER(iwp) :: j !< running index y direction |
---|
| 130 | INTEGER(iwp) :: k !< running index z direction |
---|
[1] | 131 | |
---|
[2232] | 132 | REAL(wp) :: flag !< flag to mask topography grid points |
---|
[1] | 133 | |
---|
| 134 | DO i = nxl, nxr |
---|
| 135 | DO j = nys, nyn |
---|
[2232] | 136 | DO k = nzb+1, nzt |
---|
| 137 | ! |
---|
| 138 | !-- Predetermine flag to mask topography |
---|
| 139 | flag = MERGE( 1.0_wp, 0.0_wp, BTEST( wall_flags_0(k,j,i), 0 ) ) |
---|
| 140 | |
---|
| 141 | q_p(k,j,i) = q_p(k,j,i) - ql_c(k,j,i) * flag |
---|
| 142 | pt_p(k,j,i) = pt_p(k,j,i) + l_d_cp * ql_c(k,j,i) * pt_d_t(k) & |
---|
| 143 | * flag |
---|
[1] | 144 | ENDDO |
---|
| 145 | ENDDO |
---|
| 146 | ENDDO |
---|
| 147 | |
---|
[1779] | 148 | END SUBROUTINE i_droplets_ptq |
---|
[1] | 149 | |
---|
| 150 | |
---|
| 151 | !------------------------------------------------------------------------------! |
---|
[1682] | 152 | ! Description: |
---|
| 153 | ! ------------ |
---|
| 154 | !> Call for grid point i,j |
---|
[1] | 155 | !------------------------------------------------------------------------------! |
---|
[1779] | 156 | SUBROUTINE i_droplets_ptq_ij( i, j ) |
---|
[1] | 157 | |
---|
[1320] | 158 | USE arrays_3d, & |
---|
| 159 | ONLY: pt_p, ql_c, q_p |
---|
[1] | 160 | |
---|
[1320] | 161 | USE cloud_parameters, & |
---|
| 162 | ONLY: l_d_cp, pt_d_t |
---|
| 163 | |
---|
| 164 | USE indices, & |
---|
[2232] | 165 | ONLY: nzb, nzt, wall_flags_0 |
---|
[1320] | 166 | |
---|
| 167 | USE kinds, & |
---|
| 168 | ONLY: iwp, wp |
---|
| 169 | |
---|
[1] | 170 | USE pegrid |
---|
| 171 | |
---|
| 172 | IMPLICIT NONE |
---|
| 173 | |
---|
[2232] | 174 | INTEGER(iwp) :: i !< running index x direction |
---|
| 175 | INTEGER(iwp) :: j !< running index y direction |
---|
| 176 | INTEGER(iwp) :: k !< running index z direction |
---|
[1] | 177 | |
---|
[2232] | 178 | REAL(wp) :: flag !< flag to mask topography grid points |
---|
[1] | 179 | |
---|
[2232] | 180 | |
---|
| 181 | DO k = nzb+1, nzt |
---|
| 182 | ! |
---|
| 183 | !-- Predetermine flag to mask topography |
---|
| 184 | flag = MERGE( 1.0_wp, 0.0_wp, BTEST( wall_flags_0(k,j,i), 0 ) ) |
---|
| 185 | |
---|
| 186 | q_p(k,j,i) = q_p(k,j,i) - ql_c(k,j,i) * flag |
---|
| 187 | pt_p(k,j,i) = pt_p(k,j,i) + l_d_cp * ql_c(k,j,i) * pt_d_t(k) * flag |
---|
[1] | 188 | ENDDO |
---|
| 189 | |
---|
[1779] | 190 | END SUBROUTINE i_droplets_ptq_ij |
---|
[1] | 191 | |
---|
| 192 | END MODULE interaction_droplets_ptq_mod |
---|