FlowSieve  3.4.0
FlowSieve Coarse-Graining Documentation
Constants

Provide namespace for global constants (physical and computational). More...

Namespaces

 constants
 Provide namespace for global constants (physical and computational).
 

Macros

#define DEBUG   1
 Compile-time debug setting, specified in Makefile. More...
 
#define DEBUG   1
 Compile-time debug setting, specified in Makefile. More...
 
#define DEBUG   1
 Compile-time debug setting, specified in Makefile. More...
 
#define DEBUG   1
 Compile-time debug setting, specified in Makefile. More...
 
#define DEBUG   1
 Compile-time debug setting, specified in Makefile. More...
 
#define DEBUG   1
 Compile-time debug setting, specified in Makefile. More...
 
#define DEBUG   1
 Compile-time debug setting, specified in Makefile. More...
 

Enumerations

enum  constants::ParticleRecycleType : int {
  FixedInterval, Stochastic, FixedInterval, Stochastic,
  FixedInterval, Stochastic, FixedInterval, Stochastic,
  FixedInterval, Stochastic, FixedInterval, Stochastic,
  FixedInterval, Stochastic
}
 Variable indicating what recycling scheme should be used for particles. More...
 
enum  constants::ParticleRecycleType : int {
  FixedInterval, Stochastic, FixedInterval, Stochastic,
  FixedInterval, Stochastic, FixedInterval, Stochastic,
  FixedInterval, Stochastic, FixedInterval, Stochastic,
  FixedInterval, Stochastic
}
 Variable indicating what recycling scheme should be used for particles. More...
 
enum  constants::ParticleRecycleType : int {
  FixedInterval, Stochastic, FixedInterval, Stochastic,
  FixedInterval, Stochastic, FixedInterval, Stochastic,
  FixedInterval, Stochastic, FixedInterval, Stochastic,
  FixedInterval, Stochastic
}
 Variable indicating what recycling scheme should be used for particles. More...
 
enum  constants::ParticleRecycleType : int {
  FixedInterval, Stochastic, FixedInterval, Stochastic,
  FixedInterval, Stochastic, FixedInterval, Stochastic,
  FixedInterval, Stochastic, FixedInterval, Stochastic,
  FixedInterval, Stochastic
}
 Variable indicating what recycling scheme should be used for particles. More...
 
enum  constants::ParticleRecycleType : int {
  FixedInterval, Stochastic, FixedInterval, Stochastic,
  FixedInterval, Stochastic, FixedInterval, Stochastic,
  FixedInterval, Stochastic, FixedInterval, Stochastic,
  FixedInterval, Stochastic
}
 Variable indicating what recycling scheme should be used for particles. More...
 
enum  constants::ParticleRecycleType : int {
  FixedInterval, Stochastic, FixedInterval, Stochastic,
  FixedInterval, Stochastic, FixedInterval, Stochastic,
  FixedInterval, Stochastic, FixedInterval, Stochastic,
  FixedInterval, Stochastic
}
 Variable indicating what recycling scheme should be used for particles. More...
 
enum  constants::ParticleRecycleType : int {
  FixedInterval, Stochastic, FixedInterval, Stochastic,
  FixedInterval, Stochastic, FixedInterval, Stochastic,
  FixedInterval, Stochastic, FixedInterval, Stochastic,
  FixedInterval, Stochastic
}
 Variable indicating what recycling scheme should be used for particles. More...
 

Variables

const double constants::R_earth = 6371e3
 Mean radius of the Earth. More...
 
const bool constants::USE_HIGH_PRECISION_DISTANCE = false
 If spatial resolution is very high on sphere (less than ~50 metres or so), and high presision is needed in distance calculations, turn this on. More...
 
const double constants::rho0 = 1025
 Mean fluid density. More...
 
const double constants::g = 9.81
 (constant) acceleration due to gravity. More...
 
const int constants::DiffOrd = 4
 Differentiation order for finite differencing (currently must be 2, 4, or 6). More...
 
const double constants::fill_value = -1e8
 Fill value used to indicate land values in output files. More...
 
const signed short constants::fill_value_s = -32767
 Fill value used to indicate land values in output files (signed short) More...
 
const bool constants::DEFORM_AROUND_LAND = false
 Boolean indicating whether or not the kernel should deform around land. More...
 
const bool constants::FILTER_OVER_LAND = true
 Boolean to indicate whether or not land values should be filled in with coarse-grained results. More...
 
