TECA
The Toolkit for Extreme Climate Analysis
teca_tc_candidates.h
1 #ifndef teca_tc_candidates_h
2 #define teca_tc_candidates_h
3 
4 #include "teca_config.h"
5 #include "teca_shared_object.h"
6 #include "teca_algorithm.h"
7 #include "teca_metadata.h"
8 
9 #include <string>
10 #include <vector>
11 
12 TECA_SHARED_OBJECT_FORWARD_DECL(teca_tc_candidates)
13 
14 /// GFDL tropical storms detection algorithm.
15 /**
16  * For more information see
17  * "Seasonal forecasting of tropical storms using coupled GCM integrations"
18  *
19  * --- INPUT
20  * Gwind - wind speed at 850 mb
21  * Gvort - vorticity_850mb at 850 mb
22  * Gtbar - mean core_temperature for warm core layer
23  * Gpsl - sea level sea_level_pressure
24  * Gthick - thickness of 200 to 1000 mb layer
25  * Grlon - longitudes
26  * Grlat - latitudes
27  * iyear - year
28  * imon - month
29  * iday - day of month
30  * ihour - hour
31  * iucy - unit for output
32  *
33  * --- OUTPUT
34  * --- record # 1
35  * num0 - day
36  * imon0 - month
37  * iyear - year
38  * number - number of cyclones found
39  * --- records # 2...number+1
40  * idex, jdex - (i,j) index of cyclone
41  * svort_max - max vorticity_850mb
42  * swind_max - max wind
43  * spsl_min - min sea level sea_level_pressure
44  * svort_lon, svort_lat - longitude & latitude of max vorticity_850mb
45  * spsl_lon, spsl_lat - longitude & latitude of min slp
46  * stemperature_lon, stemperature_lat - longitude & latitude of warm
47  * core
48  * sthick_lon, sthick_lat - longitude & latitude of max thickness
49  */
51 {
52 public:
53  TECA_ALGORITHM_STATIC_NEW(teca_tc_candidates)
54  TECA_ALGORITHM_DELETE_COPY_ASSIGN(teca_tc_candidates)
55  TECA_ALGORITHM_CLASS_NAME(teca_tc_candidates)
57 
58  // report/initialize to/from Boost program options
59  // objects.
60  TECA_GET_ALGORITHM_PROPERTIES_DESCRIPTION()
61  TECA_SET_ALGORITHM_PROPERTIES()
62 
63  // set/get the name of input variables
64  TECA_ALGORITHM_PROPERTY(std::string, surface_wind_speed_variable)
65  TECA_ALGORITHM_PROPERTY(std::string, vorticity_850mb_variable)
66  TECA_ALGORITHM_PROPERTY(std::string, sea_level_pressure_variable)
67  TECA_ALGORITHM_PROPERTY(std::string, core_temperature_variable)
68  TECA_ALGORITHM_PROPERTY(std::string, thickness_variable)
69 
70  // a candidate is defined as having:
71  // 1) a local maximum in vorticity above vorticty_850mb_threshold,
72  // centered on a window of vorticty_850mb_window degrees
73  // 2) a local minimum in pressure within max_core_radius degrees
74  // 3) having max pressure delta within max_pressure_radius at
75  // that location
76  TECA_ALGORITHM_PROPERTY(double, max_core_radius)
77  TECA_ALGORITHM_PROPERTY(double, min_vorticity_850mb)
78  TECA_ALGORITHM_PROPERTY(double, vorticity_850mb_window)
79  TECA_ALGORITHM_PROPERTY(double, max_pressure_delta)
80  TECA_ALGORITHM_PROPERTY(double, max_pressure_radius)
81 
82  // these criteria are recorded here but only used in the trajectory
83  // stitching stage.
84  TECA_ALGORITHM_PROPERTY(double, max_core_temperature_delta)
85  TECA_ALGORITHM_PROPERTY(double, max_core_temperature_radius)
86  TECA_ALGORITHM_PROPERTY(double, max_thickness_delta)
87  TECA_ALGORITHM_PROPERTY(double, max_thickness_radius)
88 
89  // set/get the bounding box to search for storms
90  // in units of degrees lat,lon
91  TECA_ALGORITHM_PROPERTY(double, search_lat_low)
92  TECA_ALGORITHM_PROPERTY(double, search_lat_high)
93  TECA_ALGORITHM_PROPERTY(double, search_lon_low)
94  TECA_ALGORITHM_PROPERTY(double, search_lon_high)
95 
96  // set/get the number of iterations to search for the
97  // storm local minimum. raising this parameter might increase
98  // detections but the detector will run slower. default is
99  // 50.
100  TECA_ALGORITHM_PROPERTY(int, minimizer_iterations)
101 
102  // send human readable representation to the
103  // stream
104  virtual void to_stream(std::ostream &os) const override;
105 
106 protected:
108 
109  // helper that computes the output extent
110  int get_active_extent(
111  const const_p_teca_variant_array &lat,
112  const const_p_teca_variant_array &lon,
113  std::vector<unsigned long> &extent) const;
114 
115 private:
116  using teca_algorithm::get_output_metadata;
117 
118  teca_metadata get_output_metadata(
119  unsigned int port,
120  const std::vector<teca_metadata> &input_md) override;
121 
122  std::vector<teca_metadata> get_upstream_request(
123  unsigned int port,
124  const std::vector<teca_metadata> &input_md,
125  const teca_metadata &request) override;
126 
127  const_p_teca_dataset execute(
128  unsigned int port,
129  const std::vector<const_p_teca_dataset> &input_data,
130  const teca_metadata &request) override;
131 
132 private:
133  std::string surface_wind_speed_variable;
134  std::string vorticity_850mb_variable;
135  std::string sea_level_pressure_variable;
136  std::string core_temperature_variable;
137  std::string thickness_variable;
138 
139  double max_core_radius;
140  double min_vorticity_850mb;
141  double vorticity_850mb_window;
142  double max_pressure_delta;
143  double max_pressure_radius;
144  double max_core_temperature_delta;
145  double max_core_temperature_radius;
146  double max_thickness_delta;
147  double max_thickness_radius;
148 
149  double search_lat_low;
150  double search_lat_high;
151  double search_lon_low;
152  double search_lon_high;
153 
154  int minimizer_iterations;
155 };
156 
157 #endif
teca_metadata
A generic container for meta data in the form of name=value pairs.
Definition: teca_metadata.h:21
const_p_teca_variant_array
std::shared_ptr< const teca_variant_array > const_p_teca_variant_array
Definition: teca_variant_array.h:27
teca_shared_object.h
teca_tc_candidates
GFDL tropical storms detection algorithm.
Definition: teca_tc_candidates.h:50
teca_error::TECA_EXPORT
p_teca_error_handler error_handler TECA_EXPORT
The global error handler instance.
teca_algorithm
The interface to TECA pipeline architecture.
Definition: teca_algorithm.h:237