CH-Earth / summa

Structure for Unifying Multiple Modeling Alternatives:
http://www.ral.ucar.edu/projects/summa
GNU General Public License v3.0
80 stars 105 forks source link

Develop remove flux numerical derivatives #527

Closed seantrim closed 1 year ago

seantrim commented 1 year ago

Make sure all the relevant boxes are checked (and only check the box if you actually completed the step):

This pull request pertains to the removal of numerical derivatives from flux calculations as requested by @martynpclark. The numerical derivatives were previously used to test the analytical formulas for the derivatives. Now that analytical derivatives are available for all cases in the flux files, the numerical derivative code sections could be removed, making the code more concise and more efficient (due to a reduction in branching). If the user happens to request numerical derivatives for fluxes in the model decisions, an error message is returned explaining that numerical derivatives are no longer available. Model output is bit identical to the current develop branch (verified using the full suite of 35 tests). Hopefully this does not interfere with @ashleymedin's recent pull request too much.

seantrim commented 1 year ago

Thanks for your comments Wouter! Based on today's merger meeting, I will close this PR for now, as it depends on the previous flux refactoring PR that will be reverted. Additionally, Ashley's changes may already cover the numerical derivative removal from the flux routines. I will revisit this PR after the big merger is complete. If needed, I will resubmit the PR to the upcoming v4 branch and resolve your comments above if they still apply. I will also make sure that the numerical derivatives removed here are covered by Ashley's changes.