Closed billsacks closed 5 years ago
@swensosc I'm tentatively assigning this to you to at least think about. I'm happy to talk with you more about it.
Upon further thought, the current behavior is probably okay (I think it leads to irrigation withdrawals being potentially overconstrained, but not undersconstrained as far as I can see), and making this better than it currently is could be tricky. So I'm closing this as a wontfix.
It turns out that the resolution of this issue falls out naturally in the course of resolving #521 . So I'm reopening this and assigning it to myself.
Groundwater irrigation (introduced by @swensosc in ctsm1.0.dev020) will compute the wrong water availability if there are multiple irrigated patches in a single column. Currently this is never the case, but the code should be flexible enough to handle this case.
The problem is in this block of code:
https://github.com/ESCOMP/ctsm/blob/7755baf3f729ff9adb0e39088c02113bbc9ebb58/src/biogeophys/IrrigationMod.F90#L917-L923
Note that this compares patch-level demand / fluxes with column-level availability. I think this can lead to the irrigation flux being overly constrained (e.g., if there are two patches on a column, with one being irrigated and the other not: I think the irrigated patch is currently constrained as if it took up the entire column).
Off-hand, I'm not sure how to solve this problem, but I don't think we want code like this that implicitly assumes one patch per column.