Add compression to SBN atmospheric product generation#4649
Add compression to SBN atmospheric product generation#4649ChristopherHill-NOAA wants to merge 7 commits intoNOAA-EMC:dev/gfs.v17from
Conversation
|
@DavidHuber-NOAA @TravisElless-NOAA - I see that the shfmt scan failed. I've looked into this but it doesn't appear related to this PR. Can you confirm if that's true or not. I have previously run a case with all output on. To avoid having to re-run a forecast, I am copying over the com products folder to original.products after this completes, I will use the code here to re-run the meta tasks gfs_awips_20km_1p0deg to see the effect of these changes on a single cycle high resolution run. Hopefully then we can finally have our answer about the SBN that is needed. Do any files need to be deleted from the COM directory before this re-run for a successful re-run? Do others see other flaws in this test process? @ChristopherHill-NOAA - You said you ran CI on this for technical testing, do you have the output of that to share? |
|
@JessicaMeixner-NOAA You are correct. It's not related to this PR. I'll open a separate PR to resolve this. |
|
Original products can be found in: Running with the two line change from Chris, the output can be found at: All gfs_awips_20km_1p0deg were rerun. |
|
9.1G original.products/atmos/wmo This at least has trended in the correct direction. We do need to confirm that the packing was applied and that quality of the output is acceptable. |
|
A spot check of output from the Sample degrib2 output for Values of the total volume of operational products for 2026030506 from v16.3, original products from v17, and newly generated products from v17 are shown below, and entered in this spreadsheet:
The greatest value of v16.3 SBN product volume observed over the past week was 9336.94 MB, from cycle 2026031012. |
|
@ChristopherHill-NOAA - does your decrease in volume size also account for the files that are being removed? I believe we were going to have about 70 MB from removed files? |
|
The total volume values include xtrn.awpgfs* files for v16.3, which are scheduled to be removed and are not being generating with v17. Assuming we are having to reduce SBN product volume for v17 against the same cycle for v16, then a further reduction of 70 MB would be needed in the case of 2026030506. If there is otherwise a hard limit volume (e.g. 9400 MB) to be met, that would be easier to reconcile. As noted with #4614, I will try different versions of g2lib for potentially reducing product volume. |
|
Our goal for SBN is to be neutral or decreased from GFSv16. |
|
As discussed in #4614, the initially committed code change to From a spot test of the relevant segment of code with F024 GRIB2 files generated by retrov17_01_realtime run of cycle 2026030506, the original, first commit, and second commit product file sizes (in bytes) are as follows: When expanding these results to a hypothetical full forecast range for each product, which is 40 forecast hours for the '003' grid and 54 forecast hours for the other grids, the file size values (in MB) become: A partial workflow test, similar to one conducted on March 12, may help to confirm the volume reduction of a full cycle of SBN products that are stored to |
|
According to degrib2 output, the addition of 'undefined' values for a PV-coordinate variables (and cloud-layer PRES) corresponds to an increase of the listed number of data points available for the variable to the maximum number available for any variable, but with no change to the calculated minimum, maximum, or average values. In the case of the F024 CONUS grid product ( The degrib2 output for the F024 sample of original products and new products are available here: grib2_awpgfs_003_f024_new_degrib2.txt |
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
|
@JessicaMeixner-NOAA Apologies for the multiple commits, as I should have made and pushed the changes from WCOSS. The most recent commit of code should be ready for your testing. |
|
Updated output is here: /lfs/h2/emc/ptmp/jessica.meixner/comroot/prod01/gfs.20260305/06/products The original v17 products are in original.products -- I forgot to copy over the first test of this PR, so I do not have that. |
|
The SBN product size spreadsheet is updated to reflect the latest workflow test with the code changes newly committed to this PR. A summary of volume values (MB) for cycle 2026030506 is provided here: In addition to the ... the volume for v16 includes ... the volumes for v17 include
|
|
@ChristopherHill-NOAA I suggest to combine compression switch with the interpolation process. You might also test the overall runtime, as these SBN data file generation could have impact data dissemination latency via SBN in GFS operation. |
|
@ChristopherHill-NOAA Thanks for your work on this. I agree with @WenMeng-NOAA 's suggestion to combine the -set_grib_type complex2 command with the wgrib2 interpolation step - it should have the same effect as doing the compression in a separate command. |
|
@ChristopherHill-NOAA - I will re-run after any code changes requested by @WenMeng-NOAA and @BenjaminBlake-NOAA In the meantime, I wanted to let you know that the regression tests failed for one test due to large gempak log files which was also reported here: #3630 (comment) I will not finish running the regression tests until the code changes have been confirmed. I'll also re-run the high resolution tests to confirm any code changes are not unintentionally changing output sizes. |
|
I appreciate the review and comments provided by @WenMeng-NOAA. Please note that the original code commit had attempted to constrain the setting of Does wgrib2 apply each of the options (opt1 ... opt28) to the data file in a sequential order, or all at once? |
|
@ChristopherHill-NOAA Thanks for clarifying about the latest code commit which provides more compression. I believe wgrib2 applies each of the options sequentially, in the order they are listed. |
|
@BenjaminBlake-NOAA Thanks for your input. @JessicaMeixner-NOAA I will perform another short offline test based on comments from @WenMeng-NOAA and @BenjaminBlake-NOAA to verify the effect of the proposed changes, and report back. I will update this PR again by 12pm. |
@ChristopherHill-NOAA Thanks for catching opt1, which keep the same compression from pgrb2 files. Would you try to modify opt1 as "-set_grib_type complex2" and no need opt28? |
|
Thanks @ChristopherHill-NOAA - Just ping me when you are ready for me to re-test anything. |
@WenMeng-NOAA Yes -- both opt1 and opt1uv were set with In my earlier testing, I did not try |
@ChristopherHill-NOAA The option 'complex2-bitmap' should pack additional bites than 'complex2', as bitmap applied. After reviewing settings in this exgfs_atmos_awips_20km_1pdeg.sh, it appears to me that opt1uv is applied in CONUS and AK interpolations, and opt1 is applied to PNCO, PAC and 003 interpolations. Would you test to change compression in opt1 and optuv, as the goal is reducing overall data volume and keep the comparable data quality? The final solution may depend on testing. |
|
A new series of offline tests was performed with GFSv17 F024 GRIB2 files from cycle 2026032200. SBN product files were generated with the 1st code commit and the "2nd" code commit. Product files were also generated from two new tests that invoke the wgrib2 option The use of From the limited results above, the current commit of code to this PR remains the most effective option to compress SBN product volume, and is recommended for satisfying NCO's requirement to reduce SBN product volume. For thoroughness of testing, degrib2 output are included to represent all of the product files referenced above: It is observed from the degrib2 output that . . . Conversely, the use of No changes are observed with the degrib2-calculated values of a field's minimum, maximum, or average from any file size modification performed with |
|
@ChristopherHill-NOAA - I will wait for reviews from @BenjaminBlake-NOAA and @WenMeng-NOAA before either finishing the current set of CI testing or retesting CI + high res testing. |
|
@ChristopherHill-NOAA Thanks for completing these tests. @JessicaMeixner-NOAA I suggest we go with Chris's recommendation as it is the most effective option for reducing the file sizes. |
|
@ChristopherHill-NOAA Should we expect a new commit for review, or is the current commit sufficient? |
No other code commits are planned with this PR. The current commit is open to review. |
|
I approved the PR, as no new commit has been made since 03/19/2026. I assume the current commit solves SBN data issue. |
CI testing on WCOSS2 completed after copying a few gempak logs that were too large to not be htar'd. I did not run on gaea as the job in question is just a wcoss2 job. |
|
Thanks @JessicaMeixner-NOAA for your test. @ChristopherHill-NOAA can you check Jessica's test and confirm that the new sbn product size is satisfactory? Is this what is expected? But I'm not sure if this is the exact apple to apple comparison. There have been so many emails and github comments on this issue that I have lost track of things. @ChristopherHill-NOAA Can you please provide a final report on what the SBN size is? Thanks, |
|
The CI test from @JessicaMeixner-NOAA demonstrates that the PR changes are not adversely affecting the system in a quickly-paced, low-resolution C96_atm3DVar_extended_sbn00 run of GFSv17. The resulting product files in A full resolution (single cycle) test will demonstrate both the effectiveness of the compression and packing introduced by the PR as well as the wall time necessary for jgfs_atmos_awips_master.ecf to complete. The current time allocation of 10 minutes should be more than enough to allow for generation and compression of SBN products for each forecast hour increment. The time needed to generate all 5 SBN products for F024 of 2026032200 in an offline test on an interactive node of WCOSS Cactus using the current commit changes to exgfs_atmos_awips_20km_1p0deg.sh was 22 seconds (or 13%) longer than was needed without the changes in a separate offline test. The first commit to this PR required no additional time to generate F024 products and to apply approximately half the level of compression provided by the current commit. If it is considered necessary to balance faster job completion time with a reduced level of compression/packing for the SBN products, I will assist with that effort. |
|
Thanks @ChristopherHill-NOAA for your response, I was sure I am missing something. So short answer is that this is not the test that will confirm the SBN size for v17, and you suggest a high res test to be conducted. Jessica has been kindly doing those tests for us but I am pretty sure that since this PR is only one file change in a script that is called by this job: and since the v17 realtime is running in parallel, you could also setup a quick standalone test to grab the upstream data from GFSv17 runs and run your script on them. I would encourage you to make sure you are able to do these tests moving forward. It's a good practice to make sure we can take out parts of the workflow and run them in standalone. We might be done with this PR, but I'm sure this will come in handy in the future since you are the code owner for this part of the g-w workflow. |
|
@sbanihash I have been performing offline tests with the segment of the script |
|
The gfs_awips_20km_1p0deg_*.log files here: /lfs/h2/emc/ptmp/jessica.meixner/comroot/prod01/logs/2026030506 can also be used for timing calculations for high res. I'd be good to have others look but it looks like we have about a 30 second increase, from about 1.5 min to 2min. This also looks like it's possibly calculating for more than 1 forecast hour. If we can confirm that that would be good. |
|
The product data stored in The product data in The volume difference resulting from this PR is 9120.44 - 9245.84 = -125.40 MB. Three versions of the The job A query of The maximum time needed for job completion by the current commit of code was 2 minutes, 18 seconds for F032-F035 (specifically F033) - representing a 46-second increase. The average increase of time for job completion for the 55 forecast hours processed for cycle 2026030506 was 26.36 seconds, with a standard deviation of 7.93 seconds. |
|
When comparing the volume of 9120.44 MB for When accounting for the additional 70.93 MB volume from |
Description
NCO requires that the total volume of post-processing products to be transmitted through the SBN not exceed current operational levels. The generation of these products in retrospective runs of GFSv17 have marginally exceeded operational levels, and the files must be reduced in size (in lieu of the outright removal of some).
This PR simply adds a compression/packing attribute to the generation of WMO-headed atmospheric products within the script exgfs_atmos_awips_20km_1p0deg.sh, accomplished by revising the
-set_grib_typeoption of WGRIB2 from "same" to "complex2".This PR is intended to resolve #4614.
Type of change
Change characteristics
How has this been tested?
The GFS workflow was cloned and built on WCOSS. A CI test only confirmed nominal functionality with the code change, as the products resulting from the low resolution run were too small for the code change to produce the necessary effect.
Offline tests executing a segment of
exgfs_atmos_awips_20km_1p0deg.shwith files fromproducts/atmos/grib2/0p25as input resulted in a reduction to the size of the products.It is recommended that the changes from this PR be tested in a single cycle, high-resolution test of GFSv17, to confirm its intended effect to reduce SBN product volume to the extent required by NCO.
Checklist