Skip to content

Replaced problematic incomplete gamma function with modernized version from SLATEC (copyright free).#1486

Open
robertmullis wants to merge 1 commit into
MPAS-Dev:developfrom
robertmullis:incomplete_gamma_fixes
Open

Replaced problematic incomplete gamma function with modernized version from SLATEC (copyright free).#1486
robertmullis wants to merge 1 commit into
MPAS-Dev:developfrom
robertmullis:incomplete_gamma_fixes

Conversation

@robertmullis

Copy link
Copy Markdown

This is a fix to replace the legacy incomplete gamma function with a modernized version from the SLATEC library, which is in the public domain. This also replaces the problematic log gamma function with the LOG_GAMMA Fortran intrinsic. Unit testing was performed on the function by compiling the source file against stand-in framework modules and comparing a series of values between the new and original implementations.

The implementations had a maximum relative difference of 4.1e-7, and the new implementation had a greater accuracy when compared to the Wolfram Alpha result for the same inputs (~1e-14 relative).

The functions were removed outright from [src/core_atmosphere/physics/physics_wrf/module_mp_thompson.F] because they were legacy code that was not called anywhere else.

  • This is my first PR to MPAS. Please advise on any processes for the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant