Skip to content

Conversation

@PhilMiller
Copy link

@PhilMiller PhilMiller commented Dec 26, 2025

An earlier series of commits addressing NGWPC-1351 added support for the NetCDF files in the format produced by the NextGen Forcing Engine, but dropped support for older NetCDF files (such as the ones provided as samples in this repository):

commit ed49a1d7c17a84e75d4e32fcbabc97c99ff1264d
Merge: 5b5a01b52 5589574a9
Author: Brian Hurley <[email protected]>
Date:   Thu Oct 24 19:35:02 2024 +0000

    Merge branch 'klarkin_NGWPC-1351_netcdf_functionality_just_code' into 'development'
    
    NetCDF Functionality...staged sample file separately.
    
    See merge request NGWPC/nwm-ngen/ngen!19

commit 5589574a9debe5fe9c9420385126b7eee62bcd8f
Author: Kyle Larkin <[email protected]>
Date:   Wed Oct 23 15:17:44 2024 -0400

    NetCDF Functionality...staged sample file separately.

commit 5b5a01b528f4ba5e792d138db78c50fbb6fb1191
Merge: 8aab59b7f bf41e0021
Author: Kyle Larkin <[email protected]>
Date:   Wed Oct 23 18:17:02 2024 +0000

    Merge branch 'add_netcdf_test_data' into 'development'
    
    adding sample NetCDF data for unit test
    
    See merge request NGWPC/nwm-ngen/ngen!18

commit bf41e0021e735679a1e2b50af9e3c3e683958909
Author: Kyle Larkin <[email protected]>
Date:   Wed Oct 23 14:12:45 2024 -0400

    adding sample NetCDF data for unit test

This PR restores that support.

Changes

Handle each of the following variations between the two formats:

  • Time variable with units spanning nanoseconds to hours
  • Time variable with (forcing engine) and without (classic) a specified reference epoch
  • Time variable with a single (time) dimension (forcing engine) and (catchment-id, time) dimension (classic)
  • Data variables with dimension (catchment-id, time) (classic) and (time, catchment-id) (forcing engine)

Testing

  1. Can now run successfully using data/gauge_01073000/forcing.nc

Todos

  1. Need testing on a Forcing Engine produced NetCDF file

Checklist

  • PR has an informative and human-readable title
  • Changes are limited to a single goal (no scope creep)
  • Code can be automatically merged (no conflicts)
  • Code follows project standards (link if applicable)
  • Passes all existing automated tests
  • Any change in functionality is tested
  • New functions are documented (with a description, list of inputs, and expected output)
  • Placeholder code is flagged / future todos are captured in comments
  • Project documentation has been updated (including the "Unreleased" section of the CHANGELOG)
  • Reviewers requested with the Reviewers tool ➡️

@PhilMiller
Copy link
Author

PhilMiller commented Dec 26, 2025

Currently runs cleanly on old-style NetCDF files, and crashes with some memory corruption on Forcings-engine-generated files.

I think the revision in 3002d54 addressed the above

@PhilMiller PhilMiller force-pushed the philmiller-netcdf-restoration branch from 2477cdb to 3002d54 Compare December 27, 2025 01:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants