dtcenter / MET

Model Evaluation Tools
https://dtcenter.org/community-code/model-evaluation-tools-met
Apache License 2.0
79 stars 24 forks source link

Enhance Gaussian grid support to convert non-integer (x, y) to (lat, lon). #1497

Open JohnHalleyGotway opened 4 years ago

JohnHalleyGotway commented 4 years ago

Describe the Enhancement

During the Air Force cloud evaluation project, we attempted to run GFS data from a Gaussian grid through MODE. That results in the following runtime error:

ERROR  : 
ERROR  : GaussianGrid::xy_to_latlon() const -> x and y must be integers
HDF5-DIAG: Error detected in HDF5 (1.10.5) thread 0:
  #000: H5T.c line 1754 in H5Tclose(): not a datatype
    major: Invalid arguments to routine
    minor: Inappropriate type
NetCDF: HDF error
file: ncFile.cpp  line:33

Here's the source of that error message: https://github.com/dtcenter/MET/blob/3804255cf682ae6582f6505e29f82f29c7c29589/met/src/libcode/vx_grid/gaussian_grid.cc#L251

This occurs when MODE is writing the object statistics files. It might be happening when converting the object centroid (x, y) to (lat, lon), but I'm not positive on that.

This task is to enhance the GaussianGrid::xy_to_latlon() function to handle non-integer input x/y values... assuming this is mathematically possible. Use the attached sample data file to replicate:

> mv gfs.gaussian.sample.grib2.txt gfs.gaussian.sample.grib2
> mode gfs.gaussian.sample.grib2 gfs.gaussian.sample.grib2 MODEConfig.txt -v 3
DEBUG 1: Creating Fcst-Obs Object Statistics file: ./mode_120000L_20200608_120000V_000000A_obj.txt
ERROR  : 
ERROR  : GaussianGrid::xy_to_latlon() const -> x and y must be integers

Input file: gfs.gaussian.sample.grib2.txt MODE config file: MODEConfig.txt

While this issue arose during the Air Force cloud evaluation project, fully supporting Gaussian grids is not a deliverable for that project. So we'll need to find funding elsewhere for this work.

Time Estimate

Estimate the amount of work required here. Issues should represent approximately 1 to 3 days of work.

Sub-Issues

Consider breaking the enhancement down into sub-issues. No sub-issues required.

Relevant Deadlines

List relevant project deadlines here or state NONE.

Funding Source

Define the source of funding and account keys here or state NONE.

Define the Metadata

Assignee

Labels

Projects and Milestone

Define Related Issue(s)

Consider the impact to the other METplus components.

Enhancement Checklist

See the METplus Workflow for details.

JohnHalleyGotway commented 4 years ago

Moving this issue from met-10.0-beta1 to met-10.0-beta2 since it won't be done by next week.