pywatershed.PRMSRunoff#

class pywatershed.PRMSRunoff(control, discretization, parameters, soil_lower_prev, soil_rechr_prev, net_ppt, net_rain, net_snow, potet, snowmelt, snow_evap, pkwater_equiv, pptmix_nopack, snowcov_area, through_rain, hru_intcpevap, intcp_changeover, dprst_flag=True, budget_type=None, calc_method=None, verbose=None)[source]#

PRMS surface runoff.

A surface runoff representation from PRMS.

Implementation based on PRMS 5.2.1 with theoretical documentation given in the PRMS-IV documentation:

Markstrom, S. L., Regan, R. S., Hay, L. E., Viger, R. J., Webb, R. M., Payn, R. A., & LaFontaine, J. H. (2015). PRMS-IV, the precipitation-runoff modeling system, version 4. US Geological Survey Techniques and Methods, 6, B7.

Parameters:
__init__(control, discretization, parameters, soil_lower_prev, soil_rechr_prev, net_ppt, net_rain, net_snow, potet, snowmelt, snow_evap, pkwater_equiv, pptmix_nopack, snowcov_area, through_rain, hru_intcpevap, intcp_changeover, dprst_flag=True, budget_type=None, calc_method=None, verbose=None)[source]#

Methods

__init__(control, discretization, ...[, ...])

advance()

Advance the Process in time.

basin_init()

This is trying to replicate the prms basin_init function that calculates some of the variables needed here by runoff.

calculate(time_length, **kwargs)

Calculate Process terms for a time step

check_capacity(soil_moist_prev, ...)

Fill soil to soil_moist_max, if more than capacity restrict infiltration by snowinfil_max, with excess added to runoff

compute_infil(contrib_fraction, ...)

description()

A dictionary description of this Process.

dprst_comp(dprst_vol_clos, ...)

dprst_init()

finalize()

Finalizes the Process, including output methods.

get_dimensions()

Get a tuple of dimension names for this Process.

get_init_values()

Get a dictionary of initialization values for each public variable.

get_inputs()

Get a tuple of input variable names for this Process.

get_mass_budget_terms()

Get a dictionary of variable names for mass budget terms.

get_parameters()

Get a tuple of parameter names for this Process.

get_restart_variables()

Get a list of restart varible names.

get_variables()

Get a tuple of (public) variable names for this Process.

imperv_et(imperv_stor, potet, imperv_evap, ...)

initialize_netcdf([output_dir, ...])

Initialize NetCDF output.

output()

Output data to previously initialized output types.

output_to_csv(pth)

Save each output variable to separate csv file in specified path

perv_comp(soil_moist_prev, carea_max, ...)

Pervious area computations.

set_input_to_adapter(input_variable_name, ...)

Attributes

dimensions

A tuple of parameter names.

init_values

A dictionary of initial values for each public variable.

inputs

A tuple of input variable names.

mass_budget_terms

A dictionary of variable names for the mass budget terms.

parameters

A tuple of parameter names.

restart_variables

A tuple of restart variable names.

variables

A tuple of public variable names.

advance()#

Advance the Process in time.

Returns:

None

basin_init()[source]#

This is trying to replicate the prms basin_init function that calculates some of the variables needed here by runoff. This should probably go somewhere else at some point as I suspect other components may need similar information.

calculate(time_length, **kwargs)#

Calculate Process terms for a time step

Parameters:

simulation_time – current simulation time

Return type:

None

Returns:

None

static check_capacity(soil_moist_prev, soil_moist_max, snowinfil_max, infil, srp)[source]#

Fill soil to soil_moist_max, if more than capacity restrict infiltration by snowinfil_max, with excess added to runoff

static compute_infil(contrib_fraction, soil_moist_prev, soil_moist_max, carea_max, smidx_coef, smidx_exp, pptmix_nopack, net_rain, net_ppt, imperv_stor, imperv_stor_max, snowmelt, snowinfil_max, net_snow, pkwater_equiv, infil, hru_type, intcp_changeover, hruarea_imperv, sri, srp, check_capacity, perv_comp, through_rain)[source]#
classmethod description()#

A dictionary description of this Process.

Return type:

dict

Returns:

All metadata for all variables in inputs, variables,parameters, and mass_budget_terms for this Process.

property dimensions: tuple#

A tuple of parameter names.

static dprst_comp(dprst_vol_clos, dprst_area_clos_max, dprst_area_clos, dprst_vol_open_max, dprst_vol_open, dprst_area_open_max, dprst_area_open, dprst_sroff_hru, dprst_seep_hru, sro_to_dprst_perv, sro_to_dprst_imperv, dprst_evap_hru, pptmix_nopack, snowmelt, pkwater_equiv, net_snow, hru_area, dprst_insroff_hru, dprst_frac_open, dprst_frac_clos, va_open_exp, dprst_vol_clos_max, dprst_vol_clos_frac, va_clos_exp, potet, snowcov_area, dprst_et_coef, dprst_seep_rate_open, dprst_vol_thres_open, dprst_flow_coef, dprst_seep_rate_clos, avail_et, net_rain, dprst_in, srp, sri, imperv_frac, perv_frac)[source]#
dprst_init()[source]#
finalize()#

Finalizes the Process, including output methods. :rtype: None :returns: None

static get_dimensions()[source]#

Get a tuple of dimension names for this Process.

Return type:

tuple

static get_init_values()[source]#

Get a dictionary of initialization values for each public variable.

Return type:

dict

static get_inputs()[source]#

Get a tuple of input variable names for this Process.

Return type:

tuple

static get_mass_budget_terms()[source]#

Get a dictionary of variable names for mass budget terms.

static get_parameters()[source]#

Get a tuple of parameter names for this Process.

Return type:

tuple

static get_restart_variables()#

Get a list of restart varible names.

Return type:

list

classmethod get_variables()#

Get a tuple of (public) variable names for this Process.

Return type:

tuple

static imperv_et(imperv_stor, potet, imperv_evap, sca, avail_et, imperv_frac)[source]#
property init_values: dict#

A dictionary of initial values for each public variable.

initialize_netcdf(output_dir=None, separate_files=None, budget_args=None, output_vars=None)#

Initialize NetCDF output.

Parameters:
  • output_dir – base directory path or NetCDF file path if separate_files is True

  • separate_files – boolean indicating if storage component output variables should be written to a separate file for each variable

  • output_vars – list of variable names to outuput.

Returns:

None

property inputs: tuple#

A tuple of input variable names.

property mass_budget_terms: dict#

A dictionary of variable names for the mass budget terms.

output()#

Output data to previously initialized output types. :rtype: None :returns: None

output_to_csv(pth)#

Save each output variable to separate csv file in specified path

property parameters: tuple#

A tuple of parameter names.

static perv_comp(soil_moist_prev, carea_max, smidx_coef, smidx_exp, pptp, ptc, infil, srp)[source]#

Pervious area computations.

property restart_variables: tuple#

A tuple of restart variable names.

set_input_to_adapter(input_variable_name, adapter)#
property variables: tuple#

A tuple of public variable names.