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

Remove redundant code in cable_optimise_JV_module (CABLE-POP) #512

Open
mcuntz opened this issue Dec 16, 2024 · 0 comments
Open

Remove redundant code in cable_optimise_JV_module (CABLE-POP) #512

mcuntz opened this issue Dec 16, 2024 · 0 comments

Comments

@mcuntz
Copy link
Contributor

mcuntz commented Dec 16, 2024

Photosynthesis is calculated in cable_canopy in CABLE-POP but also in cable_optimise_JV_module. The routines that solve the quadratic (implicit gm) or cubic (explicit gm) equations exists in both modules (called fAn_c3, etc.). This is because the input in cable_canopy is double precisision while it is single precision in cable_optimise_JV_module.

I propose to remove redundant code by putting these routines in a separate module that deals with single/double precision (using interface with module procedure).

I would further try to get the photosynthesis code in both modeuls as close as possible so that the least changes have to be done during further developments.

There are also two routines (golden and rtbis) that come from Numerical Recipes. I propose to also take them out of the module and put them into the utils directory (which has only minpack until now). They can have individual modules (cbl_golden, cbl_rtbis) or one module like cbl_numerical_recipes.

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

No branches or pull requests

1 participant