Skip to content

Commit

Permalink
skip output computation for sed only nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
adamchengtkc committed Aug 20, 2024
1 parent dd6108e commit f9f7c4d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
9 changes: 5 additions & 4 deletions warmth/postprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,10 +431,11 @@ def cum_reacted(A, E, weights, time, temp_k):
DI = np.zeros([nt, nw])

# When computing the deltas, drop index 0, start at index 1
for i in range(1, time.size):
for j in range(0, weights.size):
DI[i, j] = DI[i - 1, j] + (I[i, j] - I[i - 1, j]) / heat_rate[i]
CR_easy[i] += weights[j] * (1 - np.exp(-DI[i, j]))
with np.errstate(divide='ignore',invalid='ignore'):
for i in range(1, time.size):
for j in range(0, weights.size):
DI[i, j] = DI[i - 1, j] + (I[i, j] - I[i - 1, j]) / heat_rate[i]
CR_easy[i] += weights[j] * (1 - np.exp(-DI[i, j]))

return CR_easy

Expand Down
4 changes: 2 additions & 2 deletions warmth/simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ def run(self) -> Path:
fw = Forward_model(self.parameters, self.node)
if self.node._full_simulation:
fw.simulate_single_node()
self.node.max_time = self.node._depth_out.shape[1]
self.node.compute_derived_arrays()
else:
fw._sedimentation()
self.node = fw.current_node
self._pad_sediments()
self.node.simulated_at = time.time()
self.node.max_time = self.node._depth_out.shape[1]
self.node.compute_derived_arrays()
self.node.node_path = self.node_path
filepath = self._save_results()
# Delete input node
Expand Down

0 comments on commit f9f7c4d

Please sign in to comment.