Skip to content

Commit

Permalink
Per #2321, lots of changes related to CIRA_DIAG_RT and SHIPS_DIAG_RT.…
Browse files Browse the repository at this point in the history
… ci-run-unit
  • Loading branch information
JohnHalleyGotway committed Nov 15, 2022
1 parent fb7be08 commit cfd22b2
Show file tree
Hide file tree
Showing 12 changed files with 354 additions and 230 deletions.
89 changes: 55 additions & 34 deletions data/config/TCPairsConfig_default
Original file line number Diff line number Diff line change
Expand Up @@ -138,44 +138,65 @@ watch_warn = {
}

//
// Diagnostics to be extracted
//
diag_name = [];
// Metadata for diagnostic sources
//
diag_info_map = [
{
diag_source = "CIRA_DIAG_RT";
track_source = "GFS";
field_source = "GFS_0p50";
match_to_track = [ "GFS" ];
diag_name = [];
},
{
diag_source = "SHIPS_DIAG_RT";
track_source = "OFCL";
field_source = "GFS_0p50";
match_to_track = [ "OFCL" ];
diag_name = [];
}
];

//
// Unit conversions to be applied based on diagnostic names and units
// Unit conversions for diagnostic sources, names, and units
//
diag_convert_map = [
{ source = "TCDIAG";
key = [ "(10C)", "(10KT)", "(10M/S)" ];
convert(x) = x / 10; },

{ source = "LSDIAG_RT";
key = [ "LAT", "LON", "CSST", "RSST", "DSST", "DSTA", "XDST", "XNST", "NSST", "NSTA",
"NTMX", "NTFR", "U200", "U20C", "V20C", "E000", "EPOS", "ENEG", "EPSS", "ENSS",
"T000", "TLAT", "TLON", "TWAC", "TWXC", "G150", "G200", "G250", "V000", "V850",
"V500", "V300", "SHDC", "SHGC", "T150", "T200", "T250", "SHRD", "SHRS", "SHRG",
"HE07", "HE05", "PW01", "PW02", "PW03", "PW04", "PW05", "PW06", "PW07", "PW08",
"PW09", "PW10", "PW11", "PW12", "PW13", "PW14", "PW15", "PW16", "PW17", "PW18",
"PW20", "PW21" ];
convert(x) = x / 10; },

{ source = "LSDIAG_RT";
key = [ "VVAV", "VMFX", "VVAC" ];
convert(x) = x / 100; },

{ source = "LSDIAG_RT";
key = [ "TADV" ];
convert(x) = x / 1000000; },

{ source = "LSDIAG_RT";
key = [ "Z850", "D200", "TGRD", "DIVC" ];
convert(x) = x / 10000000; },

{ source = "LSDIAG_RT";
key = [ "PENC", "PENV" ];
convert(x) = x / 10 + 1000; }

{
diag_source = "CIRA_DIAG";
key = [ "(10C)", "(10KT)", "(10M/S)" ];
convert(x) = x / 10;
},
{
diag_source = "SHIPS_DIAG";
key = [ "LAT", "LON", "CSST", "RSST", "DSST", "DSTA", "XDST", "XNST", "NSST", "NSTA",
"NTMX", "NTFR", "U200", "U20C", "V20C", "E000", "EPOS", "ENEG", "EPSS", "ENSS",
"T000", "TLAT", "TLON", "TWAC", "TWXC", "G150", "G200", "G250", "V000", "V850",
"V500", "V300", "SHDC", "SHGC", "T150", "T200", "T250", "SHRD", "SHRS", "SHRG",
"HE07", "HE05", "PW01", "PW02", "PW03", "PW04", "PW05", "PW06", "PW07", "PW08",
"PW09", "PW10", "PW11", "PW12", "PW13", "PW14", "PW15", "PW16", "PW17", "PW18",
"PW20", "PW21" ];
convert(x) = x / 10;
},
{
diag_source = "SHIPS_DIAG";
key = [ "VVAV", "VMFX", "VVAC" ];
convert(x) = x / 100;
},
{
diag_source = "SHIPS_DIAG";
key = [ "TADV" ];
convert(x) = x / 1000000;
},
{
diag_source = "SHIPS_DIAG";
key = [ "Z850", "D200", "TGRD", "DIVC" ];
convert(x) = x / 10000000;
},
{
diag_source = "SHIPS_DIAG";
key = [ "PENC", "PENV" ];
convert(x) = x / 10 + 1000;
}
];

//
Expand Down
109 changes: 65 additions & 44 deletions docs/Users_Guide/tc-pairs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Required arguments for tc_pairs
Optional arguments for tc_pairs
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

5. The **-diag source path** argument indicates the TC-Pairs acceptable format data containing the tropical cyclone diagnostics dataset corresponding to the adeck tracks. The **source** can be set to TCDIAG, LSDIAG_RT, or LSDIAG_DEV to indicate the input diagnostics data source. The **path** argument specifies the name of a TC-Pairs acceptable format file or top-level directory containing TC-Pairs acceptable format files ending in ".dat" to be processed.
5. The **-diag source path** argument indicates the TC-Pairs acceptable format data containing the tropical cyclone diagnostics dataset corresponding to the adeck tracks. The **source** can be set to CIRA_DIAG_RT and SHIPS_DIAG_RT to indicate the input diagnostics data source. The **path** argument specifies the name of a TC-Pairs acceptable format file or top-level directory containing TC-Pairs acceptable format files ending in ".dat" to be processed.

6. The -**out base** argument indicates the path of the output file base. This argument overrides the default output file base (**./out_tcmpr**).

Expand All @@ -70,8 +70,6 @@ This tool currently only supports the rapid intensification (**RI**) edeck proba

At least one **-adeck** or **-edeck** option must be specified. The **-adeck, -edeck**, and **-bdeck** options may optionally be followed with **suffix=string** to append that string to all model names found within that data source. This option may be useful when processing track data from two different sources which reuse the same model names.

The **-diag** option may optionally be followed with **model=string** to override the model name of the tracks to which those diagnostics correspond. The **string** specifies a comma-separated list of one or more ATCF ID's to which these diagnostics should be paired (e.g. **model=OFCL,SHIP**).

An example of the tc_pairs calling sequence is shown below:

.. code-block:: none
Expand Down Expand Up @@ -258,52 +256,75 @@ ____________________

.. code-block:: none
diag_name = [];
The **diag_name** entry specifies a comma-separated list of strings for the tropical cyclone diagnostics of interest. This applies when the **-tcdiag** and/or **-lsdiag** command line options have been used to provide storm diagnostics data. If a non-zero list of diagnostic names is specified, only those diagnostics appearing in the list are written to the TCDIAG output line type. If defined as an empty list (default), all diagnostics found in the input are written to the TCDIAG output lines.

A TCMPR line is written to the output for each track point. If diagnostics data is also defined for that track point, a TCDIAG line is written immediately after the corresponding TCMPR line. The contents of that TCDIAG line is determined by diagnostic names requested in the **diag_name** entry.
diag_info_map = [
{
diag_source = "CIRA_DIAG_RT";
track_source = "GFS";
field_source = "GFS_0p50";
match_to_track = [ "GFS" ];
diag_name = [];
},
{
diag_source = "SHIPS_DIAG_RT";
track_source = "OFCL";
field_source = "GFS_0p50";
match_to_track = [ "OFCL" ];
diag_name = [];
}
];
A TCMPR line is written to the output for each track point. If diagnostics data is also defined for that track point, a TCDIAG line is written immediately after the corresponding TCMPR line. The contents of that TCDIAG line is determined by the **diag_info_map** entry.

The **diag_info_map** entries define how the diagnostics read with the **-diag** command line option should be used. Each array element is a dictionary consisting of entries for **diag_source**, **track_source**, **field_source**, **match_to_track**, and **diag_name**.

The **diag_source** entry is one of the supported diagnostics data sources. The **track_source** entry is a string defining the ATCF ID of the track data used to define the locations at which diagnostics are computed. This string is written to the **TRACK_SOURCE** column of the TCDIAG output line. The **field_source** entry is a string describing the gridded data over which the diagnostic are computed. This string is written to the **FIELD_SOURCE** column of the TCDIAG output line type. The **match_to_track** entry specifies a comma-separated list of strings defining the ATCF ID(s) of the tracks to which these diagnostic values should be matched. The **diag_name** entry specifies a comma-separated list of strings for the tropical cyclone diagnostics of interest. If a non-zero list of diagnostic names is specified, only those diagnostics appearing in the list are written to the TCDIAG output line type. If defined as an empty list (default), all diagnostics found in the input are written to the TCDIAG output lines.

____________________

.. code-block:: none
diag_convert_map = [
{ source = "TCDIAG";
key = [ "(10C)", "(10KT)", "(10M/S)" ];
convert(x) = x / 10; },
{ source = "LSDIAG_RT";
key = [ "LAT", "LON", "CSST", "RSST", "DSST", "DSTA", "XDST", "XNST", "NSST", "NSTA",
"NTMX", "NTFR", "U200", "U20C", "V20C", "E000", "EPOS", "ENEG", "EPSS", "ENSS",
"T000", "TLAT", "TLON", "TWAC", "TWXC", "G150", "G200", "G250", "V000", "V850",
"V500", "V300", "SHDC", "SHGC", "T150", "T200", "T250", "SHRD", "SHRS", "SHRG",
"HE07", "HE05", "PW01", "PW02", "PW03", "PW04", "PW05", "PW06", "PW07", "PW08",
"PW09", "PW10", "PW11", "PW12", "PW13", "PW14", "PW15", "PW16", "PW17", "PW18",
"PW20", "PW21" ];
convert(x) = x / 10; },
{ source = "LSDIAG_RT";
key = [ "VVAV", "VMFX", "VVAC" ];
convert(x) = x / 100; },
{ source = "LSDIAG_RT";
key = [ "TADV" ];
convert(x) = x / 1000000; },
{ source = "LSDIAG_RT";
key = [ "Z850", "D200", "TGRD", "DIVC" ];
convert(x) = x / 10000000; },
{ source = "LSDIAG_RT";
key = [ "PENC", "PENV" ];
convert(x) = x / 10 + 1000; }
];
The **diag_convert_map** entries define conversion functions to be applied to diagnostics data read with the **-diag** command line option. Each array element is a dictionary consisting of a **source**, **key**, and **convert(x)** entry.

The **source** is one of the supported diagnostics data sources. The **key** is an array of strings. The strings can specify diagnostic names or units, although units are only checked for **TCDIAG** sources. If both the name and units are specified, the conversion function for the name takes precedence. **convert(x)** is a function of one variable which defines how the diagnostic data should be converted. The defined function is applied to any diagnostic value whose name or units appears in the **key**.
diag_convert_map = [
{
diag_source = "CIRA_DIAG";
key = [ "(10C)", "(10KT)", "(10M/S)" ];
convert(x) = x / 10;
},
{
diag_source = "SHIPS_DIAG";
key = [ "LAT", "LON", "CSST", "RSST", "DSST", "DSTA", "XDST", "XNST", "NSST", "NSTA",
"NTMX", "NTFR", "U200", "U20C", "V20C", "E000", "EPOS", "ENEG", "EPSS", "ENSS",
"T000", "TLAT", "TLON", "TWAC", "TWXC", "G150", "G200", "G250", "V000", "V850",
"V500", "V300", "SHDC", "SHGC", "T150", "T200", "T250", "SHRD", "SHRS", "SHRG",
"HE07", "HE05", "PW01", "PW02", "PW03", "PW04", "PW05", "PW06", "PW07", "PW08",
"PW09", "PW10", "PW11", "PW12", "PW13", "PW14", "PW15", "PW16", "PW17", "PW18",
"PW20", "PW21" ];
convert(x) = x / 10;
},
{
diag_source = "SHIPS_DIAG";
key = [ "VVAV", "VMFX", "VVAC" ];
convert(x) = x / 100;
},
{
diag_source = "SHIPS_DIAG";
key = [ "TADV" ];
convert(x) = x / 1000000;
},
{
diag_source = "SHIPS_DIAG";
key = [ "Z850", "D200", "TGRD", "DIVC" ];
convert(x) = x / 10000000;
},
{
diag_source = "SHIPS_DIAG";
key = [ "PENC", "PENV" ];
convert(x) = x / 10 + 1000;
}
];
The **diag_convert_map** entries define conversion functions to be applied to diagnostics data read with the **-diag** command line option. Each array element is a dictionary consisting of a **diag_source**, **key**, and **convert(x)** entry.

The **diag_source** entry is one of the supported diagnostics data sources. Partial string matching logic is applied, so **SHIPS_DIAG** entries are matched to both **SHIPS_DIAG_RT** and **SHIPS_DIAG_DEV** diagnostic sources. The **key** entry is an array of strings. The strings can specify diagnostic names or units, although units are only checked for **CIRA_DIAG** sources. If both the name and units are specified, the conversion function for the name takes precedence. The **convert(x)** entry is a function of one variable which defines how the diagnostic data should be converted. The defined function is applied to any diagnostic value whose name or units appears in the **key**.

____________________

Expand Down
17 changes: 16 additions & 1 deletion internal/test_unit/config/TCPairsConfig_DIAGNOSTICS
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,22 @@ watch_warn = {
//
// Diagnostics to be extracted
//
diag_name = [ ${DIAG_NAME} ];
diag_info_map = [
{
diag_source = "CIRA_DIAG_RT";
track_source = "GFS";
field_source = "GFS_0p50";
match_to_track = [ "GFS" ];
diag_name = [ ${CIRA_RT_DIAG_NAME} ];
},
{
diag_source = "SHIPS_DIAG_RT";
track_source = "OFCL";
field_source = "GFS_0p50";
match_to_track = [ "OFCL", "SHIP" ];
diag_name = [ ${SHIPS_RT_DIAG_NAME} ];
}
];

//
// Unit conversions to be applied based on diagnostic names and units
Expand Down
7 changes: 4 additions & 3 deletions internal/test_unit/xml/unit_tc_pairs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -188,13 +188,14 @@
<pair><name>STORM_ID</name> <value>"AL092022"</value></pair>
<pair><name>INIT_BEG</name> <value>"20220926_00"</value></pair>
<pair><name>INIT_END</name> <value>"20220926_18"</value></pair>
<pair><name>DIAG_NAME</name> <value>"DTL", "PW01", "SHRD", "TPW", "LAND", "SHR_MAG", "STM_SPD"</value></pair>
<pair><name>CIRA_RT_DIAG_NAME</name> <value>"TPW", "LAND", "SHR_MAG", "STM_SPD"</value></pair>
<pair><name>SHIPS_RT_DIAG_NAME</name> <value>"DTL", "PW01", "SHRD"</value></pair>
</env>
<param> \
-adeck &DATA_DIR;/adeck/aal092022_OFCL_SHIP_AVNO.dat \
-bdeck &DATA_DIR;/bdeck/bal092022.dat \
-diag TCDIAG &DATA_DIR;/tcdiag/2022/sal092022_avno_doper_20220926*_diag.dat \
-diag LSDIAG_RT &DATA_DIR;/lsdiag_rt/2022/220926*AL0922_lsdiag.dat model=OFCL,SHIP \
-diag CIRA_DIAG_RT &DATA_DIR;/diag/cira_diag_rt/2022/sal092022_avno_doper_20220926*_diag.dat \
-diag SHIPS_DIAG_RT &DATA_DIR;/diag/ships_diag_rt/2022/220926*AL0922_lsdiag.dat \
-config &CONFIG_DIR;/TCPairsConfig_DIAGNOSTICS \
-out &OUTPUT_DIR;/tc_pairs/al092022_20220926_DIAGNOSTICS \
-log &OUTPUT_DIR;/tc_pairs/tc_pairs_DIAGNOSTICS.log \
Expand Down
6 changes: 5 additions & 1 deletion src/basic/vx_config/config_constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -1095,9 +1095,13 @@ static const char conf_key_dland_file[] = "dland_file";
static const char conf_key_basin_file[] = "basin_file";
static const char conf_key_track_watch_warn[] = "track_watch_warn";
static const char conf_key_watch_warn[] = "watch_warn";
static const char conf_key_diag_info_map[] = "diag_info_map";
static const char conf_key_diag_source[] = "diag_source";
static const char conf_key_track_source[] = "track_source";
static const char conf_key_field_source[] = "field_source";
static const char conf_key_match_to_track[] = "match_to_track";
static const char conf_key_diag_name[] = "diag_name";
static const char conf_key_diag_convert_map[] = "diag_convert_map";
static const char conf_key_source[] = "source";
static const char conf_key_basin_map[] = "basin_map";
static const char conf_key_time_offset[] = "time_offset";
static const char conf_key_amodel[] = "amodel";
Expand Down
Loading

0 comments on commit cfd22b2

Please sign in to comment.