!> @file calc_precipitation.f90 !--------------------------------------------------------------------------------! ! 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: calc_precipitation.f90 1683 2015-10-07 23:57:51Z raasch $ ! ! 1682 2015-10-07 23:56:08Z knoop ! Code annotations made doxygen readable ! ! 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:45:22 schroeter ! Initial revision ! ! ! ! Description: ! ------------ !> Calculate the change of total water content due to precipitation !> (simplified Kessler scheme) !------------------------------------------------------------------------------! MODULE calc_precipitation_mod PRIVATE PUBLIC calc_precipitation INTERFACE calc_precipitation MODULE PROCEDURE calc_precipitation MODULE PROCEDURE calc_precipitation_ij END INTERFACE calc_precipitation CONTAINS !------------------------------------------------------------------------------! ! Description: ! ------------ !> Call for all grid points !------------------------------------------------------------------------------! SUBROUTINE calc_precipitation USE arrays_3d, & ONLY: dzw, ql, tend USE cloud_parameters, & ONLY: precipitation_amount, precipitation_rate, prec_time_const, & ql_crit USE control_parameters, & ONLY: dt_do2d_xy, dt_3d, & intermediate_timestep_count, intermediate_timestep_count_max,& precipitation_amount_interval, time_do2d_xy 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 !< precipitation_rate = 0.0_wp 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 ! !-- Precipitation rate in kg / m**2 / s (= mm/s) precipitation_rate(j,i) = precipitation_rate(j,i) + & dqdt_precip * dzw(k) ENDDO ! !-- Sum up the precipitation amount, unit kg / m**2 (= mm) IF ( intermediate_timestep_count == & intermediate_timestep_count_max .AND. & ( dt_do2d_xy-time_do2d_xy ) < precipitation_amount_interval )& THEN precipitation_amount(j,i) = precipitation_amount(j,i) + & precipitation_rate(j,i) * dt_3d ENDIF ENDDO ENDDO END SUBROUTINE calc_precipitation !------------------------------------------------------------------------------! ! Description: ! ------------ !> Call for grid point i,j !------------------------------------------------------------------------------! SUBROUTINE calc_precipitation_ij( i, j ) USE arrays_3d, & ONLY: dzw, ql, tend USE cloud_parameters, & ONLY: precipitation_amount, precipitation_rate, prec_time_const, & ql_crit USE control_parameters, & ONLY: dt_do2d_xy, dt_3d, & intermediate_timestep_count, intermediate_timestep_count_max,& precipitation_amount_interval, time_do2d_xy USE indices, & ONLY: nzb_2d, nzt USE kinds IMPLICIT NONE INTEGER(iwp) :: i !< INTEGER(iwp) :: j !< INTEGER(iwp) :: k !< REAL(wp) :: dqdt_precip !< precipitation_rate(j,i) = 0.0_wp ! !-- Ghostpoints are included (although not needed for tend) to avoid a later !-- exchange of these data for the precipitation amount/rate arrays 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 ! !-- Precipitation rate in kg / m**2 / s (= mm/s) precipitation_rate(j,i) = precipitation_rate(j,i) + dqdt_precip * & dzw(k) ENDDO ! !-- Sum up the precipitation amount , unit kg / m**2 (= mm) IF ( intermediate_timestep_count == intermediate_timestep_count_max & .AND. ( dt_do2d_xy-time_do2d_xy ) < precipitation_amount_interval )& THEN precipitation_amount(j,i) = precipitation_amount(j,i) + & precipitation_rate(j,i) * dt_3d ENDIF END SUBROUTINE calc_precipitation_ij END MODULE calc_precipitation_mod