Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Issue538 seasurfaceheight #662

Merged
merged 13 commits into from
Oct 8, 2024
Merged

Issue538 seasurfaceheight #662

merged 13 commits into from
Oct 8, 2024

Conversation

einola
Copy link
Member

@einola einola commented Aug 23, 2024

Add sea-surface height

Fixes #538

Task List

  • Defined the tests that specify a complete and functioning change (It may help to create a design specification & test specification)
  • Implemented the source code change that satisfies the tests
  • Documented the feature by providing worked example
  • Updated the README or other documentation
  • Completed the pre-Request checklist below

Change Description

This PR adds the contribution of the sea-surface-height gradient to both the mEVP and BBM codes (through VPCGDynamicsKernel and BrittleDynamicsKernel). SSH is read in from IOceanBoundary and passed to the dynamical core. It can also be output through ConfigOutput as "ssh".


Test Description

No unit test was implemented for this feature, and no quantitative test exists. Qualitative testing shows that setting a fixed sea-surface-height gradient gives drift speed close to back-of-the-envelope estimates (13 cm/s modelled, 20 cm/s from back-of-the-envelope).


Documentation Impact

None


Other Details

None


Pre-Request Checklist

  • The requirements of this pull request are fully captured in an issue or design specification and are linked and summarised in the description of this PR
  • No new warnings are generated
  • The documentation has been updated (or an issue has been created to track the corresponding change)
  • Methods and Tests are commented such that they can be understood without having to obtain additional context
  • This PR/Issue is labelled as a bug/feature/enhancement/breaking change
  • File dates have been updated to reflect modification date
  • This change conforms to the conventions described in the README

winzerle and others added 3 commits August 21, 2024 14:43
This variable has to be set from outside.

CGDynamicsKernel::prepareIteration will compute the gradient of SeasurfaceHeight and stores it as CG-Vectors uGradSeasurfaceHeight and vGradSeasurfaceHeight ins CGDynamicsKernel. VPCGDynamicsKernel is using it in main update loop.

Before merging we should activate a ice-only testcase.
Adds ssh to IDynamics and IOceanBoundary classes and all the derived
classes. Also modifies TOPAZOcn_test.cpp and topaz_test_data.py to test
ssh, as well as changing era5_topaz4_maker.py to include and interpolate
 ssh.
@einola einola added the enhancement New feature or request label Aug 23, 2024
@einola einola added this to the 3 Stand-alone model milestone Aug 23, 2024
einola added 2 commits August 23, 2024 13:33
And that is "ssh" (instead of "SSH").
... to appease clang-format and the PR template
@einola einola mentioned this pull request Aug 23, 2024
27 tasks
@einola einola requested a review from timspainNERSC August 23, 2024 11:55
Copy link
Collaborator

@timspainNERSC timspainNERSC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one small change. I am assuming that the sea-surface gradient calculation code is correct.

physics/src/modules/include/IOceanBoundary.hpp Outdated Show resolved Hide resolved
@winzerle
Copy link
Collaborator

winzerle commented Oct 1, 2024 via email

@einola einola requested a review from timspainNERSC October 7, 2024 12:54
Copy link
Collaborator

@timspainNERSC timspainNERSC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of formatting changes, but if they are what clang-format demands, then they shall stand as they are.

