ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERF_StationSampler.H File Reference
#include <algorithm>
#include <cmath>
#include <string>
#include <AMReX_BoxArray.H>
#include <AMReX_REAL.H>
#include <AMReX_Vector.H>
#include "ERF_LatLonMap.H"
Include dependency graph for ERF_StationSampler.H:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  StationVar
 
struct  StationLoc
 
struct  StationColumn
 
struct  Station
 
class  StationSampler
 

Enumerations

enum class  StationEarthWind {
  None , UEast , VNorth , WindSpeed ,
  WindDir
}
 

Functions

StationEarthWind station_earth_wind_from_name (const std::string &name)
 
amrex::Real station_bilinear_skip_missing (amrex::Real v00, amrex::Real v10, amrex::Real v01, amrex::Real v11, amrex::Real wx, amrex::Real wy, amrex::Real missing_value)
 

Enumeration Type Documentation

◆ StationEarthWind

enum StationEarthWind
strong
Enumerator
None 
UEast 
VNorth 
WindSpeed 
WindDir 

Function Documentation

◆ station_bilinear_skip_missing()

amrex::Real station_bilinear_skip_missing ( amrex::Real  v00,
amrex::Real  v10,
amrex::Real  v01,
amrex::Real  v11,
amrex::Real  wx,
amrex::Real  wy,
amrex::Real  missing_value 
)
inline
99 {
100  const amrex::Real v[4] = {v00, v10, v01, v11};
101  const amrex::Real w[4] = {(amrex::Real(1.0)-wx)*(amrex::Real(1.0)-wy),
102  wx*(amrex::Real(1.0)-wy),
103  (amrex::Real(1.0)-wx)*wy,
104  wx*wy};
105  amrex::Real sum = amrex::Real(0.0);
106  amrex::Real wsum = amrex::Real(0.0);
107  for (int n = 0; n < 4; ++n) {
108  if (w[n] > amrex::Real(0.0) && std::isfinite(v[n]) && v[n] != missing_value) {
109  sum += w[n] * v[n];
110  wsum += w[n];
111  }
112  }
113  return (wsum > amrex::Real(0.0)) ? sum / wsum : missing_value;
114 }
Real w
Definition: ERF_Plotfile2DInterpolator.cpp:23
amrex::Real Real
Definition: ERF_ShocInterface.H:19

Referenced by ERF::sample_stations().

Here is the caller graph for this function:

◆ station_earth_wind_from_name()

StationEarthWind station_earth_wind_from_name ( const std::string &  name)
inline
62 {
63  if (name == "u_east") { return StationEarthWind::UEast; }
64  if (name == "v_north") { return StationEarthWind::VNorth; }
65  if (name == "wind_speed") { return StationEarthWind::WindSpeed; }
66  if (name == "wind_dir") { return StationEarthWind::WindDir; }
68 }
std::string name
Definition: ERF_Plotfile2DCatalog.cpp:116

Referenced by ERF::init_stations().

Here is the caller graph for this function: