Canoe
Comprehensive Atmosphere N' Ocean Engine
mwr_absorber_h2s.cpp
Go to the documentation of this file.
1 // canoe
2 #include <air_parcel.hpp>
3 #include <configure.hpp>
4 
5 // opacity
7 #include "mwr_absorbers.hpp"
8 
9 namespace GiantPlanets {
10 
11 Real MwrAbsorberH2S::GetAttenuation(Real wave1, Real wave2,
12  AirParcel const& var) const {
13  // adapted by cli (Cheng Li), Aug 30
14  Real P = var.w[IPR] / 1.E5;
15  Real T = var.w[IDN];
16  Real xdry = 1.;
17  for (int i = 1; i <= NVAPOR; ++i) xdry -= var.w[i];
18 
19  Real XHe = GetPar<Real>("xHe") * xdry;
20  Real XH2S = var.w[GetSpeciesIndex(0)];
21  Real XH2 = xdry - XHe;
22  Real wave = (wave1 + wave2) / 2.;
23 
24  // 1/cm -> 1/m
25  return 100. * attenuation_H2S_Hofstadter(wave, P, T, XH2, XHe, XH2S);
26 }
27 
28 } // namespace GiantPlanets
double attenuation_H2S_Hofstadter(double freq, double P, double T, double XH2, double XHe, double XH2S)
Real *const w
Definition: air_parcel.hpp:36
Real GetAttenuation(Real wave1, Real wave2, AirParcel const &var) const
Get attenuation coefficient [1/m].
int GetSpeciesIndex(int n) const
This file contains declaration of Absorber.