phil-blain / CICE

Development repository for the CICE sea-ice model
Other
0 stars 0 forks source link

VP solver: division by zero in FGMRES if starting with no ice #42

Closed phil-blain closed 1 year ago

phil-blain commented 2 years ago

Reproducer;

./cice.setup -m ppp6 -e intel -c ~/cice-dirs/cases/vp-icnone -s icnone,dynpicard,debug     

It is the first normalization by norm_residual that causes the abort.

phil-blain commented 2 years ago

So all of these fields being zero seems correct and makes sense.

We have A x = b with b = 0 so we must have x = 0. It is thus the FMGRES algorithm which has to be tweaked to account for b = 0. This is e.g. what Scipy does: https://github.com/scipy/scipy/blob/651a9b717deb68adde9416072c1e1d5aa14a58a1/scipy/sparse/linalg/_isolve/iterative.py#L620-L628

phil-blain commented 2 years ago
phil-blain commented 2 years ago

52fd683 is a missing piece for a complete fix.

phil-blain commented 1 year ago

Closed in https://github.com/CICE-Consortium/CICE/pull/774