Skip to content

Commit

Permalink
Copy active tracers in SIQN (#614)
Browse files Browse the repository at this point in the history
  • Loading branch information
nhartney authored Feb 12, 2025
1 parent 3737472 commit 3bed2e6
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions gusto/timestepping/semi_implicit_quasi_newton.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
from pyop2.profiling import timed_stage
from gusto.core import TimeLevelFields, StateFields
from gusto.core.labels import (transport, diffusion, time_derivative,
linearisation, prognostic, hydrostatic,
physics_label, sponge, incompressible)
hydrostatic, physics_label, sponge,
incompressible)
from gusto.solvers import LinearTimesteppingSolver, mass_parameters
from gusto.core.logging import logger, DEBUG, logging_ksp_monitor_true_residual
from gusto.time_discretisation.time_discretisation import ExplicitTimeDiscretisation
Expand Down Expand Up @@ -220,14 +220,9 @@ def __init__(self, equation_set, io, transport_schemes, spatial_methods,
self.setup_transporting_velocity(aux_scheme)

self.tracers_to_copy = []
for name in equation_set.field_names:
# Extract time derivative for that prognostic
mass_form = equation_set.residual.label_map(
lambda t: (t.has_label(time_derivative) and t.get(prognostic) == name),
map_if_false=drop)
# Copy over field if the time derivative term has no linearisation
if not mass_form.terms[0].has_label(linearisation):
self.tracers_to_copy.append(name)
if equation_set.active_tracers is not None:
for active_tracer in equation_set.active_tracers:
self.tracers_to_copy.append(active_tracer.name)

self.field_name = equation_set.field_name
W = equation_set.function_space
Expand Down

0 comments on commit 3bed2e6

Please sign in to comment.