Skip to content

Feature/query cxx types ne aircraft altitude#1071

Merged
srherbener merged 275 commits intodevelopfrom
feature/query_cxx_types_NE_aircraftAltitude
Dec 7, 2022
Merged

Feature/query cxx types ne aircraft altitude#1071
srherbener merged 275 commits intodevelopfrom
feature/query_cxx_types_NE_aircraftAltitude

Conversation

@nicholasesposito
Copy link
Copy Markdown
Contributor

@nicholasesposito nicholasesposito commented Sep 28, 2022

Description

In aircraft data, there are a number of height variables that, in the prepqc code, are used to determine the aircraft flight level. Multiple mnemonics exist in a number of the AIRCFT datatypes. We need to add an enhancement to the feature/query_cxx code that will go through all of the data and variables to determine which variable we will want to use. There is logic within the prepqc code to help with this.

In prepbufr processing, it finds the flight level from the list of flight-level related mnemonics in the following order: PRLC, IALT, PSAL, FLVL, HEIT, HMSL, and FLVLST

Much like the Datetime variable in the ioda-converter yamls, this code will be placed in the src/bufr/BufrParser/Exports/Variables/ directory.

For some reason, previous aircraft yamls, inputs and outputs were removed. I re-added them.

This PR also ensures all of the outputs datatypes are correct.
Please build with ioda branch: feature/NE_reduce_aircft_vars_ObsSpace to get zero warnings

And for Ron, the file you used as an input for your new subsets test was different than the one I had. I re-ran using the input that I am using and updated the output file.

The main changes (which I will update in the first comment) are in the files:
iodaconv/CMakeLists.txt
iodaconv/src/bufr/BufrParser/Exports/Export.cpp
iodaconv/test/testinput/gdas.t12z.aircft.tm00.bufr_d
iodaconv/test/testinput/gdas.t12z.aircar.tm00.bufr_d
iodaconv/test/testinput/gdas.t12z.acft_profiles.prepbufr
iodaconv/test/testinput/bufr_ncep_aircft_noAMDAR103.yaml
iodaconv/test/testinput/bufr_ncep_aircft_AMDAR103.yaml
iodaconv/test/testinput/bufr_ncep_aircar.yaml
iodaconv/test/testinput/bufr_ncep_prepbufr_aircft.yaml
iodaconv/test/testoutput/gdas.t12z.aircft_noAMDAR103.tm00.nc
iodaconv/test/testoutput/gdas.t12z.aircft_AMDAR103.tm00.nc
iodaconv/test/testoutput/gdas.t12z.aircar.tm00.nc
iodaconv/test/testoutput/gdas.t12z.acft_profiles.prepbufr.nc
iodaconv/test/testoutput/bufr_specifying_subsets.nc

and the new files:
iodaconv/src/bufr/BufrParser/Exports/Variables/AircraftAltitudeVariable.cpp
iodaconv/src/bufr/BufrParser/Exports/Variables/AircraftAltitudeVariable.h

3 older files are removed:
rm 'test/testinput/acft_profiles.data_thinned'
rm 'test/testinput/aircftpro_prepbufr.yaml'
rm 'test/testoutput/aircraft_prepbufr_acftprofiles.nc'

Requirements

This will be a new feature. It will not require any new software dependencies. The new code will the amount of height variables needed in the aircraft bufr yamls. As of now, 6 are required, with an additional one (PRLC aka "pressure") being used for height calculations.
Please build with ioda branch: feature/NE_reduce_aircft_vars_ObsSpace to get zero warnings

Acceptance Criteria (Definition of Done)

This will be finished when
[ ] All the previous tests pass
[ ] Comparison with input bufr data confirms that the software works
[ ] A new test will be written to determine if future additions break the software.
[ ] The branch is merged to feature/query_cxx

Dependencies

#1044
#1059

Issue(s) addressed

fixes #997
fixes #974

Should be merged at the same time as

ioda/

rmclaren and others added 30 commits November 9, 2021 11:08
* Add bufr to ioda conversion for IASI, ERAS/DB AMSU-A and MHS for ncar-bufr2nc-fortarn utility

