Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature #2609 tc_diag_missing_data #2680

Merged
merged 42 commits into from
Sep 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
65cc39c
Updating (#2586)
jprestop Jun 27, 2023
839aead
Adding module use line
jprestop Jun 27, 2023
9bf17be
#2578 Sets swap_to_north flag for rotated lat/lon
Jun 29, 2023
add953d
#2578 Allow to swap_to_north flag for rotated lat/lon
Jun 29, 2023
4e884ab
#2578 Allow spaces around since
Jun 29, 2023
e4ba356
Feature 2597 disk space (#2598)
jprestop Jul 3, 2023
d644fdc
Merge branch 'main_v10.1' of github.com:dtcenter/MET into bugfix_2578…
jprestop Jul 3, 2023
1eb227d
Merge remote-tracking branch 'origin/main_v11.1' into bugfix_2578_rot…
Jul 3, 2023
df36ebe
Merge branch 'bugfix_2578_rotated_latlon_main_v11.1' of github.com:dt…
Jul 3, 2023
79f6afd
Merge pull request #2595 from dtcenter/bugfix_2578_rotated_latlon_mai…
hsoh-u Jul 3, 2023
8708b43
Update installation.rst (#2602)
hertneky Jul 5, 2023
ff6bf47
Feature update 2603 mode.rst (#2604)
hertneky Jul 7, 2023
9614f28
Feature 2511 ndbc locations update (#2605)
davidalbo Jul 10, 2023
f10845a
Feature #2558 tc_diag_docs (#2580)
JohnHalleyGotway Jul 10, 2023
fe1bb67
Update main_v11.1-ref after #2605 (#2606)
github-actions[bot] Jul 10, 2023
1320e54
Bugfix 2596 main v11.1 rpath compilation (#2614)
jprestop Jul 20, 2023
6a06f18
Adding an include statement for array to allow compilation using gcc1…
jprestop Jul 21, 2023
94162cc
Added documentation about the new MAKE_ARGS option that wasn't added …
jprestop Jul 24, 2023
44cb1d4
Feature #2565 nccf_laea (#2616)
JohnHalleyGotway Jul 24, 2023
4edf278
Merge branch 'main_v11.1-ref' into main_v11.1
JohnHalleyGotway Jul 24, 2023
1c4014f
Updating development instructions
jprestop Jul 24, 2023
390ec32
Feature #2620 v11.1.0-rc2 (#2622)
JohnHalleyGotway Jul 24, 2023
3858efe
Per #2609, define the default lead times to processed as every 6 hour…
JohnHalleyGotway Jul 25, 2023
c32f4ed
Feature #2558 tc_diag_docs edits (#2625)
JohnHalleyGotway Jul 25, 2023
8beaa41
Per #2609, update logic in vx_series_data library to accept optional …
JohnHalleyGotway Jul 25, 2023
95724db
Per #2609, add logic to the logger class to suppress warning messages…
JohnHalleyGotway Jul 25, 2023
684561d
Per #2609, refine the logic here a bit. Save the print_warning state …
JohnHalleyGotway Jul 26, 2023
76b7468
Bugfix #2514 main_v11.1 clang (#2628)
JohnHalleyGotway Jul 26, 2023
2c5b82c
per #2609, merge main_v11.1 into this branch
JohnHalleyGotway Jul 26, 2023
d018235
Per #2609, add one_time_per_file_flag config option for tc_diag. Stil…
JohnHalleyGotway Jul 26, 2023
85fde55
Per #2609, partial merge of updates from develop.
JohnHalleyGotway Aug 15, 2023
a2f0ebb
Merge remote-tracking branch 'origin/develop' into feature_2609_tc_di…
JohnHalleyGotway Aug 17, 2023
4a91bda
Merge remote-tracking branch 'origin/develop' into feature_2609_tc_di…
JohnHalleyGotway Aug 30, 2023
bfe80f1
Per #2609, adding hooks for the Met2dDataFile::data_planes() function…
JohnHalleyGotway Aug 30, 2023
6a0f3d9
Merge remote-tracking branch 'origin/develop' into feature_2609_tc_di…
JohnHalleyGotway Sep 5, 2023
716ed74
Merge remote-tracking branch 'origin/develop' into feature_2609_tc_di…
JohnHalleyGotway Sep 6, 2023
22d234a
Merge remote-tracking branch 'origin/develop' into feature_2609_tc_di…
JohnHalleyGotway Sep 6, 2023
275e951
Per #2609, implement MetGrib2DataFile::data_planes() function
JohnHalleyGotway Sep 7, 2023
1eac21f
Per #2609, update tc_diag.cc to support the one_time_per_file option
JohnHalleyGotway Sep 7, 2023
ca56716
Per #2609, realized that I only need a single implementation of Met2d…
JohnHalleyGotway Sep 7, 2023
6c20b87
Per #2609, just updating code comments to indicate progress
JohnHalleyGotway Sep 11, 2023
fe4477e
Per #2609, fix TC-Diag documentation issues that @jvigh.
JohnHalleyGotway Sep 13, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion data/config/TCDiagConfig_default
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,14 @@ valid_exc = [];

//
// Subset by the valid hour and lead time.
// By default, compute diagnostics every 6 hours out to 126 hours.
//
valid_hour = [];
lead = [];
lead = [ "0", "6", "12", "18", "24",
"30", "36", "42", "48", "54",
"60", "66", "72", "78", "84",
"90", "96", "102", "108", "114",
"120", "126" ];

////////////////////////////////////////////////////////////////////////////////

Expand Down Expand Up @@ -134,6 +139,11 @@ vortex_removal = FALSE;

////////////////////////////////////////////////////////////////////////////////

//
// Flag to control input files
//
one_time_per_file_flag = TRUE;

//
// Flags to control output files
//
Expand Down
8 changes: 4 additions & 4 deletions docs/Users_Guide/config_options_tc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ For example:
valid_beg end inc exc
---------------------

Specify a model valid time window YYYYMMDD[_HH[MMSS]] format or provide a
Specify a model valid time window in YYYYMMDD[_HH[MMSS]] format or provide a
list of specific valid times to include (inc) or exclude (exc). If a time
window is specified, only tracks for which all points are contained within
the window will be used. If valid times to include or exclude are specified,
Expand Down Expand Up @@ -1077,7 +1077,7 @@ Statistics will be generated separately for each ATCF ID.
init_beg, init_end
^^^^^^^^^^^^^^^^^^

Forecast and operational initialization time window
Forecast and operational initialization time window, as strings in YYYYMMDD[_HH[MMSS]] format

.. code-block:: none

Expand All @@ -1087,7 +1087,7 @@ Forecast and operational initialization time window
valid_beg, valid_end
^^^^^^^^^^^^^^^^^^^^

Forecast, BEST, and operational valid time window
Forecast, BEST, and operational valid time window, as strings in YYYYMMDD[_HH[MMSS]] format

.. code-block:: none

Expand All @@ -1097,7 +1097,7 @@ Forecast, BEST, and operational valid time window
lead
^^^^

Forecast and operational lead times in hours
Forecast and operational lead times, as strings in HH[MMSS] format

.. code-block:: none

Expand Down
23 changes: 20 additions & 3 deletions docs/Users_Guide/tc-diag.rst
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,21 @@ Configuring input tracks and time
valid_inc = [];
valid_exc = [];
valid_hour = [];
lead = [];

The TC-Diag tool should be configured to filter the input track data (**-deck**) down to the subset of tracks that correspond to the gridded data files provided (**-data**). The filtered tracks should contain data for only *one initialization time* but may contain tracks for multiple models.

The configuration options listed above are used to filter the input track data down to those that should be processed in the current run. These options are common to multiple MET tools and are described in :numref:`config_options_tc`.

.. code-block:: none
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JohnHalleyGotway There's something weird here. There's an empty code block, but then the lead times that follow are split across multiple lines in a weird way. Should these actually be inside the code block?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I think I understand -- to be inside the code block, the lead = [ ]; stuff needs to be indented.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jvigh, great catch! Thanks for your review. I pushed a fix for that indent problem.


lead = [ "0", "6", "12", "18", "24",
"30", "36", "42", "48", "54",
"60", "66", "72", "78", "84",
"90", "96", "102", "108", "114",
"120", "126" ];

The **lead** entry is an array of strings specifying lead times in HH[MMSS] format. By default, diagnostics are computed every 6 hours out to 126 hours. Lead times for which no track point or gridded model data exist produce a warning message and diagnostics set to a missing data value.

Configuring domain information
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Expand Down Expand Up @@ -204,8 +213,16 @@ The **vortex_removal** flag entry is a boolean specifying whether or not vortex

.. note:: As of MET version 11.1.0, vortex removal logic is not yet supported.

Configuring data output options
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Configuring data input and output options
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. code-block:: none

one_time_per_file_flag = TRUE;

The **one_time_per_file_flag** entry controls the logic for reading data from input files. This option describes how data is stored in the gridded input files specified with the **-data** command line option. Set this to true if each input file contains all of the data for a single initialization time and for a single valid time. If the input files contain data for multiple initialization or valid times, or if data for one valid time is spread across multiple files, set this to false.

If true, all input fields are read efficiently from each file in a single call. If false, each field is processed separately in a less efficient manner.

.. code-block:: none

Expand Down
12 changes: 11 additions & 1 deletion internal/test_unit/config/TCDiagConfig_ian
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,14 @@ valid_exc = [];

//
// Subset by the valid hour and lead time.
// By default, compute diagnostics every 6 hours out to 126 hours.
//
valid_hour = [];
lead = [ "0", "6", "12", "18", "24" ];
lead = [ "0", "6", "12", "18", "24",
"30", "36", "42", "48", "54",
"60", "66", "72", "78", "84",
"90", "96", "102", "108", "114",
"120", "126" ];

////////////////////////////////////////////////////////////////////////////////

Expand Down Expand Up @@ -128,6 +133,11 @@ vortex_removal = FALSE;

////////////////////////////////////////////////////////////////////////////////

//
// Flag to control input files
//
one_time_per_file_flag = TRUE;

//
// Flags to control output files
//
Expand Down
15 changes: 8 additions & 7 deletions src/basic/vx_config/config_constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -1206,18 +1206,19 @@ static const char conf_key_radial_velocity_field_name[] = "radial_velocity_field
static const char conf_key_tangential_velocity_field_name[] = "tangential_velocity_field_name";
static const char conf_key_radial_velocity_long_field_name[] = "radial_velocity_long_field_name";
static const char conf_key_tangential_velocity_long_field_name[] = "tangential_velocity_long_field_name";
static const char conf_key_vortex_removal[] = "vortex_removal";

//
// TC-Diag specific parameter key names
//

static const char conf_key_domain_info[] = "domain_info";
static const char conf_key_domain[] = "domain";
static const char conf_key_diag_script[] = "diag_script";
static const char conf_key_nc_rng_azi_flag[] = "nc_rng_azi_flag";
static const char conf_key_nc_diag_flag[] = "nc_diag_flag";
static const char conf_key_cira_diag_flag[] = "cira_diag_flag";
static const char conf_key_domain_info[] = "domain_info";
static const char conf_key_domain[] = "domain";
static const char conf_key_diag_script[] = "diag_script";
static const char conf_key_vortex_removal[] = "vortex_removal";
static const char conf_key_one_time_per_file_flag[] = "one_time_per_file_flag";
static const char conf_key_nc_rng_azi_flag[] = "nc_rng_azi_flag";
static const char conf_key_nc_diag_flag[] = "nc_diag_flag";
static const char conf_key_cira_diag_flag[] = "cira_diag_flag";

//
// Parameter value names common to multiple tools
Expand Down
39 changes: 37 additions & 2 deletions src/basic/vx_log/logger.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,11 @@ static const int ErrorMessageLevel = -1;

static const int WarningMessageLevel = 0;

static const bool DefaultPrintWarning = true;

static const bool DefaultExitOnWarning = false;


//
// these need external linkage, do not make static or extern
//
Expand Down Expand Up @@ -217,6 +220,8 @@ LoggerWarning::LoggerWarning()
{
warn = WarningMessageLevel;

PrintWarning = DefaultPrintWarning;

ExitOnWarning = DefaultExitOnWarning;

NeedToExit = false;
Expand Down Expand Up @@ -246,6 +251,8 @@ LoggerWarning::LoggerWarning(const LoggerWarning & lw)
{
warn = lw.warn;

PrintWarning = lw.PrintWarning;

ExitOnWarning = lw.ExitOnWarning;

NeedToExit = lw.NeedToExit;
Expand All @@ -259,6 +266,8 @@ LoggerWarning & LoggerWarning::operator=(const LoggerWarning & lw)
{
warn = lw.warn;

PrintWarning = lw.PrintWarning;

ExitOnWarning = lw.ExitOnWarning;

NeedToExit = lw.NeedToExit;
Expand Down Expand Up @@ -491,6 +500,17 @@ void Logger::dump(ostream & dump_out, int depth) const
//////////////////////////////////////////////////////////////////


bool Logger::print_warning() const
{

return (Warning.PrintWarning);

}


//////////////////////////////////////////////////////////////////


void Logger::set_verbosity_level(const int i)
{
//
Expand All @@ -509,6 +529,19 @@ void Logger::set_verbosity_level(const int i)
//////////////////////////////////////////////////////////////////


void Logger::set_print_warning(bool b)
{
//
// if false, do not print warning messages
//
Warning.PrintWarning = b;

}


//////////////////////////////////////////////////////////////////


void Logger::set_exit_on_warning(bool b)
{
//
Expand All @@ -519,7 +552,6 @@ void Logger::set_exit_on_warning(bool b)
}



//////////////////////////////////////////////////////////////////


Expand Down Expand Up @@ -1604,7 +1636,10 @@ Logger & Logger::operator<<(const LoggerError e)

Logger & Logger::operator<<(const LoggerWarning w)
{
(*this) << level(WarningMessageLevel);
if (Warning.PrintWarning)
{
(*this) << level(WarningMessageLevel);
}

if (Warning.ExitOnWarning) Warning.NeedToExit = true;

Expand Down
5 changes: 5 additions & 0 deletions src/basic/vx_log/logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ class LoggerWarning {

public:
int warn;
bool PrintWarning;
bool ExitOnWarning;
bool NeedToExit;

Expand Down Expand Up @@ -248,6 +249,8 @@ class Logger

int verbosity_level() const;

bool print_warning() const;

bool is_open() const;

//
Expand All @@ -256,6 +259,8 @@ class Logger

void set_verbosity_level(const int);

void set_print_warning(bool);

void set_exit_on_warning(bool);

//
Expand Down
43 changes: 43 additions & 0 deletions src/libcode/vx_data2d/data_class.cc
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,49 @@ return;
////////////////////////////////////////////////////////////////////////


int Met2dDataFile::data_planes(vector<VarInfo*> &vi_list,
vector<DataPlane> &dp_list)

{

int n_valid = 0;
DataPlane cur_dp;

//
// Loop over requested VarInfo objects
//

for(int i=0; i<vi_list.size(); i++) {

//
// Initialize
//

cur_dp.clear();

//
// Read the current DataPlane
//

if(data_plane(*vi_list[i], cur_dp)) n_valid++;
else cur_dp.clear();

//
// Store the result
//

dp_list.push_back(cur_dp);

}

return ( n_valid );

}


////////////////////////////////////////////////////////////////////////


bool Met2dDataFile::process_data_plane(VarInfo *vinfo, DataPlane &dp)

{
Expand Down
5 changes: 5 additions & 0 deletions src/libcode/vx_data2d/data_class.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,11 @@ class Met2dDataFile : public Met2dData {

virtual int index(VarInfo &) = 0;

// retrieve a vector of all requested data planes

int data_planes(std::vector<VarInfo*>&,
std::vector<DataPlane>&);

// post-process data after reading it

bool process_data_plane(VarInfo *, DataPlane &);
Expand Down
2 changes: 2 additions & 0 deletions src/libcode/vx_data2d_grib/data2d_grib.cc
Original file line number Diff line number Diff line change
Expand Up @@ -827,3 +827,5 @@ int MetGrib1DataFile::index(VarInfo &vinfo){

return rec;
}

////////////////////////////////////////////////////////////////////////
8 changes: 7 additions & 1 deletion src/libcode/vx_data2d_grib/data2d_grib.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,16 @@ class MetGrib1DataFile : public Met2dDataFile {

int read_record( VarInfoGrib &); // returns match count (>=0), or -1 on error

// retrieve the first matching data plane

bool data_plane(VarInfo &, DataPlane &);

// retrieve all matching data planes

int data_plane_array(VarInfo &, DataPlaneArray &);


// retrieve the index of the first matching record

int index(VarInfo &);

};
Expand Down
Loading