Skip to content
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 new check_variable_links method #138

Merged
merged 1 commit into from
Nov 27, 2024
Merged

Add new check_variable_links method #138

merged 1 commit into from
Nov 27, 2024

Conversation

sjdaines
Copy link
Member

@sjdaines sjdaines commented Nov 27, 2024

Add

check_variable_links(model, modeldata; [throw_on_error=true] [, expect_hostdep_varnames=["global.tforce"]]) -> links_ok::Bool

This checks that all Variables are linked correctly, by checking that there are no unexpected host-dependent non-state Variables (ie unlinked Variables).

This should be called soon after 'create_model_from_config', so that an appropriate error is generated early in the user model script if any variables are unlinked.

Remove the variable link check from 'check_ready', as that was too late to be useful (often a hard-to-interpret error to do with Variable size or allocation was generated first).

See corresponding PR in PALEOmodel to add this check to PALEOmodel.initialize!

Add
    check_variable_links(model, modeldata; [throw_on_error=true] [, expect_hostdep_varnames=["global.tforce"]]) -> links_ok::Bool

This checks that all Variables are linked correctly, by checking that there are no unexpected host-dependent non-state
Variables (ie unlinked Variables).

This should be called soon after 'create_model_from_config', so that an appropriate error is generated early in the user model script
if any variables are unlinked.

Remove the variable link check from 'check_ready', as that was too late to be useful (often a hard-to-interpret error to do with
Variable size or allocation had already happened).

See corresponding PR in PALEOmodel to add this check to PALEOmodel.initialize!
@sjdaines sjdaines merged commit 0afe6a8 into main Nov 27, 2024
3 checks passed
@sjdaines sjdaines deleted the check_variable_links branch November 27, 2024 18:32
sjdaines added a commit to PALEOtoolkit/PALEOmodel.jl that referenced this pull request Nov 27, 2024
initialize!() now calls new PALEOboxes.check_variable_links() early,
so give a better error message and exit if there is a configuration error resulting in
unlinked variables.

NB: requires new PALEOboxes v0.21.31, with change in PALEOtoolkit/PALEOboxes.jl#138
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