diff --git a/grib/src/test/data/index/grib-template-3-33.grib.gbx9 b/grib/src/test/data/index/grib-template-3-33.grib.gbx9 new file mode 100644 index 0000000000..03d4a1e983 Binary files /dev/null and b/grib/src/test/data/index/grib-template-3-33.grib.gbx9 differ diff --git a/grib/src/test/java/ucar/nc2/grib/grib2/TestGdt33.java b/grib/src/test/java/ucar/nc2/grib/grib2/TestGdt33.java new file mode 100644 index 0000000000..b8cc25211a --- /dev/null +++ b/grib/src/test/java/ucar/nc2/grib/grib2/TestGdt33.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2026 University Corporation for Atmospheric Research/Unidata + * See LICENSE for license information. + */ + +package ucar.nc2.grib.grib2; + +import static com.google.common.truth.Truth.assertThat; +import static org.junit.Assert.assertEquals; + +import org.junit.Before; +import org.junit.Test; + +public class TestGdt33 { + + private Grib2Record record; + + @Before + public void openTestFile() { + String testfile = "../grib/src/test/data/index/grib-template-3-33.grib.gbx9"; + + Grib2Index gi = new Grib2Index(); + boolean success = gi.readIndex(testfile, -1); + assertThat(success).isTrue(); + assertThat(gi.getRecords()).hasSize(1); + assertThat(gi.getGds()).hasSize(1); + record = gi.getRecords().get(0); + } + + @Test + public void testGdsTemplate() { + Grib2Gds gds = record.getGDS(); + assertThat(gds.template).isEqualTo(33); + + // check that the grid dimensions are parsed out as expected + assertThat(gds.getNx()).isEqualTo(1909); + assertThat(gds.getNy()).isEqualTo(1609); + } + + @Test + public void testReferenceDateSanity() { + assertEquals("2026-08-01T00:00:00Z", record.getReferenceDate().toString()); + } + +}