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

Open
wants to merge 1 commit into
base: dev/gfdl
Choose a base branch
from

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.

  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.

CS%opacity_coef(2,n) * chl_data(i,j)**CS%chl_power(n)
enddo
do n=CS%chl_dep_bands+1,optics%nbands ! These bands do not depend on the chlorophyll.
optics%opacity_band(n,i,j,k) = CS%opacity_coef(1,n)

Choose a reason for hiding this comment

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

since the formulation does not allow for a coef_2 or chl power for near IR bands, I suggest to put a FATAL if the use tries to put a value different from zero in opacity_coefs[6] or opacity_powers[3]

do n=3,optics%nbands
optics%min_wavelength_band(n) =700
optics%max_wavelength_band(n) =2800
optics%min_wavelength_band(n) = 700. + (n-3)*2100.0*I_NIR_bands

Choose a reason for hiding this comment

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

should hardcoded values also be parameters?

if (.not.allocated(optics%min_wavelength_band)) &
allocate(optics%min_wavelength_band(optics%nbands))
if (.not.allocated(optics%max_wavelength_band)) &
allocate(optics%max_wavelength_band(optics%nbands))

! Set opacity scheme dependent parameters.
if (CS%opacity_scheme == MANIZZA_05) then
optics%min_wavelength_band(1) =0

Choose a reason for hiding this comment

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

this could be close to 300nm unless we want to include gamma rays and UV

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.

2 participants