SUBROUTINE init_cloud_physics !--------------------------------------------------------------------------------! ! 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: init_cloud_physics.f90 1054 2012-11-13 17:30:09Z raasch $ ! ! 1053 2012-11-13 17:11:03Z hoffmann ! calculation of the maximum timestep according to the terminal velocity of rain ! drops in the two moment cloud scheme ! ! calculation of frequently used constants (pirho_l, dpirho_l, schmidt_p_1d3, ! hyrho) ! ! 1036 2012-10-22 13:43:42Z raasch ! code put under GPL (PALM 3.9) ! ! 824 2012-02-17 09:09:57Z raasch ! calculation of b_cond replaced by calculation of bfactor ! ! 221 2009-01-12 15:32:23Z raasch ! Bugfix: abort in case that absolute temperature is below zero ! ! 95 2007-06-02 16:48:38Z raasch ! hydro_press renamed hyp ! ! February 2007 ! RCS Log replace by Id keyword, revision history cleaned up ! ! Revision 1.5 2005/06/26 19:55:58 raasch ! Initialization of cloud droplet constants, gas_constant renamed r_d, ! latent_heat renamed l_v ! ! Revision 1.1 2000/04/13 14:37:22 schroeter ! Initial revision ! ! ! Description: ! ------------ ! Initialization of parameters for handling cloud-physics !------------------------------------------------------------------------------! USE arrays_3d USE cloud_parameters USE constants USE control_parameters USE grid_variables USE indices IMPLICIT NONE INTEGER :: k REAL :: t_surface ALLOCATE( hyp(nzb:nzt+1), pt_d_t(nzb:nzt+1), t_d_pt(nzb:nzt+1), & hyrho(nzb:nzt+1) ) ! !-- Calculate frequently used parameters l_d_cp = l_v / cp l_d_r = l_v / r_d l_d_rv = l_v / r_v schmidt_p_1d3 = schmidt**( 1.0 / 3.0 ) pirho_l = pi * rho_l / 6.0 dpirho_l = 1.0 / pirho_l ! !-- Calculate timestep according to precipitation IF ( icloud_scheme == 0 .AND. precipitation ) THEN dt_precipitation = MINVAL( dzu(nzb+2:nzt) ) / w_precipitation ENDIF ! !-- Calculate factor used in equation for droplet growth by condensation bfactor = 3.0 * vanthoff * mass_of_solute * molecular_weight_of_water & / ( 4.0 * pi * rho_l * molecular_weight_of_solute ) ! !-- Calculate: !-- pt / t : ratio of potential and actual temperature (pt_d_t) !-- t / pt : ratio of actual and potential temperature (t_d_pt) !-- p_0(z) : vertical profile of the hydrostatic pressure (hyp) t_surface = pt_surface * ( surface_pressure / 1000.0 )**0.286 DO k = nzb, nzt+1 ! !-- Check temperature in case of too large domain height IF ( ( t_surface - g/cp * zu(k) ) < 0.0 ) THEN WRITE( message_string, * ) 'absolute temperature < 0.0 at zu(', k, & ') = ', zu(k) CALL message( 'init_cloud_physics', 'PA0142', 1, 2, 0, 6, 0 ) ENDIF hyp(k) = surface_pressure * 100.0 * & ( (t_surface - g/cp * zu(k)) / t_surface )**(1.0/0.286) pt_d_t(k) = ( 100000.0 / hyp(k) )**0.286 t_d_pt(k) = 1.0 / pt_d_t(k) hyrho(k) = hyp(k) / ( r_d * t_d_pt(k) * pt_init(k) ) ENDDO ! !-- Compute reference density rho_surface = surface_pressure * 100.0 / ( r_d * t_surface ) END SUBROUTINE init_cloud_physics