clawpack / amrclaw

AMR version of Clawpack
http://www.clawpack.org
BSD 3-Clause "New" or "Revised" License
26 stars 45 forks source link

low storage better estimate for prepc fluxes #268

Closed mjberger closed 3 years ago

mjberger commented 3 years ago

…new low storage prepc made listbc real and added a variable to remember the start of the space on each level. Saved it in check/rest as well.

mjberger commented 3 years ago

already checked. forgot to delete. sorry.

— Marsha

On Jan 2, 2021, at 4:53 PM, Randall J. LeVeque notifications@github.com wrote:

@rjleveque commented on this pull request.

In src/2d/prepc.f https://github.com/clawpack/amrclaw/pull/268#discussion_r550925004:

   mkid   = lstart(level+1)

10 if (mkid .eq. 0) go to 20 ikeep = (node(ndihi,mkid)-node(ndilo,mkid)+1)/intratx(level) jkeep = (node(ndjhi,mkid)-node(ndjlo,mkid)+1)/intraty(level) maxsp = maxsp + 2*(ikeep+jkeep) mkid = node(levelptr,mkid) go to 10

  • 20 listsp(level) = maxsp
  • if (maxsp .eq. 0) go to 99
  • 20 continue
  • !!! maxsp is enough storage for every coarse grid to have an adjustment by
  • !!! a corresponding fine grid flux sum. But not all will.
  • if (maxsp .eq. 0) go to 99 ! no fine grids, so no space needed. CHECK HOW THIS IS MARKED FOR COARSE GRIDS @mjberger https://github.com/mjberger: there's a comment in prepc.f: CHECK HOW THIS IS MARKED FOR COARSE GRIDS Is this something that still needs to be checked, or delete the comment?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/clawpack/amrclaw/pull/268#pullrequestreview-560657374, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGUGCYNII3KEWHTBSG2D6DSX6IUXANCNFSM4VRLBV6A.

rjleveque commented 3 years ago

You can delete it, commit and push to this same branch and it will update the PR automatically.

mjberger commented 3 years ago

will do right now. Thanks, — Marsha

On Jan 2, 2021, at 4:57 PM, Randall J. LeVeque notifications@github.com wrote:

You can delete it, commit and push to this same branch and it will update the PR automatically.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/clawpack/amrclaw/pull/268#issuecomment-753534641, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGUGC3JT4XLOZZDW6AD4XDSX6JDDANCNFSM4VRLBV6A.

mandli commented 3 years ago

How much more space does this seem to save then in tests?

rjleveque commented 3 years ago

@mandli: For big GeoClaw runs it can be a factor of 20 or more. In a test I just ran the old code died when trying to extend alloc past length approximately 2 billion (at which point integer*4 is not sufficient for indexing), while the new code ran fine, and reports that the maximum length of alloc was about 88 million. There were at most 7-8 million grid cells at any time in this computation.

Thanks @mjberger!

mandli commented 3 years ago

Nice!

mandli commented 3 years ago

Since this is passing tests and looks fine to me I will merge this and then look at the GeoClaw changes.