* Add tests and associated test input/output files for ncar-bufr2nc-fortarn utility

* Add NCEP BUFR tables for normal-feed and RARS/DB satellite radiance data

* Add YAML files, tests, and test reference for normal-feed and db/ears AMSU-A

* Fix coding norm

* Rename NCEP BUFR tables for satellite radiance data

* Add yaml files, tests, and test input/output files for MHS (normal-feed and RARS/DB)
t

* Update Split.cpp

* Update DataObject.cpp

* Update IodaEncoder.cpp

* Update bufr_ncep_1bamua.yaml

* Update bufr_ncep_1bmhs.yaml

* Update bufr_ncep_esamua.yaml

* Update bufr_ncep_esmhs.yaml

* Fixed coding norms issue.

* Fixed some little issues.

Co-authored-by: Ronald McLaren <ronald.mclaren@noaa.gov>
Updated documentation for dimensions.
* Update snowadpsfc

* Update bufr_snow_adpsfc.yaml

* Update testoutput

* Update yaml files and testinput and testoutput data

* Reduce input data size to 20% and update output

* Reduce input data size to 250KB and update testoutput
* Added adpupa prepbufr yamls w/o group_by field with input adpupa prepbufr file

* adpupa netCDF files  w/o group_by field

* Updates made after ioda-validate.x run.

* Changed Quality Mark group from "ObsQualityMark" to "QualityMarker"
@nicholasesposito
Copy link
Copy Markdown
Contributor Author

@srherbener I made a brand new build and the errors were the same. I also did git pulls and merges between develop and my branch and the same error popped up. Email me and we can try to link up today or later this week after the Hera work

@srherbener
Copy link
Copy Markdown
Collaborator

@srherbener I made a brand new build and the errors were the same. I also did git pulls and merges between develop and my branch and the same error popped up. Email me and we can try to link up today or later this week after the Hera work

@nicholasesposito thanks for trying that experiment. Let me see if I can reproduce this on my Mac, and see what's wrong. Later this afternoon I have time so we can meet then if necessary.

@srherbener
Copy link
Copy Markdown
Collaborator

I'm getting a match on my Mac with what CI testing is reporting. Only one test fails: test_iodaconv_bufr_ncep_aircft_noamdar2ioda with the following messages:

PRE-MAIN-INFO Executing Queries
PRE-MAIN-WARNING Warning: Query String */HEIT didn't apply to subset NC004001
PRE-MAIN-WARNING Warning: Query String */HMSL didn't apply to subset NC004001
PRE-MAIN-WARNING Warning: Query String */FLVLST didn't apply to subset NC004001
PRE-MAIN-WARNING Warning: Query String */QMRKH[4] didn't apply to subset NC004001
PRE-MAIN-WARNING Warning: Query String [NC004010/QMDD, NC004003/AFMST/QMDD] didn't apply to subset NC004001
PRE-MAIN-WARNING Warning: Query String */ACNS didn't apply to subset NC004001
PRE-MAIN-WARNING Warning: Query String */EXPRSRD didn't apply to subset NC004001
PRE-MAIN-WARNING Warning: Query String */POAF didn't apply to subset NC004001
PRE-MAIN-WARNING Warning: Query String NC004006/QMDD didn't apply to subset NC004001
PRE-MAIN-WARNING Warning: Query String */RSRD didn't apply to subset NC004001
PRE-MAIN-WARNING Warning: Query String */ACTP didn't apply to subset NC004001
PRE-MAIN-WARNING Warning: Query String */PCCF didn't apply to subset NC004001
PRE-MAIN-WARNING Warning: Query String */QMRKH[2] didn't apply to subset NC004001
PRE-MAIN-WARNING Warning: Query String [*/AFMST/REHU, */ACMST2/REHU, */RAWHU] didn't apply to subset NC004001
PRE-MAIN-WARNING Warning: Query String */QMRKH[3] didn't apply to subset NC004001
PRE-MAIN-WARNING Warning: Query String [*/ACMST2/MIXR, */MIXR] didn't apply to subset NC004001
PRE-MAIN-WARNING Warning: Query String */HEIT didn't apply to subset NC004002
PRE-MAIN-WARNING Warning: Query String */HMSL didn't apply to subset NC004002
PRE-MAIN-WARNING Warning: Query String */FLVLST didn't apply to subset NC004002
PRE-MAIN-WARNING Warning: Query String */QMRKH[4] didn't apply to subset NC004002
PRE-MAIN-WARNING Warning: Query String [NC004010/QMDD, NC004003/AFMST/QMDD] didn't apply to subset NC004002
PRE-MAIN-WARNING Warning: Query String */ACNS didn't apply to subset NC004002
PRE-MAIN-WARNING Warning: Query String */EXPRSRD didn't apply to subset NC004002
PRE-MAIN-WARNING Warning: Query String */POAF didn't apply to subset NC004002
PRE-MAIN-WARNING Warning: Query String NC004006/QMDD didn't apply to subset NC004002
PRE-MAIN-WARNING Warning: Query String */RSRD didn't apply to subset NC004002
PRE-MAIN-WARNING Warning: Query String */ACID didn't apply to subset NC004002
PRE-MAIN-WARNING Warning: Query String */PCCF didn't apply to subset NC004002
PRE-MAIN-WARNING Warning: Query String */QMRKH[2] didn't apply to subset NC004002
PRE-MAIN-WARNING Warning: Query String [*/AFMST/REHU, */ACMST2/REHU, */RAWHU] didn't apply to subset NC004002
PRE-MAIN-WARNING Warning: Query String */QMRKH[3] didn't apply to subset NC004002
PRE-MAIN-WARNING Warning: Query String [*/ACMST2/MIXR, */MIXR] didn't apply to subset NC004002
PRE-MAIN-WARNING Warning: Query String */HEIT didn't apply to subset NC004003
PRE-MAIN-WARNING Warning: Query String */HMSL didn't apply to subset NC004003
PRE-MAIN-WARNING Warning: Query String */FLVLST didn't apply to subset NC004003
PRE-MAIN-WARNING Warning: Query String */QMRKH[4] didn't apply to subset NC004003
PRE-MAIN-WARNING Warning: Query String NC004006/QMDD didn't apply to subset NC004003
PRE-MAIN-WARNING Warning: Query String */ACTP didn't apply to subset NC004003
PRE-MAIN-WARNING Warning: Query String */PCCF didn't apply to subset NC004003
PRE-MAIN-WARNING Warning: Query String */QMRKH[2] didn't apply to subset NC004003
PRE-MAIN-WARNING Warning: Query String */QMRKH[3] didn't apply to subset NC004003
PRE-MAIN-WARNING Warning: Query String [*/ACMST2/MIXR, */MIXR] didn't apply to subset NC004003
PRE-MAIN-WARNING Warning: Query String */PSAL didn't apply to subset NC004006
PRE-MAIN-WARNING Warning: Query String */FLVLST didn't apply to subset NC004006
PRE-MAIN-WARNING Warning: Query String */QMRKH[4] didn't apply to subset NC004006
PRE-MAIN-WARNING Warning: Query String [NC004010/QMDD, NC004003/AFMST/QMDD] didn't apply to subset NC004006
PRE-MAIN-WARNING Warning: Query String */FLVL didn't apply to subset NC004006
PRE-MAIN-WARNING Warning: Query String */ACTP didn't apply to subset NC004006
PRE-MAIN-WARNING Warning: Query String */PCCF didn't apply to subset NC004006
PRE-MAIN-WARNING Warning: Query String */QMRKH[2] didn't apply to subset NC004006
PRE-MAIN-WARNING Warning: Query String [*/AFMST/REHU, */ACMST2/REHU, */RAWHU] didn't apply to subset NC004006
PRE-MAIN-WARNING Warning: Query String */QMRKH[3] didn't apply to subset NC004006
PRE-MAIN-WARNING Warning: Query String */PSAL didn't apply to subset NC004009
PRE-MAIN-WARNING Warning: Query String */FLVLST didn't apply to subset NC004009
PRE-MAIN-WARNING Warning: Query String */QMRKH[4] didn't apply to subset NC004009
PRE-MAIN-WARNING Warning: Query String [NC004010/QMDD, NC004003/AFMST/QMDD] didn't apply to subset NC004009
PRE-MAIN-WARNING Warning: Query String */FLVL didn't apply to subset NC004009
PRE-MAIN-WARNING Warning: Query String NC004006/QMDD didn't apply to subset NC004009
PRE-MAIN-WARNING Warning: Query String */ACTP didn't apply to subset NC004009
PRE-MAIN-WARNING Warning: Query String */PCCF didn't apply to subset NC004009
PRE-MAIN-WARNING Warning: Query String */QMRKH[2] didn't apply to subset NC004009
PRE-MAIN-WARNING Warning: Query String [*/AFMST/REHU, */ACMST2/REHU, */RAWHU] didn't apply to subset NC004009
PRE-MAIN-WARNING Warning: Query String */QMRKH[3] didn't apply to subset NC004009
PRE-MAIN-WARNING Warning: Query String [*/ACMST2/MIXR, */MIXR] didn't apply to subset NC004009
PRE-MAIN-WARNING Warning: Query String */PSAL didn't apply to subset NC004010
PRE-MAIN-WARNING Warning: Query String */HEIT didn't apply to subset NC004010
PRE-MAIN-WARNING Warning: Query String */ACNS didn't apply to subset NC004010
PRE-MAIN-WARNING Warning: Query String */FLVL didn't apply to subset NC004010
PRE-MAIN-WARNING Warning: Query String NC004006/QMDD didn't apply to subset NC004010
PRE-MAIN-WARNING Warning: Query String */ACID didn't apply to subset NC004010
PRE-MAIN-WARNING Warning: Query String [*/ACMST2/MIXR, */MIXR] didn't apply to subset NC004010
PRE-MAIN-WARNING Warning: Query String */PSAL didn't apply to subset NC004011
PRE-MAIN-WARNING Warning: Query String */HEIT didn't apply to subset NC004011
PRE-MAIN-WARNING Warning: Query String */HMSL didn't apply to subset NC004011
PRE-MAIN-WARNING Warning: Query String */QMRKH[4] didn't apply to subset NC004011
PRE-MAIN-WARNING Warning: Query String [NC004010/QMDD, NC004003/AFMST/QMDD] didn't apply to subset NC004011
PRE-MAIN-WARNING Warning: Query String */ACNS didn't apply to subset NC004011
PRE-MAIN-WARNING Warning: Query String */FLVL didn't apply to subset NC004011
PRE-MAIN-WARNING Warning: Query String */POAF didn't apply to subset NC004011
PRE-MAIN-WARNING Warning: Query String NC004006/QMDD didn't apply to subset NC004011
PRE-MAIN-WARNING Warning: Query String */ACTP didn't apply to subset NC004011
PRE-MAIN-WARNING Warning: Query String */ACID didn't apply to subset NC004011
PRE-MAIN-WARNING Warning: Query String */PCCF didn't apply to subset NC004011
PRE-MAIN-WARNING Warning: Query String */QMRKH[2] didn't apply to subset NC004011
PRE-MAIN-WARNING Warning: Query String [*/AFMST/REHU, */ACMST2/REHU, */RAWHU] didn't apply to subset NC004011
PRE-MAIN-WARNING Warning: Query String */QMRKH[3] didn't apply to subset NC004011
PRE-MAIN-WARNING Warning: Query String [*/ACMST2/MIXR, */MIXR] didn't apply to subset NC004011
PRE-MAIN-INFO Building Bufr Data
PRE-MAIN-INFO Exporting Data
PRE-MAIN-INFO Finished [0.115s]
DIFFER : VARIABLE : aircraftAltitude : POSITION : [170] : VALUES : 1432.6 <> 1524
DIFFER : VARIABLE : aircraftAltitude : POSITION : [175] : VALUES : 243.8 <> 304.8
DIFFER : VARIABLE : aircraftAltitude : POSITION : [176] : VALUES : 396.2 <> 457.2
DIFFER : VARIABLE : aircraftAltitude : POSITION : [177] : VALUES : 548.6 <> 609.6
DIFFER : VARIABLE : aircraftAltitude : POSITION : [178] : VALUES : 853.4 <> 914.4
DIFFER : VARIABLE : aircraftAltitude : POSITION : [179] : VALUES : 2987 <> 3048
DIFFER : VARIABLE : aircraftAltitude : POSITION : [181] : VALUES : 365.8 <> 457.2
DIFFER : VARIABLE : aircraftAltitude : POSITION : [182] : VALUES : 518.2 <> 609.6
DIFFER : VARIABLE : aircraftAltitude : POSITION : [183] : VALUES : 823 <> 914.4
DIFFER : VARIABLE : aircraftAltitude : POSITION : [184] : VALUES : 1432.6 <> 1524
DIFFER : VARIABLE : aircraftAltitude : POSITION : [185] : VALUES : 2956.6 <> 3048
DIFFER : VARIABLE : aircraftAltitude : POSITION : [200] : VALUES : 2956.6 <> 3048
DIFFER : VARIABLE : aircraftAltitude : POSITION : [201] : VALUES : 4023.4 <> 4114.8
DIFFER : VARIABLE : aircraftAltitude : POSITION : [202] : VALUES : 823 <> 914.4
DIFFER : VARIABLE : aircraftAltitude : POSITION : [203] : VALUES : 518.2 <> 609.6
DIFFER : VARIABLE : aircraftAltitude : POSITION : [204] : VALUES : 365.8 <> 457.2
DIFFER : VARIABLE : aircraftAltitude : POSITION : [205] : VALUES : 213.4 <> 304.8
Variable         Group     Count     Sum AbsSum   Min Max Range     Mean  StdDev
aircraftAltitude /MetaData    17 -1401.8 1401.8 -91.4 -61  30.4 -82.4588 14.2779
<end of output>
Test time =   0.46 sec
----------------------------------------------------------
Test Failed.
"test_iodaconv_bufr_ncep_aircft_noamdar2ioda" end time: Dec 05 11:42 MST
"test_iodaconv_bufr_ncep_aircft_noamdar2ioda" time elapsed: 00:00:00
----------------------------------------------------------

and you are saying that you are seeing the error you reported earlier:

    Start 617: iodaconv_validate_testoutput_gdas.t12z.aircft_noAMDAR103.tm00.nc

617: Test command: /scratch1/NCEPDEV/da/Nicholas.Esposito/JEDI/ioda-bundle_types_AA_20220830/ioda-bundle/build/bin/ioda-validate.x "--ignore-warn" "--ignore-error" "/scratch1/NCEPDEV/da/Nicholas.Esposito/JEDI/ioda-bundle_types_AA_20220830/ioda-bundle/ioda/share/ioda/yaml/validation/ObsSpace.yaml" "/scratch1/NCEPDEV/da/Nicholas.Esposito/JEDI/ioda-bundle_types_AA_20220830/ioda-bundle/iodaconv/test/testoutput/gdas.t12z.aircft_noAMDAR103.tm00.nc"
617: Environment variables:
617:  ECKIT_COLOUR_OUTPUT=1
617:  OMP_NUM_THREADS=1
617: Test timeout computed to be: 1500
617:    Reason: Usage: ioda-validate.x yaml-file input-file
617:    source_column:  0
617:    source_filename:        /scratch1/NCEPDEV/da/Nicholas.Esposito/JEDI/ioda-bundle_types_AA_20220830/ioda-bundle/ioda/src/mains/validator/validate.cpp
617:    source_function:        int Validator::execute()
617:    source_line:    55

