-
Notifications
You must be signed in to change notification settings - Fork 156
Distribution fixes #788
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
Distribution fixes #788
Conversation
Functions inv_beta_cdf_params and beta_cdf_params now include an error check to make sure that the lower and upper bounds in the distribution_params_type have been set to 0 and 1 as other values are not supported. HK note it might be better to remove this and have pure functions with no side effects. Subroutine set_beta_params_from_ens has changed the distribution_params_type to an intent out argument and defines all six parameters correctly. It also set the parameter type to BETA_DISTRIBUTION. fixes #717
…mma distributions. jla commit message: A comment now makes it clear that this module only supports the standard gamma distribution that is bounded below by 0 and unbounded above. Subroutines gamma_cdf, inverse_gamma_cdf, set_gamma_params_from_ens, and inv_gamma_first_guess no longer have bounded_below, bounded_above, lower_bound, and upper_bound as arguments. inv_gamma_cdf now sets the bounded_below, bounded_above, lower_bound and upper_bound parameters to the correct values for the gamma. Functions inv_gamma_cdf_params and gamma_cdf_params now include an error check to make sure that the lower and upper bounds in the distribution_params_type have been set to 0 and missing_r8 as other values are not supported. Subroutine set_gamma_params_from_ens has changed the distribution_params_type to an intent out argument and defines all six parameters correctly. It also sets the parameter type to GAMMA_DISTRIBUTION.
jla commit message: Functions inv_std_normal_cdf and set_normal_params_from_ens now set the appropriate values for the bounded_below, bounded_above, lower_bound and upper_bound components of the distribution_params_type. The distribution_params_type was changed to intent out in set_normal_params_from_ens. The magic number definition of the maximum delta in the inv_cdf root searching routine was changed to be a parameter but the value of 1e-8 was unchanged. A comment notes that changing this parameter to 1e-9 allows all of Ian Groom’s KDE distribution tests to pass. HK note, assuming this is if you use inv_cdf from normal_distribution_mod rather than rootfinding mode with KDE. fixes #787
Only occurances on task 0 were printing #787 (comment)
assimilation_code/modules/assimilation/normal_distribution_mod.f90
Outdated
Show resolved
Hide resolved
assimilation_code/modules/assimilation/normal_distribution_mod.f90
Outdated
Show resolved
Hide resolved
qceff table bounds are ignored for these
397a971
to
538d238
Compare
1a9dc77
to
e0fb360
Compare
assimilation_code/modules/assimilation/probit_transform_mod.f90
Outdated
Show resolved
Hide resolved
assimilation_code/modules/assimilation/probit_transform_mod.f90
Outdated
Show resolved
Hide resolved
@mjs2369 can you take a look at this when you get a chance. |
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.
Looking good Helen. My only questions/comments are posted
@@ -41,6 +41,9 @@ else | |||
fi | |||
} | |||
|
|||
cp input.nml input.nml.bak | |||
cp input.nml.no_alg input.nml |
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.
What is the motivation here for using this input.nml file without an &algorithm_info_nml?
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.
the other tests switch in an &algorithm_info_nml with various qceff_tables by appending &algorithm_info_nml to the end of the input.nml
The namelist read in fortran will take the first occurrence of the namelist in the file and ignore any subsequent ones. So the input.nml.no_alg is to start with a input.nml that doesn't have a &algorithm_info_nml in it.
This reason it is in this pull request is test_force_bounds needs an input.nml, so now have input.nml and input.nml.no_alg
Co-authored-by: Marlena Smith <[email protected]>
Co-authored-by: Marlena Smith <[email protected]>
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.
Good stuff @hkershaw-brown
Description:
Fixes for distributions that have been hanging out on https://github.com/NCAR/DART/tree/beta_distribution_fix
Forcing the gamma and beta qceff options (bounds) in qceff table to be:
test in developer_tests/qceff/test_force_bounds
I can split this into 3 pull requests if that is easier to review.
Fixes issue
fixes #717 only supporting standard beta
fixes #786 only supporting standard gamma - note see issue, still have upper and lower bound
fixes #787 see notes - initialize distribution_param_type to UNSET?
There was an E_MSG about failing to converge, switched this to E_ALLMSG since the failure could be on any task.
I think the documentation for the qceff available distributions probably needs updating to clarify that the GAMMA & BETA bounds are fixed (QCEFF table values are ignored) Edit: went ahead and changed the documentation.
DART/guide/qceff_probit.rst
Lines 126 to 135 in bddda57
Maybe this is sufficient, I dunno:
Types of changes
Documentation changes needed?
Tests
Please describe any tests you ran to verify your changes.
developer_tests/*_dist
developer_tests/qceff/test_force_bounds
Checklist for merging
Checklist for release
Testing Datasets