-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add boundary fluxes terms to the soil jacobian when running with prescribed atmos #1011
base: main
Are you sure you want to change the base?
Conversation
topBC_op_water = topBC_op_heat | ||
end | ||
# Add term from top boundary condition before applying divergence | ||
# Note: need to pass 3D field on faces to `topBC_op`. Interpolating `K` to faces |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When you wrote "this is inefficient", why is that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@juliasloan25 do you recall what this was about?
src/integrated/land.jl
Outdated
ρc = p.soil.sub_sfc_scratch | ||
@. ρc = | ||
volumetric_heat_capacity(p.soil.θ_l, Y.soil.θ_i, ρc_ds, earth_param_set) | ||
ρc_sfc = ClimaLand.Domains.top_center_to_surface(ρc) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is allocating - is there another scratch space we could use?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh! I think top_center_to_surface is OK - because it is just pulling out a view of the field.
src/integrated/soil_canopy_model.jl
Outdated
ρc = p.soil.sub_sfc_scratch | ||
@. ρc = | ||
volumetric_heat_capacity(p.soil.θ_l, Y.soil.θ_i, ρc_ds, earth_param_set) | ||
ρc_sfc = ClimaLand.Domains.top_center_to_surface(ρc) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same comment as above w.r.t. allocations
…ub.com/CliMA/ClimaLand.jl into kd/jacobian_boundary_flux_atmos_driven
Purpose
Adds infrastructure for adding d(boundary flux)/dY to the Jacobian for the soil model when Atmos-Driven fluxes are used.
Currently sets the contributions to zero, no change in simulations are expected. I turned on the "run benchmarks" to see if there is any impact.
To-do
Content
Adds space to the cache for dLHFdT, dSHFdT, dGHFdT. Currently only the last one is updated/nonzero. The other two are set to zero
These terms will then be used in dFlux/dT dT/d rho e. We allocated space for those in the cache, but they are currently set to zero.
These terms are then added into the jacobian for the soil model.