Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed a rare logic error in the f_ground computation
When computing f_ground for cells or quadrants, the number of floating corners (nfloat) is based on how many of the four corners have f_flotation > 0. Arbitrarily, corners with f_flotation = 0.0 are considered to be grounded rather than floating. This creates a potential problem for a cell where 1 <= nfloat <= 3, but all the corners that are nominally grounded have f_flotation = 0. (This can happen in rare cases, because of another piece of logic that caps f_flotation at values slightly greater than or less than 0, so that small positive values can exactly cancel with small negative values.) Then we have a log(0) in the integral formula, leading to f_ground = NaN. The one-line fix is to treat any cell or quadrant with minval(f_flotation) = 0 as if nfloat = 4, implying f_ground = 0. This fix is answer-changing in a good way; it gives finite answers in these rare cases, instead of NaNs. The fix was introduced partway through the ISMIP6 Antarctic production runs, so that these runs could finish.
- Loading branch information