Skip to content

Conversation

@imreddyTeja
Copy link
Member

@imreddyTeja imreddyTeja commented Oct 22, 2025

  • 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.

Add gpu support for vertical mass limiter.
This addition needs documentation, and also needs
to be made more similar to the cpu version.

Other fixes:
Correct plotting axis

Important TODOS:

I think the indexing is actually happening bottom to top... done

Ask about \geq q_min or < qmin

Ask about tolerances in the test

Probably a good idea to check performance. I suspect this
implementation will have poor performance at h_elem < 30

charleskawczynski and others added 3 commits October 21, 2025 09:09
Update src/Limiters/vertical_mass_borrowing_limiter.jl

Co-authored-by: Tapio Schneider <[email protected]>

Update src/Limiters/vertical_mass_borrowing_limiter.jl

Co-authored-by: Tapio Schneider <[email protected]>

Update src/Limiters/vertical_mass_borrowing_limiter.jl

Co-authored-by: Tapio Schneider <[email protected]>

Use density-dz for pressure thickness
Add gpu support for vertical mass limiter.
This addition needs documentation, and also needs
to be made more similar to the cpu version.

Other fixes:
Correct plotting axis

Important TODOS:

I think the indexing is actually happening bottom to top...

Ask about \geq q_min or < qmin

Ask about tolerances in the test

Probably a good idea to check performance. I suspect this
implementation will have poor performance at h_elem < 30
@imreddyTeja imreddyTeja force-pushed the tr/vertical-mass-borrowing-limiter branch from 8ff8caa to 8191082 Compare October 22, 2025 22:21
@imreddyTeja imreddyTeja force-pushed the tr/vertical-mass-borrowing-limiter branch from 8191082 to 1d18d41 Compare October 22, 2025 22:23
Plots.plot!(f₀col; label = "initial")
Plots.savefig("lim.png")
end
# plot_results(ρq, ρq_init)
Copy link
Member

Choose a reason for hiding this comment

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

Could we enable a version of these plots either in the test artifacts or the documentation for this PR?

for v in 1:nlevels
CI = CartesianIndex(1, 1, f, v, 1)
# if the surface layer still needs to borrow mass
if bmass[] < 0
Copy link
Member

Choose a reason for hiding this comment

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

If the surface/bottom layer for a given column doesn't have negative tracer mass after the first top-to-bottom pass, the loop over 1:nlevels is unnecessary right ? Is there a need to check this condition at every single level v ?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think you're right

layer k+2. The borrower will proceed this process until the bottom layer.
If the tracer mass in the bottom layer goes negative, it will repeat the
process from the bottom to the top. In this way, the borrower works for
any shape of mass profiles.
Copy link
Member

@akshaysridhar akshaysridhar Nov 17, 2025

Choose a reason for hiding this comment

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

From the reference paper this is true as long as the "the
column-integrated mass is positive" ; We may not need assertions in the code for performance considerations but this is useful in the docstring (It's anyway clear, by design, in the fixer).

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