Skip to content

Conversation

bogensch
Copy link
Contributor

@bogensch bogensch commented Jun 3, 2025

This PR updates the large-scale (LS) subsidence routine used in DPxx, replacing the centered-difference scheme with a semi-Lagrangian approach. This change addresses an issue observed in an edge case with strong LS subsidence, where the original method produced an unstable signature in the water vapor (qv) profile. A comparison plot illustrating this issue—contrasting the control simulation with the new solution implemented in this PR—can be found here: Full diagnostics

The updated code compiles and runs as expected. However, I acknowledge that it likely does not yet conform to EAMxx coding standards. In particular, I implemented a custom inline linear interpolation routine, as I was unable to get EKAT’s interpolation utility to compile properly when interfacing with it. I’m submitting this as a draft PR to request feedback and guidance on making the code PR-ready. Assistance with integrating the EKAT interpolation routine—or any other suggestions for bringing the code up to standard—would be greatly appreciated.

qv_profile_subsidence

@bogensch bogensch added the EAMxx Issues related to EAMxx label Jun 3, 2025
@bartgol
Copy link
Contributor

bartgol commented Jun 3, 2025

I presume the issue was related to packs. LinInterp is hard-coding packs as the scalar type. I tried a while ago to make LinInterp work with regular Real types, and I think I made it, but then put the branch on the back burner and forgot about it. Imho, we should revive that effort, as we should not force users to use Pack's just to use LinInterp. That said, one workaround should be to use views of Pack<Real,1>. But maybe you already tried that?

@bartgol bartgol added the CI: approved Allow gh actions PR testing on ghci-snl-* machines label Jun 3, 2025
@bogensch
Copy link
Contributor Author

bogensch commented Jun 3, 2025

@bartgol the commit below represents an effort to to use ekat::LinInterp

5137089

Are you suggesting that I shouldn't have scalarized the inputs to the routine (i.e. u, v, T, etc.)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI: approved Allow gh actions PR testing on ghci-snl-* machines EAMxx Issues related to EAMxx
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants