Skip to content

Fix WBLANK initialization in FBWIND bulletins - #183

Merged
TravisElless-NOAA merged 2 commits into
NOAA-EMC:developfrom
ShellieRowe-NOAA:fix/fbwind-wblank
Nov 24, 2026
Merged

TravisElless-NOAA merged 2 commits into
NOAA-EMC:developfrom
ShellieRowe-NOAA:fix/fbwind-wblank

Conversation

@ShellieRowe-NOAA

Copy link
Copy Markdown
Contributor

Correct the initialization of WBLANK in src/fbwndgfs.fd/fbwndgfs.F from Z'20' to Z'2020202020202020', restoring the eight-space initialization used in GFS v16.

This change is intended to address the GFS v17 downstream FBWIND issue in which only two of the six expected Pacific wind bulletins are generated.

Refs NOAA-EMC/global-workflow#5399

Tested on NOAA WCOSS2 using a private GFS v17 FBWIND test environment.

Confirmed that the unchanged-source control build generated only two bulletins (FBOC31 and FBOC37).

Recompiled the corrected source using Intel Fortran with -O0, -g, -traceback, and -check bounds.

Successfully generated all six expected Pacific bulletins for forecast hours 006, 012, and 024.

Inspected the resulting bulletins and confirmed that wind and temperature data were populated for the expected locations and flight levels.

A manually compiled corrected build using -O3 encountered a segmentation fault. Additional testing with the official optimized build configuration is required.

Comment thread src/fbwndgfs.fd/fbwndgfs.F Outdated
SAVE
C
DATA WBLANK/Z'20'/
DATA WBLANK/Z'2020202020202020'/

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ShellieRowe-NOAA this was changed originally because out-of-bounds elements of NBLK were being written to by the XSTORE subroutine. This was occasionally causing a crash with newer versions of W3EMC on WCOSS2. Are you not seeing this error now?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the explanation. That is helpful context.

In my testing on WCOSS2, the corrected WBLANK initialization successfully generated all six expected Pacific FBWIND bulletins when compiled with -O0, -g, -traceback, and -check bounds. I did not encounter an out-of-bounds error in that run.

However, the corrected source compiled manually with -O3 did encounter a segmentation fault. I haven't confirmed whether that crash is related to the XSTORE/NBLK issue you described.

I'll investigate that further before considering the change ready for review. It sounds like we may need to address the underlying bounds issue rather than simply restoring the previous WBLANK value.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I investigated the FBWIND code further on WCOSS2 following your comment. I confirmed that the bulletin buffer is 1,280 bytes and that the W3EMC 2.12.0 routine W3FI01 returns a four-byte word length. I also found that XSTORE uses eight-byte memory writes, suggesting a possible mismatch in how the bulletin buffer is initialized. This could explain the previously reported out-of-bounds issue, although I still need to verify the actual number of bytes written.

@ShellieRowe-NOAA

Copy link
Copy Markdown
Contributor Author

Investigated the missing Pacific FBWIND bulletins in GFS v17. The original output contained only 2 of the expected 6 bulletins.

Testing indicated a problem with the XSTORE routine used to initialize the bulletin buffer. Replaced this initialization with a Fortran loop that fills the buffer with spaces, avoiding the suspected memory overwrite.

Recompiled the updated code with -O3 optimization and reran the GFS v17 FBWIND job on WCOSS2 using the November 9, 2026, 00Z cycle.

Results:

PBS job 298653651.cbqs01 completed successfully in 20 seconds (exit status 0).

All 6 expected Pacific bulletins were generated.

Confirmed that the previously missing f012 and f024 bulletins were present and contained forecast data.

The tested fix is included in commit fbbfcd9.

@ShellieRowe-NOAA
ShellieRowe-NOAA marked this pull request as ready for review November 19, 2026 18:44
@JessicaMeixner-NOAA

Copy link
Copy Markdown
Contributor

@DavidHuber-NOAA - If you have time and can review - this is ready for your review. We're also bringing in @TravisElless-NOAA and @BenjaminBlake-NOAA to help with reviews as well.

@DavidHuber-NOAA DavidHuber-NOAA left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good. Thanks @ShellieRowe-NOAA for getting to the bottom of the issue here.

@BenjaminBlake-NOAA BenjaminBlake-NOAA left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was able to successfully test these changes on WCOSS2 and can confirm that all 6 FBWind bulletins are now generated.

@TravisElless-NOAA TravisElless-NOAA left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update @ShellieRowe-NOAA and for reviewing and testing @DavidHuber-NOAA and @BenjaminBlake-NOAA. I'm also confirming being able to successfully build gfs-utils with these changes. Approving and merging

@TravisElless-NOAA
TravisElless-NOAA merged commit 9481431 into NOAA-EMC:develop Nov 24, 2026
3 checks passed
TravisElless-NOAA pushed a commit that referenced this pull request Nov 24, 2026
This PR incorporates the FBWIND fix from PR #183 into the
production/GFS.v17.0.0 branch for subsequent integration into
global-workflow.

The changes replace the W3FI01 and XSTORE calls in the WXAI19 subroutine
with a character-by-character initialization loop, eliminating the
potential for out-of-bounds writes during bulletin buffer
initialization.

Only the previously approved FBWIND source code changes are included.

The identical source code fix was previously tested on WCOSS2 using GFS
v17 data with the -O3 optimization level.

- November 9, 2026, 00Z: All six bulletins generated successfully.
- November 23, 2026, 00Z: All six bulletins generated successfully.
- November 24, 2026, 00Z: Independent testing by Benjamin Blake
confirmed successful generation of all six bulletins.
- David Huber agreed with the suggested fix.
- Travis Elless confirmed a successful gfs-utils build with the changes
in PR #183.

A separate production-branch build and test have not yet been conducted.

Related PR #183
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants