source: palm/trunk/SOURCE/impact_of_latent_heat.f90 @ 1671

Last change on this file since 1671 was 1354, checked in by heinze, 11 years ago

last commit documented

  • Property svn:keywords set to Id
File size: 4.4 KB
Line 
1 MODULE impact_of_latent_heat_mod
2
3!--------------------------------------------------------------------------------!
4! This file is part of PALM.
5!
6! PALM is free software: you can redistribute it and/or modify it under the terms
7! of the GNU General Public License as published by the Free Software Foundation,
8! either version 3 of the License, or (at your option) any later version.
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!
17! Copyright 1997-2014 Leibniz Universitaet Hannover
18!--------------------------------------------------------------------------------!
19!
20! Current revisions:
21! -----------------
22!
23!
24! Former revisions:
25! -----------------
26! $Id: impact_of_latent_heat.f90 1354 2014-04-08 15:22:57Z raasch $
27!
28! 1353 2014-04-08 15:21:23Z heinze
29! REAL constants provided with KIND-attribute
30!
31! 1320 2014-03-20 08:40:49Z raasch
32! ONLY-attribute added to USE-statements,
33! kind-parameters added to all INTEGER and REAL declaration statements,
34! kinds are defined in new module kinds,
35! revision history before 2012 removed,
36! comment fields (!:) to be used for variable explanations added to
37! all variable declaration statements
38!
39! 1036 2012-10-22 13:43:42Z raasch
40! code put under GPL (PALM 3.9)
41!
42! Revision 1.1  2000/04/13 14:48:40  schroeter
43! Initial revision
44!
45!
46! Description:
47! ------------
48! Calculate the impact of latent heat due to precipitation
49! (simplified Kessler scheme)
50!------------------------------------------------------------------------------!
51
52    PRIVATE
53    PUBLIC impact_of_latent_heat
54
55    INTERFACE impact_of_latent_heat
56       MODULE PROCEDURE impact_of_latent_heat
57       MODULE PROCEDURE impact_of_latent_heat_ij
58    END INTERFACE impact_of_latent_heat
59 
60 CONTAINS
61
62
63!------------------------------------------------------------------------------!
64! Call for all grid points
65!------------------------------------------------------------------------------!
66    SUBROUTINE impact_of_latent_heat
67
68       USE arrays_3d,                                                          &
69           ONLY:  ql, tend
70           
71       USE cloud_parameters,                                                   &
72           ONLY:  l_d_cp, prec_time_const, pt_d_t, ql_crit
73           
74       USE indices,                                                            &
75           ONLY:  nxl, nxr, nyn, nys, nzb_2d, nzt
76           
77       USE kinds
78
79       IMPLICIT NONE
80
81       INTEGER(iwp) ::  i  !:
82       INTEGER(iwp) ::  j  !:
83       INTEGER(iwp) ::  k  !:
84       
85       REAL(wp) ::  dqdt_precip  !:
86
87 
88       DO  i = nxl, nxr
89          DO  j = nys, nyn
90             DO  k = nzb_2d(j,i)+1, nzt
91
92                IF ( ql(k,j,i) > ql_crit )  THEN
93                   dqdt_precip = prec_time_const * ( ql(k,j,i) - ql_crit )
94                ELSE
95                   dqdt_precip = 0.0_wp
96                ENDIF
97                tend(k,j,i) = tend(k,j,i) + dqdt_precip * l_d_cp * pt_d_t(k)
98
99             ENDDO
100          ENDDO
101       ENDDO
102
103    END SUBROUTINE impact_of_latent_heat
104
105
106!------------------------------------------------------------------------------!
107! Call for grid point i,j
108!------------------------------------------------------------------------------!
109    SUBROUTINE impact_of_latent_heat_ij( i, j )
110
111       USE arrays_3d,                                                          &
112           ONLY:  ql, tend
113           
114       USE cloud_parameters,                                                   &
115           ONLY:  l_d_cp, prec_time_const, pt_d_t, ql_crit
116           
117       USE indices,                                                            &
118           ONLY:  nzb_2d, nzt
119           
120       USE kinds                                                               
121   
122       IMPLICIT NONE
123
124       INTEGER(iwp) ::  i  !:
125       INTEGER(iwp) ::  j  !:
126       INTEGER(iwp) ::  k  !:
127       
128       REAL(wp) ::  dqdt_precip  !:
129
130
131       DO  k = nzb_2d(j,i)+1, nzt
132
133          IF ( ql(k,j,i) > ql_crit )  THEN
134             dqdt_precip = prec_time_const * ( ql(k,j,i) - ql_crit )
135          ELSE
136             dqdt_precip = 0.0_wp
137          ENDIF
138          tend(k,j,i) = tend(k,j,i) + dqdt_precip * l_d_cp * pt_d_t(k)
139
140       ENDDO
141
142    END SUBROUTINE impact_of_latent_heat_ij
143
144 END MODULE impact_of_latent_heat_mod
Note: See TracBrowser for help on using the repository browser.