ufs-community / UFS_UTILS

Utilities for the NCEP models.
Other
21 stars 104 forks source link

Add chgres_cube capability to read data on WMO rotated lat-lon grid (template 1) #901

Closed LarissaReames-NOAA closed 5 months ago

LarissaReames-NOAA commented 5 months ago

The RRFS fire weather nest will be implemented operationally alongside RRFSv1, and is designed to replicate the current capabilities of the NAM fire weather nest. RRFSFW will be initialized off of RRFS grib2 data, specifically the rotated lat-lon grib2 files. Those files are on grid template 1 (WMO rotated lat-lon) and chgres_cube needs to be updated to process those files correctly.

Full completion of this capability will also depend on addressing #850 . For now, we can test with a sample subset provided by @BenjaminBlake-NOAA who requested this feature.

LarissaReames-NOAA commented 5 months ago

EDIT: Nevermind, there was a miscommunication. I've been pointed to the modified model_grid.F90 in @GeorgeGayno-NOAA 's chgres_rrfs branch.

@GeorgeGayno-NOAA I've already begun working on this, but I need some support with the g2 grib2 grid template conversion to grib1 grid definition in model_grid.F90. Could you provide some information about how you found the right values for the various gds sections?

GeorgeGayno-NOAA commented 5 months ago

EDIT: Nevermind, there was a miscommunication. I've been pointed to the modified model_grid.F90 in @GeorgeGayno-NOAA 's chgres_rrfs branch.

@GeorgeGayno-NOAA I've already begun working on this, but I need some support with the g2 grib2 grid template conversion to grib1 grid definition in model_grid.F90. Could you provide some information about how you found the right values for the various gds sections?

From the GRIB1 and GRIB2 grid definitions.

The GRIB2 definition of rotated lat/lon is: https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_temp3-1.shtml

The table entries correspond to the igdstmpl array. Example: the 8th entry in the table (NI) corresponds to the igdstmpl(8).

The GRIB1 definition is: https://www.nco.ncep.noaa.gov/pmb/docs/on388/tabled.html (scroll down to rotated lat/lon non-E stagger)

The table entries correspond (roughly) to the kgds array. kgds(1) is octet 6 (the data representation type. '205' for rot lat/lon). kgds(2) is the first entry in the table (NI). So kgds(2) in GRIB1 is igdstmp(8) in GRIB2.

The G2 library has a conversion routine you can use as a guide: https://github.com/NOAA-EMC/NCEPLIBS-g2/blob/develop/src/gdt2gds.F90

I may have better references. But that should get you started. I believe I have already done this conversion in my chgres_rrfs branch, no?

LarissaReames-NOAA commented 5 months ago

@GeorgeGayno-NOAA Yes, you're correct about your modifications. Shortly after I posted that comment Ben pointed me to your file with those modifications. I edited my previous comment after that, but it might not have shown up for you. We're working on this now that I have that code from your branch.

GeorgeGayno-NOAA commented 5 months ago

Will these updates also need to be added to our most recent tag? https://github.com/ufs-community/UFS_UTILS/releases/tag/ufs_utils_1_12_0

LarissaReames-NOAA commented 5 months ago

That's what @BenjaminBlake-NOAA has requested.

BenjaminBlake-NOAA commented 5 months ago

@GeorgeGayno-NOAA Yes we will need these updates to be included in the tag for RRFSv1, thanks.

GeorgeGayno-NOAA commented 5 months ago

@BenjaminBlake-NOAA and @LarissaReames-NOAA - I added these changes to the release branch at 33cc663. I ran the regression tests and they passed. Can you test with the RRFS?

BenjaminBlake-NOAA commented 5 months ago

@GeorgeGayno-NOAA Thank you. I should be able to test this with RRFS early next week.

BenjaminBlake-NOAA commented 5 months ago

@GeorgeGayno-NOAA @LarissaReames-NOAA I completed a successful test with these changes

GeorgeGayno-NOAA commented 5 months ago

@GeorgeGayno-NOAA @LarissaReames-NOAA I completed a successful test with these changes

Great. Is there anything else you need to add to the release branch?

BenjaminBlake-NOAA commented 5 months ago

Not that I'm aware of. @MatthewPyle-NOAA do you know of any more changes needed to UFS_UTILS for RRFS besides the changes needed for RRFSFW?

GeorgeGayno-NOAA commented 5 months ago

Not that I'm aware of. @MatthewPyle-NOAA do you know of any more changes needed to UFS_UTILS for RRFS besides the changes needed for RRFSFW?

What about the 2GB file limitation fix?

BenjaminBlake-NOAA commented 5 months ago

Yes, we will eventually want those code changes too. But in the meantime we have code working to subset the large files into smaller ones.

MatthewPyle-NOAA commented 5 months ago

I think using wgrib2 to subset gets away from the 2 GB issue for the RRFSFW. I don't think we have more expected changes, but @GeorgeGayno-NOAA if you're willing to create a release branch post the merge of PR902 that would be great.

BenjaminBlake-NOAA commented 5 months ago

@MatthewPyle-NOAA PR902 was merged so we do have a release branch ready thanks to George/Larissa. I'll point to it in my PR to rrfs-workflow. https://github.com/ufs-community/UFS_UTILS/tree/release/1_12_0

GeorgeGayno-NOAA commented 5 months ago

@MatthewPyle-NOAA PR902 was merged so we do have a release branch ready thanks to George/Larissa. I'll point to it in my PR to rrfs-workflow. https://github.com/ufs-community/UFS_UTILS/tree/release/1_12_0

I am going to create a tag for you.

GeorgeGayno-NOAA commented 5 months ago

Tag created to support RRFSv1: https://github.com/ufs-community/UFS_UTILS/releases/tag/ufs_utils_1_12_2

Closing issue.