priority_flow.calc_flow ======================= .. py:module:: priority_flow.calc_flow .. autoapi-nested-parse:: Calculate Overland Flow functions for PriorityFlow. This module contains functions for calculating overland flow from ParFlow pressure file outputs. It supports both OverlandFlow and OverlandKinematic formulations. Functions --------- .. autoapisummary:: priority_flow.calc_flow.calc_flow Module Contents --------------- .. py:function:: calc_flow(file_path: str, run_name: str, file_nums: List[int], slopex_file: str, slopey_file: str, overland_type: str, mannings: Union[float, numpy.ndarray], epsilon: float = 1e-05, dx: float = 1.0, dy: float = 1.0, mask: Optional[numpy.ndarray] = None) -> None Calculate overland flow from ParFlow pressure file outputs. This function will write three pfb outputs for every timestep: (1) outflow - volumetric outflow from each grid cell [l3/t] (2) q_east - volumetric flow across the east face of each cell (Note: this will have dimensions nx+1, ny to account for the western edge of the domain) (3) q_north - volumetric flow across the north face of each cell. (Note this will have dimensions nx, ny+1 to account for the southern edge of the domain) :param file_path: Directory path where pressure and slope files are located, also where flow files will be written :type file_path: str :param run_name: ParFlow run name used to read pressure files (standard naming: runname.out.press.00000.pfb) :type run_name: str :param file_nums: List of file numbers to be processed :type file_nums: List[int] :param slopex_file: Name of the x slopes file (must be a pfb file) :type slopex_file: str :param slopey_file: Name of the y slopes file (must be a pfb file) :type slopey_file: str :param overland_type: Type of overland flow used for ParFlow simulation. Choices: "OverlandFlow" or "OverlandKinematic" :type overland_type: str :param mannings: Manning roughness coefficient, can be either a value or a matrix :type mannings: Union[float, np.ndarray] :param epsilon: Epsilon used only in OverlandKinematic formulation. Set with Solver.OverlandKinematic.Epsilon key in ParFlow. Defaults to 1e-5. :type epsilon: float, optional :param dx: Grid size in x direction [l]. Defaults to 1.0. :type dx: float, optional :param dy: Grid size in y direction [l]. Defaults to 1.0. :type dy: float, optional :param mask: Mask with ones for cells to be processed and zeros for everything else. Defaults to mask of all 1's. Should be [nx, ny] matrix where [0,0] is lower left corner. :type mask: np.ndarray, optional .. rubric:: Notes This is a Python port of the R function CalcFlow from PriorityFlow. The function calculates overland flow using either OverlandFlow or OverlandKinematic formulations. File naming convention expected: - Pressure files: {run_name}.out.press.{file_num:05d}.pfb - Output files: {run_name}.out.{outflow/q_east/q_north}.{file_num:05d}.pfb