diff --git a/met/src/libcode/vx_tc_util/atcf_line_base.cc b/met/src/libcode/vx_tc_util/atcf_line_base.cc index bc5474cec4..c4fca4e38e 100644 --- a/met/src/libcode/vx_tc_util/atcf_line_base.cc +++ b/met/src/libcode/vx_tc_util/atcf_line_base.cc @@ -482,11 +482,13 @@ ATCFLineType string_to_atcflinetype(const char *s) { else if(strlen(s) == 0) t = ATCFLineType_Track; // BDECK else if(strcasecmp(s, "TR") == 0) t = ATCFLineType_ProbTR; else if(strcasecmp(s, "IN") == 0) t = ATCFLineType_ProbIN; - else if(strcasecmp(s, "RI") == 0) t = ATCFLineType_ProbRIRW; - else if(strcasecmp(s, "WD") == 0) t = ATCFLineType_ProbWD; + else if(strcasecmp(s, "RI") == 0) t = ATCFLineType_ProbRI; + else if(strcasecmp(s, "RW") == 0) t = ATCFLineType_ProbRW; + else if(strcasecmp(s, "WR") == 0) t = ATCFLineType_ProbWR; else if(strcasecmp(s, "PR") == 0) t = ATCFLineType_ProbPR; else if(strcasecmp(s, "GN") == 0) t = ATCFLineType_ProbGN; else if(strcasecmp(s, "GS") == 0) t = ATCFLineType_ProbGS; + else if(strcasecmp(s, "ER") == 0) t = ATCFLineType_ProbER; else t = NoATCFLineType; return(t); @@ -502,11 +504,13 @@ ConcatString atcflinetype_to_string(const ATCFLineType t) { case ATCFLineType_GenTrack: s = "GenTrack"; break; case ATCFLineType_ProbTR: s = "ProbTR"; break; case ATCFLineType_ProbIN: s = "ProbIN"; break; - case ATCFLineType_ProbRIRW: s = "ProbRIRW"; break; - case ATCFLineType_ProbWD: s = "ProbWD"; break; + case ATCFLineType_ProbRI: s = "ProbRI"; break; + case ATCFLineType_ProbRW: s = "ProbRW"; break; + case ATCFLineType_ProbWR: s = "ProbWR"; break; case ATCFLineType_ProbPR: s = "ProbPR"; break; case ATCFLineType_ProbGN: s = "ProbGN"; break; case ATCFLineType_ProbGS: s = "ProbGS"; break; + case ATCFLineType_ProbER: s = "ProbER"; break; case NoATCFLineType: s = na_str; break; default: s = na_str; break; } diff --git a/met/src/libcode/vx_tc_util/atcf_line_base.h b/met/src/libcode/vx_tc_util/atcf_line_base.h index 816ddfeba4..313c294e54 100644 --- a/met/src/libcode/vx_tc_util/atcf_line_base.h +++ b/met/src/libcode/vx_tc_util/atcf_line_base.h @@ -13,9 +13,12 @@ //////////////////////////////////////////////////////////////////////// // -// Based on Best Track file format information at: +// Best Track file format information: // http://www.nrlmry.navy.mil/atcf_web/docs/database/new/abrdeck.html // +// EDeck file format information: +// https://www.nrlmry.navy.mil/atcf_web/docs/database/new/edeck.txt +// //////////////////////////////////////////////////////////////////////// #include @@ -31,11 +34,13 @@ enum ATCFLineType { ATCFLineType_GenTrack, // Genesis Track and intensity line type (numeric) ATCFLineType_ProbTR, // Track probability (TR) ATCFLineType_ProbIN, // Intensity probability (IN) - ATCFLineType_ProbRIRW, // Rapid intensification probability (RI) - ATCFLineType_ProbWD, // Wind radii probability (WD) + ATCFLineType_ProbRI, // Rapid intensification probability (RI) + ATCFLineType_ProbRW, // Rapid weakening probability (RW) + ATCFLineType_ProbWR, // Wind radii probability (WR) ATCFLineType_ProbPR, // Pressure probability (PR) ATCFLineType_ProbGN, // TC genesis probability (GN) ATCFLineType_ProbGS, // TC genesis shape probability (GS) + ATCFLineType_ProbER, // Eyewall replacement probability (ER) NoATCFLineType }; diff --git a/met/src/libcode/vx_tc_util/atcf_prob_line.cc b/met/src/libcode/vx_tc_util/atcf_prob_line.cc index 2f912e9516..a06ad1c5eb 100644 --- a/met/src/libcode/vx_tc_util/atcf_prob_line.cc +++ b/met/src/libcode/vx_tc_util/atcf_prob_line.cc @@ -98,6 +98,7 @@ void ATCFProbLine::dump(ostream &out, int indent_depth) const { //////////////////////////////////////////////////////////////////////// void ATCFProbLine::clear() { + ATCFLineBase::clear(); return; @@ -106,40 +107,44 @@ void ATCFProbLine::clear() { //////////////////////////////////////////////////////////////////////// int ATCFProbLine::read_line(LineDataFile * ldf) { - int status; + int status = 0; int n_expect; - clear(); + // Read lines until good status is found + while(status == 0) { + + clear(); - status = ATCFLineBase::read_line(ldf); + // Return bad status from the base class + if(!(status = ATCFLineBase::read_line(ldf))) return(0); - // Check for bad return status or blank line - if(!status) return(0); + // Check the line type + switch(Type) { + case ATCFLineType_ProbRI: + n_expect = MinATCFProbRIRWElements; + break; - // Check the line type - switch(Type) { - case ATCFLineType_ProbRIRW: - n_expect = MinATCFProbRIRWElements; - break; + default: + mlog << Debug(4) + << "ATCFProbLine::read_line(LineDataFile * ldf) -> " + << "skipping ATCF line type (" + << atcflinetype_to_string(Type) << ")\n"; + status = 0; + continue; + } - default: + // Check for the minumum number of elements + if(n_items() < n_expect) { mlog << Warning << "\nint ATCFProbLine::read_line(LineDataFile * ldf) -> " - << "unexpected ATCF line type (" - << atcflinetype_to_string(Type) << ")\n\n"; - return(0); - } - - // Check for the minumum number of elements - if(n_items() < n_expect) { - mlog << Warning - << "\nint ATCFProbLine::read_line(LineDataFile * ldf) -> " - << "found fewer than the expected number of elements (" - << n_items() << "<" << n_expect - << ") in ATCF " << atcflinetype_to_string(Type) << " line:\n" - << DataLine::get_line() << "\n\n"; - return(0); - } + << "found fewer than the expected number of elements (" + << n_items() << "<" << n_expect + << ") in ATCF " << atcflinetype_to_string(Type) << " line:\n" + << DataLine::get_line() << "\n\n"; + status = 0; + continue; + } + } return(1); } diff --git a/met/src/libcode/vx_tc_util/prob_info_array.cc b/met/src/libcode/vx_tc_util/prob_info_array.cc index ea8827a682..6197121ff8 100644 --- a/met/src/libcode/vx_tc_util/prob_info_array.cc +++ b/met/src/libcode/vx_tc_util/prob_info_array.cc @@ -184,7 +184,7 @@ bool ProbInfoArray::add(const ATCFProbLine &l, bool check_dup) { // Store based on the input line type switch(l.type()) { - case(ATCFLineType_ProbRIRW): + case(ATCFLineType_ProbRI): // Check for no entries or a mismatch with the latest entry if( ProbRIRW.size() == 0 || diff --git a/met/src/libcode/vx_tc_util/prob_info_base.cc b/met/src/libcode/vx_tc_util/prob_info_base.cc index 07de90221a..f8d3bb791e 100644 --- a/met/src/libcode/vx_tc_util/prob_info_base.cc +++ b/met/src/libcode/vx_tc_util/prob_info_base.cc @@ -280,7 +280,7 @@ void ProbInfoBase::set(const TCStatLine &l) { switch(l.type()) { case TCStatLineType_ProbRIRW: - Type = ATCFLineType_ProbRIRW; + Type = ATCFLineType_ProbRI; break; default: diff --git a/met/src/libcode/vx_tc_util/prob_pair_info.cc b/met/src/libcode/vx_tc_util/prob_pair_info.cc index 4f8189d7e0..3415f040d2 100644 --- a/met/src/libcode/vx_tc_util/prob_pair_info.cc +++ b/met/src/libcode/vx_tc_util/prob_pair_info.cc @@ -200,7 +200,7 @@ ProbPairInfoBase * new_prob_pair(const ATCFLineType t) { ProbPairInfoBase *new_pair = (ProbPairInfoBase *) 0; switch(t) { - case ATCFLineType_ProbRIRW: + case ATCFLineType_ProbRI: new_pair = new ProbRIRWPairInfo; break; diff --git a/met/src/tools/tc_utils/tc_pairs/tc_pairs.cc b/met/src/tools/tc_utils/tc_pairs/tc_pairs.cc index dc3792da05..46c3a80b04 100644 --- a/met/src/tools/tc_utils/tc_pairs/tc_pairs.cc +++ b/met/src/tools/tc_utils/tc_pairs/tc_pairs.cc @@ -949,7 +949,7 @@ void filter_probs(ProbInfoArray &probs) { } // If we've made it here, retain this probability - if(p[i]->type() == ATCFLineType_ProbRIRW) probs.add(p.prob_rirw(i)); + if(p[i]->type() == ATCFLineType_ProbRI) probs.add(p.prob_rirw(i)); } // Print summary filtering info