Skip to content

Draft: Small ginit change - #732

Open
kbarnhart wants to merge 1 commit into
clawpack:masterfrom
kbarnhart:small_ginit_change
Open

Draft: Small ginit change#732
kbarnhart wants to merge 1 commit into
clawpack:masterfrom
kbarnhart:small_ginit_change

Conversation

@kbarnhart

Copy link
Copy Markdown
Contributor

In current D-Claw work we have recently found that this change is needed to allow values to persist in aux across regrinding.

For the moment we have made this change in a D-Claw specific ginit. But if the change does not cause problems in geoclaw, perhaps it should live here. For reference, in D-Claw we are working to create a storage layer of static material to put h<drytol. We'd like this to be in aux. If this change is not made, that value of aux is set to zero every time regridding occurs. With this change we can know which parts that aux variable need to be set.

@rjleveque @mandli @dlgeorge

@kbarnhart kbarnhart changed the title Draft: Small init change Draft: Small ginit change Aug 26, 2026
@mandli

mandli commented Aug 26, 2026

Copy link
Copy Markdown
Member

Thanks @kbarnhart. I remember you bringing this up and being confused about why this might be needed. I was able I think to puzzle out what I was not understanding and have a couple of comments:

  • The change should be fine in GeoClaw. setaux used NEEDS_TO_BE_SET only on the topo component and is used mostly so that topo does not need to be recomputed if an existing grid at the same level overlaps with requested block. Setting the rest won't matter unless they have modified setaux to look for NEEDS_TO_BE_SET. This may take time though to set the arrays to this value rather than just assuming it though.
  • Future aux values may need this feature. We could need this for aux components that are either expensive to compute or, as in your case, it needs to persist. We should make it clear though that if we set NEEDS_TO_BE_SET that this value does not mean it has been, i.e. we may need to ensure that the logic holds out.
  • This alone will not solve the persistence problem in D-Claw. As I think you may have realized, the subroutines that set aux are fillval + setaux. I assume that in D-Claw you have gotten the logic already so that this is solved, and you are simply copying in the values you need for NEEDS_TO_BE_SET but note that the idea behind this again was to reduce computational overhead rather than implement persistence. Not that we cannot do this, but it was originally intended for something else.

I have not looked through what you did in D-Claw so far, but the implementation that I think should work would require (a) setaux to check for NEEDS_TO_BE_SET before writing and (b) filval to flag that component before icall so only un-copied cells get recomputed.

We may also want to add a comment mentioning what NEEDS_TO_BE_SET means, matching filval.f90:136 for consistency between the pathway for initialization and regridding.

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