Skip to content

Tr/rm bcs - #2521

Closed
imreddyTeja wants to merge 1 commit into
mainfrom
tr/rm-bcs
Closed

Tr/rm bcs#2521
imreddyTeja wants to merge 1 commit into
mainfrom
tr/rm-bcs

Conversation

@imreddyTeja

@imreddyTeja imreddyTeja commented Jun 2, 2026

Copy link
Copy Markdown
Member
  • Removed SetValue from GradientC2F, DivergenceC2F, CurlC2F, UpwindBiasedProductC2F
  • Removed SetGradient from InterpolateC2F and WeightedInterpolateC2F
  • Removed AdvectionC2C, AdvectionF2F, FluxCorrectionF2F, and FluxCorrectionC2C operators

The step example is now merged with the advection example.

TODO: Add a compat for ClimaCore to KinematicDrivers.jl

  • Code follows the style guidelines OR N/A.
  • Unit tests are included OR N/A.
  • Code is exercised in an integration test OR N/A.
  • Documentation has been added/updated OR N/A.

@imreddyTeja
imreddyTeja force-pushed the tr/rm-bcs branch 6 times, most recently from 3cbaec7 to 5cba998 Compare June 3, 2026 18:27
@imreddyTeja
imreddyTeja force-pushed the tr/rm-bcs branch 2 times, most recently from d7d5be8 to b7adf2d Compare June 10, 2026 22:44
@imreddyTeja
imreddyTeja force-pushed the tr/rm-bcs branch 3 times, most recently from e5a117d to 19ac42c Compare June 17, 2026 23:12
@imreddyTeja
imreddyTeja marked this pull request as ready for review June 17, 2026 23:15
@akshaysridhar

Copy link
Copy Markdown
Member

Thanks @imreddyTeja. I looked over the artifacts (and updated docstrings) in the examples/column and hybrid/plane + box sections the outcomes are reasonable. @dennisYatunin can comment on the operator_matrices.jl changes. BorisBook FCT operators are not used anywhere in ClimaAtmos.jl. FluxCorrection<> ops are also unused in ClimaAtmos.jl - the related examples (density current / rising bubble) could be written with prescribed constant diffusion to simplify them if needed.

@dennisYatunin dennisYatunin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Great simplification! Few minor comments about changes to tests and examples, but looks great otherwise.

Comment thread test/MatrixFields/operator_matrices.jl
Comment thread test/MatrixFields/operator_matrices.jl Outdated
Comment on lines +70 to +74
top_center_left_biased_grad =
Geometry.Covariant3Vector.(
Fields.level(T, Fields.nlevels(T)) .-
Fields.level(T, Fields.nlevels(T) - 1)
)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is this equivalent to ∇gaussian at the second-to-last level? Might be simpler to write it that way if it is.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yeah it is, but then I would need to project the value from a WVector into a Covariant3Vector. If you think that is a more understandable approach, I can make that change.

Comment thread test/Operators/finitedifference/unit_column.jl Outdated
Comment thread test/Operators/hybrid/unit_2d.jl Outdated
Comment thread docs/src/examples.md
- Tendency 2:

$$D = \partial(UB) + \textrm{fcc}(v, \theta),$$
$$D = \partial(UB) - \textrm{fcc}(v, \theta),$$

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This looks like the opposite of the deformation_flow.jl example, which has UB + FCC rather than UB - FCC. Where did you get this sign flip from?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This makes it match the example code. If I flip the sign in the example code, the outputs become garbage, so I'm assuming the sign in the example code is correct. My understanding might be incorrect, but I think most of the advection operators return a flux. The AdvectionC2C/F2F and FluxCorrectionC2C/F2F return the actual tendency.

@imreddyTeja
imreddyTeja force-pushed the tr/rm-bcs branch 3 times, most recently from 6fe0f2f to 3d92803 Compare August 12, 2026 17:35
Delete unused test

rm SetValue bc for gradc2f

rm interpc2f setgradient bc

rm weightedinterpc2f setgradient

rm UpwindBiasedProductC2F setval bc

rm divc2f setval bc

undo pipeline changes

rm curlc2f setvalue bc

rm AdvectionC2C

Add LinVanleerC2F to non-linear ops const

rm AdvectionF2F

merge pipeline

Re-add deleted tests

rm FluxCorrectionC2C

fixes for rebase

rm FluxCorrectionF2F

Up news

lazify bcs

minor fixes

Fix unit_column.jl GPU failures

The reference values in the "Replacements for removed operators and
boundary conditions" testset are built with scalar indexing, so extract
the data they are built from (and the results they are compared
against) on the CPU.

Also apply the biased operators to `ᶠlg.J` rather than to `ᶠlg`: the GPU
compiles the never-taken `NullBoundaryCondition` branch of the stencil,
which multiplies by `NaN` and so cannot handle a `LocalGeometry`
element type.

Auto project SetCurl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants