source: palm/trunk/SOURCE/init_cloud_physics.f90 @ 1046

Last change on this file since 1046 was 1037, checked in by raasch, 12 years ago

last commit documented

  • Property svn:keywords set to Id
File size: 3.3 KB
Line 
1 SUBROUTINE init_cloud_physics
2
3!--------------------------------------------------------------------------------!
4! This file is part of PALM.
5!
6! PALM is free software: you can redistribute it and/or modify it under the terms
7! of the GNU General Public License as published by the Free Software Foundation,
8! either version 3 of the License, or (at your option) any later version.
9!
10! PALM is distributed in the hope that it will be useful, but WITHOUT ANY
11! WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
12! A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
13!
14! You should have received a copy of the GNU General Public License along with
15! PALM. If not, see <http://www.gnu.org/licenses/>.
16!
17! Copyright 1997-2012  Leibniz University Hannover
18!--------------------------------------------------------------------------------!
19!
20! Current revisions:
21! -----------------
22!
23!
24! Former revisions:
25! ------------------
26! $Id: init_cloud_physics.f90 1037 2012-10-22 14:10:22Z maronga $
27!
28! 1036 2012-10-22 13:43:42Z raasch
29! code put under GPL (PALM 3.9)
30!
31! 824 2012-02-17 09:09:57Z raasch
32! calculation of b_cond replaced by calculation of bfactor
33!
34! 221 2009-01-12 15:32:23Z raasch
35! Bugfix: abort in case that absolute temperature is below zero
36!
37! 95 2007-06-02 16:48:38Z raasch
38! hydro_press renamed hyp
39!
40! February 2007
41! RCS Log replace by Id keyword, revision history cleaned up
42!
43! Revision 1.5  2005/06/26 19:55:58  raasch
44! Initialization of cloud droplet constants, gas_constant renamed r_d,
45! latent_heat renamed l_v
46!
47! Revision 1.1  2000/04/13 14:37:22  schroeter
48! Initial revision
49!
50!
51! Description:
52! ------------
53! Initialization of parameters for handling cloud-physics
54!------------------------------------------------------------------------------!
55
56    USE arrays_3d
57    USE cloud_parameters
58    USE constants
59    USE control_parameters
60    USE grid_variables
61    USE indices
62
63    IMPLICIT NONE
64
65    INTEGER ::  k
66    REAL    ::  t_surface
67
68    ALLOCATE( hyp(nzb:nzt+1), pt_d_t(nzb:nzt+1), t_d_pt(nzb:nzt+1) )
69
70!
71!-- Calculate frequently used parameters
72    l_d_cp = l_v / cp
73    l_d_r  = l_v / r_d
74    l_d_rv = l_v / r_v
75!
76!-- Calculate factor used in equation for droplet growth by condensation
77    bfactor = 3.0 * vanthoff * mass_of_solute * molecular_weight_of_water &
78              / ( 4.0 * pi * rho_l * molecular_weight_of_solute )
79!
80!-- Calculate:
81!-- pt / t : ratio of potential and actual temperature (pt_d_t)
82!-- t / pt : ratio of actual and potential temperature (t_d_pt)
83!-- p_0(z) : vertical profile of the hydrostatic pressure (hyp)
84    t_surface = pt_surface * ( surface_pressure / 1000.0 )**0.286
85    DO  k = nzb, nzt+1
86!
87!--    Check temperature in case of too large domain height
88       IF ( ( t_surface - g/cp * zu(k) ) < 0.0 )  THEN
89          WRITE( message_string, * )  'absolute temperature < 0.0 at zu(', k, &
90                                      ') = ', zu(k)
91          CALL message( 'init_cloud_physics', 'PA0142', 1, 2, 0, 6, 0 )
92       ENDIF
93       hyp(k)    = surface_pressure * 100.0 * &
94                   ( (t_surface - g/cp * zu(k)) / t_surface )**(1.0/0.286)
95       pt_d_t(k) = ( 100000.0 / hyp(k) )**0.286
96       t_d_pt(k) = 1.0 / pt_d_t(k)       
97    ENDDO
98
99!
100!-- Compute reference density
101    rho_surface = surface_pressure * 100.0 / ( r_d * t_surface )
102
103
104 END SUBROUTINE init_cloud_physics
Note: See TracBrowser for help on using the repository browser.