dtcenter/MET

Bugfix: Fix PBL derivation bug in `main_v11.1` by porting over fix from `develop`

Closed this issue · 0 comments

Describe the Problem

This issue arose via the dtcenter/METplus#2599. @gsketefian points out that the PB2NC tool does not create reproducible results for MET version 11.1.0. Testing reveals that the differences arise when deriving the following 2 PBL observations:

ADPUPA 71722   20190615_000000 46.30  -76.0000  192 PBL          NA     0.0000 2   418.00000000
ADPUPA 74560   20190615_000000 40.15  -89.3400  179 PBL          NA     0.0000 9  8965.00000000

Here's detailed log output that demonstrate the issue:

DEBUG 8: compute_pbl() input to calpbl_ (buffer): index, P, Q, T, Z, U, V
DEBUG 8: compute_pbl()   0	 9975264256.00000 0.00000 -2291927040.00000 -29473247232.00000 6.50000 -1.70000
DEBUG 8: compute_pbl()   1	 93960.00000 0.00659 286.96384 610.00000 6.50000 -1.70000
DEBUG 8: compute_pbl()   2	 97400.00000 0.00840 289.29169 305.00000 2.00000 0.70000
DEBUG 8: compute_pbl()   3	 98700.00000 0.00906 290.14999 192.00000 -9999.00000 -9999.00000
DEBUG 7:  hpbl: 592.493, obs_arr[4]: 400.493   lat: 46.3, lon: -76, elv: 192 20190615_000000 ADPUPA 71722

Note that bad values being passed as input the calpbl_ function.
This bad data arises during the pressure-level-reversal step. Pressure level data is read from the PREPBUFR file in decreasing pressure level order (i.e. surface level first). The PBL derivation logic expects data in the opposite order (i.e. surface level last). The bug occurs in the reversal step.

This bug does NOT exist in the develop branch since it was fixed by this commit:
f051fac88e9e5e2632d2c9ef38de8fa8a3315fc3

For this issue, simply cherry-pick that commit from develop into main_v11.1 and confirm that the log messages listed above no longer contain garbage values.

To Reproduce

Go to seneca:/d1/projects/METplus/discussions/2599 and run test_pb2nc.sh.

Relevant Deadlines

List relevant project deadlines here or state NONE.

Funding Source

Define the source of funding and account keys here or state NONE.

Define the Metadata

Assignee

  • Select engineer(s) or no engineer required
  • Select scientist(s) or no scientist required

Labels

  • Review default alert labels
  • Select component(s)
  • Select priority
  • Select requestor(s)

Milestone and Projects

  • Select Milestone as the next bugfix version
  • Select Coordinated METplus-X.Y Support project for support of the current coordinated release
  • Select MET-X.Y.Z Development project for development toward the next official release

Define Related Issue(s)

Consider the impact to the other METplus components.

Bugfix Checklist

See the METplus Workflow for details.

  • Complete the issue definition above, including the Time Estimate and Funding Source.
  • Fork this repository or create a branch of main_<Version>.
    Branch name: bugfix_<Issue Number>_main_<Version>_<Description>
  • Fix the bug and test your changes.
  • Add/update log messages for easier debugging.
  • Add/update unit tests.
  • Add/update documentation.
  • Push local changes to GitHub.
  • Submit a pull request to merge into main_<Version>.
    Pull request: bugfix <Issue Number> main_<Version> <Description>
  • Define the pull request metadata, as permissions allow.
    Select: Reviewer(s) and Development issue
    Select: Milestone as the next bugfix version
    Select: Coordinated METplus-X.Y Support project for support of the current coordinated release
  • Iterate until the reviewer(s) accept and merge your changes.
  • Delete your fork or branch.
  • Complete the steps above to fix the bug on the develop branch.
    Branch name: bugfix_<Issue Number>_develop_<Description>
    Pull request: bugfix <Issue Number> develop <Description>
    Select: Reviewer(s) and Development issue
    Select: Milestone as the next official version
    Select: MET-X.Y.Z Development project for development toward the next official release
  • Close this issue.