Vector Statistics and Rotated Lat/Lon grid compatibility #2370
Replies: 3 comments 8 replies
-
@heu3becteh apologies for the delay in responding to this one. I see you have a question about the handling of rotating wind vector components from being defined as grid-relative to earth-relative. Let me start by saying that MET does include logic for rotating U/V wind components, but it certainly is possible that it isn't working the way we want for your data. This rotate_uv_grid_to_earth(...) utility function handles it. First, we assume that the U/V wind components in point observations are defined as being earth-relative... meaning they're defined relative to the poles of the earth. Vector winds in gridded model output can be defined either as being earth-relative or grid-relative, meaning they're defined based on the orientation of the grid. And the grid orientation can differ considerably from true north. When reading wind components from GRIB1 or GRIB2 files, MET checks the metadata and automatically rotates them when needed. This MetGrib2DataFile::check_uv_rotation(...) function handles it for GRIB2. The 5th bit in the GRIB2 Resolution and Component Flags indicates whether winds are defined as grid or earth-relative. All grid-relative vectors are rotated to be earth-relative automatically. When processing GRIB1 or GRIB2 input data, the following Debug(3) log message indicates that wind rotation is occurring:
However, based on the content of your question, I'm guessing you're using NetCDF input data, not GRIB. And grep-ing through the MET codebase, I see that the rotate_uv_grid_to_earth(...) utility function is only called in the GRIB1 and GRIB2 libraries. So MET isn't currently doing any wind rotation for NetCDF inputs. This is related to issue dtcenter/MET#1518, to generalize MET's support for the automated derivation of wind speed and direction. Again, automatic derivation of wind speed and direction is also currently only supported for GRIB1 or GRIB2 inputs. It seems to me that that issue should be expanded to include wind rotation as well. Ideally, we'd like for MET to be able to read U/V input or Wind Speed/Direction inputs, automatically rotate them when needed, and then verify them against observations of U/V wind or Wind Speed/Direction. But work is needed to add that level of flexibility. I'm also not aware of any NetCDF convention that defines whether or not the rotation is necessary. Do you know of anything that indicates HOW the vector components are defined, similar to the resolution and components flag for GRIB? Lacking that, I suppose we could choose some default behavior (e.g. automatically rotate or not), and then provide a configuration option to turn the rotation on/off as needed. |
Beta Was this translation helpful? Give feedback.
-
@JohnHalleyGotway Thank you for such a detailed and useful reply!
In my case resolutionAndComponentFlags define data as
But the following message is missing in the log (with
And the value MET writes as
In addition to what @RogerHar said, in case of COSMO-model it is |
Beta Was this translation helpful? Give feedback.
-
Thanks for posting that Here's the short answer. I found a bug on this line of code.
Should be changed to:
I'll write up an issue and create a bugfix to address this. If you're interested, here's the steps I used to debug this behavior: I tested this using the
Those However, comparing the
The
The
Both have a value of I updated the source code to print out the Resolution and Component Flag stored by MET and found:
This indicates that there's a bug in how the MET library code is parsing the Resolution and Component Flag for this data. |
Beta Was this translation helpful? Give feedback.
-
Are Vector Statistics compatible with a Rotated Lat/Lon grid?
I did a check and the forecast values are written to the MPR as is, without rotating the U/V components.
There is also a discussion regarding converting WRF data from the native grid, so I'm guessing the conversion must be done outside MET, even though the Rotated Lat/Lon grid is marked as compatible here (it is in fact supported for scalar fields, and the nearest nodes are found correctly, the problem is with wind direction)?
Is there any way to correctly calculate Vector Statistics for a Rotated Lat/Lon grid?
Best regards,
Alexander
Beta Was this translation helpful? Give feedback.
All reactions