Skip to content

Commit

Permalink
Per #1451, merging develop into this feature branch.
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnHalleyGotway committed Feb 20, 2021
2 parents 4411687 + 11a5419 commit d3551f1
Show file tree
Hide file tree
Showing 6 changed files with 78 additions and 59 deletions.
8 changes: 4 additions & 4 deletions met/data/table_files/grib1_ncep_129_7.txt
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,10 @@ GRIB1
232 129 7 -1 "OZMAX8" "Ozone Daily Max from 8-hour Average" "ppbV"
233 129 7 -1 "PDMAX1" "PM 2.5 Daily Max from 1-hour Average" "mcg/m^3"
234 129 7 -1 "PDMX24" "PM 2.5 Daily Max from 24-hour Average" "mcg/m^3"
235 129 7 -1 "MAXREF" "Hourly Maximum of Simulated Reflectivity at 1 km AGL" "dbZ"
236 129 7 -1 "MXUPHL" "Hourly Maximum of Updraft Helicity over layer 2km to 5 km AGL" "m^2/s^2"
237 129 7 -1 "MAXUVV" "Hourly Maximum of Upward Vertical Velocity in the lowest 400hPa" "m/s"
238 129 7 -1 "MAXDVV" "Hourly Maximum of Downward Vertical Velocity in the lowest 400hPa" "m/s"
235 129 7 -1 "MAXREF" "Hourly Maximum of Simulated Reflectivity" "dbZ"
236 129 7 -1 "MXUPHL" "Hourly Maximum of Updraft Helicity" "m^2/s^2"
237 129 7 -1 "MAXUVV" "Hourly Maximum of Upward Vertical Velocity" "m/s"
238 129 7 -1 "MAXDVV" "Hourly Maximum of Downward Vertical Velocity" "m/s"
239 129 7 -1 "MAXVIG" "Hourly Maximum of Column Vertical Integrated Graupel" "kg/m^2"
240 129 7 -1 "RETOP" "Radar Echo Top (18.3 DBZ)" "m"
241 129 7 -1 "VRATE" "Ventilation Rate" "m^2/s"
Expand Down
10 changes: 5 additions & 5 deletions met/data/table_files/grib2_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -421,11 +421,11 @@ GRIB2
0 1 0 255 0 0 1 97 "MASSDS" "Mass Density of Snow" "kg/m^3"
0 1 0 255 0 0 20 2 "MASSMR" "Mass Mixing Ratio (Mass Fraction in Air)" "kg/kg"
0 1 0 255 0 0 1 28 "MAXAH" "Maximum Absolute Humidity" "kg/m^3"
0 0 0 255 7 1 2 221 "MAXDVV" "Hourly Maximum of Downward Vertical Velocity in the lowest 400hPa" "m/s"
0 0 0 255 7 1 2 221 "MAXDVV" "Hourly Maximum of Downward Vertical Velocity" "m/s"
0 1 0 255 0 0 2 21 "MAXGUST" "Maximum Wind Speed" "m/s"
0 0 0 255 7 1 16 198 "MAXREF" "Hourly Maximum of Simulated Reflectivity at 1 km AGL" "dB"
0 0 0 255 7 1 16 198 "MAXREF" "Hourly Maximum of Simulated Reflectivity" "dB"
0 1 0 255 0 0 1 27 "MAXRH" "Maximum Relative Humidity" "%"
0 0 0 255 7 1 2 220 "MAXUVV" "Hourly Maximum of Upward Vertical Velocity in the lowest 400hPa" "m/s"
0 0 0 255 7 1 2 220 "MAXUVV" "Hourly Maximum of Upward Vertical Velocity" "m/s"
0 0 0 255 7 1 2 222 "MAXUW" "U Component of Hourly Maximum 10m Wind Speed" "m/s"
0 0 0 255 7 1 2 223 "MAXVW" "V Component of Hourly Maximum 10m Wind Speed" "m/s"
10 1 0 255 0 0 0 24 "MAXWH" "Maximum Individual Wave Height" "m"
Expand Down Expand Up @@ -460,7 +460,7 @@ GRIB2
0 1 0 255 0 0 19 28 "MWTURB" "Mountain Wave Turbulence (Eddy Dissipation Rate)" "m2/3s-1"
0 0 0 255 7 1 19 192 "MXSALB" "Maximum Snow Albedo" "%"
0 1 0 255 0 0 19 17 "MXSALB" "Maximum Snow Albedosee Note 1" "%"
0 0 0 255 7 1 7 199 "MXUPHL" "Hourly Maximum of Updraft Helicity over Layer 2km to 5 km AGL" "m^2/s^2"
0 0 0 255 7 1 7 199 "MXUPHL" "Hourly Maximum of Updraft Helicity" "m^2/s^2"
10 1 0 255 0 0 0 30 "MZPTSW" "Mean Zero-Crossing Period of The Total Swell" "s"
10 1 0 255 0 0 0 29 "MZPWW" "Mean Zero-Crossing Period of The Wind Waves" "s"
10 1 0 255 0 0 0 28 "MZWPER" "Mean Zero-Crossing Wave Period" "s"
Expand Down Expand Up @@ -1016,4 +1016,4 @@ GRIB2
4 1 0 255 0 0 6 1 "XLONG" "Solar X-ray Flux (XRS Long)" "W/m^2"
4 1 0 255 0 0 8 0 "XRAYRAD" "X-Ray Radiance" "W/sr/m^2"
4 1 0 255 0 0 6 2 "XSHRT" "Solar X-ray Flux (XRS Short)" "W/m^2"
10 1 0 255 0 0 2 10 "ZVCICEP" "Zonal Vector Component of Vertically Integrated Ice Internal Pressure" "Pa*m"
10 1 0 255 0 0 2 10 "ZVCICEP" "Zonal Vector Component of Vertically Integrated Ice Internal Pressure" "Pa*m"
22 changes: 13 additions & 9 deletions met/docs/Users_Guide/release-notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,26 @@ Version `10.0.0-beta3 <https://github.com/dtcenter/MET/projects/25>`_ release no

* When reading MET NetCDF files, parse the "init_time" and "valid_time" attributes (`#1346 <http://github.com/dtcenter/MET/issues/1346>`_).
* Python embedding enhancements:
* Complete support for Python XArray embedding (`#1534 <http://github.com/dtcenter/MET/issues/1534>`_).
* Correct error messages from Python embedding (`#1473 <http://github.com/dtcenter/MET/issues/1473>`_).

* Complete support for Python XArray embedding (`#1534 <http://github.com/dtcenter/MET/issues/1534>`_).
* Correct error messages from Python embedding (`#1473 <http://github.com/dtcenter/MET/issues/1473>`_).

* Application code:

* Enhance Plot-Point-Obs to support regridding in the config file (`#1627 <http://github.com/dtcenter/MET/issues/1627>`_).
* Update ASCII2NC and Point2Grid to create empty output files for zero input observations instead of erroring out (`#1630 <http://github.com/dtcenter/MET/issues/1630>`_).
* Point2Grid Tool:
* Improve the Point2Grid runtime performance (`#1421 <http://github.com/dtcenter/MET/issues/1421>`_).
* Process point observations by variable name instead of GRIB code (`#1408 <http://github.com/dtcenter/MET/issues/1408>`_).
* Support the 2-dimensional time variable in Himawari data files (`#1580 <http://github.com/dtcenter/MET/issues/1580>`_).

* Improve the Point2Grid runtime performance (`#1421 <http://github.com/dtcenter/MET/issues/1421>`_).
* Process point observations by variable name instead of GRIB code (`#1408 <http://github.com/dtcenter/MET/issues/1408>`_).
* Support the 2-dimensional time variable in Himawari data files (`#1580 <http://github.com/dtcenter/MET/issues/1580>`_).

* TC-Gen Tool:
* Overhaul the Tropical Cyclone genesis matching logic, add the development and operational scoring algorithms, and add many config file options (`#1448 <http://github.com/dtcenter/MET/issues/1448>`_).
* Add config file options to filter data by initialization time (init_inc and init_exc) and hurricane basin (basin_mask) (`#1626 <http://github.com/dtcenter/MET/issues/1626>`_).
* Add the genesis matched pair (GENMPR) output line type (`#1597 <http://github.com/dtcenter/MET/issues/1597>`_).
* Add a gridded NetCDF output file with counts for genesis events and track points (`#1430 <http://github.com/dtcenter/MET/issues/1430>`_).

* Overhaul the Tropical Cyclone genesis matching logic, add the development and operational scoring algorithms, and add many config file options (`#1448 <http://github.com/dtcenter/MET/issues/1448>`_).
* Add config file options to filter data by initialization time (init_inc and init_exc) and hurricane basin (basin_mask) (`#1626 <http://github.com/dtcenter/MET/issues/1626>`_).
* Add the genesis matched pair (GENMPR) output line type (`#1597 <http://github.com/dtcenter/MET/issues/1597>`_).
* Add a gridded NetCDF output file with counts for genesis events and track points (`#1430 <http://github.com/dtcenter/MET/issues/1430>`_).

Version `10.0.0-beta2 <https://github.com/dtcenter/MET/projects/24>`_ release notes (20201207)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
2 changes: 1 addition & 1 deletion met/src/tools/core/stat_analysis/aggr_stat_line.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2628,7 +2628,7 @@ void aggr_ecnt_lines(LineDataFile &f, STATAnalysisJob &job,
bad_data_double : (crpscl_emp - crps_emp)/crpscl_emp);

