@@ -163,11 +163,17 @@ function soil_vangenuchten_parameters(
163
163
file_reader_kwargs = (; preprocess_func = (data) -> data > 0 ,),
164
164
)
165
165
# If the parameter mask = 0, set to physical value
166
+ # (equal to the mean where we have data; the mean of α is in log space)
166
167
# This function in applied in **simulation mask** aware
167
168
# manner.
168
- μ = FT (0.27 )
169
+ # That is, we replace values in the simulation, but without data, with the mean
170
+ # over the data.
171
+ masked_to_value (field, mask, value) =
172
+ mask == 1.0 ? field : eltype (field)(value)
173
+
174
+ μ = FT (0.33 )
169
175
vg_α .= masked_to_value .(vg_α, soil_params_mask, 10.0 ^ μ)
170
- μ = FT (1.65 )
176
+ μ = FT (1.74 )
171
177
vg_n .= masked_to_value .(vg_n, soil_params_mask, μ)
172
178
173
179
vg_fields_to_hcm_field (α:: FT , n:: FT ) where {FT} =
@@ -206,13 +212,13 @@ function soil_vangenuchten_parameters(
206
212
regridder_kwargs = (; extrapolation_bc,),
207
213
)
208
214
209
- μ = FT (- 6 )
215
+ # Set missing values to the mean. For Ksat, we use the mean in log space.
216
+ μ = FT (- 5.08 )
210
217
K_sat .= masked_to_value .(K_sat, soil_params_mask, 10.0 ^ μ)
211
218
212
- μ = FT (0.5 )
213
- ν .= masked_to_value .(ν, soil_params_mask, μ)
219
+ ν .= masked_to_value .(ν, soil_params_mask, 0.47 )
214
220
215
- θ_r .= masked_to_value .(θ_r, soil_params_mask, 0 )
221
+ θ_r .= masked_to_value .(θ_r, soil_params_mask, 0.09 )
216
222
217
223
return (; ν = ν, hydrology_cm = hydrology_cm, K_sat = K_sat, θ_r = θ_r)
218
224
end
@@ -291,10 +297,11 @@ function soil_composition_parameters(
291
297
# we require that the sum of these be less than 1 and equal to or bigger than zero.
292
298
# The input should satisfy this almost exactly, but the regridded values may not.
293
299
# Values of zero are OK here, so we dont need to apply any masking
294
- texture_norm = @. min (ν_ss_gravel + ν_ss_quartz + ν_ss_om, 1 )
295
- @. ν_ss_gravel = ν_ss_gravel / max (texture_norm, eps (FT))
296
- @. ν_ss_om = ν_ss_om / max (texture_norm, eps (FT))
297
- @. ν_ss_quartz = ν_ss_quartz / max (texture_norm, eps (FT))
300
+ # if sum > 1, normalize by sum, else "normalize" by 1 (i.e., do not normalize)
301
+ texture_norm = @. max (ν_ss_gravel + ν_ss_quartz + ν_ss_om, 1 )
302
+ @. ν_ss_gravel = ν_ss_gravel / texture_norm
303
+ @. ν_ss_om = ν_ss_om / texture_norm
304
+ @. ν_ss_quartz = ν_ss_quartz / texture_norm
298
305
299
306
return (;
300
307
ν_ss_om = ν_ss_om,
0 commit comments