SUBROUTINE lpm_calc_liquid_water_content !--------------------------------------------------------------------------------! ! 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-2012 Leibniz University Hannover !--------------------------------------------------------------------------------! ! ! Current revisions: ! ------------------ ! ! ! Former revisions: ! ----------------- ! $Id: lpm_calc_liquid_water_content.f90 1037 2012-10-22 14:10:22Z maronga $ ! ! 1036 2012-10-22 13:43:42Z raasch ! code put under GPL (PALM 3.9) ! ! 849 2012-03-15 10:35:09Z raasch ! initial revision (former part of advec_particles) ! ! ! Description: ! ------------ ! Calculate the liquid water content for each grid box. !------------------------------------------------------------------------------! USE arrays_3d USE cloud_parameters USE constants USE control_parameters USE cpulog USE grid_variables USE indices USE interfaces USE particle_attributes IMPLICIT NONE INTEGER :: i, j, k, n, psi CALL cpu_log( log_point_s(45), 'lpm_calc_ql', 'start' ) ! !-- Set water content initially to zero ql = 0.0; ql_v = 0.0; ql_vp = 0.0 ! !-- Calculate for each grid box DO i = nxl, nxr DO j = nys, nyn DO k = nzb, nzt+1 ! !-- Calculate the total volume in the boxes (ql_v, weighting factor !-- has to beincluded) psi = prt_start_index(k,j,i) DO n = psi, psi+prt_count(k,j,i)-1 ql_v(k,j,i) = ql_v(k,j,i) + particles(n)%weight_factor * & particles(n)%radius**3 ENDDO ! !-- Calculate the liquid water content IF ( ql_v(k,j,i) /= 0.0 ) THEN ql(k,j,i) = ql(k,j,i) + rho_l * 1.33333333 * pi * & ql_v(k,j,i) / & ( rho_surface * dx * dy * dz ) IF ( ql(k,j,i) < 0.0 ) THEN WRITE( message_string, * ) 'LWC out of range: ' , & ql(k,j,i) CALL message( 'lpm_calc_liquid_water_content', '', 2, 2, & -1, 6, 1 ) ENDIF ELSE ql(k,j,i) = 0.0 ENDIF ENDDO ENDDO ENDDO CALL cpu_log( log_point_s(45), 'lpm_calc_ql', 'stop' ) END SUBROUTINE lpm_calc_liquid_water_content