Skip to content

Commit

Permalink
Negative errors were triggering convergence
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacsquires committed Nov 8, 2023
1 parent 3b0c37f commit cbc61ec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion taufactor/taufactor.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ def check_vertical_flux(self, conv_crit):
err = (fl.max() - fl.min())*2/(fl.max() + fl.min())
if fl.min() == 0:
return 'zero_flux', torch.mean(fl), err
if err < conv_crit or torch.isnan(err).item():
if abs(err) < conv_crit or torch.isnan(err).item():
return True, torch.mean(fl), err
return False, torch.mean(fl), err

Expand Down

0 comments on commit cbc61ec

Please sign in to comment.