Adds the thermo coupling - #461
Conversation
| const Real PTopDb = PressureMid(ICell, KTop) * Pa2Db; | ||
| const Real SaTop = SaltIndex >= 0 | ||
| ? TracerCell(SaltIndex, ICell, KTop) | ||
| : 0.0_Real; // not sure we want zero here? |
There was a problem hiding this comment.
I think 0 is a fine limit. Does this form of code preclude logging when we go below this threshold?
There was a problem hiding this comment.
@vanroekel note that this conditional is checking the validity of the tracer index (SaltIndex >= 0), not the value of salinity. For a check on salinity, it would be preferable to use Kokkos::clamp().
This was to make sure we are not using an invalid index, but we could do a clean fail rather than use 0 salinity...
There was a problem hiding this comment.
I'm not sure that it's the job of this function to make sure that the tracer indices are initialized correctly. I'd be inclined to check for that elsewhere (and maybe not every timestep or every time forcing is updated) and remove the conditional. Thoughts?
There was a problem hiding this comment.
Yea, I would agree. Are you thinking something like OceanInit, @cbegeman?
There was a problem hiding this comment.
Yes, maybe Tracers::Init which is called during OceanInit?
There was a problem hiding this comment.
@katsmith133 Should this be resolved or is this work still outstanding?
There was a problem hiding this comment.
It seems like this is resolved looking at the code, but @katsmith133 can verify.
|
overall this looks quite good @alicebarthel I only had pretty minor comments |
f814b7a to
47abc12
Compare
47abc12 to
2e13052
Compare
|
One key test to do is to verify that Here is my current test report: Polaris
|
|
the log is at |
|
@alicebarthel Is this ready to test with standalone Omega (I'm thinking column cases) with the flux fields provided in the forcing stream? |
|
Yes @cbegeman additional testing with single-column polaris cases (and analytical equilibrated state) or more realistic cases could be performed at this stage. It may be good to resolve |
|
Pulled this PR down onto PM this morning and verified it passes all CTests on PM-CPU and GPU. Also, the polaris Polaris
|
|
Pretty minor comment for the PR. Seems like overall its pretty good, but I'd also like to see the results of the single-column test. @cbegeman can I help in any way with this? |
|
Was just checking the compile logs and saw this warning for PM-GPU: working on how to resolve this issue... |
Ok, I figured out a solution to this that removes the compile warning, but I am now adding in Linear and Constant EOS support to this PR, which primarily is just adding non-TEOS10 options to the |
ab1da2e to
808185a
Compare
Retesting on Frontier after latest enthalpy calculation changes and rebasing to
|
|
@katsmith133 Thanks for testing! I also did testing last night. Results located here: E3SM-Project/polaris#663 (comment) |
TestingPolaris
|
Testing
|
This PR adds the thermo coupling - from forcing terms to thickness and tracer tendencies.
The energy of mass fluxes and phase changes are hard-coded into the tendency conversions, like it was in MPAS-O. Hopefully the documentation (inline or otherwise) clarifies the meaning of each term.
This PR is 3/3 to make #418 more digestible.
Checklist
CTest unit tests: "All tests passed" on pm-cpu (gnu) and pm-gpu.
The Polaris omega_pr test suite
has passed, using the Polaris
e3sm_submodules/OmegabaselineNew tests: