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

potential division by zero in pChl_subcol computation #50

Closed
klindsay28 opened this issue Apr 23, 2016 · 0 comments
Closed

potential division by zero in pChl_subcol computation #50

klindsay28 opened this issue Apr 23, 2016 · 0 comments
Assignees
Labels
Milestone

Comments

@klindsay28
Copy link
Collaborator

The computation of pChl_subcol, in marbl_compute_autotroph_photosynthesis, is

            ! GD 98 Chl. synth. term
            pChl_subcol = autotrophs(auto_ind)%thetaN_max * PCphoto_subcol / &
                 (autotrophs(auto_ind)%alphaPI * thetaC * PAR_avg(subcol_ind))

The denominator can underflow to zero, even if the individual terms are positive. This happened in a coupled run using cesm_pop_2_1_20160222 (before MARBL was separated out). In this run, PAR_avg was less than 10^-300, in an individual sub-colum at a single grid point, but it was positive.

A work-around is to set PAR%interface to zero if it is below a threshold, after it is computed and before it is used to set PAR%avg. This is in marbl_compute_photosynthetically_available_radiation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants