Skip to content

Commit

Permalink
Per #2204, add a new unit test to exercise the new sum option.
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnHalleyGotway committed Jul 8, 2022
1 parent 497307d commit a59b30d
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 0 deletions.
52 changes: 52 additions & 0 deletions internal/test_unit/config/Ascii2NcConfig_rain_01H_sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
////////////////////////////////////////////////////////////////////////////////
//
// ASCII2NC configuration file.
//
// For additional information, please see the MET User's Guide.
//
////////////////////////////////////////////////////////////////////////////////

//
// The parameters listed below are used to summarize the ASCII data read in
//

//
// Time periods for the summarization
// obs_var (string array) is added and works like grib_code (int array)
// when the obs name is given instead of grib_code
//

time_summary = {
flag = TRUE;
raw_data = FALSE;
beg = "00";
end = "23";
step = 3600;
width = { beg = -3599; end = 1; }
grib_code = [ ];
obs_var = [ "rain" ];
type = [ "sum" ];
vld_freq = 15*60;
vld_thresh = 1.0;
}

//
// Mapping of input little_r report types to output message types
//
message_type_map = [
{ key = "FM-12 SYNOP"; val = "ADPSFC"; },
{ key = "FM-13 SHIP"; val = "SFCSHP"; },
{ key = "FM-15 METAR"; val = "ADPSFC"; },
{ key = "FM-18 BUOY"; val = "SFCSHP"; },
{ key = "FM-281 QSCAT"; val = "ASCATW"; },
{ key = "FM-32 PILOT"; val = "ADPUPA"; },
{ key = "FM-35 TEMP"; val = "ADPUPA"; },
{ key = "FM-88 SATOB"; val = "SATWND"; },
{ key = "FM-97 ACARS"; val = "AIRCFT"; }
];

//
// Indicate a version number for the contents of this configuration file.
// The value should generally not be modified.
//
version = "V11.0.0";
16 changes: 16 additions & 0 deletions internal/test_unit/xml/unit_ascii2nc.xml
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,20 @@
</output>
</test>

<test name="ascii2nc_rain_01H_sum">
<exec>&MET_BIN;/ascii2nc</exec>
<param> \
&DATA_DIR_OBS;/ascii/aws/aws_20220609_020000.txt \
&DATA_DIR_OBS;/ascii/aws/aws_20220609_021500.txt \
&DATA_DIR_OBS;/ascii/aws/aws_20220609_023000.txt \
&DATA_DIR_OBS;/ascii/aws/aws_20220609_024500.txt \
&DATA_DIR_OBS;/ascii/aws/aws_20220609_030000.txt \
&OUTPUT_DIR;/ascii2nc/aws_2022060903_rain_01H_sum.nc \
-config &CONFIG_DIR;/Ascii2NcConfig_rain_01H_sum
</param>
<output>
<point_nc>&OUTPUT_DIR;/ascii2nc/aws_2022060903_rain_01H_sum.nc</point_nc>
</output>
</test>

</met_test>

0 comments on commit a59b30d

Please sign in to comment.