Skip to content

diffoutputdirs reports changes in WMO headers when other checks do not #17

Description

@RussellManser-NCO

What's wrong?

While upgrading petss/1.4.5, I found that diffoutputdirs reported changes in WMO headers between production and parallel runs. This was concerning for what was intended to be a minimal upgrade. Output from diffoutputdirs can be found at:

/lfs/h1/nco/idsb/noscrub/russell.manser/projects/petss_v1_4_5/diffoutputdirs/prod_para/diffoutputdirs.*etss.20260628.log

After some discussion with other team members and the developers, I compared WMO headers with the following short script.

#!/bin/bash

# Search for WMO headers in two files, then compare the results
#
# See the following: https://www.weather.gov/tg/headef

file1=$1
file2=$2

if [[ -z "${file1}" || -z "${file2}" ]]; then
  echo "Usage $0: file1 file2"
  exit 1
fi

diff <(strings "${file1}" | grep -E "[A-Z]{4}[0-9]{2}\ .*\ [0-9]{6}") \
<(strings "${file2}" | grep -E "[A-Z]{4}[0-9]{2}\ .*\ [0-9]{6}")

This script did not report any differences in WMO headers.

Proposed Solution

I suggest adding unit tests for diffoutputdirs to identify its intended behavior and locate any bugs. Once that is complete, I optionally suggest refactoring the script and improving its readability.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions