Skip to content

Commit

Permalink
Fixed major typo in dP_dt calc in parcel_aux; miscellaneous tweaks fo…
Browse files Browse the repository at this point in the history
…r porting SD code
  • Loading branch information
Daniel Rothenberg committed Apr 14, 2015
1 parent e40e1dc commit a1b440a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion parcel_model/integrator.py
Expand Up @@ -29,7 +29,7 @@

import constants as c

state_atol = [1e-4, 1e-4, 1e-4, 1e-10, 1e-15, 1e-4, 1e-8]
state_atol = [1e-4, 1e-4, 1e-4, 1e-10, 1e-10, 1e-4, 1e-8]
state_rtol = 1e-7

class Integrator(object):
Expand Down
6 changes: 2 additions & 4 deletions parcel_model/parcel.py
Expand Up @@ -348,7 +348,7 @@ def _setup_run(self):
def run(self, t_end,
output_dt=1., solver_dt=None,
max_steps=1000, solver="odeint", output="dataframes",
terminate=False, solver_args={}):
terminate=False, **solver_args):
""" Run the parcel model simulation.
Once the model has been instantiated, a simulation can immediately be
Expand All @@ -367,7 +367,7 @@ def run(self, t_end,
**Numerical Solver** -- By default, the model will use the `odeint` wrapper
of LSODA shipped by default with scipy. Some fine-tuning of the solver tolerances
is afforded here through the `max_steps`. For other solvers, a set of optional
arguments `solver_args` can be passed as a dictionary.
arguments `solver_args` can be passed.
**Solution Output** -- Several different output formats are available by default.
Additionally, the output arrays are saved with the `ParcelModel` instance so they
Expand Down Expand Up @@ -397,8 +397,6 @@ def run(self, t_end,
Choose format of solution output.
terminate : boolean
End simulation at or shortly after a maximum supersaturation has been achieved
solver_args : dict
Additional arguments to pass to the numerical ODE solver
Returns
-------
Expand Down
2 changes: 1 addition & 1 deletion parcel_model/parcel_aux.pyx
Expand Up @@ -109,7 +109,7 @@ def der(double[::1] y, double t,
double dwc_dt, dwv_dt, dwi_dt, dT_dt, dS_dt
double[::1] drs_dt, x

dP_dt = -1.*rho_air*g*Tv
dP_dt = -1.*rho_air*g*V

dwc_dt = 0.0
drs_dt = np.empty(shape=(nr), dtype="d")
Expand Down

0 comments on commit a1b440a

Please sign in to comment.