11 #include <configure.hpp>
29 int fileid, dimid, varid, err;
35 nc_open(fname.c_str(), NC_NETCDF4, &fileid);
39 nc_inq_varid(fileid,
"p", &varid);
40 nc_get_var_double(fileid, varid,
axis_.data());
41 nc_inq_varid(fileid,
"t", &varid);
42 nc_get_var_double(fileid, varid,
axis_.data() +
len_[0]);
43 nc_inq_varid(fileid,
"samples", &varid);
44 nc_get_var_double(fileid, varid,
axis_.data() +
len_[0] +
len_[1]);
47 nc_inq_varid(fileid,
GetName().c_str(), &varid);
48 size_t start[4] = {0, 0, bid, 0};
50 nc_get_vara_double(fileid, varid, start, count,
kcoeff_.data());
58 Real val, coord[3] = {log(var.
q[IPR]), var.
q[IDN], g1};
61 return exp(val) * dens;
Real *const q
chemistry data
std::string GetName() const
void interpn(double *val, double const *coor, double const *data, double const *axis, size_t const *len, int ndim, int nval)