Skip to content

Commit

Permalink
Merge pull request #95 from tldr-group/feature---change-err-for-negat…
Browse files Browse the repository at this point in the history
…ive-flux

Feature   change err for negative flux resolves #94
  • Loading branch information
amirDahari1 authored Jan 8, 2024
2 parents 74263a2 + 83e7d20 commit 2e3ab8a
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 @@ -197,7 +197,7 @@ def check_vertical_flux(self, conv_crit):
vert_flux[self.conc[:, :-2, 1:-1, 1:-1] == 0] = 0
vert_flux[self.conc[:, 1:-1, 1:-1, 1:-1] == 0] = 0
fl = torch.sum(vert_flux, (0, 2, 3))[1:-1]
err = (fl.max() - fl.min())*2/(fl.max() + fl.min())
err = (fl.max() - fl.min())/(fl.max())
if fl.min() == 0:
return 'zero_flux', torch.mean(fl), err
if err < conv_crit or torch.isnan(err).item():
Expand Down

0 comments on commit 2e3ab8a

Please sign in to comment.