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

+Refactor MOM_opacity to replace hard-coded params #775

Merged

Conversation

Hallberg-NOAA
Copy link
Member

Refactored MOM_opacity to replace hard-coded dimensional parameters for the Manizza and Morel opacity fits with run-time parameters. By default, these parameters are set to the previous hard-coded values, using the recently added defaults argument to get_param_real_array(). The bounds of the frequency band label arrays with the MANIZZA_05 opacity scheme were also corrected when PEN_SW_NBANDS > 3, but it would not by typical to use so many bands for no purpose and these labeling arrays (optics%min_wavelength_band and optics%max_wavelength_band) do not appear to be used anywhere. In addition, the unused publicly visible routines opacity_manizza() and opacity_morel() were eliminated or made private. All answers are bitwise identical, but there are new entries in some MOM_parameter_doc files.

@Hallberg-NOAA Hallberg-NOAA added the Parameter change Input parameter changes (addition, removal, or description) label Dec 11, 2024
@raphaeldussin raphaeldussin self-assigned this Jan 6, 2025
Copy link

@raphaeldussin raphaeldussin left a comment

Choose a reason for hiding this comment

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

I think there should be a response from the model (e.g. FATAL) to changing parameters that would not have any effect. The rest is nitpicking.

src/parameterizations/vertical/MOM_opacity.F90 Outdated Show resolved Hide resolved
src/parameterizations/vertical/MOM_opacity.F90 Outdated Show resolved Hide resolved
Copy link
Member

@marshallward marshallward left a comment

Choose a reason for hiding this comment

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

Approving on behalf of @raphaeldussin but I will let you all decide when the conversation below above has been resolved.

@Hallberg-NOAA
Copy link
Member Author

Neither opacity_manizza() nor opacity_morel() appears anywhere in the GFDL ocean-BGC code under version control at https://github.com/NOAA-GFDL/ocean_BGC. I strongly suspect that these routines are not used anywhere.

@Hallberg-NOAA Hallberg-NOAA force-pushed the refactor_MOM_opacity branch 2 times, most recently from 70384fd to 7937920 Compare January 14, 2025 03:27
@Hallberg-NOAA
Copy link
Member Author

This PR passed pipeline testing at https://gitlab.gfdl.noaa.gov/ogrp/mom6ci/MOM6/-/pipelines/26027, with the expected changes in parameter settings. However, there are OPACITY_BAND_WAVELENGTHS parameters being logged in cases with only a single wavelength band, for which this parameter has little physical meaning, so I have revised this PR to only log OPACITY_BAND_WAVELENGTHS when PEN_SW_NBANDS > 1.

  Refactored MOM_opacity to replace hard-coded dimensional parameters for the
Manizza and Morel opacity fits with run-time parameters, and also added the
runtime parameter OPACITY_BAND_WAVELENGTHS to provide the ability to set the
wavelengths of the bands, even though these are not actually used in MOM6.  By
default, these parameters are all set to the previous hard-coded values, using
the recently added defaults argument to get_param_real_array().  The bounds of
the frequency band label arrays with the MANIZZA_05 opacity scheme were also
corrected when PEN_SW_NBANDS > 3, but it would not be typical to use so many
bands for no purpose and these labeling arrays (optics%min_wavelength_band and
optics%max_wavelength_band) do not appear to be used anywhere.  In addition, the
unused publicly visible routines opacity_manizza and opacity_morel were
eliminated or made private.  All answers are bitwise identical, but there are
new entries in some MOM_parameter_doc files.
@Hallberg-NOAA
Copy link
Member Author

This revised version has passed pipeline testing at https://gitlab.gfdl.noaa.gov/ogrp/mom6ci/MOM6/-/pipelines/26036 with the expected warnings about additional runtime parameters.

@Hallberg-NOAA Hallberg-NOAA merged commit 8249510 into NOAA-GFDL:dev/gfdl Jan 14, 2025
10 checks passed
@Hallberg-NOAA Hallberg-NOAA deleted the refactor_MOM_opacity branch January 14, 2025 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Parameter change Input parameter changes (addition, removal, or description)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants