Skip to content

Commit

Permalink
Per #1714, correcting logic for parsing the storm_id and warning_time…
Browse files Browse the repository at this point in the history
… columns for ATCFGen and regular ATCF line types. For ATCFGen line types, the code was incorrectly using the 3rd column when it should have used the 4th column!
  • Loading branch information
JohnHalleyGotway committed Apr 9, 2021
1 parent f35a777 commit 9f41da5
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions met/src/libcode/vx_tc_util/atcf_line_base.cc
Original file line number Diff line number Diff line change
Expand Up @@ -211,11 +211,13 @@ ConcatString ATCFLineBase::get_item(int i) const {
int i_col = i;

// For ATCFLineType_GenTrack:
// Columns 1 and 2 are consistent: use offsets 0 and 1
// Column 3 has the GenStormIdOffset: use offset 2
// Columns 1 and 2 are consistent:
// Use offsets 0 and 1
// Column 3 for is an EXTRA column for this line type:
// Add special handling in storm_id()
// Columns 4-20 are the same as columns 3-19 of ATCFLineType_Track:
// Shift offsets 3 through 18 up by 1.
if(Type == ATCFLineType_GenTrack && i >= 3 && i <= 18) i_col++;
// Shift those column indices by 1.
if(Type == ATCFLineType_GenTrack && i >= 2 && i <= 18) i_col++;

cs = DataLine::get_item(i_col);

Expand Down Expand Up @@ -359,8 +361,10 @@ int ATCFLineBase::lead() const {
ConcatString ATCFLineBase::storm_id() const {
ConcatString cs;

// For ATCFLineType_GenTrack, use the contents of the extra 3rd column
// Call DataLine::get_item() to avoid the column shifting logic
if(Type == ATCFLineType_GenTrack) {
cs = get_item(GenStormIdOffset);
cs = DataLine::get_item(GenStormIdOffset);
}
else {
unixtime ut = valid();
Expand Down

0 comments on commit 9f41da5

Please sign in to comment.