Skip to content

For unstructured grid and budget method 3, node numbers written instead of layer numbers #48

@aprovost-usgs

Description

@aprovost-usgs

Budget method 3 (which is used, e.g., by RCH when recharge is to the topmost active layer) should write layer numbers and flows. But when the grid is unstructured, node numbers are apparently passed via array IBUFF to subroutine UBDSV3U, which then writes them to the budget without converting them to layer numbers. This was discovered when MODPATH crashed while reading method 3 budget information written for EVT. MODPATH attempted to convert the "layer numbers" it read to node numbers, resulting in out-of-bounds values. It's not clear to me how to best implement the fix. Converting node numbers to layer numbers is not as straightforward for an unstructured grid as it is for a structured grid, since there can be different numbers of nodes in each layer (stored in array NODLAY). But in any case, the conversion needs to take place at some point, either within UBDSV3U (with IBUFF loaded with node numbers and NODLAY presumably also passed in) or before UBDSV3U is called (with IBUFF loaded with pre-computed layer numbers).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions