1#ifndef REMORA_LATLONREGRID_H_
2#define REMORA_LATLONREGRID_H_
4#ifdef REMORA_USE_NETCDF
9#include <AMReX_MultiFab.H>
10#include <AMReX_iMultiFab.H>
69 void define (
const std::string& file_name,
const std::string& field_name,
70 const std::vector<long long>& field_shape,
71 const amrex::MultiFab& target_lon,
const amrex::MultiFab& target_lat,
72 const amrex::MultiFab& like,
const amrex::Box&
domain,
79 static bool has_latlon_axes (
const std::string& file_name,
const std::string& field_name);
82 bool same_source_grid (
const std::string& file_name,
const std::string& field_name,
83 const std::vector<long long>& field_shape)
const;
87 void apply (
const std::string& file_name,
const std::string& field_name,
int itime,
88 amrex::MultiFab& dst)
const;
94 amrex::Box
target_box (
const amrex::MFIter& mfi)
const;
97 void build_weights (
const amrex::MultiFab& lon,
const amrex::MultiFab& lat);
98 void interpolate (
const amrex::FArrayBox& src, amrex::MultiFab& dst)
const;
Bilinear interpolation of a 2D field from a rectilinear lat-lon grid onto REMORA's rho points,...
void define(const std::string &file_name, const std::string &field_name, const std::vector< long long > &field_shape, const amrex::MultiFab &target_lon, const amrex::MultiFab &target_lat, const amrex::MultiFab &like, const amrex::Box &domain, const LatLonRegridOptions &options, const std::string &context)
Find the source grid of a variable and build the weights. Collective.
void interpolate(const amrex::FArrayBox &src, amrex::MultiFab &dst) const
std::vector< double > lon_inc
void build_weights(const amrex::MultiFab &lon, const amrex::MultiFab &lat)
std::vector< double > lat_inc
std::vector< double > lon_file
void apply(const std::string &file_name, const std::string &field_name, int itime, amrex::MultiFab &dst) const
Read record itime of the variable and interpolate it into dst, over the domain and its one-cell ring....
static constexpr int stencil_size
Number of stencil points per target cell.
static bool has_latlon_axes(const std::string &file_name, const std::string &field_name)
Whether a variable's last two dimensions are CF longitude and latitude coordinates (1D variables of t...
bool same_source_grid(const std::string &file_name, const std::string &field_name, const std::vector< long long > &field_shape) const
Whether another file's variable lies on the same source grid. Collective.
std::string summary() const
One line describing the source grid, for the log.
amrex::Box target_box(const amrex::MFIter &mfi) const
The cells filled: the valid box of mfi grown by the ring, inside the ring.
std::vector< double > lat_file
How a NetCDF forcing field on a lat-lon grid is interpolated onto the model grid.