pywatershed.PRMSSoilzoneNoDprst#
- class pywatershed.PRMSSoilzoneNoDprst(control, discretization, parameters, hru_impervevap, hru_intcpevap, infil_hru, sroff, sroff_vol, potet, transp_on, snow_evap, snowcov_area, budget_type='defer', calc_method=None, adjust_parameters='warn', verbose=None)[source]#
PRMS soil zone.
Implementation based on PRMS 5.2.1 with theoretical documentation given in the PRMS-IV documentation:
Note that as of pywatershed version 2.0.0, pref_flow_infil_frac is a required parameters which is optional in PRMS. Specifying zeros for all HRUs gives the same behavior as not supplying the parameter to PRMS.
- Parameters:
control (
Control) – a Control objectdiscretization (
Parameters) – a discretization of class Parametersparameters (
Parameters) – a parameter object of class Parametershru_impervevap (
Union[str,Path,ndarray,Adapter]) – HRU area-weighted average evaporation from impervious area for each HRUhru_intcpevap (
Union[str,Path,ndarray,Adapter]) – HRU area-weighted average evaporation from the canopy for each HRUinfil_hru (
Union[str,Path,ndarray,Adapter]) – Infiltration to the capillary and preferential-flow reservoirs, depth on HRU areasroff (
Union[str,Path,ndarray,Adapter]) – Surface runoff to the stream network for each HRUsroff_vol (
Union[str,Path,ndarray,Adapter]) – Surface runoff volume to the stream network for each HRUpotet (
Union[str,Path,ndarray,Adapter]) – Potential ET for each HRUtransp_on (
Union[str,Path,ndarray,Adapter]) – Flag indicating whether transpiration is occurring (0=no;1=yes)snow_evap (
Union[str,Path,ndarray,Adapter]) – Evaporation and sublimation from snowpack on each HRUsnowcov_area (
Union[str,Path,ndarray,Adapter]) – Snow-covered area on each HRU prior to melt and sublimation unless snowpackbudget_type (
Literal['defer',None,'warn','error']) – one of [“defer”, None, “warn”, “error”] with “defer” being the default and defering to control.options[“budget_type”] when available. When control.options[“budget_type”] is not avaiable, budget_type is set to “warn”.calc_method (
Literal['numba','numpy']) – one of [“fortran”, “numba”, “numpy”]. None defaults to “numba”.adjust_parameters (
Literal['warn','error','no']) – one of [“warn”, “error”, “no”]. Default is “warn”, the code edits the parameters and issues a warning. If “error” is selected the the code issues warnings about all edited parameters before raising the error to give you information. If “no” is selected then no parameters are adjusted and there will be no warnings or errors.verbose (
bool) – Print extra information or not?
- __init__(control, discretization, parameters, hru_impervevap, hru_intcpevap, infil_hru, sroff, sroff_vol, potet, transp_on, snow_evap, snowcov_area, budget_type='defer', calc_method=None, adjust_parameters='warn', verbose=None)[source]#
Methods
__init__(control, discretization, ...[, ...])advance()Advance the Process in time.
calculate(time_length, **kwargs)Calculate Process terms for a time step
A dictionary description of this Process.
finalize()Finalizes the Process, including output methods.
Get a tuple of dimension names for this Process.
Get a dictionary of initialization values for each public variable.
Get a tuple of input variable names for this Process.
Get a dictionary of variable names for mass budget terms.
Get a tuple of parameter names for this Process.
Get a list of restart varible names.
Get a tuple of (public) variable names for this Process.
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
set_input_to_adapter(input_variable_name, ...)Set input variables to adapter.current and manage the adapter.
Attributes
A tuple of parameter names.
A dictionary of initial values for each public variable.
A tuple of input variable names.
A dictionary of variable names for the mass budget terms.
A tuple of parameter names.
A tuple of restart variable names.
A tuple of public variable names.
- advance()#
Advance the Process in time.
- Returns:
None
- calculate(time_length, **kwargs)#
Calculate Process terms for a time step
- Parameters:
simulation_time – current simulation time
- Return type:
- Returns:
None
- classmethod description()#
A dictionary description of this Process.
- Return type:
- Returns:
All metadata for all variables in inputs, variables,parameters, and mass_budget_terms for this Process.
- static get_init_values()[source]#
Get a dictionary of initialization values for each public variable.
- Return type:
- classmethod get_variables()#
Get a tuple of (public) variable names for this Process.
- Return type:
- initialize_netcdf(output_dir=None, separate_files=None, budget_args=None, output_vars=None, extra_coords=None, addtl_output_vars=None)#
Initialize NetCDF output.
- Parameters:
output_dir ([<class ‘str’>, <class ‘pathlib.Path’>]) – base directory path or NetCDF file path if separate_files is True
separate_files (
bool) – boolean indicating if storage component output variables should be written to a separate file for each variableoutput_vars (
list) – list of variable names to outuput.
- Return type:
- Returns:
None
- output_to_csv(pth)#
Save each output variable to separate csv file in specified path
- set_input_to_adapter(input_variable_name, adapter)#
Set input variables to adapter.current and manage the adapter.
TODO: make this private?