Skip to content

Commit

Permalink
bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
kmdeck committed Dec 13, 2024
1 parent 7884d44 commit 1d1dd77
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/tutorials/standalone/Soil/freezing_front.jl
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ ode_algo = CTS.IMEXAlgorithm(
timestepper,
CTS.NewtonsMethod(
max_iters = 3,
update_j = CTS.UpdateEvery(CTS.NewTimeStep),
update_j = CTS.UpdateEvery(CTS.NewNewtonIteration),
),
);

Expand Down
9 changes: 4 additions & 5 deletions src/shared_utilities/implicit_timestepping.jl
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,11 @@ function ImplicitEquationJacobian(Y::ClimaCore.Fields.FieldVector)
# Here, we take the convention that each pair has order (T_x, y) to produce ∂T_x/∂y as above
off_diagonal_pairs = ((@name(soil.ρe_int), @name(soil.ϑ_l)),)
available_off_diagonal_pairs =
MatrixFields.unrolled_filter(is_in_Y, off_diagonal_pairs)
MatrixFields.unrolled_filter(pair -> all(is_in_Y.(pair)),off_diagonal_pairs)
implicit_off_diagonals = MatrixFields.unrolled_map(
var_tend,
var ->
(var_tend, var) =>
get_j_field(axes(MatrixFields.get_field(Y, var_tend)), FT),
pair ->
(pair[1], pair[2]) =>
get_j_field(axes(MatrixFields.get_field(Y, pair[1])), FT),
available_off_diagonal_pairs,
)
# For explicitly-stepped variables, use the negative identity matrix
Expand Down
2 changes: 1 addition & 1 deletion src/standalone/Soil/energy_hydrology.jl
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ function ClimaLand.make_compute_jacobian(model::EnergyHydrology{FT}) where {FT}
-dtγ * (
divf2c_matrix()
MatrixFields.DiagonalMatrixRow(
-interpc2f(
-interpc2f_op(
volumetric_internal_energy_liq(
p.soil.T,
model.parameters.earth_param_set,
Expand Down

0 comments on commit 1d1dd77

Please sign in to comment.