20 USE def_control,
ONLY: strctrl
21 USE def_atm,
ONLY: stratm
22 USE def_spectrum,
ONLY: strspecdata
23 USE def_dimen,
ONLY: strdim
24 USE def_cld,
ONLY: strcld, allocate_cld, allocate_cld_prsc
39 TYPE(StrCtrl),
INTENT(IN) :: control
42 TYPE(StrAtm),
INTENT(IN) :: atm
45 TYPE(StrDim),
INTENT(IN) :: dimen
48 TYPE (StrSpecData),
INTENT(IN) :: spectrum
51 TYPE(StrCld),
INTENT(OUT) :: cld
54 type (str_merge_atm),
intent(in) :: merge_fields
57 type (str_socrates_options),
intent(in) :: socrates_opt
61 condensed_min_dim(dimen%nd_cloud_component) &
63 , condensed_max_dim(dimen%nd_cloud_component)
72 INTEGER,
intent(in) :: &
81 REAL,
PARAMETER :: a0_agg_cold = 7.5094588e-04
82 REAL,
PARAMETER :: b0_agg_cold = 5.0830326e-07
83 REAL,
PARAMETER :: a0_agg_warm = 1.3505403e-04
84 REAL,
PARAMETER :: b0_agg_warm = 2.6517429e-05
85 REAL,
PARAMETER :: t_switch = 216.208
86 REAL,
PARAMETER :: t0_agg = 279.5
87 REAL,
PARAMETER :: s0_agg = 0.05
90 REAL,
PARAMETER :: a1_s=45.9866
91 REAL,
PARAMETER :: a2_s=0.2214
92 REAL,
PARAMETER :: a3_s=0.7957
93 REAL,
PARAMETER :: a4_s=0.2535
94 REAL,
PARAMETER :: a5_s=83.15
95 REAL,
PARAMETER :: a6_s=1.2351
96 REAL,
PARAMETER :: a7_s=0.0105
98 REAL,
PARAMETER :: a8_s=30.0
104 REAL,
PARAMETER :: m_ice_baran = 1.868e-6
105 REAL,
PARAMETER :: n_ice_baran = 353.613e-6
106 REAL,
PARAMETER :: min_ice_baran = 7.0e-6
107 REAL,
PARAMETER :: max_ice_baran = 156.631e-6
113 INTEGER,
EXTERNAL :: set_n_cloud_parameter
116 call allocate_cld(cld, dimen, spectrum)
117 call allocate_cld_prsc(cld, dimen, spectrum)
120 IF ( (control%i_st_water <= spectrum%dim%nd_drop_type) .AND. &
121 (spectrum%drop%l_drop_type(control%i_st_water)) )
THEN
122 i_scheme=spectrum%drop%i_drop_parm(control%i_st_water)
123 cld%i_condensed_param(ip_clcmp_st_water)=i_scheme
124 cld%condensed_n_phf(ip_clcmp_st_water)= &
125 spectrum%drop%n_phf(control%i_st_water)
126 condensed_min_dim(ip_clcmp_st_water) &
127 =spectrum%drop%parm_min_dim(control%i_st_water)
128 condensed_max_dim(ip_clcmp_st_water) &
129 =spectrum%drop%parm_max_dim(control%i_st_water)
132 (
log_error,
"Socrates error: no data exist for type of selected droplet - STOP")
135 DO i=1, spectrum%basic%n_band
137 DO j=1, set_n_cloud_parameter(i_scheme &
138 , ip_clcmp_st_water, cld%condensed_n_phf(ip_clcmp_st_water))
139 cld%condensed_param_list(j, ip_clcmp_st_water, i) &
140 =spectrum%drop%parm_list(j, i, control%i_st_water)
145 IF ( (control%i_st_ice <= spectrum%dim%nd_ice_type) .AND. &
146 (spectrum%ice%l_ice_type(control%i_st_ice)) )
THEN
147 i_scheme=spectrum%ice%i_ice_parm(control%i_st_ice)
148 cld%i_condensed_param(ip_clcmp_st_ice)=i_scheme
149 cld%condensed_n_phf(ip_clcmp_st_ice)= &
150 spectrum%ice%n_phf(control%i_st_ice)
151 condensed_min_dim(ip_clcmp_st_ice) &
152 =spectrum%ice%parm_min_dim(control%i_st_ice)
153 condensed_max_dim(ip_clcmp_st_ice) &
154 =spectrum%ice%parm_max_dim(control%i_st_ice)
157 (
log_error,
"Socrates error: no data exist for type of ice crystal - STOP")
160 DO i=1, spectrum%basic%n_band
162 DO j=1, set_n_cloud_parameter(i_scheme &
163 , ip_clcmp_st_ice, cld%condensed_n_phf(ip_clcmp_st_ice))
164 cld%condensed_param_list(j, ip_clcmp_st_ice, i) &
165 = spectrum%ice%parm_list(j, i, control%i_st_ice)
169 IF (socrates_opt%cloud_representation == ip_cloud_ice_water)
THEN
184 cld%type_condensed(1)=ip_clcmp_st_water
185 cld%type_condensed(2)=ip_clcmp_st_ice
202 IF (merge_fields%total_cloud_fraction(j) > &
203 epsilon(merge_fields%total_cloud_fraction(j)))
THEN
204 cld%condensed_mix_ratio(l, j, ip_clcmp_st_water) = &
205 ( merge_fields%ql_n(j) + merge_fields%qi_n(j) )/ &
206 merge_fields%total_cloud_fraction(j)
208 cld%condensed_mix_ratio(l, j, ip_clcmp_st_water) = 0.0
210 cld%condensed_mix_ratio(l, j, ip_clcmp_st_ice) = &
211 cld%condensed_mix_ratio(l, j, ip_clcmp_st_water)
219 cld%w_cloud(l, j) = merge_fields%total_cloud_fraction(j)
222 cld%frac_cloud(l, j, ip_cloud_type_sw) = merge_fields%liquid_cloud_fraction(j)
223 cld%frac_cloud(l, j, ip_cloud_type_si) = merge_fields%ice_cloud_fraction(j)
227 if (socrates_opt%l_fix_re)
then
230 cld%condensed_dim_char(l, j, ip_clcmp_cnv_water) = 0.0_default_precision
232 cld%condensed_dim_char(l, j, ip_clcmp_st_water) = socrates_opt%fixed_cloud_re * 1.e-6
237 if (socrates_opt%l_use_ndrop)
then
238 IF (socrates_opt%l_use_liu_spec)
THEN
261 cld%condensed_dim_char(l, j, ip_clcmp_cnv_water) = 0.0_default_precision
262 cld%condensed_dim_char(l, j, ip_clcmp_st_water) = max(0.0_default_precision, &
263 3.0_default_precision*cld%condensed_mix_ratio(l, j, ip_clcmp_st_water) &
264 *atm%density(l, j)/(4.0_default_precision*
pi*socrates_opt%rho_water* &
265 socrates_opt%kparam*merge_fields%cloudnumber_n(j)) &
266 **(1.0_default_precision/3.0_default_precision))
277 cld%condensed_dim_char(l, j, ip_clcmp_st_water) &
278 =max(condensed_min_dim(ip_clcmp_st_water) &
279 , min(condensed_max_dim(ip_clcmp_st_water) &
280 , cld%condensed_dim_char(l, j, ip_clcmp_st_water)))
281 cld%condensed_dim_char(l, j, ip_clcmp_cnv_water) &
282 =max(condensed_min_dim(ip_clcmp_cnv_water) &
283 , min(condensed_max_dim(ip_clcmp_cnv_water) &
284 , cld%condensed_dim_char(l, j, ip_clcmp_cnv_water)))
286 cld%condensed_dim_char(l, j, ip_clcmp_st_ice) = 0.0
295 SELECT CASE (cld%i_condensed_param(ip_clcmp_st_ice))
297 CASE (ip_ice_agg_de, ip_ice_agg_de_sun)
317 IF (atm%t(l, i) < t_switch)
THEN
318 cld%condensed_dim_char(l, i, ip_clcmp_st_ice) &
319 = a0_agg_cold*exp(s0_agg*(atm%t(l, i)-t0_agg))+b0_agg_cold
321 cld%condensed_dim_char(l, i, ip_clcmp_st_ice) &
322 = a0_agg_warm*exp(s0_agg*(atm%t(l, i)-t0_agg))+b0_agg_warm
325 cld%condensed_dim_char(l, i, ip_clcmp_st_ice) &
326 = (3.0/2.0)*(3.0/(2.0*sqrt(3.0)))* &
327 min(1.24e-04, max(8.0e-06, &
328 cld%condensed_dim_char(l, i, ip_clcmp_st_ice)))
338 cld%condensed_dim_char(l, i, ip_clcmp_st_ice) &
339 =max(condensed_min_dim(ip_clcmp_st_ice) &
340 , min(condensed_max_dim(ip_clcmp_st_ice) &
341 , cld%condensed_dim_char(l, i, ip_clcmp_st_ice)))
342 cld%condensed_dim_char(l, i, ip_clcmp_cnv_ice) &
343 =max(condensed_min_dim(ip_clcmp_cnv_ice) &
344 , min(condensed_max_dim(ip_clcmp_cnv_ice) &
345 , cld%condensed_dim_char(l, i, ip_clcmp_cnv_ice)))