-
Notifications
You must be signed in to change notification settings - Fork 62
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
base: dev/gfdl
Are you sure you want to change the base?
+Refactor MOM_opacity to replace hard-coded params #775
Conversation
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.
There was a problem hiding this 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) |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
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 toget_param_real_array()
. The bounds of the frequency band label arrays with theMANIZZA_05
opacity scheme were also corrected whenPEN_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
andoptics%max_wavelength_band
) do not appear to be used anywhere. In addition, the unused publicly visible routinesopacity_manizza()
andopacity_morel()
were eliminated or made private. All answers are bitwise identical, but there are new entries in someMOM_parameter_doc
files.