Skip to content

Convert 28 static arrays into dynamic arrays - #921

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

Hallberg-NOAA merged 1 commit into
NOAA-GFDL:dev/gfdlfrom
Hallberg-NOAA:less_static_arrays

Conversation

@Hallberg-NOAA

Copy link
Copy Markdown
Member

Converted 28 arrays from potentially static using the ALLOCABLE_ and ALLOC_() macros into dynamic arrays in three modules. This change reduces the static memory footprint of MOM6. These arrays are only ever used conditionally based on parameter settings, so they should never have been declared using these static memory macros. All answers are bitwise identical and there are no changes to any public interfaces.

@Hallberg-NOAA Hallberg-NOAA added the refactor Code cleanup with no changes in functionality or results label Jun 15, 2025
@adcroft

adcroft commented Jul 9, 2025

Copy link
Copy Markdown
Member

"...should never have been declared using these static memory macros...". These would only be static if using static memory mode? I'm not what the policy for static memory should be anymore - for debugging or speed...?

  Converted 28 arrays from potentially static using the ALLOCABLE_ and ALLOC_
macros into dynamic arrays in three modules.  This change reduces the static
memory footprint of MOM6.  These arrays are only ever used conditionally based
on parameter settings, so they should never have been declared using these
static memory macros.  All answers are bitwise identical and there are no
changes to any public interfaces.
@Hallberg-NOAA

Copy link
Copy Markdown
Member Author

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

@Hallberg-NOAA
Hallberg-NOAA merged commit 1db9ac1 into NOAA-GFDL:dev/gfdl Jul 9, 2025
@Hallberg-NOAA
Hallberg-NOAA deleted the less_static_arrays branch August 21, 2025 15:42
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