diff --git a/src/forcing.jl b/src/forcing.jl index 78ec025f7..294aa2908 100644 --- a/src/forcing.jl +++ b/src/forcing.jl @@ -16,8 +16,8 @@ function AtmosphericForcing( temperature::Vector{T} = fill(mv, n), ) where {T} return AtmosphericForcing{T}(; - precipitation = precipitation, - potential_evaporation = potential_evaporation, - temperature = temperature, + precipitation, + potential_evaporation, + temperature, ) end \ No newline at end of file diff --git a/src/horizontal_process.jl b/src/horizontal_process.jl index 51ad1212f..ffca7d9f9 100644 --- a/src/horizontal_process.jl +++ b/src/horizontal_process.jl @@ -104,12 +104,11 @@ function ssf_celerity(zi, slope, theta_e, kh_profile::KhExponentialConstant, i) (; z_exp) = kh_profile (; kh_0, f) = kh_profile.exponential Cn_const = (kh_0[i] * exp(-f[i] * z_exp[i]) * slope) / theta_e - if zi < z_exp[i] - Cn = (kh_0[i] * exp(-f[i] * zi) * slope) / theta_e + Cn_const + return if zi < z_exp[i] + (kh_0[i] * exp(-f[i] * zi) * slope) / theta_e + Cn_const else - Cn = Cn_const + Cn_const end - return Cn end """ diff --git a/src/sbm_gwf_model.jl b/src/sbm_gwf_model.jl index e0d4e9abb..725b58177 100644 --- a/src/sbm_gwf_model.jl +++ b/src/sbm_gwf_model.jl @@ -124,10 +124,10 @@ function initialize_sbm_gwf_model(config::Config) if do_water_demand areas = unique(lsm.allocation.parameters.areas) for a in areas - area_index = findall(x -> x == a, lsm.allocation.parameters.areas) + area_index = findall(==(a), lsm.allocation.parameters.areas) push!(inds_allocation_areas, area_index) area_riv_index = - findall(x -> x == a, lsm.allocation.parameters.areas[index_river]) + findall(==(a), lsm.allocation.parameters.areas[index_river]) push!(inds_riv_allocation_areas, area_riv_index) end end @@ -346,8 +346,8 @@ function initialize_sbm_gwf_model(config::Config) end gwf = GroundwaterFlow{Float}(; - aquifer = aquifer, - connectivity = connectivity, + aquifer, + connectivity, constanthead = constant_head, boundaries = aquifer_boundaries, ) diff --git a/src/sbm_model.jl b/src/sbm_model.jl index 93f6576c3..8f5d4f689 100644 --- a/src/sbm_model.jl +++ b/src/sbm_model.jl @@ -148,8 +148,8 @@ function initialize_sbm_model(config::Config) khfrac = khfrac, zi = ssf_zi, soilthickness = ssf_soilthickness, - theta_s = theta_s, - theta_r = theta_r, + theta_s, + theta_r, dt = dt / basetimestep, slope = landslope, dl = dl, diff --git a/src/utils.jl b/src/utils.jl index c7ed6a953..08a754fd8 100644 --- a/src/utils.jl +++ b/src/utils.jl @@ -701,13 +701,12 @@ function hydraulic_conductivity_at_depth(p::KvLayered, kvfrac, z, i, n) end function hydraulic_conductivity_at_depth(p::KvLayeredExponential, kvfrac, z, i, n) - if z < p.z_layered[i] - kv_z = kvfrac[i][n] * p.kv[i][n] + return if z < p.z_layered[i] + kvfrac[i][n] * p.kv[i][n] else n = p.nlayers_kv[i] - kv_z = kvfrac[i][n] * p.kv[i][n] * exp(-p.f[i] * (z - p.z_layered[i])) + kvfrac[i][n] * p.kv[i][n] * exp(-p.f[i] * (z - p.z_layered[i])) end - return kv_z end """ @@ -732,7 +731,7 @@ function kh_layered_profile!( for i in eachindex(kh) m = nlayers[i] - if (soilthickness[i] - zi[i]) > 0.0 + if soilthickness[i] > zi[i] transmissivity = 0.0 _sumlayers = @view sumlayers[i][2:end] n = max(n_unsatlayers[i], 1) @@ -768,7 +767,7 @@ function kh_layered_profile!( for i in eachindex(kh) m = nlayers[i] - if (soilthickness[i] - zi[i]) > 0.0 + if soilthickness[i] > zi[i] transmissivity = 0.0 n = max(n_unsatlayers[i], 1) if zi[i] >= z_layered[i]