1 | !> @file impact_of_latent_heat.f90 |
---|
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 | ! |
---|
16 | ! Copyright 1997-2014 Leibniz Universitaet Hannover |
---|
17 | !--------------------------------------------------------------------------------! |
---|
18 | ! |
---|
19 | ! Current revisions: |
---|
20 | ! ----------------- |
---|
21 | ! |
---|
22 | ! |
---|
23 | ! Former revisions: |
---|
24 | ! ----------------- |
---|
25 | ! $Id: impact_of_latent_heat.f90 1683 2015-10-07 23:57:51Z maronga $ |
---|
26 | ! |
---|
27 | ! 1682 2015-10-07 23:56:08Z knoop |
---|
28 | ! Code annotations made doxygen readable |
---|
29 | ! |
---|
30 | ! 1353 2014-04-08 15:21:23Z heinze |
---|
31 | ! REAL constants provided with KIND-attribute |
---|
32 | ! |
---|
33 | ! 1320 2014-03-20 08:40:49Z raasch |
---|
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 |
---|
40 | ! |
---|
41 | ! 1036 2012-10-22 13:43:42Z raasch |
---|
42 | ! code put under GPL (PALM 3.9) |
---|
43 | ! |
---|
44 | ! Revision 1.1 2000/04/13 14:48:40 schroeter |
---|
45 | ! Initial revision |
---|
46 | ! |
---|
47 | ! |
---|
48 | ! Description: |
---|
49 | ! ------------ |
---|
50 | !> Calculate the impact of latent heat due to precipitation |
---|
51 | !> (simplified Kessler scheme) |
---|
52 | !------------------------------------------------------------------------------! |
---|
53 | MODULE impact_of_latent_heat_mod |
---|
54 | |
---|
55 | |
---|
56 | PRIVATE |
---|
57 | PUBLIC impact_of_latent_heat |
---|
58 | |
---|
59 | INTERFACE impact_of_latent_heat |
---|
60 | MODULE PROCEDURE impact_of_latent_heat |
---|
61 | MODULE PROCEDURE impact_of_latent_heat_ij |
---|
62 | END INTERFACE impact_of_latent_heat |
---|
63 | |
---|
64 | CONTAINS |
---|
65 | |
---|
66 | |
---|
67 | !------------------------------------------------------------------------------! |
---|
68 | ! Description: |
---|
69 | ! ------------ |
---|
70 | !> Call for all grid points |
---|
71 | !------------------------------------------------------------------------------! |
---|
72 | SUBROUTINE impact_of_latent_heat |
---|
73 | |
---|
74 | USE arrays_3d, & |
---|
75 | ONLY: ql, tend |
---|
76 | |
---|
77 | USE cloud_parameters, & |
---|
78 | ONLY: l_d_cp, prec_time_const, pt_d_t, ql_crit |
---|
79 | |
---|
80 | USE indices, & |
---|
81 | ONLY: nxl, nxr, nyn, nys, nzb_2d, nzt |
---|
82 | |
---|
83 | USE kinds |
---|
84 | |
---|
85 | IMPLICIT NONE |
---|
86 | |
---|
87 | INTEGER(iwp) :: i !< |
---|
88 | INTEGER(iwp) :: j !< |
---|
89 | INTEGER(iwp) :: k !< |
---|
90 | |
---|
91 | REAL(wp) :: dqdt_precip !< |
---|
92 | |
---|
93 | |
---|
94 | DO i = nxl, nxr |
---|
95 | DO j = nys, nyn |
---|
96 | DO k = nzb_2d(j,i)+1, nzt |
---|
97 | |
---|
98 | IF ( ql(k,j,i) > ql_crit ) THEN |
---|
99 | dqdt_precip = prec_time_const * ( ql(k,j,i) - ql_crit ) |
---|
100 | ELSE |
---|
101 | dqdt_precip = 0.0_wp |
---|
102 | ENDIF |
---|
103 | tend(k,j,i) = tend(k,j,i) + dqdt_precip * l_d_cp * pt_d_t(k) |
---|
104 | |
---|
105 | ENDDO |
---|
106 | ENDDO |
---|
107 | ENDDO |
---|
108 | |
---|
109 | END SUBROUTINE impact_of_latent_heat |
---|
110 | |
---|
111 | |
---|
112 | !------------------------------------------------------------------------------! |
---|
113 | ! Description: |
---|
114 | ! ------------ |
---|
115 | !> Call for grid point i,j |
---|
116 | !------------------------------------------------------------------------------! |
---|
117 | SUBROUTINE impact_of_latent_heat_ij( i, j ) |
---|
118 | |
---|
119 | USE arrays_3d, & |
---|
120 | ONLY: ql, tend |
---|
121 | |
---|
122 | USE cloud_parameters, & |
---|
123 | ONLY: l_d_cp, prec_time_const, pt_d_t, ql_crit |
---|
124 | |
---|
125 | USE indices, & |
---|
126 | ONLY: nzb_2d, nzt |
---|
127 | |
---|
128 | USE kinds |
---|
129 | |
---|
130 | IMPLICIT NONE |
---|
131 | |
---|
132 | INTEGER(iwp) :: i !< |
---|
133 | INTEGER(iwp) :: j !< |
---|
134 | INTEGER(iwp) :: k !< |
---|
135 | |
---|
136 | REAL(wp) :: dqdt_precip !< |
---|
137 | |
---|
138 | |
---|
139 | DO k = nzb_2d(j,i)+1, nzt |
---|
140 | |
---|
141 | IF ( ql(k,j,i) > ql_crit ) THEN |
---|
142 | dqdt_precip = prec_time_const * ( ql(k,j,i) - ql_crit ) |
---|
143 | ELSE |
---|
144 | dqdt_precip = 0.0_wp |
---|
145 | ENDIF |
---|
146 | tend(k,j,i) = tend(k,j,i) + dqdt_precip * l_d_cp * pt_d_t(k) |
---|
147 | |
---|
148 | ENDDO |
---|
149 | |
---|
150 | END SUBROUTINE impact_of_latent_heat_ij |
---|
151 | |
---|
152 | END MODULE impact_of_latent_heat_mod |
---|