dtcenter / MET

Model Evaluation Tools
https://dtcenter.org/community-code/model-evaluation-tools-met
Apache License 2.0
74 stars 22 forks source link

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

Closed JohnHalleyGotway closed 1 month ago

JohnHalleyGotway commented 1 month ago

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

Labels

Milestone and Projects

Define Related Issue(s)

Consider the impact to the other METplus components.

Bugfix Checklist

See the METplus Workflow for details.