SUBROUTINE 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: calc_liquid_water_content.f90 1254 2013-11-07 10:53:19Z maronga $ ! ! 1253 2013-11-07 10:48:12Z fricke ! Bugfix: q is set to qr in case that q is smaller than qr ! ! 1115 2013-03-26 18:16:16Z hoffmann ! drizzle can be used independently from precipitation ! ! 1053 2012-11-13 17:11:03Z hoffmann ! description expanded to the two-moment cloud scheme ! ! 1036 2012-10-22 13:43:42Z raasch ! code put under GPL (PALM 3.9) ! ! 667 2010-12-23 12:06:00Z suehring/gyschka ! nxl-1, nxr+1, nys-1, nyn+1 replaced by nxlg, nxrg, nysg, nyng ! ! 95 2007-06-02 16:48:38Z raasch ! hydro_press renamed hyp ! ! 19 2007-02-23 04:53:48Z raasch ! Old comment removed ! ! RCS Log replace by Id keyword, revision history cleaned up ! ! Revision 1.5 2005/03/26 15:22:06 raasch ! Arguments for non-cyclic boundary conditions added to argument list of ! routine exchange_horiz, ! ql calculated for the ghost points, exchange of ghost points removed ! ! Revision 1.1 2000/04/13 14:50:45 schroeter ! Initial revision ! ! ! ! Description: ! ------------ ! Calculation of the liquid water content (0%-or-100%-scheme). This scheme is ! used by the one and the two moment cloud physics scheme. Using the two moment ! scheme, this calculation results in the cloud water content. !------------------------------------------------------------------------------! USE arrays_3d USE cloud_parameters USE constants USE control_parameters USE grid_variables USE indices USE pegrid IMPLICIT NONE INTEGER :: i, j, k REAL :: alpha, e_s, q_s, t_l DO i = nxlg, nxrg DO j = nysg, nyng DO k = nzb_s_inner(j,i)+1, nzt ! !-- Compute the liquid water temperature t_l = t_d_pt(k) * pt(k,j,i) ! !-- Compute saturation water vapor pressure at t_l e_s = 610.78 * EXP( 17.269 * ( t_l - 273.16 ) / & ( t_l - 35.86 ) ) ! !-- Compute approximation of saturation humidity q_s = 0.622 * e_s / ( hyp(k) - 0.378 * e_s ) ! !-- Correction factor alpha = 0.622 * l_d_r * l_d_cp / ( t_l * t_l ) ! !-- Correction of the approximated value !-- (see: Cuijpers + Duynkerke, 1993, JAS, 23) q_s = q_s * ( 1.0 + alpha * q(k,j,i) ) / ( 1.0 + alpha * q_s ) ! !-- Compute the liquid water content IF ( icloud_scheme == 0 .AND. precipitation) THEN IF ( ( q(k,j,i) - q_s - qr(k,j,i) ) > 0.0 ) THEN qc(k,j,i) = q(k,j,i) - q_s - qr(k,j,i) ql(k,j,i) = qc(k,j,i) + qr(k,j,i) ELSE IF ( q(k,j,i) < qr(k,j,i) ) q(k,j,i) = qr(k,j,i) qc(k,j,i) = 0.0 ql(k,j,i) = qr(k,j,i) ENDIF ELSEIF ( icloud_scheme == 0 .AND. .NOT. precipitation ) THEN IF ( ( q(k,j,i) - q_s ) > 0.0 ) THEN qc(k,j,i) = q(k,j,i) - q_s ql(k,j,i) = qc(k,j,i) ELSE qc(k,j,i) = 0.0 ql(k,j,i) = 0.0 ENDIF ELSE IF ( ( q(k,j,i) - q_s ) > 0.0 ) THEN ql(k,j,i) = q(k,j,i) - q_s ELSE ql(k,j,i) = 0.0 ENDIF ENDIF ENDDO ENDDO ENDDO END SUBROUTINE calc_liquid_water_content