Comment on lines 10 to 45
{ "damage", "DAMAGE0" }, // Ice thickness, cell average, m
{ "hice", "H_ICE_cell" }, // Ice thickness, cell average, m
{ "cice", "C_ICE0" }, // Ice concentration
{ "hsnow", "H_SNOW_cell" }, // Snow depth, cell average, m
{ "tice", "T_ICE0" }, // Ice temperature, ˚C
{ "tair", "T_AIR" }, // Air temperature, ˚C
{ "dew2m", "DEW_2M" }, // Dew point at 2 m, ˚C
{ "pair", "P_AIR" }, // sea level air pressure, Pa
{ "mixrat", "MIXRAT" }, // water vapour mass mixing ratio
{ "sw_in", "SW_IN" }, // incoming shortwave flux, W m⁻²
{ "lw_in", "LW_IN" }, // incoming longwave flux, W m⁻²
{ "mld", "MLD" }, // mixed layer depth, m
{ "snowfall", "SNOWFALL" }, // snow fall, kg m⁻² s⁻¹
{ "sss", "SSS" }, // sea surface salinity, PSU
{ "sst", "SST" }, // sea surface temperature ˚C
{ "sst_ext", "EXT_SST" }, // External sea surface temperature ˚C
{ "sss_ext", "EXT_SSS" }, // External sea surface salinity PSU
{ "eminusp", "E-P" }, // E-P atmospheric freshwater flux, kg s⁻¹ m⁻²
{ "mlcp", "CPML" }, // Mixed layer bulk heat capacity J K⁻¹ m⁻²
{ "tf", "TF" }, // Ocean freezing temperature, ˚C
{ "wind_speed", "WIND_SPEED" }, // Wind speed, m s⁻¹
{ "wind_u", "WIND_U" }, // wind velocity x component, m s⁻¹
{ "wind_v", "WIND_V" }, // wind velocity y component, m s⁻¹
{ "hice_true_pro", "HTRUE_ICE" }, // Ice thickness, ice average, m
{ "hsnow_true_pro", "HTRUE_SNOW" }, // Snow thickness, ice average, m
{ "ocean_u", "OCEAN_U" }, // x(east)-ward ocean current, m s⁻¹
{ "ocean_v", "OCEAN_V" }, // y(north)-ward ocean current, m s⁻¹
{ "u", "ICE_U" }, // x(east)-ward ice velocity, m s⁻¹
{ "v", "ICE_V" }, // y(north)-ward ice velocity, m s⁻¹
{ "sst_slab", "SLAB_SST" }, // Slab ocean surface temperature ˚C
{ "sss_slab", "SLAB_SSS" }, // Slab ocean surface salinity PSU
{ "qdw", "SLAB_QDW" }, // Slab ocean temperature nudging heat flux, W m⁻²
{ "fdw", "SLAB_FDW" }, // Slab ocean salinity nudging water flux, kg s⁻¹ m⁻²
{ "hice", "H_ICE_cell" }, // Ice thickness, cell average, m
{ "cice", "C_ICE0" }, // Ice concentration
{ "hsnow", "H_SNOW_cell" }, // Snow depth, cell average, m
{ "tice", "T_ICE0" }, // Ice temperature, ˚C
{ "tair", "T_AIR" }, // Air temperature, ˚C
{ "dew2m", "DEW_2M" }, // Dew point at 2 m, ˚C
{ "pair", "P_AIR" }, // sea level air pressure, Pa
{ "mixrat", "MIXRAT" }, // water vapour mass mixing ratio
{ "sw_in", "SW_IN" }, // incoming shortwave flux, W m⁻²
{ "lw_in", "LW_IN" }, // incoming longwave flux, W m⁻²
{ "mld", "MLD" }, // mixed layer depth, m
{ "snowfall", "SNOWFALL" }, // snow fall, kg m⁻² s⁻¹
{ "sss", "SSS" }, // sea surface salinity, PSU
{ "sst", "SST" }, // sea surface temperature ˚C
{ "sst_ext", "EXT_SST" }, // External sea surface temperature ˚C
{ "sss_ext", "EXT_SSS" }, // External sea surface salinity PSU
{ "eminusp", "E-P" }, // E-P atmospheric freshwater flux, kg s⁻¹ m⁻²
{ "mlcp", "CPML" }, // Mixed layer bulk heat capacity J K⁻¹ m⁻²
{ "tf", "TF" }, // Ocean freezing temperature, ˚C
{ "wind_speed", "WIND_SPEED" }, // Wind speed, m s⁻¹
{ "wind_u", "WIND_U" }, // wind velocity x component, m s⁻¹
{ "wind_v", "WIND_V" }, // wind velocity y component, m s⁻¹
{ "hice_true_pro", "HTRUE_ICE" }, // Ice thickness, ice average, m
{ "hsnow_true_pro", "HTRUE_SNOW" }, // Snow thickness, ice average, m
{ "ocean_u", "OCEAN_U" }, // x(east)-ward ocean current, m s⁻¹
{ "ocean_v", "OCEAN_V" }, // y(north)-ward ocean current, m s⁻¹
{ "u", "ICE_U" }, // x(east)-ward ice velocity, m s⁻¹
{ "v", "ICE_V" }, // y(north)-ward ice velocity, m s⁻¹
{ "sst_slab", "SLAB_SST" }, // Slab ocean surface temperature ˚C
{ "sss_slab", "SLAB_SSS" }, // Slab ocean surface salinity PSU
{ "qdw", "SLAB_QDW" }, // Slab ocean temperature nudging heat flux, W m⁻²
{ "fdw", "SLAB_FDW" }, // Slab ocean salinity nudging water flux, kg s⁻¹ m⁻²
{ "ssh", "SSH" }, // Slab ocean salinity nudging water flux, kg s⁻¹ m⁻²

