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

bufr_subset_find_values() fails when TLC keys are used #69

Open
vsouvan opened this issue Apr 19, 2020 · 1 comment
Open

bufr_subset_find_values() fails when TLC keys are used #69

vsouvan opened this issue Apr 19, 2020 · 1 comment

Comments

@vsouvan
Copy link
Collaborator

vsouvan commented Apr 19, 2020

Testing with the following template:

201013 201023 5012 101003 12001

Shows that if I do a find using a TLC code, ala:

     k = 0;
     bufr_set_key_location( &(codes[k++]), 5002, 64 );
     bufr_set_key_int32( &(codes[k++]), 12001, NULL, 0 );
     n = bufr_subset_find_values( dss, codes, k, 0 );

I get the wrong instance of 12001. The bug appears to be that in bufr_subset_find_values(), a TLC match still increments to the NEXT descriptor in the list, and because that descriptor is replicated, I get it instead of the one which had the matching TLC value.

I'll commit a test case...


Imported from Launchpad using lp2gh.

@vsouvan
Copy link
Collaborator Author

vsouvan commented Apr 19, 2020

(by chris-beauregard)
Ah... another bug is that:

     k = 0;
     ivalues[0] = 291;
     bufr_set_key_int32( &(codes[k++]), 12001, ivalues, 1 );

     n = bufr_subset_find_values( dss, codes, k, 0 );

Gives me the first 12001 descriptor in the sequence, because when we match descriptors but not the value, we don't reset the jj index. Which means we don't set it to the actual match.

@vsouvan vsouvan added this to the 0.8.2rc2 milestone Apr 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant