Skip to content
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

+Add grid_unit_to_L to the ocean_grid_type #766

Merged
merged 1 commit into from
Jan 16, 2025

Conversation

Hallberg-NOAA
Copy link
Member

Add the new element grid_unit_to_L to the ocean_grid_type and thedyn_horgrid_type, which can be used to convert the units of the G%geoLat and G%geoLon variables to rescaled horizontal distance units ([L ~> m]) when they are Cartesian coordinates. When Cartesian coordinates are not in use, G%grid_unit_to_L is set to 0.

This new element of the grid type is used to test for inconsistent grids or to eliminate rescaling variables in set_rotation_beta_plane(), initialize_velocity_circular(), DOME_initialize_topography(), DOME_initialize_sponges(), DOME_set_OBC_data(), ISOMIP_initialize_topography(), idealized_hurricane_wind_forcing(), Kelvin_set_OBC_data(), Rossby_front_initialize_velocity(), soliton_initialize_thickness(), and soliton_initialize_velocity(). These are the instances where this new variable could be used and bitwise identical answers are recovered. There are a few other places where they should be used, but where answers would change, and these will be deferred to a subsequent commit.

All answers are bitwise identical, but there are new elements in two transparent and widely used types.

@Hallberg-NOAA Hallberg-NOAA added the enhancement New feature or request label Dec 4, 2024
Copy link

@MJHarrison-GFDL MJHarrison-GFDL left a comment

Choose a reason for hiding this comment

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

The introduction of G%grid_unit_to_L makes sense and I approve. Unfortunate that this requires updating user code - unmerged user code on other forks will require manual updates.

  Add the new element grid_unit_to_L to the ocean_grid_type and the
dyn_horgrid_type, which can be used to convert the units of the geoLat and
geoLon variables to rescaled horizontal distance units ([L ~> m]) when they are
Cartesian coordinates.  When Cartesian coordinates are not in use,
G%grid_unit_to_L is set to 0.

  This new element of the grid type is used to test for inconsistent grids or to
eliminate rescaling variables in set_rotation_beta_plane(),
initialize_velocity_circular(), DOME_initialize_topography(),
DOME_initialize_sponges(), DOME_set_OBC_data(), ISOMIP_initialize_topography(),
idealized_hurricane_wind_forcing(), Kelvin_set_OBC_data(),
Rossby_front_initialize_velocity(), soliton_initialize_thickness(), and
soliton_initialize_velocity().   These are the instances where this new
variable could be used and bitwise identical answers are recovered.  There are
a few other places where they should be used, but where answers would change,
and these will be deferred to a subsequent commit.

  All answers are bitwise identical, but there are new elements in two
transparent and widely used types.
@Hallberg-NOAA
Copy link
Member Author

The use of this variable is not required, so if users do not want to update their code on other forks, they don't have to do anything.

@Hallberg-NOAA
Copy link
Member Author

Hallberg-NOAA commented Jan 15, 2025

This was failing the pipeline testing on the first try for one case due to overly aggressive error detection on line 361 of Idealized_Hurricane.F90 , but this was readily corrected with a single-line fix to the logic around an error message that I showed to Theresa (who agreed that it was innocuous if it works), and now it has passed pipeline testing at https://gitlab.gfdl.noaa.gov/ogrp/mom6ci/MOM6/-/pipelines/26079.

@Hallberg-NOAA Hallberg-NOAA merged commit 400c982 into NOAA-GFDL:dev/gfdl Jan 16, 2025
10 checks passed
@Hallberg-NOAA Hallberg-NOAA deleted the add_grid_unit_to_L branch January 19, 2025 03:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants