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

Bugfix 1715 pb2nc seg fault with pbl 91 #1718

Merged
merged 5 commits into from Mar 18, 2021

Conversation

hsoh-u
Copy link
Collaborator

@hsoh-u hsoh-u commented Mar 18, 2021

Pull Request Testing

  • Describe testing already performed for these changes:

The segmentation fault on computing PBL. It happened on cray machine (9.1.1 & 9.1.2). The problem happens when the TQ records and the UV records are overlapping to interpolate.

  • Recommend testing for the reviewer(s) to perform, including the location of input datasets, and any additional instructions:
/d1/personal/hsoh/git/bugfix/bugfix_1715_pb2nc_seg_fault_with_pbl_91/MET/met/bin/pb2nc /d1/personal/hsoh/data/MET-1715/nam.20210311.t00z.prepbufr.tm00 nam.20210311.t00z.prepbufr.tm00.pbl.nc /d1/personal/hsoh/data/MET-1715/PB2NCConfig_case_6 -v 6

log messages:
WARNING: combine_tqz_and_uv() Can not combine TQ and UV records because of no overlapping.
WARNING:              TQZ record count: 1, UV record count: 57  common_levels: 0
WARNING: Failed to compute PBL 20210311_000000 ADPUPA 72493
  • Do these changes include sufficient documentation and testing updates? [No]

  • Will this PR result in changes to the test suite? [No]

    If yes, describe the new output and/or changes to the existing output:

Pull Request Checklist

See the METplus Workflow for details.

  • Complete the PR definition above.
  • Ensure the PR title matches the feature or bugfix branch name.
  • Define the PR metadata, as permissions allow.
    Select: Reviewer(s), Project(s), and Milestone
  • After submitting the PR, select Linked Issues with the original issue number.
  • After the PR is approved, merge your changes. If permissions do not allow this, request that the reviewer do the merge.
  • Close the linked issue and delete your feature or bugfix branch from GitHub.

Summary of Updating

  • Check if TQ records and UV are overlapping and display log messages if no overlapping
  • Use nint instead of int for pressure values
  • Additional check at interpolate_by_pressure and interpolate_pqtzuv

@hsoh-u hsoh-u linked an issue Mar 18, 2021 that may be closed by this pull request
21 tasks
@JohnHalleyGotway JohnHalleyGotway removed the request for review from jprestop March 18, 2021 17:56
@JohnHalleyGotway JohnHalleyGotway added this to In progress in METplus Version 3.1 Support via automation Mar 18, 2021
@JohnHalleyGotway JohnHalleyGotway added this to the met-9.1.3 (bugfix) milestone Mar 18, 2021
<< " to " << tq_pres_min << " UV pressures: " << uv_pres_max
<< " to " << uv_pres_min << (no_overlap ? " no overlap!" : " overlapping") << "\n";
if( no_overlap ) {
mlog << Warning << method_name
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
mlog << Warning << method_name
mlog << Warning << "\n" << method_name

if( no_overlap ) {
mlog << Warning << method_name
<< "Can not combine TQ and UV records because of no overlapping.\n";
mlog << Warning << " TQZ record count: " << tq_count
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
mlog << Warning << " TQZ record count: " << tq_count
<< " TQZ record count: " << tq_count

<< " to " << uv_pres_min << (no_overlap ? " no overlap!" : " overlapping") << "\n";
if( no_overlap ) {
mlog << Warning << method_name
<< "Can not combine TQ and UV records because of no overlapping.\n";
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
<< "Can not combine TQ and UV records because of no overlapping.\n";
<< "Cannot combine TQ and UV records because of no pressure level overlap.\n"

<< "Can not combine TQ and UV records because of no overlapping.\n";
mlog << Warning << " TQZ record count: " << tq_count
<< ", UV record count: " << uv_count
<< " common_levels: " << common_levels.n() << "\n";
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
<< " common_levels: " << common_levels.n() << "\n";
<< " common_levels: " << common_levels.n() << "\n\n";

<< ", next: " << prev_pqtzuv[0] << "\n";
<< " Can't interpolate because of same pressure levels. prev: "
<< prev_pqtzuv[0] << ", cur: " << cur_pqtzuv[0]
<< ", next: " << prev_pqtzuv[0] << "\n";
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
<< ", next: " << prev_pqtzuv[0] << "\n";
<< ", next: " << prev_pqtzuv[0] << "\n\n";

if ((prev_pqtzuv[0] == cur_pqtzuv[0]) || (next_pqtzuv[0] == cur_pqtzuv[0])) {
if ((nint(prev_pqtzuv[0]) == nint(cur_pqtzuv[0]))
|| (nint(next_pqtzuv[0]) == nint(cur_pqtzuv[0]))
|| (nint(prev_pqtzuv[0]) == nint(next_pqtzuv[0]))) {
mlog << Error << method_name
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
mlog << Error << method_name
mlog << Error << "\n" << method_name

Copy link
Collaborator

@JohnHalleyGotway JohnHalleyGotway left a comment

Choose a reason for hiding this comment

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

Made suggestions for minor edits to the log warning/error log messages that are changed by this PR.

I did test these changes on kiowa in /d1/projects/MET/MET_pull_requests/met-9.1.3/feature_1715/MET-bugfix_1715_pb2nc_seg_fault_with_pbl_91_into_main_v9.1.
I ran unit_pb2nc.xml and diffed the output with recent main_v9.1 NB output. There are no differences, so low risk of unintended consequences.

@malloryprow already tested this patch on the WCOSS Cray machine and confirmed that it fixes the bug.

After accepting minor edits, please merge these changes into main_v9.1.

@hsoh-u hsoh-u merged commit 5ce7aa8 into main_v9.1 Mar 18, 2021
METplus Version 3.1 Support automation moved this from In progress to Done Mar 18, 2021
@JohnHalleyGotway JohnHalleyGotway deleted the bugfix_1715_pb2nc_seg_fault_with_pbl_91 branch March 18, 2021 22:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

Fix pb2nc segfault when deriving PBL
2 participants