source: palm/trunk/SOURCE/interaction_droplets_ptq.f90 @ 3435

Last change on this file since 3435 was 3274, checked in by knoop, 6 years ago

Modularization of all bulk cloud physics code components

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