Skip to content

Conversation

haakon-e
Copy link
Member

@haakon-e haakon-e commented Oct 10, 2025

This pull request introduces improved error handling and model differentiation in the update_jacobian! function within the manual_sparse_jacobian.jl file. The changes ensure that unsupported or unknown vertical diffusion types are caught early and provide clearer handling for different turbulence convection models.

Key changes:

Model differentiation and error handling:

  • Added an explicit check for AbstractEDMF turbulence convection models in the conditional logic, making the code more robust and maintainable.
  • Introduced an error message for unknown vertical_diffusion types, preventing silent failures and aiding debugging.

Anna and I ran into this else block while working with Smagorinsky diffusion for her simulation setup (i.e. yaml has vert_diff: false, and no EDMF).

It is likely due to incorrectly configured yaml file: i.e. implicit_diffusion: true is only compatible with DecayWithHeightDiffusion, VerticalDiffusion, or (I presume) EDMF-type closures. For convenience, this PR proposes to explicitly check this both during model construction, and make it clearer within the jacobian that the last block pertains to EDMF.

@haakon-e haakon-e force-pushed the he/fix-error-on-inconsistent branch from b515307 to b5b3159 Compare October 10, 2025 18:31
@haakon-e haakon-e force-pushed the he/fix-error-on-inconsistent branch from b5b3159 to 1aabddf Compare October 10, 2025 18:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant