Skip to content

Commit

Permalink
Update develop-ref after #1984 (#1988)
Browse files Browse the repository at this point in the history
Co-authored-by: Julie Prestopnik <[email protected]>
Co-authored-by: johnhg <[email protected]>
Co-authored-by: Seth Linden <[email protected]>
Co-authored-by: John Halley Gotway <[email protected]>
Co-authored-by: j-opatz <[email protected]>
Co-authored-by: Howard Soh <[email protected]>
Co-authored-by: jprestop <[email protected]>
Co-authored-by: Seth Linden <[email protected]>
Co-authored-by: hsoh-u <[email protected]>
  • Loading branch information
8 people authored Dec 2, 2021
1 parent b4c2714 commit d446382
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 20 deletions.
8 changes: 4 additions & 4 deletions met/docs/Users_Guide/point-stat.rst
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ The first set of header columns are common to all of the output files generated

.. _table_PS_format_info_CTS_cont:

.. list-table:: Format information for CTS (Contingency Table Statistics) output line type, continued from above
.. list-table:: Format information for CTS (Contingency Table Statistics) output line type, continued from above
:widths: auto
:header-rows: 2

Expand Down Expand Up @@ -745,7 +745,7 @@ The first set of header columns are common to all of the output files generated

.. _table_PS_format_info_CNT:

.. list-table:: Format information for CNT(Continuous Statistics) output line type.
.. list-table:: Format information for CNT (Continuous Statistics) output line type.
:widths: auto
:header-rows: 2

Expand Down Expand Up @@ -804,7 +804,7 @@ The first set of header columns are common to all of the output files generated

.. _table_PS_format_info_CNT_cont:

.. list-table:: Format information for CNT(Continuous Statistics) output line type continued from above table
.. list-table:: Format information for CNT (Continuous Statistics) output line type continued from above table
:widths: auto
:header-rows: 2

Expand Down Expand Up @@ -1299,7 +1299,7 @@ The first set of header columns are common to all of the output files generated

.. _table_PS_format_info_VCNT:

.. list-table:: Format information for VAL1L2 (Vector Anomaly Partial Sums) output line type. Note that each statistic (except TOTAL) is followed by two columns giving bootstrap confidence intervals. These confidence intervals are not currently calculated for this release of MET, but will be in future releases.
.. list-table:: Format information for VCNT (Vector Continuous Statistics) output line type. Note that each statistic (except TOTAL) is followed by two columns giving bootstrap confidence intervals. These confidence intervals are not currently calculated for this release of MET, but will be in future releases.
:widths: auto
:header-rows: 2

Expand Down
26 changes: 10 additions & 16 deletions met/src/tools/other/madis2nc/madis2nc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ static void clean_up();
static void setup_netcdf_out(int nhdr);

