MODULE calc_precipitation_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: calc_precipitation.f90 1321 2014-03-20 09:40:40Z kanani $ ! ! 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) !------------------------------------------------------------------------------! PRIVATE PUBLIC calc_precipitation INTERFACE calc_precipitation MODULE PROCEDURE calc_precipitation MODULE PROCEDURE calc_precipitation_ij END INTERFACE calc_precipitation CONTAINS !------------------------------------------------------------------------------! ! 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 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 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 !------------------------------------------------------------------------------! ! 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 ! !-- 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 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