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

feat(idm): update CHD to source static and dynamic list input from the input context #1366

Merged
merged 6 commits into from
Sep 26, 2023

Conversation

mjreno
Copy link
Contributor

@mjreno mjreno commented Sep 24, 2023

No description provided.

@mjreno mjreno marked this pull request as draft September 24, 2023 19:55
Copy link
Contributor

@langevin-usgs langevin-usgs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good, @mjreno. Nice to see this all settling in.

@mjreno
Copy link
Contributor Author

mjreno commented Sep 25, 2023

@langevin-usgs I'm thinking about adding CHD updates to this PR if you aren't opposed to it. Without some initial package there are some missing variables in the dfn2f90 generated code that the BoundaryPackage extensions refer to.

@langevin-usgs
Copy link
Contributor

Sure, I say go for it. This PR is pretty small in it's current form, so the CHD additions make sense here.

@mjreno mjreno changed the title feat(idm): updates to support sourcing of dynamic list input for base stress packages feat(idm): update CHD to source static and dynamic list input from the input context Sep 25, 2023
@mjreno mjreno force-pushed the idm_model_stress_prereqs branch from d0297e1 to f845c67 Compare September 25, 2023 17:45
@mjreno
Copy link
Contributor Author

mjreno commented Sep 26, 2023

This PR introduces extensions to the BndModule (BoundaryPackageExt.f90) to support integrating base stress packages with IDM:

  • BndExtType, which extends BndType, as a new base type for stress packages that want to integrate with IDM.
  • CHD (gwf3chd8.f90) refactored to inherit from BndExtType

This PR reflects changes in approach to managing bound parameters that were outlined in PR #1337, including:

  • IDM allocates and loads based on dfn described parameters (e.g. head), it does not for example aggregate parameters into a 2d bound array
  • In general, IDM tries to represent input as provided from the user. For example, with list based inputs IDM reads and stores cellids. A cellid is translated to a node (user or reduced) on the model side. The BndExtType contains a member cellid that points to the input context.
  • Timeseries and TAS are managed on the input side
  • No auxiliary multipliers or flow (cell area) calculations are done on the input side- this is managed on the model side.
  • While certain parameters may be updated through a copy to the model side (e.g. nbound copied via mem_set_value()), many arrays are intended to be pointed to directly from the model side.

Additional PR details:

  • Some refactoring to package input mempath was done for consistency with respect to how mempaths are managed and also transparency in package code.
  • An IDM function was added to return a FILEIN input file name when a maximum of one input file is expected.
  • BndExtType defines a read and prepare routine that translates cellids to node numbers.
  • Logging is supported (similar to ListReader) but requires packages to implement a routine that can return a value for a bound parameter. CHD implements this routine (bound_value()).

@mjreno mjreno marked this pull request as ready for review September 26, 2023 16:21
@mjreno mjreno force-pushed the idm_model_stress_prereqs branch from 482ee18 to 7e43994 Compare September 26, 2023 17:08
@langevin-usgs langevin-usgs merged commit 173dc50 into MODFLOW-USGS:develop Sep 26, 2023
@mjreno mjreno deleted the idm_model_stress_prereqs branch February 19, 2024 23:31
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.

2 participants