Skip to content

Clean up global grid parameters and grid shape#1183

Open
Copilot wants to merge 16 commits intomainfrom
copilot/clean-up-global-grid-parameters
Open

Clean up global grid parameters and grid shape#1183
Copilot wants to merge 16 commits intomainfrom
copilot/clean-up-global-grid-parameters

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 30, 2026

Rename GlobalGridParams to GridParams and removes most members. GridParams now only contains the type of grid and dimensions (domain height/length for torus, radius for icosahedron; the R/B params are also stored for icosahedron but are just metadata that's not required).

@jenkins-apn
Copy link
Copy Markdown

Hi there, this is jenkins continuous integration...
Do you want me to verify this patch?

1 similar comment
@jenkins-apn
Copy link
Copy Markdown

Hi there, this is jenkins continuous integration...
Do you want me to verify this patch?

Copilot AI linked an issue Mar 30, 2026 that may be closed by this pull request
Agent-Logs-Url: https://github.com/C2SM/icon4py/sessions/148d4123-da81-4914-a9e3-16465bc49c48

Co-authored-by: jcanton <5622559+jcanton@users.noreply.github.com>
Comment thread model/common/src/icon4py/model/common/grid/icon.py Outdated
Copy link
Copy Markdown
Contributor

@nfarabullini nfarabullini left a comment

Choose a reason for hiding this comment

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

a couple of preliminary comments

Comment thread model/common/src/icon4py/model/common/grid/grid_manager.py Outdated
Comment thread model/common/src/icon4py/model/common/grid/icon.py Outdated
Copy link
Copy Markdown
Contributor

@nfarabullini nfarabullini left a comment

Choose a reason for hiding this comment

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

Some other minor comments

Comment thread model/common/tests/common/grid/unit_tests/test_icon.py
Comment thread model/driver/src/icon4py/model/driver/initialization_utils.py
Copy link
Copy Markdown
Contributor

@nfarabullini nfarabullini left a comment

Choose a reason for hiding this comment

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

Look good so far but conflicts need to be solved

@msimberg
Copy link
Copy Markdown
Contributor

Look good so far but conflicts need to be solved

Indeed. Note: this is still a draft, I'm not ready with the changes.

@msimberg msimberg changed the title [WIP] Clean up global grid parameters and grid shape Clean up global grid parameters and grid shape May 6, 2026
@msimberg msimberg marked this pull request as ready for review May 7, 2026 14:25
@msimberg
Copy link
Copy Markdown
Contributor

msimberg commented May 7, 2026

I'm stopping here with this PR.

I looked into completely removing the GridParams metadata from GridDescription, but decided I don't want to mix that into this PR. I'd like to do that if/when we refactor datatest fixtures (currently there are is e.g. no fixture for reading a grid directly from a grid file; the grid_savepoint fixture is from a savepoint and the icon_grid fixture uses the savepoint).

@msimberg
Copy link
Copy Markdown
Contributor

msimberg commented May 7, 2026

cscs-ci run default

@msimberg
Copy link
Copy Markdown
Contributor

msimberg commented May 7, 2026

cscs-ci run distributed

case icon.GeometryType.ICOSAHEDRON:
return icon.GridParams(
params=icon.IcosahedronParams(
subdivision=icon.GridSubdivision(root=grid_root, level=grid_level),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@jcanton Now I remember that why the mean cell area is different from icon's serialized data. Because the original icon computes mean cell area on the global grid with the equation using grid root and level (total globe's surface area divided by num of cells).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

That also possibly means that running the standalone driver will of course produce a different result from Fortran icon.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Not sure that if the mean cell area on the limited area may also be different.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yeah, I think it would be different on limited area... and yes, this always a bit of a contentious thing. It's weird the way icon fortran calculates it (in my opinion), but if we care about exactly reproducing icon fortran results then we may need to take this into consideration. RBF uses mean_characteristic_length (which is derived from the mean cell area) to scale the RBF kernels, so that could introduce additional differences.

@msimberg
Copy link
Copy Markdown
Contributor

msimberg commented May 8, 2026

cscs-ci run default

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 8, 2026

Mandatory Tests

Please make sure you run these tests via comment before you merge!

  • cscs-ci run default
  • cscs-ci run distributed

Optional Tests

To run benchmarks you can use:

  • cscs-ci run benchmark-bencher

To run tests and benchmarks with the DaCe backend you can use:

  • cscs-ci run dace

To run test levels ignored by the default test suite (mostly simple datatest for static fields computations) you can use:

  • cscs-ci run extra

For more detailed information please look at CI in the EXCLAIM universe.

@msimberg
Copy link
Copy Markdown
Contributor

msimberg commented May 8, 2026

cscs-ci run distributed

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.

Clean up global grid parameters and grid shape

6 participants