[1] | 1 | SUBROUTINE init_cloud_physics |
---|
| 2 | |
---|
[1036] | 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 | ! |
---|
[1310] | 17 | ! Copyright 1997-2014 Leibniz Universitaet Hannover |
---|
[1036] | 18 | !--------------------------------------------------------------------------------! |
---|
| 19 | ! |
---|
[484] | 20 | ! Current revisions: |
---|
[1] | 21 | ! ----------------- |
---|
[1335] | 22 | ! |
---|
[1354] | 23 | ! |
---|
[1321] | 24 | ! Former revisions: |
---|
| 25 | ! ------------------ |
---|
| 26 | ! $Id: init_cloud_physics.f90 1354 2014-04-08 15:22:57Z heinze $ |
---|
[1323] | 27 | ! |
---|
[1354] | 28 | ! 1353 2014-04-08 15:21:23Z heinze |
---|
| 29 | ! REAL constants provided with KIND-attribute |
---|
| 30 | ! |
---|
[1335] | 31 | ! 1334 2014-03-25 12:21:40Z heinze |
---|
| 32 | ! Bugfix: REAL constants provided with KIND-attribute |
---|
| 33 | ! |
---|
[1323] | 34 | ! 1322 2014-03-20 16:38:49Z raasch |
---|
| 35 | ! REAL constants defined as wp-kind |
---|
[1321] | 36 | ! |
---|
| 37 | ! 1320 2014-03-20 08:40:49Z raasch |
---|
[1320] | 38 | ! ONLY-attribute added to USE-statements, |
---|
| 39 | ! kind-parameters added to all INTEGER and REAL declaration statements, |
---|
| 40 | ! kinds are defined in new module mod_kinds, |
---|
| 41 | ! revision history before 2012 removed, |
---|
| 42 | ! comment fields (!:) to be used for variable explanations added to |
---|
| 43 | ! all variable declaration statements |
---|
[1054] | 44 | ! |
---|
[1066] | 45 | ! 1065 2012-11-22 17:42:36Z hoffmann |
---|
| 46 | ! The Courant number of sedimentation can be controlled with c_sedimentation. |
---|
| 47 | ! |
---|
[1054] | 48 | ! 1053 2012-11-13 17:11:03Z hoffmann |
---|
[1053] | 49 | ! calculation of the maximum timestep according to the terminal velocity of rain |
---|
| 50 | ! drops in the two moment cloud scheme |
---|
[1] | 51 | ! |
---|
[1053] | 52 | ! calculation of frequently used constants (pirho_l, dpirho_l, schmidt_p_1d3, |
---|
| 53 | ! hyrho) |
---|
| 54 | ! |
---|
[1037] | 55 | ! 1036 2012-10-22 13:43:42Z raasch |
---|
| 56 | ! code put under GPL (PALM 3.9) |
---|
| 57 | ! |
---|
[826] | 58 | ! 824 2012-02-17 09:09:57Z raasch |
---|
| 59 | ! calculation of b_cond replaced by calculation of bfactor |
---|
| 60 | ! |
---|
[1] | 61 | ! Revision 1.1 2000/04/13 14:37:22 schroeter |
---|
| 62 | ! Initial revision |
---|
| 63 | ! |
---|
| 64 | ! |
---|
| 65 | ! Description: |
---|
| 66 | ! ------------ |
---|
| 67 | ! Initialization of parameters for handling cloud-physics |
---|
| 68 | !------------------------------------------------------------------------------! |
---|
| 69 | |
---|
[1320] | 70 | USE arrays_3d, & |
---|
| 71 | ONLY: dzu, hyp, pt_init, zu |
---|
| 72 | |
---|
| 73 | USE cloud_parameters, & |
---|
| 74 | ONLY: bfactor, cp, c_sedimentation, dpirho_l, dt_precipitation, & |
---|
| 75 | hyrho, l_d_cp, l_d_r, l_d_rv, l_v, mass_of_solute, & |
---|
| 76 | molecular_weight_of_solute, molecular_weight_of_water, pirho_l, & |
---|
| 77 | pt_d_t, rho_l, r_d, r_v, schmidt, schmidt_p_1d3, t_d_pt, & |
---|
| 78 | vanthoff, w_precipitation |
---|
| 79 | |
---|
| 80 | USE constants, & |
---|
| 81 | ONLY: pi |
---|
| 82 | |
---|
| 83 | USE control_parameters, & |
---|
| 84 | ONLY: g, icloud_scheme, message_string, precipitation, pt_surface, & |
---|
| 85 | rho_surface, surface_pressure |
---|
| 86 | |
---|
| 87 | USE indices, & |
---|
| 88 | ONLY: nzb, nzt |
---|
| 89 | |
---|
| 90 | USE kinds |
---|
[1] | 91 | |
---|
| 92 | IMPLICIT NONE |
---|
| 93 | |
---|
[1320] | 94 | INTEGER(iwp) :: k !: |
---|
| 95 | |
---|
| 96 | REAL(wp) :: t_surface !: |
---|
[1] | 97 | |
---|
[1353] | 98 | ALLOCATE( hyp(nzb:nzt+1), pt_d_t(nzb:nzt+1), t_d_pt(nzb:nzt+1), & |
---|
[1053] | 99 | hyrho(nzb:nzt+1) ) |
---|
[1] | 100 | |
---|
| 101 | ! |
---|
[824] | 102 | !-- Calculate frequently used parameters |
---|
[1] | 103 | l_d_cp = l_v / cp |
---|
| 104 | l_d_r = l_v / r_d |
---|
| 105 | l_d_rv = l_v / r_v |
---|
[1053] | 106 | |
---|
[1322] | 107 | schmidt_p_1d3 = schmidt**( 1.0_wp / 3.0_wp ) |
---|
[1053] | 108 | |
---|
[1353] | 109 | pirho_l = pi * rho_l / 6.0_wp |
---|
| 110 | dpirho_l = 1.0_wp / pirho_l |
---|
[1] | 111 | ! |
---|
[1053] | 112 | !-- Calculate timestep according to precipitation |
---|
| 113 | IF ( icloud_scheme == 0 .AND. precipitation ) THEN |
---|
[1353] | 114 | dt_precipitation = c_sedimentation * MINVAL( dzu(nzb+2:nzt) ) / & |
---|
[1065] | 115 | w_precipitation |
---|
[1053] | 116 | ENDIF |
---|
| 117 | ! |
---|
[824] | 118 | !-- Calculate factor used in equation for droplet growth by condensation |
---|
[1353] | 119 | bfactor = 3.0_wp * vanthoff * mass_of_solute * molecular_weight_of_water & |
---|
| 120 | / ( 4.0_wp * pi * rho_l * molecular_weight_of_solute ) |
---|
[1] | 121 | ! |
---|
| 122 | !-- Calculate: |
---|
| 123 | !-- pt / t : ratio of potential and actual temperature (pt_d_t) |
---|
| 124 | !-- t / pt : ratio of actual and potential temperature (t_d_pt) |
---|
[95] | 125 | !-- p_0(z) : vertical profile of the hydrostatic pressure (hyp) |
---|
[1353] | 126 | t_surface = pt_surface * ( surface_pressure / 1000.0_wp )**0.286_wp |
---|
[1] | 127 | DO k = nzb, nzt+1 |
---|
[221] | 128 | ! |
---|
| 129 | !-- Check temperature in case of too large domain height |
---|
[1353] | 130 | IF ( ( t_surface - g/cp * zu(k) ) < 0.0_wp ) THEN |
---|
[221] | 131 | WRITE( message_string, * ) 'absolute temperature < 0.0 at zu(', k, & |
---|
| 132 | ') = ', zu(k) |
---|
[226] | 133 | CALL message( 'init_cloud_physics', 'PA0142', 1, 2, 0, 6, 0 ) |
---|
[221] | 134 | ENDIF |
---|
[1353] | 135 | hyp(k) = surface_pressure * 100.0_wp * & |
---|
[1322] | 136 | ( (t_surface - g/cp * zu(k)) / t_surface )**(1.0_wp/0.286_wp) |
---|
[1353] | 137 | pt_d_t(k) = ( 100000.0_wp / hyp(k) )**0.286_wp |
---|
| 138 | t_d_pt(k) = 1.0_wp / pt_d_t(k) |
---|
[1053] | 139 | hyrho(k) = hyp(k) / ( r_d * t_d_pt(k) * pt_init(k) ) |
---|
[1] | 140 | ENDDO |
---|
| 141 | |
---|
| 142 | ! |
---|
| 143 | !-- Compute reference density |
---|
[1353] | 144 | rho_surface = surface_pressure * 100.0_wp / ( r_d * t_surface ) |
---|
[1] | 145 | |
---|
| 146 | |
---|
| 147 | END SUBROUTINE init_cloud_physics |
---|