Skip to content

Commit

Permalink
moved where ordered arrays are computed
Browse files Browse the repository at this point in the history
  • Loading branch information
alexjamesgarza committed Apr 2, 2024
1 parent c94bfa7 commit be0484d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/box_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,6 @@ def solve(self, path_to_output = None):
output_array.append(headers)



curr_time = 0
next_output_time = curr_time
#runs the simulation at each timestep
Expand Down Expand Up @@ -451,8 +450,7 @@ def solve(self, path_to_output = None):
next_conditions = self.evolving_conditions.conditions[next_conditions_index]
next_conditions_time = self.evolving_conditions.times[next_conditions_index]

ordered_concentrations = self.order_species_concentrations(curr_conditions, species_constant_ordering)
ordered_rate_constants = self.order_reaction_rates(curr_conditions, rate_constant_ordering)



#overrides concentrations if specified by conditions
Expand All @@ -463,7 +461,8 @@ def solve(self, path_to_output = None):
next_conditions = None



ordered_concentrations = self.order_species_concentrations(curr_conditions, species_constant_ordering)
ordered_rate_constants = self.order_reaction_rates(curr_conditions, rate_constant_ordering)

#solves and updates concentration values in concentration array
musica.micm_solve(self.solver, self.box_model_options.chem_step_time, curr_conditions.temperature, curr_conditions.pressure, ordered_concentrations, ordered_rate_constants)
Expand Down

0 comments on commit be0484d

Please sign in to comment.