ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERF_WeatherDataInterpolation.cpp File Reference
#include <filesystem>
#include <stdexcept>
#include "ERF.H"
#include "ERF_ReadCustomBinaryIC.H"
#include "ERF_Interpolation_Bilinear.H"
Include dependency graph for ERF_WeatherDataInterpolation.cpp:

Macros

#define ERF_WEATHERDATAINTERPOLATION_H_
 

Enumerations

enum class  MultiFabType { CC , NC }
 

Functions

void PlotMultiFab (const MultiFab &mf, const Geometry &geom_mf, const std::string plotfilename, MultiFabType mftype)
 

Macro Definition Documentation

◆ ERF_WEATHERDATAINTERPOLATION_H_

#define ERF_WEATHERDATAINTERPOLATION_H_

Enumeration Type Documentation

◆ MultiFabType

enum MultiFabType
strong
Enumerator
CC 
NC 

Function Documentation

◆ PlotMultiFab()

void PlotMultiFab ( const MultiFab &  mf,
const Geometry &  geom_mf,
const std::string  plotfilename,
MultiFabType  mftype 
)
24 {
25 
26  Vector<std::string> varnames = {
27  "rho", "uvel", "vvel", "wvel", "theta", "qv", "qc", "qr", "latitude", "longitude"
28  }; // Customize variable names
29 
30  const Real time = 0.0;
31 
32 
33  // Assume weather_mf is nodal in all directions
34  if(mftype == MultiFabType::NC) {
35  BoxArray cba = mf.boxArray();
36  cba = amrex::convert(mf.boxArray(), IntVect::TheCellVector());
37 
38  MultiFab cc_mf(cba, mf.DistributionMap(),
39  mf.nComp(), 0);
40 
41  amrex::average_node_to_cellcenter(cc_mf, 0, mf, 0, mf.nComp());
42 
43  WriteSingleLevelPlotfile(
44  plotfilename,
45  cc_mf,
46  varnames,
47  geom_mf,
48  time,
49  0 // level
50  );
51  } else {
52  WriteSingleLevelPlotfile(
53  plotfilename,
54  mf,
55  varnames,
56  geom_mf,
57  time,
58  0 // level
59  );
60  }
61 }
amrex::Real Real
Definition: ERF_ShocInterface.H:19