Skip to content

Fix no-op N/TAN loss-rate clamps (min result discarded)#7

Open
mklarmann wants to merge 1 commit into
agroscope-ch:mainfrom
mklarmann:fix/loss-rate-clamp-noop
Open

Fix no-op N/TAN loss-rate clamps (min result discarded)#7
mklarmann wants to merge 1 commit into
agroscope-ch:mainfrom
mklarmann:fix/loss-rate-clamp-noop

Conversation

@mklarmann

Copy link
Copy Markdown

The min(1.0, loss_rate_N_frac) and min(1.0, loss_rate_TAN_frac) calls in SALCAfield_field.py (lines 861, 870) computed a value that was discarded, so the intended clamp ("cannot be >1") had no effect and the loss rates could exceed 1.0 and flow uncapped into SALCAnitrate. This assigns the result back.

Fixes #2

The min(1.0, loss_rate_N_frac) / min(1.0, loss_rate_TAN_frac) calls computed a
value that was discarded (no assignment), so the intended clamp ('cannot be >1')
had no effect and loss rates could exceed 1.0. Assign the result back.

Fixes agroscope-ch#2
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.

N and TAN loss-rate clamps are no-ops: min(1.0, ...) result discarded (SALCAfield_field.py:861, 870)

1 participant