// Compute aggregated Gaussian CRPSS
it->second.ens_pd.crpss_emp =
it->second.ens_pd.crpss_gaus =
(is_bad_data(crps_gaus) || is_bad_data(crpscl_gaus) && is_eq(crpscl_gaus, 0.0) ?
bad_data_double : (crpscl_gaus - crps_gaus)/crpscl_gaus);

Expand Down
87 changes: 50 additions & 37 deletions met/src/tools/other/point2grid/point2grid.cc
Original file line number Diff line number Diff line change
Expand Up @@ -405,10 +405,12 @@ void process_data_file() {
// Open the output file
open_nc(to_grid, run_cs);

if (goes_data)
if (goes_data) {
process_goes_file(nc_in, config, vinfo, fr_grid, to_grid);
else if (TYPE_OBS == obs_type)
}
else if (TYPE_OBS == obs_type) {
process_point_file(nc_in, config, vinfo, fr_grid, to_grid);
}
else if (TYPE_NCCF == obs_type) {
process_point_nccf_file(nc_in, config, vinfo, fr_mtddf, to_grid);
unsetenv(nc_att_met_point_nccf);
Expand Down Expand Up @@ -657,6 +659,7 @@ void process_point_file(NcFile *nc_in, MetConfig &config, VarInfo *vinfo,

// Check and read obs_vid and obs_var if exists
bool success_to_read = true;
bool empty_input = (nhdr == 0 && nobs == 0);
NcVar obs_vid_var = get_var(nc_in, nc_var_obs_vid);
if (IS_VALID_NC(obs_vid_var)) {
if (success_to_read) success_to_read = get_nc_data_int_array(nc_in, nc_var_obs_vid, obs_ids);
Expand All @@ -671,30 +674,32 @@ void process_point_file(NcFile *nc_in, MetConfig &config, VarInfo *vinfo,
}
}

if (success_to_read)
success_to_read = get_nc_data_int_array(nc_in, nc_var_obs_hid, obs_hids);
if (success_to_read)
success_to_read = get_nc_data_int_array(nc_in, nc_var_hdr_vld, hdr_vld_ids);
if (success_to_read)
success_to_read = get_nc_data_int_array(nc_in, nc_var_hdr_typ, hdr_typ_ids);
if (success_to_read)
success_to_read = get_nc_data_int_array(nc_in, nc_var_obs_qty, obs_qty_ids);
if (success_to_read)
success_to_read = get_nc_data_float_array(nc_in, nc_var_hdr_lat, hdr_lats);
if (success_to_read)
success_to_read = get_nc_data_float_array(nc_in, nc_var_hdr_lon, hdr_lons);
if (success_to_read)
success_to_read = get_nc_data_float_array(nc_in, nc_var_obs_lvl, obs_lvls);
if (success_to_read)
success_to_read = get_nc_data_float_array(nc_in, nc_var_obs_hgt, obs_hgts);
if (success_to_read)
success_to_read = get_nc_data_float_array(nc_in, nc_var_obs_val, obs_vals);
if (success_to_read)
success_to_read = get_nc_data_string_array(
nc_in, nc_var_hdr_vld_tbl, &hdr_valid_times);
if (success_to_read)
success_to_read = get_nc_data_string_array(
nc_in, nc_var_obs_qty_tbl, &qc_tables);
if (!empty_input) {
if (success_to_read)
success_to_read = get_nc_data_int_array(nc_in, nc_var_obs_hid, obs_hids);
if (success_to_read)
success_to_read = get_nc_data_int_array(nc_in, nc_var_hdr_vld, hdr_vld_ids);
if (success_to_read)
success_to_read = get_nc_data_int_array(nc_in, nc_var_hdr_typ, hdr_typ_ids);
if (success_to_read)
success_to_read = get_nc_data_int_array(nc_in, nc_var_obs_qty, obs_qty_ids);
if (success_to_read)
success_to_read = get_nc_data_float_array(nc_in, nc_var_hdr_lat, hdr_lats);
if (success_to_read)
success_to_read = get_nc_data_float_array(nc_in, nc_var_hdr_lon, hdr_lons);
if (success_to_read)
success_to_read = get_nc_data_float_array(nc_in, nc_var_obs_lvl, obs_lvls);
if (success_to_read)
success_to_read = get_nc_data_float_array(nc_in, nc_var_obs_hgt, obs_hgts);
if (success_to_read)
success_to_read = get_nc_data_float_array(nc_in, nc_var_obs_val, obs_vals);
if (success_to_read)
success_to_read = get_nc_data_string_array(
nc_in, nc_var_hdr_vld_tbl, &hdr_valid_times);
if (success_to_read)
success_to_read = get_nc_data_string_array(
nc_in, nc_var_obs_qty_tbl, &qc_tables);
}
if (success_to_read) {
bool has_qc_flags = (qc_flags.n() > 0);
IntArray qc_idx_array = prepare_qc_array(qc_flags, qc_tables);
Expand Down Expand Up @@ -723,7 +728,9 @@ void process_point_file(NcFile *nc_in, MetConfig &config, VarInfo *vinfo,
obs_count_zero_to = obs_count_non_zero_to = 0;
obs_count_zero_from = obs_count_non_zero_from = 0;
for(int i=0; i<FieldSA.n(); i++) {

var_idx_or_gc = -1;

// Initialize
vinfo->clear();

Expand All @@ -743,7 +750,7 @@ void process_point_file(NcFile *nc_in, MetConfig &config, VarInfo *vinfo,
else {
if (use_var_id) {
if (!var_names.has(vname, var_idx_or_gc)) {
exit_by_field_name_error = true;;
exit_by_field_name_error = true;
error_msg << "The variable \"" << vname << "\" is not available.\n";
}
}
Expand All @@ -758,7 +765,7 @@ void process_point_file(NcFile *nc_in, MetConfig &config, VarInfo *vinfo,
sprintf(grib_code, "%d", var_idx_or_gc);
}
else {
exit_by_field_name_error = true;;
exit_by_field_name_error = true;
error_msg << "Invalid GRIB code [" << vname << "]\n";
}
}
Expand All @@ -771,7 +778,7 @@ void process_point_file(NcFile *nc_in, MetConfig &config, VarInfo *vinfo,
}
}
if (not_found_grib_code) {
exit_by_field_name_error = true;;
exit_by_field_name_error = true;
error_msg << "No data for the GRIB code [" << vname << "]\n";
}
}
Expand All @@ -797,11 +804,17 @@ void process_point_file(NcFile *nc_in, MetConfig &config, VarInfo *vinfo,
}
}
}
mlog << Error << "\n" << method_name
<< error_msg
<< "Try setting the \"name\" in the \"-field\" command line option to one of the available names:\n"
<< "\t" << log_msg << "\n\n";
exit(1);
if (empty_input) {
mlog << Warning << "\n" << method_name
<< error_msg << "\tBut ignored because of empty input\n\n";
}
else {
mlog << Error << "\n" << method_name
<< error_msg
<< "Try setting the \"name\" in the \"-field\" command line option to one of the available names:\n"
<< "\t" << log_msg << "\n\n";
exit(1);
}
}

// Check the time range. Apply the time window
Expand Down Expand Up @@ -877,7 +890,7 @@ void process_point_file(NcFile *nc_in, MetConfig &config, VarInfo *vinfo,
continue;
}

//Filter by QC flag
// Filter by QC flag
if (has_qc_flags && !qc_idx_array.has(obs_qty_ids[idx])) {
filtered_by_qc++;
continue;
Expand Down Expand Up @@ -1923,7 +1936,7 @@ static bool get_grid_mapping(Grid fr_grid, Grid to_grid, IntArray *cellMapping,

int to_lat_count = to_grid.ny();
int to_lon_count = to_grid.nx();
int from_lat_count = fr_grid.ny();;
int from_lat_count = fr_grid.ny();
int from_lon_count = fr_grid.nx();

// Override the from nx & ny from NetCDF if exists
Expand Down Expand Up @@ -2026,7 +2039,7 @@ void get_grid_mapping(Grid fr_grid, Grid to_grid, IntArray *cellMapping,
clock_t start_clock = clock();
int to_lat_count = to_grid.ny();
int to_lon_count = to_grid.nx();
int from_lat_count = fr_grid.ny();;
int from_lat_count = fr_grid.ny();
int from_lon_count = fr_grid.nx();

bool has_coord_input = false;
Expand Down
8 changes: 5 additions & 3 deletions met/src/tools/other/point2grid/point2grid_conf_info.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ void PointToGridConfInfo::clear() {
quality_mark_thresh = bad_data_int;
version.clear();
valid_time = 0;
//def_var_name_map.clear();
def_var_name_map.clear();
var_name_map.clear();

return;
Expand Down Expand Up @@ -126,22 +126,24 @@ void PointToGridConfInfo::process_config() {

ConcatString PointToGridConfInfo::get_var_id(const ConcatString var_name) {
ConcatString var_id;

map<ConcatString,ConcatString>::iterator ptr;
for (ptr=var_name_map.begin(); ptr != var_name_map.end(); ptr++) {
if( ptr->second == var_name ) {
var_id = ptr->first;
break;
}
}

if( var_id.empty() ) {
for (ptr=def_var_name_map.begin(); ptr != var_name_map.end(); ptr++) {
for (ptr=def_var_name_map.begin(); ptr != def_var_name_map.end(); ptr++) {
if( ptr->second == var_name ) {
var_id = ptr->first;
break;
}
}
}

return var_id;
}

Expand Down

0 comments on commit d3551f1

Please sign in to comment.