NOAA-GFDL / pace

Re-write of FV3GFS weather/climate model in Python
Apache License 2.0
12 stars 11 forks source link

variables contained within data structures #35

Open bensonr opened 10 months ago

bensonr commented 10 months ago

In the native Fortran code there are many variables stored in the various sub-structures within the ATM datatype. There are separate structures for nesting, inline physics, grid-related quantities, control variables/flags. It makes sense to perform a review of the many variables within the datatypes to ensure we are keeping the bare minimum. This is to ensure we are keeping memory pressure on the various processors we are targeting to a minimum. For example, how often do we use area vs inverse area and does it make sense to keep both.

FlorianDeconinck commented 10 months ago

+1

This can even go further, as the memory available on a device can vary widely and for GPU can be a pretty strong performance killer.

The area vs inverse is the perfect example of a case where on GPU you'd be much better of running the math rather than storing/loading a variable. Going further, one could image that some cached numerics should also live with a "uncached" version where the numerics are ran instead of cached - again to limit memory pressure.

lharris4 commented 10 months ago

Hi, Rusty. I also agree that we could easily recompute most if not all the metrics necessary when they are needed. (Virtually everything can be recomputed from the array of grid corners.) In addition this would make creating a deep atmosphere dynamics easier since the area of the grid cell then depends on altitude.

Lucas

On Thu, Oct 26, 2023 at 3:54 PM Florian Deconinck @.***> wrote:

+1

This can even go further, as the memory available on a device can vary widely and for GPU can be a pretty strong performance killer.

The area vs inverse is the perfect example of a case where on GPU you'd be much better of running the math rather than storing/loading a variable. Going further, one could image that some cached numerics should also live with a "uncached" version where the numerics are ran instead of cached - again to limit memory pressure.

— Reply to this email directly, view it on GitHub https://github.com/NOAA-GFDL/pace/issues/35#issuecomment-1781806690, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMUQRVFNRZDCOM4FJQKCVKDYBK5WVAVCNFSM6AAAAAA6RWV5V6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOBRHAYDMNRZGA . You are receiving this because you are subscribed to this thread.Message ID: @.***>