Skip to content

Commit

Permalink
bugfix: run precip func once, then index if 3d
Browse files Browse the repository at this point in the history
  • Loading branch information
scivision committed Oct 27, 2023
1 parent c083bb2 commit b8969dd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/gemini3d/particles/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ def particles_BCs(cfg: dict[str, T.Any], xg: dict[str, T.Any]):
Qtmp = Qfunc(pg, cfg["Qprecip"], cfg["Qprecip_background"])

for i in range(i_on, i_off):
pg["Q"][i, :, :] = Qtmp[i, :, :]
if Qtmp.ndim == 3:
pg["Q"][i, :, :] = Qtmp[i, :, :]
else:
pg["Q"][i, :, :] = Qtmp
pg["E0"][i, :, :] = cfg["E0precip"]

assert np.isfinite(pg["Q"]).all(), "Q flux must be finite"
Expand Down

0 comments on commit b8969dd

Please sign in to comment.