29 std::ifstream file(fname.c_str(), std::ios::in);
31 int nwave = 396, nsize = 189;
33 axis_.resize(nwave + nsize);
34 ssalb_.resize(nwave * nsize);
35 gg_.resize(nwave * nsize);
38 for (
int i = 0; i < nwave; ++i) {
39 for (
int j = 0;
j < nsize; ++
j) {
40 std::getline(file, line);
42 auto sline = Vectorize<std::string>(line.c_str());
43 if (i == 0)
axis_[nwave +
j] = atof(sline[1].c_str());
44 if (
j == 0)
axis_[i] = atof(sline[0].c_str());
45 ssalb_[i * nsize +
j] = atof(sline[5].c_str());
46 gg_[i * nsize +
j] = atof(sline[6].c_str());
62 T1 = air.
w[IDN] - 273.15;
64 re = 326.3 + 12.42 * T1 + 0.197 * T1 * T1 + 0.0012 * T1 * T1 * T1;
76 T1 = air.
w[IDN] - 273.15;
78 re = 326.3 + 12.42 * T1 + 0.197 * T1 * T1 + 0.0012 * T1 * T1 * T1;
80 Real ww = 10000. / wave;
81 Real coor[2] = {ww,
re};
96 T1 = air.
w[IDN] - 273.15;
98 re = 326.3 + 12.42 * T1 + 0.197 * T1 * T1 + 0.0012 * T1 * T1 * T1;
100 Real ww = 10000. / wave;
101 Real coor[2] = {ww,
re};
int GetCloudIndex(int n) const
std::vector< Real > axis_
void LoadCoefficient(std::string fname, size_t bid) override
Load absorption coefficient from file.
Real getAttenuation1(Real wave, AirParcel const &var) const
std::vector< Real > ssalb_
Real getSingleScatteringAlbedo1(Real wave, AirParcel const &var) const
void getPhaseMomentum1(Real *pp, Real wave, AirParcel const &var, int np) const
double min(double x1, double x2, double x3)
double max(double x1, double x2, double x3)
void interpnf(double *val, double const *coor, double const *data, double const *axis, size_t const *len, int ndim)
void get_phase_momentum(Real *pmom, int iphas, Real gg, int npmom)