37 const LineRecord line(6,0,61150556350.7454,0.0,4.03935532732085e-19,
38 296.0,2.5505950629926e-21,13255.072408981,13047.9619025907,0.8,0.8,
39 0.0,empty_aon,0.0,0.0,0.0,0.0,0.0,0.0,0.0);
41 const Numeric vmr=0.2, dT = 1e-1;
43 Numeric tmp1,tmp2,tmp3,tmp4, g_0, df_0, dg, ddf, g_1, df_1;
51 for(
Numeric T = 150; T<350; T+=20)
53 line.PressureBroadening().GetPressureBroadeningParams(g_0,tmp1,tmp2,df_0,tmp3,tmp4,
54 line.
Ti0()/T, P, vmr*P,0,-1,empty1,
vmrs,none);
56 line.PressureBroadening().GetPressureBroadeningParams(g_1,tmp1,tmp2,df_1,tmp3,tmp4,
57 line.
Ti0()/(T+dT), P, vmr*P,0,-1,empty1,vmrs,none);
59 line.PressureBroadening().GetPressureBroadeningParams_dT(dg,ddf, T,
74 const LineFunctionData test(
istringstream(
"VP none 3 SELF T1 16000 0.7 T1 100 1.3 CO2 T1 16001 0.71 T1 101 1.31 AIR T1 16002 0.72 T1 102 1.32"));
75 String x = test.HumanReadable();
88 296.0,2.5505950629926e-21,13255.072408981,13047.9619025907,0.8,0.8,
89 0.0,empty_aon,0.0,0.0,0.0,0.0,0.0,0.0,0.0);
91 Numeric qt_cache, qt_cache_d, qref_cache, qref_cache_d, dqt;
97 part_data={ 4.016432e-01, 7.315888e-01, -3.313678e-05, 6.642877e-08 };
101 for(
Numeric T = 150; T<350; T+=20)
103 CalculatePartitionFctFromCoeff(qref_cache,qt_cache,line.
Ti0(),T,part_data);
104 CalculatePartitionFctFromCoeff(qref_cache_d,qt_cache_d,line.
Ti0(),T+dT,part_data);
106 CalculatePartitionFctFromCoeff_dT(dqt, T, part_data);
122 296.0,2.5505950629926e-21,13255.072408981,13047.9619025907,0.8,0.8,
123 0.0,empty_aon,0.0,0.0,0.0,0.0,0.0,0.0,0.0);
127 for(
Numeric T = 150; T<350; T+=20)
131 const Numeric gamma = exp( - PLANCK_CONST * line.
F() / ( BOLTZMAN_CONST * T ) );
132 const Numeric gamma_ref = exp( - PLANCK_CONST * line.
F() / ( BOLTZMAN_CONST * line.
Ti0()) );
134 const Numeric K2 = (1.-gamma)/(1.-gamma_ref);
136 const Numeric K1 = exp( line.
Elow() / BOLTZMAN_CONST * (T-line.
Ti0())/(T*line.
Ti0()) );
140 const Numeric gamma_d = exp( - PLANCK_CONST * line.
F() / ( BOLTZMAN_CONST * (T+dT) ) );
142 const Numeric K2_d = (1.-gamma_d)/(1.-gamma_ref);
144 const Numeric K1_d = exp( line.
Elow() / BOLTZMAN_CONST * ((T+dT)-line.
Ti0())/((T+dT)*line.
Ti0()) );
146 const Numeric dK1 = line.
Elow()/BOLTZMAN_CONST/T/T * K1;
147 const Numeric dK2 = -line.
F()*PLANCK_CONST/BOLTZMAN_CONST/T/T * (gamma/(1.0-gamma_ref));
157 if(!(
abs(((K1_d-K1)/dT-dK1)/dK1)<0.001))
158 std::cout<<
"K1 partial checks out bad.\n";
159 if(!(
abs((((K2_d-K2)/dT)- dK2)/dK2)<0.01))
160 std::cout<<
"K1 partial checks out bad.\n";
172 const LineRecord line(6,0,61150556350.7454,0.0,4.03935532732085e-19,
173 296.0,2.5505950629926e-21,13255.072408981,13047.9619025907,0.8,0.8,
174 0.0,empty_aon,0.0,0.0,0.0,0.0,0.0,0.0,0.0);
176 const Numeric vmr=0.2, dT = 1e-1;
178 Numeric tmp1,tmp2,tmp3,tmp4, g, df, g_d, df_d, dg, ddf;
185 f_grid[0]=line.
F()-1.0e6;
186 f_grid[1]=line.
F()-50.0e3;
188 f_grid[3]=line.
F()+50.0e3;
189 f_grid[4]=line.
F()+1.0e6;
191 Vector ls(5,0.0),ls_d(5,0.0),ls_phase(5,0.0),dls_dx(5,0.0),dls_dy(5,0.0),dx_dT(5,0.0);
197 for(
Numeric T = 150; T<350; T+=20)
199 line.PressureBroadening().GetPressureBroadeningParams(g,tmp1,tmp2,df,tmp3,tmp4,
200 line.
Ti0()/T, P, vmr*P,0,-1,empty1,
vmrs,none);
202 line.PressureBroadening().GetPressureBroadeningParams(g_d,tmp1,tmp2,df_d,tmp3,tmp4,
203 line.
Ti0()/(T+dT), P, vmr*P,0,-1,empty1,vmrs,none);
205 line.PressureBroadening().GetPressureBroadeningParams_dT(dg,ddf, T,
211 const Numeric sigma = line.
F() * doppler_const
212 *
sqrt( T / 31.989830);
214 const Numeric dsigma_dT = line.
F() * doppler_const
215 *
sqrt( T / 31.989830)/T/2.0;
217 const Numeric sigma_d = line.
F() * doppler_const
218 *
sqrt( (T+dT) / 31.989830);
296 tmp(0,0)=1.06286e-08; tmp(0,1)=3.81257e-10; tmp(0,2)=7.23907e-10; tmp(0,3)=-5.71387e-09;
297 tmp(1,0)=3.81268e-10; tmp(1,1)=1.06286e-08; tmp(1,2)=1.0299e-08; tmp(1,3)=4.25483e-09;
298 tmp(2,0)=7.23901e-10; tmp(2,1)=-1.0299e-08; tmp(2,2)=1.06286e-08; tmp(2,3)=-2.24089e-09;
299 tmp(3,0)=-5.71387e-09; tmp(3,1)=-4.25481e-09; tmp(3,2)=2.24093e-09; tmp(3,3)=1.06286e-08;
302 tmp(0,0)=6.57435e-10; tmp(0,1)=2.38216e-11; tmp(0,2)=4.52381e-11; tmp(0,3)=-3.49977e-10;
303 tmp(1,0)=2.38216e-11; tmp(1,1)=6.57435e-10; tmp(1,2)=6.81735e-10; tmp(1,3)=2.71398e-10;
304 tmp(2,0)=4.52381e-11; tmp(2,1)=-6.81735e-10; tmp(2,2)=6.57435e-10; tmp(2,3)=-1.42913e-10;
305 tmp(3,0)=-3.49977e-10; tmp(3,1)=-2.71398e-10; tmp(3,2)=1.42913e-10; tmp(3,3)=6.57435e-10;
306 const Matrix ppath_ext_1=tmp;
308 tmp(0,0)=2.08609e-10; tmp(0,1)=7.33668e-12; tmp(0,2)=1.39302e-11; tmp(0,3)=-1.11706e-10;
309 tmp(1,0)=7.33668e-12; tmp(1,1)=2.08609e-10; tmp(1,2)=2.13876e-10; tmp(1,3)=8.65063e-11;
310 tmp(2,0)=1.39302e-11; tmp(2,1)=-2.13876e-10; tmp(2,2)=2.08609e-10; tmp(2,3)=-4.55607e-11;
311 tmp(3,0)=-1.11706e-10; tmp(3,1)=-8.65063e-11; tmp(3,2)=4.55607e-11; tmp(3,3)=2.08609e-10;
312 const Matrix ppath_ext_0=tmp
314 tmp(0,0)=2.08609e-10; tmp(0,1)=7.33668e-12; tmp(0,2)=1.39302e-11; tmp(0,3)=-1.11706e-10;
315 tmp(1,0)=7.33668e-12; tmp(1,1)=2.08609e-10; tmp(1,2)=0; tmp(1,3)=0;
316 tmp(2,0)=1.39302e-11; tmp(2,1)=0; tmp(2,2)=2.08609e-10; tmp(2,3)=0;
317 tmp(3,0)=-1.11706e-10; tmp(3,1)=0; tmp(3,2)=0; tmp(3,3)=2.08609e-10;
318 const Matrix ppath_ext_0_test=tmp
320 tmp(0,0)=-2.53045e-12; tmp(0,1)=-9.07729e-14; tmp(0,2)=-1.72351e-13; tmp(0,3)=1.36037e-12;
321 tmp(1,0)=-9.07729e-14; tmp(1,1)=-2.53045e-12; tmp(1,2)=-2.59077e-12; tmp(1,3)=-1.2184e-12;
322 tmp(2,0)=-1.72351e-13; tmp(2,1)=2.59077e-12; tmp(2,2)=-2.53045e-12; tmp(2,3)=6.41701e-13;
323 tmp(3,0)=1.36037e-12; tmp(3,1)=1.2184e-12; tmp(3,2)=-6.41701e-13; tmp(3,3)=-2.53045e-12;
324 const Matrix dppath_ext_dx=tmp;
325 tmp(0,0)=-2.53045e-12; tmp(0,1)=-9.07729e-14; tmp(0,2)=-1.72351e-13; tmp(0,3)=1.36037e-12;
326 tmp(1,0)=-9.07729e-14; tmp(1,1)=-2.53045e-12; tmp(1,2)=0; tmp(1,3)=0;
327 tmp(2,0)=-1.72351e-13; tmp(2,1)=0; tmp(2,2)=-2.53045e-12; tmp(2,3)=0;
328 tmp(3,0)=1.36037e-12; tmp(3,1)=0; tmp(3,2)=0; tmp(3,3)=-2.53045e-12;
329 const Matrix dppath_ext_dx_test=tmp;
331 tmp(0,0)=2.08356e-10; tmp(0,1)=7.32761e-12; tmp(0,2)=1.3913e-11; tmp(0,3)=-1.1157e-10;
332 tmp(1,0)=7.32761e-12; tmp(1,1)=2.08356e-10; tmp(1,2)=2.13631e-10; tmp(1,3)=8.64051e-11;
333 tmp(2,0)=1.3913e-11; tmp(2,1)=-2.13631e-10; tmp(2,2)=2.08356e-10; tmp(2,3)=-4.55074e-11;
334 tmp(3,0)=-1.1157e-10; tmp(3,1)=-8.64051e-11; tmp(3,2)=4.55074e-11; tmp(3,3)=2.08356e-10;
335 const Matrix ppath_ext_dt=tmp;
337 tmp(0,0)=0.999996; tmp(0,1)=-1.30978e-07; tmp(0,2)=-2.48724e-07; tmp(0,3)=1.94076e-06;
338 tmp(1,0)=-1.3098e-07; tmp(1,1)=0.999996; tmp(1,2)=-3.76485e-06; tmp(1,3)=-1.50451e-06;
339 tmp(2,0)=-2.48723e-07; tmp(2,1)=3.76485e-06; tmp(2,2)=0.999996; tmp(2,3)=7.92277e-07;
340 tmp(3,0)=1.94076e-06; tmp(3,1)=1.50451e-06; tmp(3,2)=-7.92283e-07; tmp(3,3)=0.999996;
341 const Matrix trans_partial=tmp;
344 Matrix T(4,4),dT(4,4), A(4,4),dA(4,4);
363 std::cout<<
"Testing Propmat Partials\n";
Numeric Ti0() const
Reference temperature for I0 in K:
const Numeric PLANCK_CONST
Global constant, the Planck constant [Js].
void matrix_exp_dmatrix_exp(MatrixView F, Tensor3View dF, ConstMatrixView A, ConstTensor3View dA, const Index &q)
General exponential of a Matrix with their derivatives.
Vector vmrs(const ConstVectorView &atmospheric_vmrs, const ArrayOfArrayOfSpeciesTag &atmospheric_species, const QuantumIdentifier &self, const ArrayOfSpeciesTag &lineshape_species, bool self_in_list, bool bath_in_list, Type type)
Returns a VMR vector for this model's main calculations.
void faddeeva_algorithm_916(Vector &ls_attenuation, Vector &ls_phase, Vector &ls_dattenuation_dfrequency_term, Vector &ls_dphase_dfrequency_term, Vector &ls_dattenuation_dpressure_term, Vector &ls_dphase_dpressure_term, Vector &, const Numeric f0, const Numeric gamma, const Numeric, const Numeric, const Numeric, const Numeric, const Numeric sigma, const Numeric, ConstVectorView f_grid, const bool do_phase, const bool do_partials)
const Numeric BOLTZMAN_CONST
Global constant, the Boltzmann constant [J/K].
Stuff related to lineshape functions.
Routines for setting up the jacobian.
void test_linefunctionsdata()
Linear algebra functions.
Numeric Elow() const
Lower state energy in cm^-1:
basic_istringstream< char, string_char_traits< char >, alloc > istringstream
void test_partitionfunction()
NUMERIC Numeric
The type to use for all floating point numbers.
Declarations required for the calculation of absorption coefficients.
Numeric pow(const Rational base, Numeric exp)
Power of.
Index species_index_from_species_name(String name)
Return species index for given species name.
This can be used to make arrays out of anything.
Constains various line scaling functions.
void test_pressurebroadening()
void w_x_plus_iy_dT(Vector &dx_dT, Numeric &dy_dT, Numeric &dFu_dT, ConstVectorView f, const Numeric &f0, const Numeric &sigma, const Numeric &dPF_dT, const Numeric &dDF_dT, const Numeric &dsigma_dT, const Numeric &gamma, const Numeric &dgamma_dT)
const Numeric DOPPLER_CONST
Numeric F() const
The line center frequency in Hz.
Declaration of functions in rte.cc.
Numeric sqrt(const Rational r)
Square root.