NOAA-OWP / ngen

Next Generation Water Modeling Engine and Framework Prototype
Other
84 stars 63 forks source link

Lumped Forcings Engine Data Provider #845

Closed program-- closed 3 months ago

program-- commented 4 months ago

This PR adds the ForcingsEngineLumpedDataProvider class, inheriting from ForcingsEngineDataProvider<double, CatchmentAggrDataSelector>.

This provider interacts with the python-based Forcings Engine when running in "hydrofabric" mode (i.e. in the configuration file, GRID_TYPE="hydrofabric"). The following variables are accessible through the data provider interface:

BMI Variable Alias Description Units
U2D_ELEMENT U2D 10-m U-component of wind m/s
V2D_ELEMENT V2D 10-m V-component of wind m/s
T2D_ELEMENT T2D 2-m Air Temperature K
Q2D_ELEMENT Q2D 2-m Specific Humidity kg/kg
LWDOWN_ELEMENT LWDOWN Surface downward long-wave radiation flux W/m^2
SWDOWN_ELEMENT SWDOWN Surface downward short-wave radiation flux W/m^2
PSFC_ELEMENT PSFC Surface Pressure Pa
RAINRATE_ELEMENT RAINRATE Surface Precipitation Rate mm/s

Within the engine's catchment domain, each variable has an aggregated scalar value for each catchment. As such, every constructed lumped data provider is associated with a single catchment (but, the underlying forcings engine instance is shared between them).

~This PR also includes a minor change to the parent base class, which moves the time and config file path member variables into the protected scope to allow printing of them in derived functions/exceptions and prevent the need to perform some conversions within std::chrono if they were kept in the private scope.~

These changes were incorporated in #851.

Additions

Testing

Notes

In order to run the forcings engine unit tests prerequisites must be met:

Checklist

PhilMiller commented 3 months ago

Other than the divide_idx_ remarks, the rest of this looks pretty good.