forked from E3SM-Project/E3SM
-
Notifications
You must be signed in to change notification settings - Fork 8
adds frazil (both the teos and basic options) #466
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
alicebarthel
wants to merge
15
commits into
E3SM-Project:develop
Choose a base branch
from
alicebarthel:omega/add-frazil-basic-rebased
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
32081a4
added Frazil class infrastructure
alicebarthel c729859
first implementation of FrazilFormation
alicebarthel 10ec496
added Frazil unit tests on Formation
alicebarthel 7cd9f5d
added a multi-layer test (incl kernel logging) and FrazilMelt
alicebarthel daa530f
added conservation check, depth limit, and tendencies
alicebarthel 2c507ca
update to Fraziltest incl. depthlimit
alicebarthel a64c3f9
clean up of redundant flag. Frazil is based on FrazilTendencyEnable
alicebarthel 10bfd11
fix to P units + tendencytest
alicebarthel 19245c8
using the Eos for CtFrz calculation
alicebarthel 6065ea9
added limit to melt, refactored melt terms, and clean-up
alicebarthel a45f9f0
clean up initializer order to remove build warning
alicebarthel 8c53aa5
adds basic frazil option - basic works on gpu
alicebarthel b5d9c3a
added documentation for basic and teos frazil
alicebarthel c284dac
clean up and added the salt mass to the mass tendencies
alicebarthel e022fca
fixing linting
alicebarthel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,101 @@ | ||
| (omega-dev-frazil)= | ||
|
|
||
| # Frazil | ||
|
|
||
| This page describes frazil design and implementation details in Omega, | ||
| including both the `basic` and `teos` pathways. | ||
|
|
||
| ## Purpose and coupling points | ||
|
|
||
| Frazil computes phase-change-related tendencies that modify: | ||
|
|
||
| - pseudo-thickness tendency | ||
| - temperature tracer tendency | ||
| - salinity tracer tendency | ||
|
|
||
| The tendency hook-up is implemented through `FrazilOnCell` in the tracer | ||
| tendency phase, where frazil contributions are added to the accumulated | ||
| `PseudoThicknessTend` and `TracerTend` arrays. | ||
|
|
||
| ## Data flow and call sequence | ||
|
|
||
| 1. `Tendencies::computeTracerTendenciesOnly` checks | ||
| `Tendencies.FrazilTendencyEnable`. | ||
| 2. If enabled, `FrazilOnCell::operator()` retrieves the default `Frazil` | ||
| object and zeros frazil tendency/accumulator arrays. | ||
| 3. `FrazilOnCell` extracts `Temperature` and `Salinity` tracer subviews, | ||
| then calls `Frazil::computeFrazil(CT, SA, PressureMid, PseudoThickness)`. | ||
| 4. `Frazil::computeFrazil` dispatches to `computeFrazilBasicImpl` or | ||
| `computeFrazilTeosImpl` based on `FrazilType`. | ||
| 5. Returned frazil tendencies are added into `PseudoThicknessTend` and | ||
| `TracerTend` for all active cell layers. | ||
|
|
||
| ## Configuration coupling | ||
|
|
||
| Frazil behavior is configured with: | ||
|
|
||
| - `Omega.Tendencies.FrazilTendencyEnable` | ||
| - global switch for applying frazil tendency terms | ||
| - `Omega.Frazil.FrazilType` | ||
| - implementation choice (`basic` or `teos`) | ||
| - `Omega.Frazil.MassLimit` | ||
| - per-layer mass/thickness limiter used by frazil formation/melt pathways | ||
| - `Omega.Frazil.Phi` | ||
| - teos pathway liquid-fraction parameter for new frazil partitioning | ||
| - `Omega.Frazil.DepthLimit` | ||
| - optional depth cutoff for frazil activity; negative means no cutoff | ||
| - `Omega.Frazil.ConservationCheck` | ||
| - optional post-compute column conservation diagnostic/logging | ||
|
|
||
| ## Physics/algorithm summary | ||
|
|
||
| ### Common behavior | ||
|
|
||
| - Freezing-point checks are based on conservative temperature and absolute | ||
| salinity with pressure-dependent freezing temperature. | ||
| - Vertical accumulation order is bottom-to-top within each active column. | ||
| - Frazil tendencies are not time-step scaled inside `Frazil`; they are | ||
| accumulated as tendency contributions. | ||
|
|
||
| ### Basic pathway (`FrazilType: basic`) | ||
|
|
||
| - Uses simplified energetics: the energy of the super-cooled water sets the | ||
| amount of solid ice formed (used constant latent heat of fusion of fresh ice). | ||
| Salt is added based on a constant bulk salinity `IceRefSal` (default) or a | ||
| manual toggle (for now) using the local salinity and the frazil porosity. | ||
| Melting of existing frazil is set by the amount of pure ice that can be melted | ||
| by the warm layer, and the enthalpy of melt water at the local freezing point | ||
| is added to the temperature tendency. | ||
| temperature comparisons and fractional thickness limits. | ||
| - Computes local layer tendencies (`HTend`, `TTend`, `STend`) and updates | ||
| accumulated frazil stores. | ||
| - Applies surface salt redistribution adjustment and converts accumulators to | ||
| coupler units at the end of the column loop. | ||
| -Warnings: 1) basic frazil formation/melt is does not conserve energy. | ||
| 2) Using porosity to set the salt content includes a redistribution of excess | ||
| salt in the surface layer, which can be very significant. | ||
|
|
||
| ### Teos pathway (`FrazilType: teos`) | ||
|
|
||
| - Uses teos-10 Gibbs SeaWater routines for frazil formation and melt state | ||
| transitions. | ||
| - Formation uses `Phi` and `MassLimit` to partition and limit newly formed | ||
| frazil contributions. | ||
| - Melt computes fraction melted subject to available thermodynamic energy and | ||
| mass-limit constraints. | ||
|
|
||
| ## Existing ctest coverage | ||
|
|
||
| The existing frazil test driver is in | ||
| `components/omega/test/ocn/FrazilTest.cpp` and covers: | ||
|
|
||
| - teos frazil formation in cold and warm single-layer states | ||
| - basic frazil formation in cold and warm single-layer states | ||
| - mixed warm/cold column behavior with sign checks for branch switching | ||
| - depth-limit behavior ensuring excluded deep layers have zero frazil tendency | ||
|
|
||
|
|
||
| ## Related pages | ||
|
|
||
| - User-facing options: [User Frazil Guide](../userGuide/Frazil.md) | ||
| - Tendency container/hook-up: [Tendencies](Tendencies.md) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| (omega-user-frazil)= | ||
|
|
||
| # Frazil | ||
|
|
||
| This page describes user-facing configuration for frazil tendencies in Omega. | ||
| Frazil physics is used to represent the formation and melt of frazil ice within | ||
| the ocean water column. It impacts the local layer pseudo-thickness (i.e. mass), | ||
| temperature, and salinity tendencies. The vertical sum of the frazil energy, | ||
| mass of water and mass of salt are passed to the coupler (if coupled) or | ||
| discarded (in ocean standalone mode). | ||
|
|
||
| ## Configuration overview | ||
|
|
||
| Frazil behavior is controlled by one enable switch in `Tendencies` and one | ||
| `Frazil` configuration block: | ||
|
|
||
| ```yaml | ||
| Omega: | ||
| Tendencies: | ||
| FrazilTendencyEnable: true | ||
|
|
||
| Frazil: | ||
| FrazilType: basic | ||
| MassLimit: 0.1 | ||
| Phi: 0.75 | ||
| DepthLimit: -1.0 | ||
| ConservationCheck: false | ||
| ``` | ||
|
|
||
| - `Tendencies.FrazilTendencyEnable` | ||
| - enables/disables application of frazil tendency contributions | ||
| - `Frazil.FrazilType` | ||
| - selects frazil option | ||
| - supported options in current code: `basic` and `teos` | ||
| - `simple` exists as a placeholder name but is not supported | ||
| - `Frazil.MassLimit` | ||
| - limits per-layer frazil mass/thickness tendency magnitude (applied to formation and melt) | ||
| - `Frazil.Phi` | ||
| - liquid-mass fraction of frazil (used by the teos frazil formation, or by the basic frazil when using porosity rather than constant salinity). | ||
| - `Frazil.DepthLimit` | ||
| - limits the depth range over which frazil is computed | ||
| - negative values mean no depth limit | ||
| - `Frazil.ConservationCheck` | ||
| - enables a column-level diagnostic conservation check with logging | ||
|
|
||
| ## Available frazil options | ||
|
|
||
| Omega currently includes two active frazil pathways: | ||
|
|
||
| - `basic` | ||
| - freezing is based on the formation of fresh solid ice, to which salt is added (similar the mpas-ocean implementation). | ||
| - `teos` | ||
| - teos-10-based option using Gibbs SeaWater thermodynamic routines. | ||
|
|
||
| Both pathways contribute to: | ||
|
|
||
| - pseudo-thickness tendency | ||
| - temperature tracer tendency | ||
| - salinity tracer tendency | ||
|
|
||
| ## Notes | ||
|
|
||
| - Frazil tendencies are applied through the `Tendencies` tracer-step workflow. | ||
| - The frazil tendency hook assumes tracer names include `Temperature` and | ||
| `Salinity`. | ||
| - For implementation and algorithm details, see | ||
| [Developer Frazil Guide](../devGuide/Frazil.md). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be off by default else the omega_pr tests will fail against baseline, and any test using constant/linear eos and frazil will fail. FYI @katsmith133 @cbegeman
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @alicebarthel !