static bool get_filtered_nc_data(NcVar var, float *data, const long dim,
const long cur, const char *var_name);
const long cur, const char *var_name, bool required=true);
static bool get_filtered_nc_data_2d(NcVar var, int *data, const long *dim,
const long *cur, const char *var_name, bool count_bad=false);
static bool get_filtered_nc_data_2d(NcVar var, float *data, const long *dim,
Expand Down Expand Up @@ -415,7 +415,7 @@ void setup_netcdf_out(int nhdr) {

static bool get_filtered_nc_data(NcVar var, float *data,
const long dim, const long cur,
const char *var_name) {
const char *var_name, bool required) {

bool status = false;
float in_fill_value;
Expand All @@ -439,15 +439,13 @@ static bool get_filtered_nc_data(NcVar var, float *data,
<< "Fail to read data [" << var_name << "].\n\n";
}
}
else {
else if (required) {
mlog << Error << "\n" << method_name
<< "Can not read a NetCDF data because the variable [" << var_name << "] is missing.\n\n";
}
if (!status) {
for (int idx=0; idx<dim; idx++) {
data[idx] = bad_data_float;
rej_fill++;
}
if(!status) {
for (int idx=0; idx<dim; idx++) data[idx] = bad_data_float;
rej_fill += dim;
}
return status;

Expand Down Expand Up @@ -2715,10 +2713,6 @@ void process_madis_mesonet(NcFile *&f_in) {
if (IS_INVALID_NC(in_soilTemperature_var)) missing_vars.add("soilTemperature");
if (IS_INVALID_NC(in_minTemp24Hour_var)) missing_vars.add("minTemp24Hour");
if (IS_INVALID_NC(in_maxTemp24Hour_var)) missing_vars.add("maxTemp24Hour");
if (IS_INVALID_NC(in_precip3hr_var)) missing_vars.add("precip3hr");
if (IS_INVALID_NC(in_precip6hr_var)) missing_vars.add("precip6hr");
if (IS_INVALID_NC(in_precip12hr_var)) missing_vars.add("precip12hr");
if (IS_INVALID_NC(in_precip10min_var)) missing_vars.add("precip10min");
if (IS_INVALID_NC(in_precip1min_var)) missing_vars.add("precip1min");
if (IS_INVALID_NC(in_windDir10_var)) missing_vars.add("windDir10");
if (IS_INVALID_NC(in_windSpeed10_var)) missing_vars.add("windSpeed10");
Expand Down Expand Up @@ -2922,10 +2916,10 @@ void process_madis_mesonet(NcFile *&f_in) {
get_filtered_nc_data(in_soilTemperature_var, soilTemperature_arr, buf_size, i_hdr_s, "soilTemperature" );
get_filtered_nc_data(in_minTemp24Hour_var, minTemp24Hour_arr, buf_size, i_hdr_s, "minTemp24Hour" );
get_filtered_nc_data(in_maxTemp24Hour_var, maxTemp24Hour_arr, buf_size, i_hdr_s, "maxTemp24Hour" );
get_filtered_nc_data(in_precip3hr_var, precip3hr_arr, buf_size, i_hdr_s, "precip3hr" );
get_filtered_nc_data(in_precip6hr_var, precip6hr_arr, buf_size, i_hdr_s, "precip6hr" );
get_filtered_nc_data(in_precip12hr_var, precip12hr_arr, buf_size, i_hdr_s, "precip12hr" );
get_filtered_nc_data(in_precip10min_var, precip10min_arr, buf_size, i_hdr_s, "precip10min" );
get_filtered_nc_data(in_precip3hr_var, precip3hr_arr, buf_size, i_hdr_s, "precip3hr" , false);
get_filtered_nc_data(in_precip6hr_var, precip6hr_arr, buf_size, i_hdr_s, "precip6hr" , false);
get_filtered_nc_data(in_precip12hr_var, precip12hr_arr, buf_size, i_hdr_s, "precip12hr" , false);
get_filtered_nc_data(in_precip10min_var, precip10min_arr, buf_size, i_hdr_s, "precip10min" , false);
get_filtered_nc_data(in_precip1min_var, precip1min_arr, buf_size, i_hdr_s, "precip1min" );
get_filtered_nc_data(in_windDir10_var, windDir10_arr, buf_size, i_hdr_s, "windDir10" );
get_filtered_nc_data(in_windSpeed10_var, windSpeed10_arr, buf_size, i_hdr_s, "windSpeed10" );
Expand Down
12 changes: 12 additions & 0 deletions test/xml/unit_madis2nc.xml
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,18 @@
</output>
</test>

<test name="madis2nc_MESONET_optional_vars">
<exec>&MET_BIN;/madis2nc</exec>
<param> \
&DATA_DIR_OBS;/madis/mesonet/mesonet_20170101_0000.nc \
&OUTPUT_DIR;/madis2nc/mesonet_20170101_0000_F000.nc \
-type mesonet -mask_grid G207 -v 2
</param>
<output>
<point_nc>&OUTPUT_DIR;/madis2nc/mesonet_20170101_0000_F000.nc</point_nc>
</output>
</test>

<test name="madis2nc_ACARS_PROFILES">
<exec>&MET_BIN;/madis2nc</exec>
<param> \
Expand Down

0 comments on commit d446382

Please sign in to comment.