Correct? If so then it looks like to me that your develop branch in ioda (not ioda-converters) is out of sync with github. Note your feature branch in ioda-converters appears to be in sync with develop (as you mentioned). In your build area, run make update and then try make and ctest again. If that doesn't work, then let's meet later on and figure out what's going on.

If you are getting the error I see on my Mac, then I think it's a matter of validating the new results in the output file and then updating the test reference file.

Thanks!

@nicholasesposito
Copy link
Copy Markdown
Contributor Author

@srherbener So for the first ctest you mentioned, it's so weird to me because that one passes. I get the warnings (which are expected), but I don't get the "DIFFER" messages.
The second error is the same as what I get though.

@srherbener
Copy link
Copy Markdown
Collaborator

@nicholasesposito that is strange. I don't have access to Hera, but if we do a google meet while you drive perhaps we can figure out what is wrong. I'll send a calendar invite.

@nicholasesposito
Copy link
Copy Markdown
Contributor Author

@srherbener @CoryMartin-NOAA Some changes were made to the code thanks to @rmclaren. I'm going to see what happens when I update the code on Hera when it comes back online. If we get the same error on Hera as the other machines, then we have success and I'll update the output and push the new changes. I'll keep you all updated.

@nicholasesposito
Copy link
Copy Markdown
Contributor Author

