pywatershed.PRMSAtmosphereTranspFrostDynamic#

class pywatershed.PRMSAtmosphereTranspFrostDynamic(control, discretization, parameters, prcp, tmax, tmin, soltab_potsw, soltab_horad_potsw, fall_frost_dyn=None, spring_frost_dyn=None, input_aliases=None, verbose=False, restart_read=False, restart_write=False, restart_write_freq=False)[source]#

PRMSAtmosphereTranspFrost with dynamic (time-varying) frost dates.

In this subclass, the fall_frost and spring_frost solar dates bounding the transpiration period may each be supplied as a PRMS dynamic parameter file (or PrmsDynamicParameter object) instead of the static parameters used by PRMSAtmosphereTranspFrost. This reproduces PRMS/GSFLOW runs with dyn_fallfrost_flag and/or dyn_springfrost_flag set (dynamic_param_read.f90 updating transp_frost.f90).

The sparse (typically annual) updates in a dynamic parameter file are forward-filled to daily values, starting from the first date in the file, exactly as PRMS applies updates: values from dates at or before the model start time are in effect at the start, then each new date in the file takes effect on that day. The model time window must begin at or after the first date in each dynamic parameter file.

When neither dynamic argument is supplied, behavior is identical to PRMSAtmosphereTranspFrost using the static fall_frost and spring_frost parameters. When only one is supplied, the other uses its static parameter.

Parameters:
  • fall_frost_dyn (Union[str, Path, PrmsDynamicParameter]) – a PRMS dynamic parameter file (e.g. fall_frost.dyn) or a PrmsDynamicParameter object giving time-varying solar dates of the first killing frost of the fall. If None (default), the static fall_frost parameter is used.

  • spring_frost_dyn (Union[str, Path, PrmsDynamicParameter]) – as for fall_frost_dyn but for the solar date of the last killing frost of the spring, using the static spring_frost parameter if None.

See PRMSAtmosphereTranspFrost and PRMSAtmosphere for all other arguments.

__init__(control, discretization, parameters, prcp, tmax, tmin, soltab_potsw, soltab_horad_potsw, fall_frost_dyn=None, spring_frost_dyn=None, input_aliases=None, verbose=False, restart_read=False, restart_write=False, restart_write_freq=False)[source]#

Methods

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

adjust_precip()

Input precipitation adjustments using calibrated parameters.

adjust_temperature()

Input temperature adjustments using calibrated parameters.

advance()

Advance the Process in time.

calc_transp_frost()

rtype:

None

calc_transp_tindex()

calculate(time_length, **kwargs)

Calculate Process terms for a time step

calculate_potential_et_jh()

Calculate potential evapotranspiration following Jensen and Haise

calculate_sw_rad_degree_day()

Calculate shortwave radiation using the degree day method.

description()

A dictionary description of this Process.

finalize()

Finalize the Process, output methods, and close input adapters.

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_parameters()

Get a tuple of parameter names for this Process.

get_restart_variables()

A list of restart varible names.

get_variables()

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

dimensions

A tuple of parameter names.

init_values

A dictionary of initial values for each public variable.

inputs

A tuple of input variable names.

parameters

A tuple of parameter names.

restart_variables

previous.

variables

A tuple of public variable names.

adjust_precip()#

Input precipitation adjustments using calibrated parameters.

Snow/rain partitioning of total precip depends on adjusted temperature in addition to depending on additonal parameters.

Returns:

None

adjust_temperature()#

Input temperature adjustments using calibrated parameters.

advance()#

Advance the Process in time.

Returns:

None

calc_transp_frost()[source]#
Return type:

None

calc_transp_tindex()#
calculate(time_length, **kwargs)#

Calculate Process terms for a time step

Parameters:

simulation_time – current simulation time

Return type:

None

Returns:

None

calculate_potential_et_jh()#

Calculate potential evapotranspiration following Jensen and Haise

Jensen and Haise (1963)

Return type:

None

Returns:

None

calculate_sw_rad_degree_day()#

Calculate shortwave radiation using the degree day method.

Return type:

None

Returns:

None

classmethod description()#

A dictionary description of this Process.

Return type:

dict

Returns:

All metadata for all variables in inputs, variables, and parameters.

property dimensions: tuple#

A tuple of parameter names.

finalize()#

Finalize the Process, output methods, and close input adapters.

Return type:

None

Returns:

None

static get_dimensions()#

Get a tuple of dimension names for this Process.

static get_init_values()#

Get a dictionary of initialization values for each public variable.

Return type:

dict

static get_inputs()#

Get a tuple of input variable names for this Process.

Return type:

tuple

static get_parameters()#

Get a tuple of parameter names for this Process.

static get_restart_variables()#

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

property init_values: dict#

A dictionary of initial values for each public variable.

initialize_netcdf(output_dir=None, separate_files=None, output_vars=None, **kwargs)#

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 variable

  • output_vars (list) – list of variable names to output.

Returns:

None

property inputs: tuple#

A tuple of input variable names.

output()#

Output data to previously initialized output types. :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.

property restart_variables: dict#

previous.

Type:

A dict of restart variable names mapping current

set_input_to_adapter(input_variable_name, adapter)#

Set input variables to adapter.current and manage the adapter.

TODO: make this private?

Parameters:
  • input_variable_name (str) – key of input variable

  • adapter (Adapter) – the Adapter for the input.

property variables: tuple#

A tuple of public variable names.