Adds the thermo coupling #461
Conversation
| - Surface stress forcing (e.g. wind stress) | ||
| - Surface tracer restoring | ||
| - Surface flux forcing (actively coupled or data-forced) | ||
| - Surface tracer restoring (soon to be ported) |
There was a problem hiding this comment.
somewhere, I don't think it needs to be in this PR, but we should separate out salinity restoring (or explicitly call it out) and note we plan to do this in the coupler instead of the framework from mpas.
There was a problem hiding this comment.
The plan is to do restoring in the Forcing infrastructure too, as its own tendencies. I was planning to do a simple port into Forcing like I did for winds. With the timeline getting a little tight, I decided to prioritize implementing the new capability rather than spending time on the port.
The original PR (#418) had all the terms moved over but it was too big to test and review cleanly.
Are you thinking that you'd prefer a different design?
There was a problem hiding this comment.
Yep this sounds right, not saying it needs to be higher priority. And I was wanting us to note when we do restoring that the time varying salinity will come from the coupler not from a Omega forcing framework like we have for MPAS. I don't think that changes anything you plan, just where you get the restoring target from.
| - `SensibleHeatFlux`: sensible heat transfer | ||
| - `LongWaveHeatFluxUp`: upward longwave radiation | ||
| - `LongWaveHeatFluxDown`: downward longwave radiation | ||
| - `SeaIceHeatFlux`: heat from sea-ice interaction |
There was a problem hiding this comment.
I don't understand what you mean by sea ice interaction, can you clarify?
There was a problem hiding this comment.
I'll clarify. This includes the direct heat fluxes (conduction, etc.) and the enthalpy of liquid water from sea ice melt.
| - `SnowFlux`: precipitation from snow | ||
| - `RainFlux`: precipitation from rain | ||
| - `EvaporationFlux`: evaporative water loss | ||
| - `SeaIceFreshWaterFlux`: freshwater input from sea-ice melt or formation |
There was a problem hiding this comment.
do we want to say freshwater input here since it can get positive and negative? Maybe just 'mass input from sea ice melt/formation?
There was a problem hiding this comment.
Good point, maybe "water mass flux from sea ice metl/formation"?
| values to Omega. | ||
| - The reference density used here ($\rho_{sw}$) is not a Boussinesq density, it is the | ||
| conversion factor from mass to pseudo-thickness. | ||
| - No iceberg fluxes are included for now. |
There was a problem hiding this comment.
would the iceberg flux be a modification to iceRunoffFlux?
There was a problem hiding this comment.
The iceberg fluxes are their own additional terms. It's not hard to add an extra term, but given that we clearly stated that icebergs were out of scope for Omega, I thought I could skip defining/including them for now.
There was a problem hiding this comment.
Yes you can for sure. I was mostly curious
| Mesh->NCellsSize), | ||
| SeaIceHeatFluxCell("seaIceHeatFlux" + Suffix, Mesh->NCellsSize), | ||
| ShortWaveHeatFluxCell("shortWaveHeatFlux" + Suffix, Mesh->NCellsSize), | ||
| SeaIceSaltFluxCell("seaIceSalinityFlux" + Suffix, Mesh->NCellsSize), |
There was a problem hiding this comment.
Why is there a SeaIceSalinityFlux here? Is this because it's assuming that's the form in forcing.nc?
There was a problem hiding this comment.
Good catch. yes, it's a remnant from previous versions because I used to run a test reading from forcing.nc and loading the terms. This test has been removed so I can modify that to align it with the coupler terms.
| Err += MeshHalo->exchangeFullArrayHalo(SfcStressForcing.MeridStressCell, | ||
| OnCell); | ||
|
|
||
| Err += MeshHalo->exchangeFullArrayHalo(TracerForcing.SnowFluxCell, OnCell); |
There was a problem hiding this comment.
Can you explain why a halo exchange is needed for on cell quantities? I would have thought the owned cells is enough
There was a problem hiding this comment.
Good catch. Cell centered variables should not need the halo exchange.
| fluxes, and 1 salt flux component | ||
| - Fields initialized to zero and registered in `Forcing` field group | ||
| - `SfcThicknessForcingOnCell` tendency term | ||
| - Computes freshwater flux contribution: $\sum (\text{SnowFlux} + \text{RainFlux} + \text{EvaporationFlux} + \text{SeaIceFreshWaterFlux} + \text{IceRunoffFlux} + \text{RiverRunoffFlux} + \text{SeaIceSaltFlux}) / \rho_{sw}$ |
There was a problem hiding this comment.
even though I think this works out, is SeaIceSaltFlux/\rho_{sw} the right form? It's kg Salt instead of water. Should we be specific about that? I recall you are elsewhere. I also recall the conversion factor works out to 1 to go from kg salt to kg water, so maybe it's not a big deal
There was a problem hiding this comment.
actually isn't this a direct salt flux and maybe shouldn't appear here at all?
There was a problem hiding this comment.
I clarified the text: these are all the mass contributions to the layer. The salt mass flux is taken into account in the same way as freshwater mass fluxes.
| This page documents the user-facing configuration and behavior for current forcing in Omega: | ||
|
|
||
| - Surface stress forcing (e.g. wind stress) | ||
| - Coupled flux forcing |
There was a problem hiding this comment.
surface stress is a momentum flux, so perhaps 'coupled thermodynamic and mass flux forcing'?
|
|
||
| ## Surface flux forcing | ||
|
|
||
| Surface flux forcing applies ocean-atmosphere and ocean-sea ice fluxes from the other model |
There was a problem hiding this comment.
similar comment, I don't think we should use surface flux and surface stress
| Additional information on forcing (currently wind forcing and surface tracer | ||
| restoring) is detailed in [](omega-user-forcing). | ||
| Additional information on forcing, including surface stress forcing, | ||
| surface flux forcing, and surface tracer restoring, is detailed in |
There was a problem hiding this comment.
flagging surface flux again
| SeaIceFreshWaterFlux(ICell) + | ||
| IceRunoffFlux(ICell) + RiverRunoffFlux(ICell); | ||
|
|
||
| Tend(ICell, KTop) += (FreshWaterFlux + SeaIceSaltFlux(ICell)) / RhoSw; |
There was a problem hiding this comment.
i'm still unsure why this appears as a thickness flux
There was a problem hiding this comment.
@vanroekel the variable is pseudo-thickness, which is directly proportional to layer mass. So the question is: do we explicitly add the salt mass to the layer mass?
It changes the interplay between equations but isn't it more rigorous to include it?
I've been pondering this on the frazil side too.
There was a problem hiding this comment.
oh yes right. good point. What is the SeaIceSaltFlux term in the ocean? If I recall right it's the consequence of the 4PSU assumption, do you understand why it's a separate field and not directly included with the SeaIceFreshwaterFlux?
There was a problem hiding this comment.
The sea ice stores the freshwater and salt into 2 separate channels. In omega, both are mass (SI unit: kg) fluxes that come straight from the coupler (no 4psu assumption), with mass of salt and mass of pure freshwater as separate coupling terms. Both terms are added to the layer mass evolution, but only salt mass is added to the salinity tendency.
The use of "variable salinity coupling" will allow for time-varying salt flux due to sea ice drainage (i.e. prognostic salinity within the sea ice - translated to mass fluxes for coupling).
(note: if seaIceHeatFlux did not already include the enthalpy of melted water, we would use SeaIceFreshWaterFlux in the temperature tendency - here we don't because it would double count)
| 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?
|
overall this looks quite good @alicebarthel I only had pretty minor comments |
…iscussion" This reverts commit 70b0ca2.
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 |
This (draft) 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: