forked from E3SM-Project/E3SM
-
Notifications
You must be signed in to change notification settings - Fork 6
Add surface tracer restoring #355
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
Merged
mark-petersen
merged 15 commits into
E3SM-Project:develop
from
katsmith133:omega/surface-restoring
Apr 7, 2026
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
dc5a8da
starts adding surface tracer restoring
katsmith133 1717bfa
completes working surface forcing
katsmith133 f142ae5
rebase
katsmith133 864cf69
updates docs
katsmith133 8777f79
adds ability to apply surface restoring to specified tracers or trace…
katsmith133 4367a5e
removed group tracer optioin in config and checks if maxdiff is pos
katsmith133 4189450
adds more documentation and renames vars
katsmith133 c785491
removed layer loop from surface restoring calc
katsmith133 acba12c
adds suggestions from pr review
katsmith133 56be44b
rebases and updates docs
katsmith133 c6ddfac
removes redundent call of OmegaConfig
katsmith133 4f79be5
reverts submodule changes
katsmith133 8fa3a02
removes maxdiff and adds suggestions from pr review
katsmith133 a9e2fa4
linting
katsmith133 761b24d
adds suggestion from pr review
katsmith133 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
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,79 @@ | ||
| (omega-dev-forcing)= | ||
|
|
||
| # Forcing | ||
|
|
||
| This page describes design and implementation details for forcing-related | ||
| pathways in Omega, currently this includes: | ||
|
|
||
| - Wind forcing | ||
| - Surface tracer restoring | ||
|
|
||
| ## Wind forcing design | ||
|
|
||
| ### Wind forcing data flow | ||
|
|
||
| 1. External fields provide: | ||
| - `WindStressZonal` | ||
| - `WindStressMeridional` | ||
| 2. Auxiliary-state compute builds `NormalStressEdge` from those fields. | ||
| 3. Tendency term applies wind-stress forcing to edge-normal velocity tendency. | ||
|
|
||
| ### Wind forcing key classes/components | ||
|
|
||
| - `WindForcingAuxVars` | ||
| - Stores wind-stress cell fields and computed `NormalStressEdge` | ||
| - Applies configured interpolation choice (`InterpType`) | ||
| - `AuxiliaryState::computeMomAux` | ||
| - Calls `WindForcingAuxVars::computeVarsOnEdge` | ||
| - `WindForcingOnEdge` tendency term | ||
| - Adds contribution proportional to normal stress and inverse layer | ||
| thickness in the surface layer | ||
|
|
||
| ### Wind forcing config coupling | ||
|
|
||
| - `Omega.WindStress.InterpType` | ||
| - mapped to `InterpCellToEdgeOption` | ||
| - `Omega.Tendencies.WindForcingTendencyEnable` | ||
| - gates execution of wind forcing tendency kernel | ||
|
|
||
| ## Surface tracer restoring design | ||
|
|
||
| ### Surface tracer restoring data flow | ||
|
|
||
| 1. External fields provide target values: `TracersMonthlySurfClimoCell` (values and units should match the state variables) | ||
| 2. Auxiliary-state compute forms restoring differences: `SurfTracerRestoringDiffsCell = target - tracer_surface` | ||
| 3. Tendency term applies restoring only at surface layer and only for tracers selected from `SurfaceRestoring.TracersToRestore`. | ||
|
|
||
| ### Surface tracer restoring key classes/components | ||
|
|
||
| - `SurfTracerRestAuxVars` | ||
| - Inputs: `TracersMonthlySurfClimoCell`, tracer state array | ||
| - Output: `SurfTracerRestoringDiffsCell` | ||
| - Uses `MinLayerCell` to select surface layer index | ||
| - `SurfaceTracerRestoringOnCell` tendency term | ||
| - Applies `PistonVelocity * SurfTracerRestoringDiffsCell` at surface | ||
| - `Tendencies` | ||
| - Parses `SurfaceRestoring.TracersToRestore` and resolves tracer indices | ||
| - Builds `TracerIdsToRestore` and `NTracersToRestore` | ||
| - Applies tracer-selection logic at call site in | ||
| `computeTracerTendenciesOnly` | ||
| - Aborts if restoring is enabled but no tracer IDs are available | ||
|
|
||
| ### Surface tracer restoring config coupling | ||
|
|
||
| - `Omega.SurfaceRestoring.PistonVelocity` | ||
| - tendency scaling | ||
| - `Omega.SurfaceRestoring.TracersToRestore` | ||
| - tracer-level enable list used to build `TracerIdsToRestore` | ||
| - `Omega.Tendencies.SurfaceTracerRestoringEnable` | ||
| - gates restoring tendency execution | ||
|
|
||
| ## Notes | ||
|
|
||
| - If a tracer is not listed in `TracersToRestore`, no restoring tendency is applied to that tracer. | ||
| - If restoring is enabled but no tracer IDs are available at tendency compute-time, Omega aborts with an error. | ||
| - It is assumed that the incoming `TracersMonthlySurfClimoCell` fields (values and units) match the Omega state variables (i.e. conservative temperature and absolute salinity for Teos-10). If not, a pre-processing conversion should be implemented. | ||
| - Surface tracer restoring is active everywhere if enabled. A flag to turn it off under sea ice will need to be added in later development if this feature is desired. | ||
| - Unlike MPAS-Ocean, a `MaxDiff` clamping is not applied here. This check should instead be implemented in Ocean Validate when that is available. | ||
| - A global scaling to ensure zero-sum has not been implemented for the surface tracer restoring, but should be added in later development. | ||
| - At this stage, there is no temporal interpolation applied to the restoring targets, the raw `TracersMonthlySurfClimoCell` snapshot is used. |
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
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,86 @@ | ||
| (omega-user-forcing)= | ||
|
|
||
| # Forcing | ||
|
|
||
| This page documents the user-facing configuration and behavior for current forcing in Omega: | ||
|
|
||
| - Wind forcing | ||
| - Surface tracer restoring | ||
|
|
||
| ## Wind forcing | ||
|
|
||
| Wind forcing adds momentum tendency from surface wind stress. | ||
|
|
||
| ### Wind forcing configuration | ||
|
|
||
| Wind forcing behavior is controlled by two configuration blocks: | ||
|
|
||
| ```yaml | ||
| Omega: | ||
| WindStress: | ||
| InterpType: Isotropic | ||
|
|
||
| Tendencies: | ||
| WindForcingTendencyEnable: true | ||
| ``` | ||
|
|
||
| - `WindStress.InterpType` | ||
| - `Isotropic`: isotropic cell-to-edge interpolation for wind stress | ||
| - `Anisotropic`: anisotropic interpolation option | ||
| - `Tendencies.WindForcingTendencyEnable`: switch to enable wind forcing tendency | ||
|
|
||
| ### Required input fields | ||
|
|
||
| Wind forcing uses auxiliary wind-stress fields: | ||
|
|
||
| - `WindStressZonal` | ||
| - `WindStressMeridional` | ||
|
|
||
| These are used to form edge-normal stress (`NormalStressEdge`) that enters | ||
| momentum tendencies. | ||
|
|
||
| ## Surface tracer restoring | ||
|
|
||
| Surface tracer restoring applies a piston-velocity tendency, or damping, at the ocean | ||
| surface for selected tracers. This is implemented to mitigate drifts in chosen tracers | ||
| (most often salinity) by nudging the model's simulated tracer values towards observed climatological values. | ||
| This process prevents oceanic regimes from shifting away from reality due to errors in surface freshwater | ||
| forcing (in the case of salinity restoring). Currently, it is applied everywhere when enabled. | ||
|
|
||
| ### Surface tracer restoring configuration | ||
|
|
||
| Surface tracer restoring is controlled by two configuration blocks: | ||
|
|
||
| ```yaml | ||
| Omega: | ||
| SurfaceRestoring: | ||
| TracersToRestore: [Temperature, Salinity] | ||
| PistonVelocity: 1.585e-5 | ||
|
|
||
| Tendencies: | ||
| SurfaceTracerRestoringEnable: true | ||
| ``` | ||
|
|
||
| - `TracersToRestore`: list of tracer names that restoring is applied to | ||
| - `PistonVelocity`: restoring rate coefficient | ||
| - `SurfaceTracerRestoringEnable`: switch to enable surface tracer restoring | ||
|
|
||
| When restoring is enabled, Omega resolves `TracersToRestore` into an internal | ||
| list of tracer IDs and applies restoring only to tracers in that list. | ||
|
|
||
| ### Restoring target fields | ||
|
|
||
| Surface restoring uses auxiliary fields: | ||
|
|
||
| - `TracersMonthlySurfClimoCell`: restoring target climatological values | ||
| - `SurfTracerRestoringDiffsCell`: computed target-minus-state differences | ||
|
|
||
| The restoring tendency is computed at the surface layer only and is limited by | ||
| the configured `PistonVelocity` and target-minus-state difference. | ||
|
|
||
| ## Notes | ||
|
|
||
| - If a tracer is not listed in `TracersToRestore`, no restoring tendency is | ||
| applied to that tracer. | ||
| - If surface restoring is enabled but no tracer IDs are available at tendency | ||
| compute-time, Omega aborts with an error. |
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
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.