Skip to content

Add on_face to OBC_segment_data_type#926

Merged
Hallberg-NOAA merged 1 commit into
NOAA-GFDL:dev/gfdlfrom
Hallberg-NOAA:on_face_in_OBC_segment_type
Jul 8, 2025
Merged

Add on_face to OBC_segment_data_type#926
Hallberg-NOAA merged 1 commit into
NOAA-GFDL:dev/gfdlfrom
Hallberg-NOAA:on_face_in_OBC_segment_type

Conversation

@Hallberg-NOAA
Copy link
Copy Markdown
Member

Added the new on_face element to the OBC_segment_data_type to indicate where a field is staggered, and the used this to simplify the code and the logical tests in initialize_segment_data() and update_OBC_segment_data(). The new function field_is_on_face() is used to set the on_face elements. Also, duplicated code that determines whether data requirements have been satisfied has been moved into a single block of code that used regardless of whether the data is specified or provided from a file. There is also the new routine field_is_tidal() that can be used to determine the appropriate vertical extent of a field within the model. With these changes, there has been a substantial consolidation of the blocks of code that allocates and initializes the various input buffers.

In addition, some of the duplicated code setting the tracer reservoir values for temperatures, salinities and other "obgc" tracers has been consolidated into a single block of code. The code setting the SSH at boundaries was also consolidated rather than having duplicate blocks with and without the ramping enabled. Several redundant logical tests or unneeded arrays were also eliminated.

With these changes, MOM_open_boundary.F90 is shorter by about 190 lines and should be easier to read and maintain. There are no changes to publicly visible interfaces, and all answers are bitwise identical.

@Hallberg-NOAA Hallberg-NOAA added the refactor Code cleanup with no changes in functionality or results label Jun 25, 2025
@Hallberg-NOAA Hallberg-NOAA force-pushed the on_face_in_OBC_segment_type branch from dc5e154 to 6a735a1 Compare June 27, 2025 00:46
@theresa-cordero theresa-cordero self-requested a review June 30, 2025 17:20
@theresa-cordero
Copy link
Copy Markdown

This PR does not change answers for the NWA and NEP configurations.

  Added the new on_face element to the OBC_segment_data_type to indicate where a
field is staggered, and the used this to simplify the code and the logical tests
in initialize_segment_data and update_OBC_segment_data.  The new function
field_is_on_face() is used to set the on_face elements.  Also, duplicated code
that determines whether data requirements have been satisfied has been moved
into a single block of code that used regardless of whether the data is
specified or provided from a file.  There is also the new routine field_is_tidal
that can be used to determine the appropriate vertical extent of a field within
the model.  With these changes, there has been a substantial consolidation of
the blocks of code that allocates and initializes the various input buffers.

  In addition, some of the duplicated code setting the tracer reservoir values
for temperatures, salinities and other "obgc" tracers has been consolidated into
a single block of code.  The code setting the SSH at boundaries was also
consolidated rather than having duplicate blocks with and without the ramping
enabled.  Several redundant logical tests or unneeded arrays were also
eliminated.

  With these changes, MOM_open_boundary.F90 is shorter by about 190 lines and
should be easier to read and maintain.  There are no changes to publicly visible
interfaces, and all answers are bitwise identical.
@Hallberg-NOAA Hallberg-NOAA force-pushed the on_face_in_OBC_segment_type branch from 6a735a1 to f6a6bd2 Compare July 8, 2025 18:14
@Hallberg-NOAA
Copy link
Copy Markdown
Member Author

This PR has passed pipeline testing at https://gitlab.gfdl.noaa.gov/ogrp/mom6ci/MOM6/-/pipelines/28002.

@Hallberg-NOAA Hallberg-NOAA merged commit bce9a38 into NOAA-GFDL:dev/gfdl Jul 8, 2025
52 checks passed
@Hallberg-NOAA Hallberg-NOAA deleted the on_face_in_OBC_segment_type branch August 21, 2025 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Code cleanup with no changes in functionality or results

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants