FlowSieve  3.0.0
Coarse Graining Routines
/home/docs/checkouts/readthedocs.org/user_builds/flowsieve/checkouts/read_the_docs_testing/constants.hpp
Go to the documentation of this file.
1 #ifndef CONSTANTS_HPP
2 #define CONSTANTS_HPP 1
3 
4 #include <map>
5 
6 // Default debug value
7 #ifndef DEBUG
8  #define DEBUG 1
9 #endif
10 
35 namespace constants
36 {
37 
43  const double R_earth = 6371e3;
44 
60  const bool USE_HIGH_PRECISION_DISTANCE = false;
61 
67  const double rho0 = 1025;
68 
74  const double g = 9.81;
75 
81  const int DiffOrd = 4;
82 
88  const double fill_value = -1e8;
89 
95  const signed short fill_value_s = -32767;
96 
105  const bool DEFORM_AROUND_LAND = false;
106 
118  const bool FILTER_OVER_LAND = false;
119 
125  const bool ZONAL_KERNEL_ONLY = false;
126 
136  const bool EXTEND_DOMAIN_TO_POLES = true;
137 
143  const bool CARTESIAN = false;
144 
151  const bool PERIODIC_X = true;
152 
158  const bool PERIODIC_Y = false;
159 
165  const bool UNIFORM_LON_GRID = true;
166 
172  const bool UNIFORM_LAT_GRID = true;
173 
185  const bool FULL_LON_SPAN = true;
186 
192  const bool COMP_VORT = true;
193 
200  const bool COMP_TRANSFERS = true;
201  const bool COMP_PI_HELMHOLTZ = false;
202 
208  const bool COMP_BC_TRANSFERS = false;
209 
215  const bool DO_OKUBOWEISS_ANALYSIS = false;
216 
225  const bool MINIMAL_OUTPUT = false;
226 
238  const bool NO_FULL_OUTPUTS = false;
239 
247  const bool CAST_TO_SINGLE = true;
248 
256  const bool CAST_TO_INT = false;
257 
263  const bool DO_TIMING = false;
264 
270  const bool APPLY_POSTPROCESS = false;
271 
277  const bool POSTPROCESS_DO_ZONAL_MEANS = true;
278 
284  const bool POSTPROCESS_DO_TIME_MEANS = true;
285 
297  const int KERNEL_OPT = 4;
298 
307  const double KernPad = 2.5;
308  /*
309  switch (KERNEL_OPT) {
310  case 0: const double KernPad = 1.1;
311  case 1: const double KernPad = 2.5; // exp(-2.5^4) ~1e-17
312  case 2: const double KernPad = 5.; // exp(-5^2) ~1e-11
313  case 3: const double KernPad = -1.;
314  case 4: const double KernPad = 2.5;
315  }
316  */
317 
318 
325  const std::map< std::string, std::string > variable_descriptions = {
326  { "coarse_u_r", "Coarse-grained vertical/radial velocity." },
327  { "coarse_u_lon", "Coarse-grained zonal velocity." },
328  { "coarse_u_lat", "Coarse-grained meridional velocity." },
329  { "coarse_KE", "Kinetic energy of coarse-grained velocity" },
330  { "fine_KE", "Small-scale kinetic energy ( filter(KE(u)) - KE(filter(u)) )" },
331  { "enstrophy", "Enstrophy of coarse-grained velocity" },
332  { "Pi", "Non-linear energy transfer from large-scales to small-scales" },
333  { "Z", "Non-linear enstrophy transfer from large-scales to small-scales" },
334  { "OkuboWeiss", "Okubo-Weiss parameter ( positive -> strain dominated, negative -> vortex dominated )" },
335  { "div_Jtransport", "divergence of energy transport term" },
336  { "coarse_vort_r", "Radial (z) vorticity of coarse-grained velocity." },
337  { "coarse_vel_div", "Divergence of the coarse-grained velocity" }
338  };
339 
346  const std::map< std::string, std::string > variable_units = {
347  { "coarse_u_r", "m / s" },
348  { "coarse_u_lon", "m / s" },
349  { "coarse_u_lat", "m / s" },
350  { "coarse_KE", "J / (m^3)" },
351  { "fine_KE", "J / (m^3)" },
352  { "enstrophy", "J / (m^5)" },
353  { "Pi", "Watt / (m^3)" },
354  { "Z", "Watt / (m^5)" },
355  { "OkuboWeiss", "1 / (s^2)" },
356  { "div_Jtransport", "Watt / (m^3)" },
357  { "coarse_vort_r", "1 / s" },
358  { "coarse_vel_div", "1 / s" }
359  };
360 
361  const std::string spatial_average_description = "The lat/lon average computed over each defined region (see region dimension).";
362  const std::string zonal_average_description = "The zonal (longitudinal) average computed at each latitude.";
363  const std::string time_average_description = "Time average over the entire provided dataset.";
364  const std::string OkuboWeiss_average_description = "Variable binned by Okubo-Weiss parameter (i.e. histogram). "
365  "Values in OkuboWeiss dimension indicate the lower bound of each bin.";
366 
367 }
370 #endif
const double fill_value
Fill value used to indicate land values in output files.
Definition: constants.hpp:88
const bool DEFORM_AROUND_LAND
Boolean indicating whether or not the kernel should deform around land.
Definition: constants.hpp:105
const double rho0
Mean fluid density.
Definition: constants.hpp:67
const bool COMP_VORT
Boolean indicating if vorticity should be computed.
Definition: constants.hpp:192
const bool CARTESIAN
Boolean indicating if the coordinate system is Cartesian. (If false, then spherical) ...
Definition: constants.hpp:143
const bool FULL_LON_SPAN
Boolean indicating if the provided longitude grid spans the full periodic domain. ...
Definition: constants.hpp:185
const bool MINIMAL_OUTPUT
Boolean indicating if user wants a minimal output.
Definition: constants.hpp:225
const bool NO_FULL_OUTPUTS
Indicates that no full fields should be produced.
Definition: constants.hpp:238
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:247
Definition: constants.hpp:35
const signed short fill_value_s
Fill value used to indicate land values in output files (signed short)
Definition: constants.hpp:95
const bool UNIFORM_LAT_GRID
Boolean indicating if the latitude grid is uniform.
Definition: constants.hpp:172
const bool DO_OKUBOWEISS_ANALYSIS
Boolean to indicate if post-processing should also bin by Okubo-Weiss.
Definition: constants.hpp:215
const int DiffOrd
Differentiation order for finite differencing (currently must be 2, 4, or 6).
Definition: constants.hpp:81
const bool POSTPROCESS_DO_TIME_MEANS
Boolean indicating whether or not the postprocess routines should include time means (i...
Definition: constants.hpp:284
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:256
const std::map< std::string, std::string > variable_units
A dictionary of variable units to provide details in netcdf outputs.
Definition: constants.hpp:346
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:136
const bool POSTPROCESS_DO_ZONAL_MEANS
Boolean indicating whether or not the postprocess routines should include zonal means.
Definition: constants.hpp:277
const bool COMP_BC_TRANSFERS
Boolean indicating if baroclinic transfers (Lambda^m) should be computed.
Definition: constants.hpp:208
const bool PERIODIC_X
Boolean indicating if the coordinate system is periodic in x / longitude.
Definition: constants.hpp:151
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:60
const double KernPad
Scale factor for kernel search radius.
Definition: constants.hpp:307
const std::map< std::string, std::string > variable_descriptions
A dictionary of variable descriptions to provide details in netcdf outputs.
Definition: constants.hpp:325
const double R_earth
Mean radius of the Earth.
Definition: constants.hpp:43
const bool UNIFORM_LON_GRID
Boolean indicating if the longitude grid is uniform.
Definition: constants.hpp:165
const bool PERIODIC_Y
Boolean indicating if the coordinate system is periodic in y / latitute.
Definition: constants.hpp:158
const bool DO_TIMING
Boolean indicating if we want to output internal timings.
Definition: constants.hpp:263
const double g
(constant) acceleration due to gravity.
Definition: constants.hpp:74
const bool ZONAL_KERNEL_ONLY
Definition: constants.hpp:125
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:200
const bool FILTER_OVER_LAND
Boolean to indicate whether or not land values should be filled in with coarse-grained results...
Definition: constants.hpp:118
const bool APPLY_POSTPROCESS
Boolean indicating whether or not the postprocess routines should be applied.
Definition: constants.hpp:270
const int KERNEL_OPT
Integer flag indicating the choice of kernel.
Definition: constants.hpp:297