Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Octal forecast hour unintentionally used in logical expression #1141

Closed
DavidHuber-NOAA opened this issue Dec 1, 2022 · 1 comment · Fixed by #1171
Closed

Octal forecast hour unintentionally used in logical expression #1141

DavidHuber-NOAA opened this issue Dec 1, 2022 · 1 comment · Fixed by #1171
Assignees
Labels
bug Something isn't working

Comments

@DavidHuber-NOAA
Copy link
Contributor

DavidHuber-NOAA commented Dec 1, 2022

Expected behavior

Forecast hours (fhr) should be treated as a decimal, not octal, when executing math expressions.

Current behavior

In exgdas_atmos_post.sh:222, fhr is treated as an octal, resulting in an error when fhr=008, etc. This results in the if evaluating to false and IGEN=${IGEN_ANL}. In the end, this makes not difference as IGEN is not used in any meaningful way.

Machines affected

All

To Reproduce

Run a post job for forecast hour 008 or 009.

Possible Implementation

Remove all references to IGEN, unless there are plans to use this variable in the future. If so, then replace
if (( fhr > 0 )); then
with

d_fhr=$((10#$fhr))
if (( d_fhr > 0 )); then
@DavidHuber-NOAA DavidHuber-NOAA added the bug Something isn't working label Dec 1, 2022
@lgannoaa
Copy link
Contributor

I will take a look.

@lgannoaa lgannoaa self-assigned this Dec 12, 2022
WalterKolczynski-NOAA pushed a commit that referenced this issue Dec 12, 2022
`fhr` was still being treated as an octal in some places of atmos post. Instances where `fhr` are used for math are now updated to `d_fhr`, which is always a decimal representation of the `fhr` string.

Fixes #1141
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants