NOAA-OWP / wres

Code and scripts for the Water Resources Evaluation Service
Other
2 stars 1 forks source link

As a developer, the netcdf output needs to support long (int64) NWM feature ids; currently its restricted to just int #150

Open epag opened 3 weeks ago

epag commented 3 weeks ago

Author Name: Hank (Hank) Original Redmine Issue: 123976, https://vlab.noaa.gov/redmine/issues/123976 Original Date: 2023-12-13


NWM feature ids are stored as @int64@ in the NWM netCDF data. Alaska appears to be the first location where the NWM feature ids are larger than the standard @int@ and require a @long@ to store. Changes were made in #120645 to allow for reading the NWM features from a netCDF as a @long@ and using that feature id to parse to data.

However, the netCDF output format outputs NWM feature ids as @int@ in @NetcdfOutputFileCreator2.java@:

                try
                {
                    nwmFeatureId = Integer.parseInt( name );
                }
                catch ( NumberFormatException nfe )
                {
                    throw new WriteException( "While writing NWM feature IDs to "
                                              + writer.getNetcdfFile()
                                                      .getLocation()
                                              + " encountered feature named '"
                                              + name
                                              + "' from the "
                                              + nwmDataset.name()
                                              + " dataset that was not an "
                                              + "integer, but NWM feature IDs "
                                              + "are assumed to be integers.",
                                              nfe );
                }
</code>

It shows up as an @int@ datatype using @ncdump@:

        int feature_id(geo_feature_tuple) ;
                feature_id:coordinates = "lon lat" ;
                feature_id:grid_mapping = "ProjectionCoordinateSystem" ;

This ticket can be resolved once we output NWM feature ids as @long@ (@int64@ in netCDF) in the netCDF files output. Until that time, Alaska results will not be outputted to netCDF.

Thanks,

Hank

epag commented 3 weeks ago

Original Redmine Comment Author Name: Hank (Hank) Original Date: 2023-12-13T19:06:56Z


I'm going to create a 7.0 version and assign this ticket to that target version, since this is a breaking change.

Hank

epag commented 3 weeks ago

Original Redmine Comment Author Name: Hank (Hank) Original Date: 2023-12-13T19:08:37Z


I'm guessing this will be about 4 hours of work spent mostly in checking outputs, looking at system tests that use netCDF (if any), and so on. Note that this could have ramifications down the line, particularly for the WRES GUI, but that would be another ticket.

Hank