Skip to content

Fix dt passed uninitialized to b4step2#693

Merged
rjleveque merged 1 commit intoclawpack:masterfrom
carlosmunozmoncayo:fix_b4step_dt
Feb 22, 2026
Merged

Fix dt passed uninitialized to b4step2#693
rjleveque merged 1 commit intoclawpack:masterfrom
carlosmunozmoncayo:fix_b4step_dt

Conversation

@carlosmunozmoncayo
Copy link
Contributor

Fix uninitialized dt passed to b4step2 in advanc.

@rjleveque
Copy link
Member

Thanks @carlosmunozmoncayo, good catch! We don't use dt in the default version src/2d/shallow/b4step2.f90 but good to get this fixed for users who need it.

@mandli
Copy link
Member

mandli commented Feb 14, 2026

I was surprised that b4step was broken as we set a number of time-dependent things in multilayer and surge applications, but we don't need the current time step as that is used in src2. That got me thinking to the purpose of b4step and whether dt can be relied upon to be accurate, or if it is something that should be done in src2. I could see interpolation being a good use case though, and for the exact same reason we set the storm fields in b4step, the interpolation needs to be done there.

All this is to say, we should definitely fix this as this probably broke when moving b4step2 recently (me). The rest is thinking about how dt may be fragile, or maybe not and I am thinking too deeply on this.

@rjleveque
Copy link
Member

@mandli, I don't think b4step was broken, it was the calls to b4step in advanc that passed dt instead of delt, the variable name used there.

You raise a question about whether this value is accurate -- It seems like it should be since the call to b4step in advanc should use the same value as in the call to stepgrid a bit later. That call returns dtnew suggested for the next step, but I think the step taken is of size delt.

@mandli
Copy link
Member

mandli commented Feb 14, 2026

b4step was broken, but the new code we added when we moved b4step to advanc needed to use delt, rather than what it was when being called from stepgrid. You are right though, any issues would have been present already.

@rjleveque rjleveque merged commit 37d0bf5 into clawpack:master Feb 22, 2026
1 check failed
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.

3 participants