FlowSieve  3.4.0
FlowSieve Coarse-Graining Documentation
constants.hpp
Go to the documentation of this file.
1 #ifndef CONSTANTS_HPP
2 #define CONSTANTS_HPP 1
3 
4 #include <map>
5 #include <string>
6 
16 #ifndef DEBUG
17  #define DEBUG 1
18 #endif
19 
44 namespace constants
45 {
46 
52  const double R_earth = 6371e3;
53 
69  const bool USE_HIGH_PRECISION_DISTANCE = false;
70 
76  const double rho0 = 1025;
77 
83  const double g = 9.81;
84 
90  const int DiffOrd = 4;
91 
97  const double fill_value = -1e8;
98 
104  const signed short fill_value_s = -32767;
105 
114  const bool DEFORM_AROUND_LAND = false;
115 
127  const bool FILTER_OVER_LAND = true;
128 
134  const bool ZONAL_KERNEL_ONLY = false;
135 
147  const bool EXTEND_DOMAIN_TO_POLES = true;
148 
154  const bool CARTESIAN = false;
155 
162  const bool PERIODIC_X = true;
163 
169  const bool PERIODIC_Y = false;
170 
176  const bool UNIFORM_LON_GRID = true;
177 
183  const bool UNIFORM_LAT_GRID = true;
184 
196  const bool FULL_LON_SPAN = true;
197 
203  const bool COMP_VORT = true;
204 
211  const bool COMP_TRANSFERS = true;
212  const bool COMP_PI_HELMHOLTZ = false;
213 
223  const bool COMP_BC_TRANSFERS = false;
224 
230  const bool COMP_WIND_FORCE = false;
231 
237  const bool DO_OKUBOWEISS_ANALYSIS = false;
238 
247  const bool MINIMAL_OUTPUT = true;
248 
260  const bool NO_FULL_OUTPUTS = true;
261 
269  const bool CAST_TO_SINGLE = false;
270 
278  const bool CAST_TO_INT = false;
279 
285  const bool DO_TIMING = false;
286 
292  const bool APPLY_POSTPROCESS = true;
293 
299  const bool POSTPROCESS_DO_ZONAL_MEANS = true;
300 
306  const bool POSTPROCESS_DO_TIME_MEANS = false;
307 
319  const int KERNEL_OPT = 4;
320 
329  const double KernPad = 2.5;
330  /*
331  switch (KERNEL_OPT) {
332  case 0: const double KernPad = 1.1;
333  case 1: const double KernPad = 2.5; // exp(-2.5^4) ~1e-17
334  case 2: const double KernPad = 5.; // exp(-5^2) ~1e-11
335  case 3: const double KernPad = -1.;
336  case 4: const double KernPad = 2.5;
337  }
338  */
339 
345  enum ParticleRecycleType : int { FixedInterval, Stochastic };
346  const int PARTICLE_RECYCLE_TYPE = ParticleRecycleType::FixedInterval;
347 
348 
355  const std::map< std::string, std::string > variable_descriptions = {
356  { "coarse_u_r", "Coarse-grained vertical/radial velocity." },
357  { "coarse_u_lon", "Coarse-grained zonal velocity." },
358  { "coarse_u_lat", "Coarse-grained meridional velocity." },
359  { "coarse_KE", "Kinetic energy of coarse-grained velocity" },
360  { "fine_KE", "Small-scale kinetic energy ( filter(KE(u)) - KE(filter(u)) )" },
361  { "enstrophy", "Enstrophy of coarse-grained velocity" },
362  { "Pi", "Non-linear energy transfer from large-scales to small-scales" },
363  { "Z", "Non-linear enstrophy transfer from large-scales to small-scales" },
364  { "OkuboWeiss", "Okubo-Weiss parameter ( positive -> strain dominated, negative -> vortex dominated )" },
365  { "div_Jtransport", "divergence of energy transport term" },
366  { "coarse_vort_r", "Radial (z) vorticity of coarse-grained velocity." },
367  { "coarse_vel_div", "Divergence of the coarse-grained velocity" }
368  };
369 
376  const std::map< std::string, std::string > variable_units = {
377  { "coarse_u_r", "m / s" },
378  { "coarse_u_lon", "m / s" },
379  { "coarse_u_lat", "m / s" },
380  { "coarse_KE", "J / (m^3)" },
381  { "fine_KE", "J / (m^3)" },
382  { "enstrophy", "J / (m^5)" },
383  { "Pi", "Watt / (m^3)" },
384  { "Z", "Watt / (m^5)" },
385  { "OkuboWeiss", "1 / (s^2)" },
386  { "div_Jtransport", "Watt / (m^3)" },
387  { "coarse_vort_r", "1 / s" },
388  { "coarse_vel_div", "1 / s" }
389  };
390 
391 
398  const std::string spatial_average_description = "The lat/lon average computed over each defined region (see region dimension).";
399 
406  const std::string zonal_average_description = "The zonal (longitudinal) average computed at each latitude.";
407 
414  const std::string time_average_description = "Time average over the entire provided dataset.";
415 
424  const std::string OkuboWeiss_average_description = "Variable binned by Okubo-Weiss parameter (i.e. histogram). "
425  "Values in OkuboWeiss dimension indicate the lower bound of each bin.";
426 
427 }
430 #endif
const double fill_value
Fill value used to indicate land values in output files.
Definition: constants.hpp:97
const bool DEFORM_AROUND_LAND
Boolean indicating whether or not the kernel should deform around land.
Definition: constants.hpp:114
const double rho0
Mean fluid density.
Definition: constants.hpp:76
const bool COMP_VORT
Boolean indicating if vorticity should be computed.
Definition: constants.hpp:203
const std::string zonal_average_description
Human-friendly text that is added to all zonal-average variables in postprocessing outputs...
Definition: constants.hpp:406
const std::string time_average_description
Human-friendly text that is added to all time-average variables in postprocessing outputs...
Definition: constants.hpp:414
const bool CARTESIAN
Boolean indicating if the coordinate system is Cartesian. (If false, then spherical) ...
Definition: constants.hpp:154
const bool FULL_LON_SPAN
Boolean indicating if the provided longitude grid spans the full periodic domain. ...
Definition: constants.hpp:196
const bool MINIMAL_OUTPUT
Boolean indicating if user wants a minimal output.
Definition: constants.hpp:247
const bool NO_FULL_OUTPUTS
Indicates that no full fields should be produced.
Definition: constants.hpp:260
const std::string spatial_average_description
Human-friendly text that is added to all region-average variables in postprocessing outputs...
Definition: constants.hpp:398
const bool CAST_TO_SINGLE
Boolean indicating if user wants to cast to float (single) output (reduces output size by factor 2...
Definition: constants.hpp:269
Provide namespace for global constants (physical and computational).
const signed short fill_value_s
Fill value used to indicate land values in output files (signed short)
Definition: constants.hpp:104
const bool UNIFORM_LAT_GRID
Boolean indicating if the latitude grid is uniform.
Definition: constants.hpp:183
const bool DO_OKUBOWEISS_ANALYSIS
Boolean to indicate if post-processing should also bin by Okubo-Weiss.
Definition: constants.hpp:237
const int DiffOrd
Differentiation order for finite differencing (currently must be 2, 4, or 6).
Definition: constants.hpp:90
const bool COMP_WIND_FORCE
Boolean to indicate if wind forcing should be computing (requires supplying wind terms) ...
Definition: constants.hpp:230
const bool POSTPROCESS_DO_TIME_MEANS
Boolean indicating whether or not the postprocess routines should include time means (i...
Definition: constants.hpp:306
const bool CAST_TO_INT
Boolean indicating if user wants to cast to int output (further reduces output size by factor 2...
Definition: constants.hpp:278
const std::map< std::string, std::string > variable_units
A dictionary of variable units to provide details in netcdf outputs.
Definition: constants.hpp:376
ParticleRecycleType
Variable indicating what recycling scheme should be used for particles.
Definition: constants.hpp:345
const bool EXTEND_DOMAIN_TO_POLES
Boolean to indicate whether or not the input domain should have the latitude extended to reach the po...
Definition: constants.hpp:147
const bool POSTPROCESS_DO_ZONAL_MEANS
Boolean indicating whether or not the postprocess routines should include zonal means.
Definition: constants.hpp:299
const bool COMP_BC_TRANSFERS
Boolean indicating if baroclinic transfers (Lambda^m) should be computed.
Definition: constants.hpp:223
const bool PERIODIC_X
Boolean indicating if the coordinate system is periodic in x / longitude.
Definition: constants.hpp:162
const bool USE_HIGH_PRECISION_DISTANCE
If spatial resolution is very high on sphere (less than ~50 metres or so), and high presision is need...
Definition: constants.hpp:69
const double KernPad
Scale factor for kernel search radius.
Definition: constants.hpp:329
const std::map< std::string, std::string > variable_descriptions
A dictionary of variable descriptions to provide details in netcdf outputs.
Definition: constants.hpp:355
const double R_earth
Mean radius of the Earth.
Definition: constants.hpp:52
const bool UNIFORM_LON_GRID
Boolean indicating if the longitude grid is uniform.
Definition: constants.hpp:176
const bool PERIODIC_Y
Boolean indicating if the coordinate system is periodic in y / latitute.
Definition: constants.hpp:169
const bool DO_TIMING
Boolean indicating if we want to output internal timings.
Definition: constants.hpp:285
const double g
(constant) acceleration due to gravity.
Definition: constants.hpp:83
const bool ZONAL_KERNEL_ONLY
Definition: constants.hpp:134
const std::string OkuboWeiss_average_description
Human-friendly text that is added to all OkuboWeiss-average variables in postprocessing outputs...
Definition: constants.hpp:424
const bool COMP_TRANSFERS
Boolean indicating if non-linear transfers (Pi) should be computed. For coarse_grain.x, this is required to get fine (sub-filter) KE.
Definition: constants.hpp:211
const bool FILTER_OVER_LAND
Boolean to indicate whether or not land values should be filled in with coarse-grained results...
Definition: constants.hpp:127
const bool APPLY_POSTPROCESS
Boolean indicating whether or not the postprocess routines should be applied.
Definition: constants.hpp:292
const int KERNEL_OPT
Integer flag indicating the choice of kernel.
Definition: constants.hpp:319