const bool constants::ZONAL_KERNEL_ONLY = false
 
const bool constants::EXTEND_DOMAIN_TO_POLES = true
 Boolean to indicate whether or not the input domain should have the latitude extended to reach the poles. More...
 
const bool constants::CARTESIAN = false
 Boolean indicating if the coordinate system is Cartesian. (If false, then spherical) More...
 
const bool constants::PERIODIC_X = true
 Boolean indicating if the coordinate system is periodic in x / longitude. More...
 
const bool constants::PERIODIC_Y = false
 Boolean indicating if the coordinate system is periodic in y / latitute. More...
 
const bool constants::UNIFORM_LON_GRID = true
 Boolean indicating if the longitude grid is uniform. More...
 
const bool constants::UNIFORM_LAT_GRID = true
 Boolean indicating if the latitude grid is uniform. More...
 
const bool constants::FULL_LON_SPAN = true
 Boolean indicating if the provided longitude grid spans the full periodic domain. More...
 
const bool constants::COMP_VORT = true
 Boolean indicating if vorticity should be computed. More...
 
const bool constants::COMP_TRANSFERS = true
 Boolean indicating if non-linear transfers (Pi) should be computed. For coarse_grain.x, this is required to get fine (sub-filter) KE. More...
 
const bool constants::COMP_BC_TRANSFERS = false
 Boolean indicating if baroclinic transfers (Lambda^m) should be computed. More...
 
const bool constants::COMP_WIND_FORCE = false
 Boolean to indicate if wind forcing should be computing (requires supplying wind terms) More...
 
const bool constants::DO_OKUBOWEISS_ANALYSIS = false
 Boolean to indicate if post-processing should also bin by Okubo-Weiss. More...
 
const bool constants::MINIMAL_OUTPUT = true
 Boolean indicating if user wants a minimal output. More...
 
const bool constants::NO_FULL_OUTPUTS = true
 Indicates that no full fields should be produced. More...
 
const bool constants::CAST_TO_SINGLE = false
 Boolean indicating if user wants to cast to float (single) output (reduces output size by factor 2, but also reduces precision) More...
 
const bool constants::CAST_TO_INT = false
 Boolean indicating if user wants to cast to int output (further reduces output size by factor 2, but also reduces precision) More...
 
const bool constants::DO_TIMING = false
 Boolean indicating if we want to output internal timings. More...
 
const bool constants::APPLY_POSTPROCESS = true
 Boolean indicating whether or not the postprocess routines should be applied. More...
 
const bool constants::POSTPROCESS_DO_ZONAL_MEANS = true
 Boolean indicating whether or not the postprocess routines should include zonal means. More...
 
const bool constants::POSTPROCESS_DO_TIME_MEANS = false
 Boolean indicating whether or not the postprocess routines should include time means (i.e. spatial maps) More...
 
const int constants::KERNEL_OPT = 4
 Integer flag indicating the choice of kernel. More...
 
const double constants::KernPad = 2.5
 Scale factor for kernel search radius. More...
 
const std::map< std::string, std::string > constants::variable_descriptions
 A dictionary of variable descriptions to provide details in netcdf outputs. More...
 
const std::map< std::string, std::string > constants::variable_units
 A dictionary of variable units to provide details in netcdf outputs. More...
 
const std::string constants::spatial_average_description = "The lat/lon average computed over each defined region (see region dimension)."
 Human-friendly text that is added to all region-average variables in postprocessing outputs. More...
 
const std::string constants::zonal_average_description = "The zonal (longitudinal) average computed at each latitude."
 Human-friendly text that is added to all zonal-average variables in postprocessing outputs. More...
 
const std::string constants::time_average_description = "Time average over the entire provided dataset."
 Human-friendly text that is added to all time-average variables in postprocessing outputs. More...
 
const std::string constants::OkuboWeiss_average_description
 Human-friendly text that is added to all OkuboWeiss-average variables in postprocessing outputs. More...
 

Detailed Description

Provide namespace for global constants (physical and computational).

Macro Definition Documentation

◆ DEBUG [1/7]

#define DEBUG   1

Compile-time debug setting, specified in Makefile.

Parameters
DEBUGThis is an integer than generally controls how much is printed during run-time. Higher values mean more print statements.

◆ DEBUG [2/7]

#define DEBUG   1

Compile-time debug setting, specified in Makefile.

Parameters
DEBUGThis is an integer than generally controls how much is printed during run-time. Higher values mean more print statements.

◆ DEBUG [3/7]

#define DEBUG   1

Compile-time debug setting, specified in Makefile.

Parameters
DEBUGThis is an integer than generally controls how much is printed during run-time. Higher values mean more print statements.

◆ DEBUG [4/7]

#define DEBUG   1

Compile-time debug setting, specified in Makefile.

Parameters
DEBUGThis is an integer than generally controls how much is printed during run-time. Higher values mean more print statements.

◆ DEBUG [5/7]

#define DEBUG   1

Compile-time debug setting, specified in Makefile.

Parameters
DEBUGThis is an integer than generally controls how much is printed during run-time. Higher values mean more print statements.

◆ DEBUG [6/7]

#define DEBUG   1

Compile-time debug setting, specified in Makefile.

Parameters
DEBUGThis is an integer than generally controls how much is printed during run-time. Higher values mean more print statements.

◆ DEBUG [7/7]

#define DEBUG   1

Compile-time debug setting, specified in Makefile.

Parameters
DEBUGThis is an integer than generally controls how much is printed during run-time. Higher values mean more print statements.

Enumeration Type Documentation

◆ ParticleRecycleType [1/7]

Variable indicating what recycling scheme should be used for particles.

Parameters
PARTICLE_RECYCLE_TYPE

◆ ParticleRecycleType [2/7]

Variable indicating what recycling scheme should be used for particles.

Parameters
PARTICLE_RECYCLE_TYPE

◆ ParticleRecycleType [3/7]

Variable indicating what recycling scheme should be used for particles.

Parameters
PARTICLE_RECYCLE_TYPE

◆ ParticleRecycleType [4/7]

Variable indicating what recycling scheme should be used for particles.

Parameters
PARTICLE_RECYCLE_TYPE

◆ ParticleRecycleType [5/7]

Variable indicating what recycling scheme should be used for particles.

Parameters
PARTICLE_RECYCLE_TYPE

◆ ParticleRecycleType [6/7]

Variable indicating what recycling scheme should be used for particles.

Parameters
PARTICLE_RECYCLE_TYPE

◆ ParticleRecycleType [7/7]

Variable indicating what recycling scheme should be used for particles.

Parameters
PARTICLE_RECYCLE_TYPE

Variable Documentation

◆ APPLY_POSTPROCESS

const bool constants::APPLY_POSTPROCESS = true

Boolean indicating whether or not the postprocess routines should be applied.

Parameters
APPLY_POSTPROCESS

◆ CARTESIAN

const bool constants::CARTESIAN = false

Boolean indicating if the coordinate system is Cartesian. (If false, then spherical)

Parameters
CARTESIAN

◆ CAST_TO_INT

const bool constants::CAST_TO_INT = false

Boolean indicating if user wants to cast to int output (further reduces output size by factor 2, but also reduces precision)

Parameters
CAST_TO_INT

◆ CAST_TO_SINGLE

const bool constants::CAST_TO_SINGLE = false

Boolean indicating if user wants to cast to float (single) output (reduces output size by factor 2, but also reduces precision)

Parameters
CAST_TO_SINGLE

◆ COMP_BC_TRANSFERS

const bool constants::COMP_BC_TRANSFERS = false

Boolean indicating if baroclinic transfers (Lambda^m) should be computed.

Parameters
COMP_BC_TRANSFERSLambda transfers are currently in development and removed from main branch. This flag only activates PEtoKE conversion term using p and rho.

◆ COMP_TRANSFERS

const bool constants::COMP_TRANSFERS = true

Boolean indicating if non-linear transfers (Pi) should be computed. For coarse_grain.x, this is required to get fine (sub-filter) KE.

Parameters
COMP_TRANSFERS

◆ COMP_VORT

const bool constants::COMP_VORT = true

Boolean indicating if vorticity should be computed.

Parameters
COMP_VORT

◆ COMP_WIND_FORCE

const bool constants::COMP_WIND_FORCE = false

Boolean to indicate if wind forcing should be computing (requires supplying wind terms)

Parameters
COMP_WIND_FORCE

◆ DEFORM_AROUND_LAND

const bool constants::DEFORM_AROUND_LAND = false

Boolean indicating whether or not the kernel should deform around land.

Parameters
DEFORM_AROUND_LANDIf true, land is given zero weight (i.e. not factored into local average). If false, land is included in local average (treated as zero velocity

◆ DiffOrd

const int constants::DiffOrd = 4

Differentiation order for finite differencing (currently must be 2, 4, or 6).

Parameters
DiffOrd

◆ DO_OKUBOWEISS_ANALYSIS

const bool constants::DO_OKUBOWEISS_ANALYSIS = false

Boolean to indicate if post-processing should also bin by Okubo-Weiss.

Parameters
DO_OKUBOWEISS_ANALYSIS

◆ DO_TIMING

const bool constants::DO_TIMING = false

Boolean indicating if we want to output internal timings.

Parameters
DO_TIMING

◆ EXTEND_DOMAIN_TO_POLES

const bool constants::EXTEND_DOMAIN_TO_POLES = true

Boolean to indicate whether or not the input domain should have the latitude extended to reach the poles.

Parameters
EXTEND_DOMAIN_TO_POLESIf true, 'land' is added with a uniform grid spacing to make the domain reach both north and south poles If false, nothing happens.

Set to false if not on a sphere

◆ fill_value

const double constants::fill_value = -1e8

Fill value used to indicate land values in output files.

Parameters
fill_value

◆ fill_value_s

const signed short constants::fill_value_s = -32767

Fill value used to indicate land values in output files (signed short)

Parameters
fill_value_s

◆ FILTER_OVER_LAND

const bool constants::FILTER_OVER_LAND = true

Boolean to indicate whether or not land values should be filled in with coarse-grained results.

Parameters
FILTER_OVER_LANDIf true, land values are filled in with the results of coarse-graining. Masks are removed when variables are loaded and filled in with constants If false, land values are maintained as land, and masked out

Note that this does NOT affect the shape of filtering kernels.

◆ FULL_LON_SPAN

const bool constants::FULL_LON_SPAN = true

Boolean indicating if the provided longitude grid spans the full periodic domain.

Parameters
FULL_LON_SPANi.e. is the first longitude point beside the last longitude point?

This flag enables computational optimizations by allowing the kernel to simply be translated through lon, instead of having to recompute for each longitude index.

◆ g

const double constants::g = 9.81

(constant) acceleration due to gravity.

Parameters
g

◆ KERNEL_OPT

const int constants::KERNEL_OPT = 4

Integer flag indicating the choice of kernel.

Parameters
KERNEL_OPT0 = tophat 1 = Hyper gaus ( exp( -x^4 ) ) 2 = Gaus ( exp( -x^2 ) ) 3 = sinc ( sinc( pi * x ) ) 4 = tanh ( 1 - tanh( (x - 1) / (0.1) ) )

◆ KernPad

const double constants::KernPad = 2.5

Scale factor for kernel search radius.

Parameters
KernPadFilter integral applied in circle of radius (filt_scale/2) * KernPad

◆ MINIMAL_OUTPUT

const bool constants::MINIMAL_OUTPUT = true

Boolean indicating if user wants a minimal output.

Parameters
MINIMAL_OUTPUTRemoves: fine velocities, coarse/fine KE, divergences

◆ NO_FULL_OUTPUTS

const bool constants::NO_FULL_OUTPUTS = true

Indicates that no full fields should be produced.

Parameters
NO_FULL_OUTPUTSOnly results from APPLY_POSTPROCESS will be produced.

If NO_FULL_OUTPUTS and not(APPLY_POSTPROCESS), the no outputs at all will be produced, so the code will simply halt immediately.

◆ OkuboWeiss_average_description

const std::string constants::OkuboWeiss_average_description
Initial value:
= "Variable binned by Okubo-Weiss parameter (i.e. histogram). "
"Values in OkuboWeiss dimension indicate the lower bound of each bin."

Human-friendly text that is added to all OkuboWeiss-average variables in postprocessing outputs.

Parameters
OkuboWeiss_average_descriptioni.e. for variables that are averaged over OkuboWeiss bins / histograms

◆ PERIODIC_X

const bool constants::PERIODIC_X = true

Boolean indicating if the coordinate system is periodic in x / longitude.

Parameters
PERIODIC_X

◆ PERIODIC_Y

const bool constants::PERIODIC_Y = false

Boolean indicating if the coordinate system is periodic in y / latitute.

Parameters
PERIODIC_Y

◆ POSTPROCESS_DO_TIME_MEANS

const bool constants::POSTPROCESS_DO_TIME_MEANS = false

Boolean indicating whether or not the postprocess routines should include time means (i.e. spatial maps)

Parameters
POSTPROCESS_DO_TIME_MEANS

◆ POSTPROCESS_DO_ZONAL_MEANS

const bool constants::POSTPROCESS_DO_ZONAL_MEANS = true

Boolean indicating whether or not the postprocess routines should include zonal means.

Parameters
POSTPROCESS_DO_ZONAL_MEANS

◆ R_earth

const double constants::R_earth = 6371e3

Mean radius of the Earth.

Parameters
R_earth

◆ rho0

const double constants::rho0 = 1025

Mean fluid density.

Parameters
rho0

◆ spatial_average_description

const std::string constants::spatial_average_description = "The lat/lon average computed over each defined region (see region dimension)."

Human-friendly text that is added to all region-average variables in postprocessing outputs.

Parameters
spatial_average_description

◆ time_average_description

const std::string constants::time_average_description = "Time average over the entire provided dataset."

Human-friendly text that is added to all time-average variables in postprocessing outputs.

Parameters
time_average_description

◆ UNIFORM_LAT_GRID

const bool constants::UNIFORM_LAT_GRID = true

Boolean indicating if the latitude grid is uniform.

Parameters
UNIFORM_LAT_GRID

◆ UNIFORM_LON_GRID

const bool constants::UNIFORM_LON_GRID = true

Boolean indicating if the longitude grid is uniform.

Parameters
UNIFORM_LON_GRID

◆ USE_HIGH_PRECISION_DISTANCE

const bool constants::USE_HIGH_PRECISION_DISTANCE = false

If spatial resolution is very high on sphere (less than ~50 metres or so), and high presision is needed in distance calculations, turn this on.

Parameters
USE_HIGH_PRECISION_DISTANCEThe default spherical distance caluclation, spherical law of cosines, has floating point errors for small distances (a couple metres or so). However, so long as your grid is very high resolution, this shouldn't be an issue. This is particularly true if: you are also using a continuous kernel and the filtering scales themselves also aren't very short (couple of metres or so).

The test routine (Tests/distance_formulas.cpp) uses both methods on a specified grid and outputs the result. If you think you might need the high precision scheme, test it out there first.

◆ variable_descriptions

const std::map< std::string, std::string > constants::variable_descriptions
Initial value:
= {
{ "coarse_u_r", "Coarse-grained vertical/radial velocity." },
{ "coarse_u_lon", "Coarse-grained zonal velocity." },
{ "coarse_u_lat", "Coarse-grained meridional velocity." },
{ "coarse_KE", "Kinetic energy of coarse-grained velocity" },
{ "fine_KE", "Small-scale kinetic energy ( filter(KE(u)) - KE(filter(u)) )" },
{ "enstrophy", "Enstrophy of coarse-grained velocity" },
{ "Pi", "Non-linear energy transfer from large-scales to small-scales" },
{ "Z", "Non-linear enstrophy transfer from large-scales to small-scales" },
{ "OkuboWeiss", "Okubo-Weiss parameter ( positive -> strain dominated, negative -> vortex dominated )" },
{ "div_Jtransport", "divergence of energy transport term" },
{ "coarse_vort_r", "Radial (z) vorticity of coarse-grained velocity." },
{ "coarse_vel_div", "Divergence of the coarse-grained velocity" }
}

A dictionary of variable descriptions to provide details in netcdf outputs.

Parameters
variable_descriptions

◆ variable_units

const std::map< std::string, std::string > constants::variable_units
Initial value:
= {
{ "coarse_u_r", "m / s" },
{ "coarse_u_lon", "m / s" },
{ "coarse_u_lat", "m / s" },
{ "coarse_KE", "J / (m^3)" },
{ "fine_KE", "J / (m^3)" },
{ "enstrophy", "J / (m^5)" },
{ "Pi", "Watt / (m^3)" },
{ "Z", "Watt / (m^5)" },
{ "OkuboWeiss", "1 / (s^2)" },
{ "div_Jtransport", "Watt / (m^3)" },
{ "coarse_vort_r", "1 / s" },
{ "coarse_vel_div", "1 / s" }
}

A dictionary of variable units to provide details in netcdf outputs.

Parameters
variable_units

◆ zonal_average_description

const std::string constants::zonal_average_description = "The zonal (longitudinal) average computed at each latitude."

Human-friendly text that is added to all zonal-average variables in postprocessing outputs.

Parameters
zonal_average_description

◆ ZONAL_KERNEL_ONLY

const bool constants::ZONAL_KERNEL_ONLY = false
Parameters
ZONAL_KERNEL_ONLY