MODULE impact_of_latent_heat_mod !--------------------------------------------------------------------------------! ! This file is part of PALM. ! ! PALM is free software: you can redistribute it and/or modify it under the terms ! of the GNU General Public License as published by the Free Software Foundation, ! either version 3 of the License, or (at your option) any later version. ! ! PALM is distributed in the hope that it will be useful, but WITHOUT ANY ! WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR ! A PARTICULAR PURPOSE. See the GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License along with ! PALM. If not, see . ! ! Copyright 1997-2014 Leibniz Universitaet Hannover !--------------------------------------------------------------------------------! ! ! Current revisions: ! ----------------- ! ! ! Former revisions: ! ----------------- ! $Id: impact_of_latent_heat.f90 1354 2014-04-08 15:22:57Z heinze $ ! ! 1353 2014-04-08 15:21:23Z heinze ! REAL constants provided with KIND-attribute ! ! 1320 2014-03-20 08:40:49Z raasch ! ONLY-attribute added to USE-statements, ! kind-parameters added to all INTEGER and REAL declaration statements, ! kinds are defined in new module kinds, ! revision history before 2012 removed, ! comment fields (!:) to be used for variable explanations added to ! all variable declaration statements ! ! 1036 2012-10-22 13:43:42Z raasch ! code put under GPL (PALM 3.9) ! ! Revision 1.1 2000/04/13 14:48:40 schroeter ! Initial revision ! ! ! Description: ! ------------ ! Calculate the impact of latent heat due to precipitation ! (simplified Kessler scheme) !------------------------------------------------------------------------------! PRIVATE PUBLIC impact_of_latent_heat INTERFACE impact_of_latent_heat MODULE PROCEDURE impact_of_latent_heat MODULE PROCEDURE impact_of_latent_heat_ij END INTERFACE impact_of_latent_heat CONTAINS !------------------------------------------------------------------------------! ! Call for all grid points !------------------------------------------------------------------------------! SUBROUTINE impact_of_latent_heat USE arrays_3d, & ONLY: ql, tend USE cloud_parameters, & ONLY: l_d_cp, prec_time_const, pt_d_t, ql_crit USE indices, & ONLY: nxl, nxr, nyn, nys, nzb_2d, nzt USE kinds IMPLICIT NONE INTEGER(iwp) :: i !: INTEGER(iwp) :: j !: INTEGER(iwp) :: k !: REAL(wp) :: dqdt_precip !: DO i = nxl, nxr DO j = nys, nyn DO k = nzb_2d(j,i)+1, nzt IF ( ql(k,j,i) > ql_crit ) THEN dqdt_precip = prec_time_const * ( ql(k,j,i) - ql_crit ) ELSE dqdt_precip = 0.0_wp ENDIF tend(k,j,i) = tend(k,j,i) + dqdt_precip * l_d_cp * pt_d_t(k) ENDDO ENDDO ENDDO END SUBROUTINE impact_of_latent_heat !------------------------------------------------------------------------------! ! Call for grid point i,j !------------------------------------------------------------------------------! SUBROUTINE impact_of_latent_heat_ij( i, j ) USE arrays_3d, & ONLY: ql, tend USE cloud_parameters, & ONLY: l_d_cp, prec_time_const, pt_d_t, ql_crit USE indices, & ONLY: nzb_2d, nzt USE kinds IMPLICIT NONE INTEGER(iwp) :: i !: INTEGER(iwp) :: j !: INTEGER(iwp) :: k !: REAL(wp) :: dqdt_precip !: DO k = nzb_2d(j,i)+1, nzt IF ( ql(k,j,i) > ql_crit ) THEN dqdt_precip = prec_time_const * ( ql(k,j,i) - ql_crit ) ELSE dqdt_precip = 0.0_wp ENDIF tend(k,j,i) = tend(k,j,i) + dqdt_precip * l_d_cp * pt_d_t(k) ENDDO END SUBROUTINE impact_of_latent_heat_ij END MODULE impact_of_latent_heat_mod