diff --git a/met/src/tools/other/pb2nc/pb2nc.cc b/met/src/tools/other/pb2nc/pb2nc.cc index 588e3a62e7..7510da204e 100644 --- a/met/src/tools/other/pb2nc/pb2nc.cc +++ b/met/src/tools/other/pb2nc/pb2nc.cc @@ -130,8 +130,7 @@ static const int mxr8vt = 6; static const int mxr8nm = 8; // Maximum number of BUFR variable types -// Length of the "YYYYMMDD_HHMMSS" string -static const int COUNT_THRESHOLD = 5; +static const int COUNT_THRESHOLD = 16; // File unit number for opening the PrepBufr file static const int file_unit = 11; @@ -1997,7 +1996,7 @@ void process_pbfile_metadata(int i_pb) { int lv, var_index; int debug_threshold = 10; - int tmp_nlev_max_req = mxr8lv_small; + int nlev_max_req; bool check_all = do_all_vars || collect_metadata; char hdr_typ[max_str_len]; StringArray tmp_bufr_obs_name_arr; @@ -2103,6 +2102,8 @@ void process_pbfile_metadata(int i_pb) { int length; bool is_prepbufr_hdr = false; bool showed_progress = false; + + nlev_max_req = (mxr8lv_small > COUNT_THRESHOLD) ? COUNT_THRESHOLD : mxr8lv_small; // Loop through the PrepBufr messages from the input file for(i_read=0; i_read=0; vIdx--) { - int nlev2, buf_nlev; + int nlev2, count; bool has_valid_data; ConcatString var_name = unchecked_var_list[vIdx]; int var_name_len = var_name.length(); - readpbint_(&unit, &i_ret, &nlev2, bufr_obs, (char*)var_name.c_str(), &var_name_len, &tmp_nlev_max_req); + readpbint_(&unit, &i_ret, &nlev2, bufr_obs, (char*)var_name.c_str(), &var_name_len, &nlev_max_req); if (0 >= nlev2) continue; - // Checks the first level intread of searching through the vertical levels - lv = 0; - has_valid_data = (bufr_obs[lv][0] < r8bfms); + // Search through the vertical levels + has_valid_data = false; + for(lv=0; lv &MET_BIN;/pb2nc - STATION_ID "72364","72265","72274","72426","72489" + STATION_ID "72364","72265","72274","72426","72489","14008" MASK_GRID MASK_POLY QUALITY_MARK_THRESH 2