Skip to content

Commit

Permalink
Merge pull request #168 from mabruzzo/minor-tweaks-initialize_rates.c
Browse files Browse the repository at this point in the history
Minor tweaks to `initialize_rates.c` of little importance.
  • Loading branch information
brittonsmith committed Jul 21, 2023
2 parents 032d971 + 27ede71 commit 72be02a
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/clib/initialize_rates.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ void logT_spacing_dust(double *logT_start_dust, double *d_logT_dust, chemistry_d
/ (my_chemistry->NumberOfDustTemperatureBins - 1);
}

//Define a fucntion which is able to add a scalar rate to the calculation.
//Define a function which is able to add a scalar rate to the calculation.
int add_scalar_reaction_rate(double *rate_ptr, scalar_rate_function my_function, double units,
chemistry_data *my_chemistry)
{
Expand Down Expand Up @@ -154,7 +154,7 @@ int add_k13dd_reaction_rate(double **rate_ptr, double units, chemistry_data *my_
*rate_ptr = malloc(14 * my_chemistry->NumberOfTemperatureBins * sizeof(double));

//Create a temporary array to retrieve the 14 coefficients calculated by the k13dd function.
double *temp_array = malloc(14 * sizeof(double));
double temp_array[14];

//Calculate temperature spacing.
double T, logT, logT_start, d_logT;
Expand All @@ -172,13 +172,11 @@ int add_k13dd_reaction_rate(double **rate_ptr, double units, chemistry_data *my_
(*rate_ptr)[i + (my_chemistry->NumberOfTemperatureBins * j)] = temp_array[j];
}
}
//Delete temporary array.
free(temp_array);

return SUCCESS;
}

//Define a functin which will calculate h2dust rates.
//Define a function which will calculate h2dust rates.
int add_h2dust_reaction_rate(double **rate_ptr, double units, chemistry_data *my_chemistry)
{
//Allocate memory for h2dust.
Expand Down

0 comments on commit 72be02a

Please sign in to comment.