Skip to content

Conversation

@shawncrawley
Copy link

Updates output files to support int64 for station_id and time. This is to align with the equivalent change that was made years back on what I believe must be the official NWM output side of things (which used "feature_id" instead of "station_id"). For example, all of the official NWM outputs for the Alaska domain correctly use int64 for the feature_id variable with no data loss.

TYPE: bug fix

KEYWORDS: dtype, netcdf, output, int64

SOURCE: Shawn Crawley (NOAA Affiliate via Lynker)

DESCRIPTION OF CHANGES: The dtype of a few output NetCDF variables was changed from int to int64.

ISSUE: My input RouteLink.nc file supports INT64 in the "link", "from", and "to" columns. The CHRTOUT_DOMAIN output NetCDF files had the associated links - stored as "station_id" - recast to int32, and thus were converted to 10-digits that no longer matched the input.

TESTS CONDUCTED: I just manually made the changes herein, recompiled, reran my simulation and checked that the results were as hoped.

There may be other spots that a similar update is needed. I only did so for the few that were unique to my situation.

Updates output files to support int64 for station_id and time. This is to align with the equivalent change that was made on what I believe must be the official NWM output side of things (which used "feature_id" instead of "station_id")
@aubreyd
Copy link
Collaborator

aubreyd commented Aug 18, 2025

I don't think these routines are used in the NWM. We have custom output routines for that model (e.g., output_chrt_NWM). And I'm not sure what outlake option 2 is - I don't think this option is currently supported (at least not documented). That being said, IO modules could use some cleanup to remove some of these options not supported.

@rcabell rcabell requested a review from Copilot August 26, 2025 21:26
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes data type compatibility issues in NetCDF output files by changing integer variables from 32-bit to 64-bit precision. The changes address a bug where large integer values in input files were being truncated when output to NetCDF files, causing mismatches between input and output data.

Key changes:

  • Updates lake_id, time, and station_id variables to use NF90_INT64 instead of NF90_INT
  • Ensures compatibility with input RouteLink.nc files that use INT64 for link identifiers
  • Aligns with official NWM output format standards that use int64 for feature_id variables

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

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