Good news. The changes that @rmclaren made ended up being the fix! The changes caused the tests on Hera (the odd-computer out) to fail, and those failures were the same failures that were found on the other machines. I updated the testoutput, re-built, and re-ran the ctests on both machines (Hera and Orion), and how all of them work. @srherbener please check your Mac's runs and any others. Please let me know what you find if you're not getting what I'm getting. And afterward, if everything is to your liking, please approve this PR. Thank you to everyone @srherbener for being patient and @CoryMartin-NOAA and @rmclaren for all of your generous insights and help.

@srherbener
Copy link
Copy Markdown
Collaborator

@nicholasesposito great news! I get identical results on my Mac and on Orion to those from the ctests (ie all ctests pass except for the bufr coding norms test). iodaconv_bufr_coding_norms reports:

/jcsda/ioda-bundle/iodaconv/src/bufr/BufrParser/Exports/Variables/AircraftAltitudeVariable.cpp:61:  Tab found; better to use spaces  [whitespace/tab] [1]
/jcsda/ioda-bundle/iodaconv/src/bufr/BufrParser/Exports/Variables/AircraftAltitudeVariable.cpp:69:  Tab found; better to use spaces  [whitespace/tab] [1]
/jcsda/ioda-bundle/iodaconv/src/bufr/BufrParser/Exports/Variables/AircraftAltitudeVariable.cpp:96:  Tab found; better to use spaces  [whitespace/tab] [1]
/jcsda/ioda-bundle/iodaconv/src/bufr/BufrParser/Exports/Variables/AircraftAltitudeVariable.cpp:97:  Tab found; better to use spaces  [whitespace/tab] [1]
/jcsda/ioda-bundle/iodaconv/src/bufr/BufrParser/Exports/Variables/AircraftAltitudeVariable.cpp:97:  Line ends in whitespace.  Consider deleting these extra spaces.  [whitespace/end_of_line] [4]
/jcsda/ioda-bundle/iodaconv/src/bufr/BufrParser/Exports/Variables/AircraftAltitudeVariable.cpp:123:  Lines should be <= 100 characters long  [whitespace/line_length] [2]
/jcsda/ioda-bundle/iodaconv/src/bufr/BufrParser/Exports/Variables/AircraftAltitudeVariable.cpp:141:  Line ends in whitespace.  Consider deleting these extra spaces.  [whitespace/end_of_line] [4]

Almost there!

Copy link
Copy Markdown
Collaborator

@srherbener srherbener left a comment

Choose a reason for hiding this comment

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

Looks good! Thanks for your patience with getting the tests straightened out. I have just one very minor comment.

@nicholasesposito
Copy link
Copy Markdown
Contributor Author

Changes made and iodaconv_bufr_coding_norms now passes (on Hera)

@nicholasesposito
Copy link
Copy Markdown
Contributor Author

Project has been closed. Thanks everyone for your help and your patience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request update test data The test data files need to be updated

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Have BufrParser be able to choose which "height" variable should populate aircraftAltitude Update datatypes of AIRCFT/AIRCAR bufr and prepbufr data.