Skip to content

Add tracer advection to standalone driver [cycle 34]#1039

Open
DropD wants to merge 40 commits intoC2SM:mainfrom
DropD:ricoh-c34-tracer-advection
Open

Add tracer advection to standalone driver [cycle 34]#1039
DropD wants to merge 40 commits intoC2SM:mainfrom
DropD:ricoh-c34-tracer-advection

Conversation

@DropD
Copy link
Contributor

@DropD DropD commented Feb 4, 2026

Ready the standalone driver for running experiments with tracer advection.

Added

  • add tracer advection granule to driver
  • add tracer fields to prognostic state
  • fieldop and program to calculate deepatmo_* fields used in tracer advection.
  • update initialization logic for existing experiments to include tracer advection
  • any_float type alias in common.type_alias to express type hints where the type could be either float type allowed for vpfloat.

Improved

  • include tracer advection related modules in type checking and fix related problems
  • updated type hints around how the backend is passed around to make sure the backend is "customized" as soon as possible and then passed onwards, rather than in many individual places

Tests

  • The tracer advection granule remains independently tested
  • Passing existing tests confirms that the presence of the granule in the driver does not impact experiments without tracer advection
  • No data test actually running tracer advection in the driver exists yet (this is intended to be added separately, because it is a nontrivial task to itself).

@DropD DropD requested review from jcanton and nfarabullini February 4, 2026 09:27
Copy link
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.

overall you're on the right track

@DropD
Copy link
Contributor Author

DropD commented Feb 12, 2026

cscs-ci run default

@DropD
Copy link
Contributor Author

DropD commented Feb 13, 2026

cscs-ci run

@DropD
Copy link
Contributor Author

DropD commented Feb 13, 2026

cscs-ci run

@DropD
Copy link
Contributor Author

DropD commented Feb 13, 2026

cscs-ci run defaul

@DropD
Copy link
Contributor Author

DropD commented Feb 13, 2026

cscs-ci run default

Copy link
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 few comments

@DropD
Copy link
Contributor Author

DropD commented Feb 16, 2026

cscs-ci run default

1 similar comment
@DropD
Copy link
Contributor Author

DropD commented Feb 17, 2026

cscs-ci run default

@DropD
Copy link
Contributor Author

DropD commented Feb 23, 2026

should tracers=[] be constructed as a class?

I read this as something like tracers=NewTracersClass(ntracer=0), where NewTracersClass contains the fields. Is that what you mean?

@DropD
Copy link
Contributor Author

DropD commented Feb 25, 2026

cscs-ci run default

@DropD
Copy link
Contributor Author

DropD commented Feb 25, 2026

cscs-ci run default

@DropD
Copy link
Contributor Author

DropD commented Feb 25, 2026

cscs-ci run distributed

Copy link
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 last few comments

self._grid,
dims.CellDim,
dims.KDim,
allocator=model_backends.get_allocator(self._backend),
Copy link
Contributor

Choose a reason for hiding this comment

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

is it not enough to just specify self._backend without the get_allocator wrapper?

Copy link
Contributor

Choose a reason for hiding this comment

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

and same question for all of the other ones below

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, because self._backend.allocator can be None, which leads to either type mismatches or a lot of checks for is not None or calls to get_allocator down the line.
It's a bit like the customize_backend, if we do it early on, we have to deal with fewer cases later.

cell_geometry = grid_savepoint.construct_cell_geometry()
assert (
cell_geometry.area is not None
), "Broken assumption: this test assumes it's running from a save point containing a 'cell_area' field."
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
), "Broken assumption: this test assumes it's running from a save point containing a 'cell_area' field."
), "Broken assumption: this test assumes it's running from a savepoint containing a 'cell_area' field."

),
),
least_squares_state=advection_states.AdvectionLeastSquaresState(
# TODO(ricoh): [c34] check integration with #1065
Copy link
Contributor

Choose a reason for hiding this comment

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

do you still need this TODO?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks, I will remove it.

@edopao
Copy link
Contributor

edopao commented Feb 26, 2026

Just a note. The driver tests are not run with dace in the default pipeline. Please run the dace CI pipeline when you are close to merging this PR.

@DropD
Copy link
Contributor Author

DropD commented Feb 26, 2026

cscs-ci run default

@DropD
Copy link
Contributor Author

DropD commented Feb 26, 2026

cscs-ci run default

@DropD
Copy link
Contributor Author

DropD commented Feb 26, 2026

cscs-ci run distributed

@DropD
Copy link
Contributor Author

DropD commented Feb 26, 2026

cscs-ci run dace

@DropD
Copy link
Contributor Author

DropD commented Feb 26, 2026

cscs-ci run default

@DropD
Copy link
Contributor Author

DropD commented Feb 26, 2026

cscs-ci run distributed

@DropD
Copy link
Contributor Author

DropD commented Feb 26, 2026

cscs-ci run dace

@github-actions
Copy link

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.

@DropD
Copy link
Contributor Author

DropD commented Feb 27, 2026

cscs-ci run default

@DropD
Copy link
Contributor Author

DropD commented Feb 27, 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.

4 participants