mksurfdata_map rounding/truncation of special landunits should happen before wetland filling #1118
Labels
bug
something is working incorrectly
priority: high
High priority to fix/merge soon, e.g., because it is a problem in important configurations
Brief summary of bug
I think the current ordering of the rounding/truncation of special landunits in mksurfdata_map relative to the wetland filling could cause issues in some edge cases. These should be reversed. I haven't actually observed any problems; this comes just from looking at the code.
General bug information
CTSM version you are using: master
Does this bug cause significantly incorrect results in the model's science? No
Configurations affected: Probably unusual conditions in mksurfdata_map
Details of bug
I think this may be important to avoid errors and/or wrong behavior in some edge cases where we have < 0.5% cover of glacier and/or lake. I think the best thing to do would be to move the whole block of truncation code to above the wetland adjustment. i.e., move this block:
CTSM/tools/mksurfdata_map/src/mksurfdat.F90
Lines 737 to 747 in 6c99904
to above this block:
CTSM/tools/mksurfdata_map/src/mksurfdat.F90
Lines 714 to 735 in 6c99904
In addition to the edge case where pctlak or pctgla is < 0.5%, this could also be relevant in a case like this: pctlak = 5.4%, pctgla = 94.4%. With the current code, we'd first get pctwet = 0.2%. But then, after the rounding, we'd end up with pctlak = 5%, pctgla = 94%, pctwet = 0%. Then later, in normalizencheck_landuse, I think we'd end up with 1% natural veg, which could trigger the 'vegetation found outside the pft mask' abort. (Caveat: I may be missing something here, since there are so many corrections done at different points. It's also possible that there are other problems with doing the rounding first, but I'm not seeing any off-hand.)
(This split off from #1001 )
The text was updated successfully, but these errors were encountered: