8 #include <application/exceptions.hpp>
26 throw NotFoundError(
"XizH2H2CIA", fname);
31 std::ifstream infile(fname.c_str(), std::ios::in);
35 if (infile.is_open()) {
37 for (
int j = 0;
j <
len_[1];
j++) {
40 for (
int k = 0; k <
len_[0]; k++) {
42 for (
int j = 0; j < len_[1]; j++) infile >>
kcoeff_[k *
len_[1] +
j];
46 throw RuntimeError(
"XizH2H2CIA::LoadCoefficient",
47 "Cannot open file: " + fname);
54 Real val, coord[2] = {wave1, var.
w[IDN]};
60 for (
int n = 1; n <= NVAPOR; ++n) x0 -= var.
w[n];
65 return 100. * exp(-val) *
66 sqr(x0 * amagat * GetPar<Real>(
"mixr"));
int GetSpeciesIndex(int n) const
std::vector< Real > kcoeff_
void LoadCoefficient(std::string fname, int bid=-1)
Real GetAttenuation(Real wave1, Real wave2, AirParcel const &var) const
Get attenuation coefficient [1/m].
std::vector< Real > axis_
int GetNumCols(std::string fname, char c)
get number of columns in a data table
int GetNumRows(std::string fname)
get number of rows in a data table
bool FileExists(std::string fname)
test file existance
void interpn(double *val, double const *coor, double const *data, double const *axis, size_t const *len, int ndim, int nval)