{ "taux", "IO_STRESS_U" }, // Ice-ocean stress x(east) direction, Pa
{ "tauy", "IO_STRESS_V" }, // Ice-ocean stress x(east) direction, Pa
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some, but not all, of these are indented. Can they at least be consistent?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is weird. I removed the indentation. I'm not sure if clang-format knows what to do with this file.

physics/src/modules/include/IOceanBoundary.hpp Outdated Show resolved Hide resolved
It looks like clang-format was a bit overzealous.
@einola einola merged commit ad86763 into develop Oct 8, 2024
5 checks passed
@einola einola deleted the issue538_seasurfaceheight branch October 8, 2024 07:55
@einola einola mentioned this pull request Dec 6, 2024
12 tasks
einola added a commit that referenced this pull request Dec 13, 2024
# Add sea-surface height
Fixes #538 

### Task List
- [x] Defined the tests that specify a complete and functioning change
(*It may help to create a [design specification & test
specification](../../../wiki/Specification-Template)*)
- [x] Implemented the source code change that satisfies the tests
- [x] Documented the feature by providing worked example
- [ ] Updated the README or other documentation
- [x] Completed the pre-Request checklist below

---
# Change Description

This PR adds the contribution of the sea-surface-height gradient to both
the mEVP and BBM codes (through VPCGDynamicsKernel and
BrittleDynamicsKernel). SSH is read in from IOceanBoundary and passed to
the dynamical core. It can also be output through ConfigOutput as "ssh".

This PR is a repeat of PR #662 with some fixes to make sure the
integration test runs.

---
# Test Description

No unit test was implemented for this feature, and no quantitative test
exists. Qualitative testing shows that setting a fixed
sea-surface-height gradient gives drift speed close to
back-of-the-envelope estimates (13 cm/s modelled, 20 cm/s from
back-of-the-envelope).

---
# Documentation Impact

None

---
# Other Details

None

---
### Pre-Request Checklist

- [x] The requirements of this pull request are fully captured in an
issue or design specification and are linked and summarised in the
description of this PR
- [x] No new warnings are generated
- [x] The documentation has been updated (or an issue has been created
to track the corresponding change)
- [x] Methods and Tests are commented such that they can be understood
without having to obtain additional context
- [x] This PR/Issue is labelled as a bug/feature/enhancement/breaking
change
- [x] File dates have been updated to reflect modification date
- [x] This change conforms to the conventions described in the README
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request
Projects
Development

Successfully merging this pull request may close these issues.

Gradient of sea-surface height
3 participants