82 abs_t = rtp_temperature;
97 abs_lines_per_species.resize(tgs.
nelem());
101 for (
auto &tg : abs_lines_per_species)
108 if (lines.NumLines() == 0)
continue;
112 for (
auto& this_tag: tgs[
i]) {
114 if (this_tag.Species() not_eq lines.Species())
break;
118 this_tag.Isotopologue() not_eq lines.Isotopologue())
122 if (this_tag.Lf() >= 0 or this_tag.Uf() >= 0) {
123 const Numeric low = (this_tag.Lf() >= 0) ? this_tag.Lf() : std::numeric_limits<Numeric>::lowest();
128 for (
Index k=lines.NumLines()-1; k>=0; k--)
129 if (low <= lines.F0(k) and upp >= lines.F0(k))
135 abs_lines_per_species[i].push_back(these_lines);
139 if (lines.NumLines() == 0)
140 goto leave_inner_loop;
143 abs_lines_per_species[i].push_back(lines);
144 goto leave_inner_loop;
155 Index& propmat_clearsky_agenda_checked,
156 Index& abs_xsec_agenda_checked,
163 propmat_clearsky_agenda_checked =
false;
164 abs_xsec_agenda_checked =
false;
177 String filename = basename;
178 if (basename.length() && basename[basename.length() - 1] !=
'/')
180 filename += specname;
185 included.push_back(specname);
193 this_group[0] = this_tag;
196 tgs.push_back(this_group);
197 }
catch (
const std::runtime_error& e) {
199 excluded.push_back(specname);
204 out2 <<
" Included Species (" << included.
nelem() <<
"):\n";
205 for (
Index i = 0;
i < included.nelem(); ++
i)
206 out2 <<
" " << included[
i] <<
"\n";
208 out2 <<
" Excluded Species (" << excluded.
nelem() <<
"):\n";
210 out2 <<
" " << excluded[
i] <<
"\n";
216 Index& propmat_clearsky_agenda_checked,
217 Index& abs_xsec_agenda_checked,
226 specs.push_back(spec.Name());
230 abs_speciesSet(abs_species, abs_xsec_agenda_checked, propmat_clearsky_agenda_checked, specs, verbosity);
239 const Index& atmosphere_dim,
245 if (1 != atmosphere_dim) {
247 os <<
"Atmospheric dimension must be 1D, but atmosphere_dim is " 248 << atmosphere_dim <<
".";
249 throw runtime_error(os.
str());
253 abs_t = t_field(
joker, 0, 0);
280 if (abs_vmrs.
nrows() != abs_xsec_per_species.
nelem()) {
282 os <<
"Variable abs_vmrs must have compatible dimension to abs_xsec_per_species.\n" 283 <<
"abs_vmrs.nrows() = " << abs_vmrs.
nrows() <<
"\n" 284 <<
"abs_xsec_per_species.nelem() = " << abs_xsec_per_species.
nelem();
285 throw runtime_error(os.
str());
291 if (abs_vmrs.
ncols() != abs_xsec_per_species[0].ncols()) {
293 os <<
"Variable abs_vmrs must have same numbers of altitudes as abs_xsec_per_species.\n" 294 <<
"abs_vmrs.ncols() = " << abs_vmrs.
ncols() <<
"\n" 295 <<
"abs_xsec_per_species[0].ncols() = " 296 << abs_xsec_per_species[0].ncols();
297 throw runtime_error(os.
str());
306 (src_xsec_per_species.
nelem() == abs_xsec_per_species.
nelem())
307 ? not src_xsec_per_species[0].empty() ? true : false
309 const Index src_rows = do_src ? src_xsec_per_species[0].nrows() : 0;
315 abs_coef.
resize(abs_xsec_per_species[0].nrows(),
316 abs_xsec_per_species[0].ncols());
318 src_coef.
resize(src_rows, src_xsec_per_species[0].ncols());
323 dabs_coef_dx.resize(jacobian_quantities_position.
nelem());
324 dsrc_coef_dx.resize(do_src ? jacobian_quantities_position.
nelem() : 0);
326 for (
Index ii = 0; ii < jacobian_quantities_position.
nelem(); ii++) {
327 if (jacobian_quantities[jacobian_quantities_position[ii]] not_eq
329 dabs_coef_dx[ii].resize(abs_xsec_per_species[0].nrows(),
330 abs_xsec_per_species[0].ncols());
331 dabs_coef_dx[ii] = 0.0;
333 dsrc_coef_dx[ii].resize(src_rows, src_xsec_per_species[0].ncols());
334 dsrc_coef_dx[ii] = 0.0;
339 abs_coef_per_species.resize(abs_xsec_per_species.
nelem());
340 src_coef_per_species.resize(src_xsec_per_species.
nelem());
343 <<
" Computing abs_coef and abs_coef_per_species from abs_xsec_per_species.\n";
346 out3 <<
" Tag group " <<
i <<
"\n";
349 abs_coef_per_species[i].resize(abs_xsec_per_species[i].nrows(),
350 abs_xsec_per_species[i].ncols());
351 abs_coef_per_species[i] = 0;
354 src_coef_per_species[i].resize(src_rows, src_xsec_per_species[i].ncols());
355 src_coef_per_species[i] = 0;
359 for (
Index j = 0; j < abs_xsec_per_species[i].ncols(); j++) {
367 for (
Index k = 0; k < abs_xsec_per_species[i].nrows(); k++) {
368 abs_coef_per_species[i](k, j) =
369 abs_xsec_per_species[i](k, j) * n * abs_vmrs(i, j);
371 src_coef_per_species[i](k, j) =
372 src_xsec_per_species[i](k, j) * n * abs_vmrs(i, j);
374 for (
Index iq = 0; iq < jacobian_quantities_position.
nelem(); iq++) {
375 if (jacobian_quantities[jacobian_quantities_position[iq]] ==
377 dabs_coef_dx[iq](k, j) +=
378 (dabs_xsec_per_species_dx[i][iq](k, j) * n +
379 abs_xsec_per_species[i](k, j) * dn_dT) *
382 dsrc_coef_dx[iq](k, j) +=
383 (dsrc_xsec_per_species_dx[i][iq](k, j) * n +
384 src_xsec_per_species[i](k, j) * dn_dT) *
386 }
else if (jacobian_quantities[jacobian_quantities_position[iq]] ==
388 bool seco =
false,
main =
false;
389 for (
const auto& s : abs_species[i]) {
391 jacobian_quantities[jacobian_quantities_position[iq]],
396 jacobian_quantities[jacobian_quantities_position[iq]],
402 dabs_coef_dx[iq](k, j) +=
403 (dabs_xsec_per_species_dx[i][iq](k, j) * abs_vmrs(i, j) +
404 abs_xsec_per_species[i](k, j)) *
407 dsrc_coef_dx[iq](k, j) +=
408 (dsrc_xsec_per_species_dx[i][iq](k, j) * abs_vmrs(i, j) +
409 src_xsec_per_species[i](k, j)) *
412 dabs_coef_dx[iq](k, j) += abs_xsec_per_species[i](k, j) * n;
414 dsrc_coef_dx[iq](k, j) += src_xsec_per_species[i](k, j) * n;
416 dabs_coef_dx[iq](k, j) +=
417 dabs_xsec_per_species_dx[i][iq](k, j) * abs_vmrs(i, j) * n;
419 dsrc_coef_dx[iq](k, j) +=
420 dsrc_xsec_per_species_dx[i][iq](k, j) * abs_vmrs(i, j) * n;
422 }
else if (jacobian_quantities
423 [jacobian_quantities_position[iq]] not_eq
425 dabs_coef_dx[iq](k, j) +=
426 dabs_xsec_per_species_dx[i][iq](k, j) * n * abs_vmrs(i, j);
428 dsrc_coef_dx[iq](k, j) +=
429 dsrc_xsec_per_species_dx[i][iq](k, j) * n * abs_vmrs(i, j);
436 abs_coef += abs_coef_per_species[i];
438 if (do_src) src_coef += src_coef_per_species[i];
454 const Index& abs_xsec_agenda_checked,
455 const Index& nlte_do,
459 if (!abs_xsec_agenda_checked)
461 "You must call *abs_xsec_agenda_checkedCalc* before calling this method.");
468 if (tgs.
nelem() < abs_species_active.
nelem()) {
470 os <<
"abs_species_active (n=" << abs_species_active.
nelem()
471 <<
") not allowed to have more elements than abs_species (n=" 472 << tgs.
nelem() <<
")!\n";
473 throw runtime_error(os.
str());
478 abs_xsec_per_species.resize(tgs.
nelem());
479 src_xsec_per_species.resize(tgs.
nelem());
482 jacobian_quantities);
486 dabs_xsec_per_species_dx.resize(do_jac ? tgs.
nelem() : 0);
487 dsrc_xsec_per_species_dx.resize(do_jac ? tgs.
nelem() : 0);
492 for (
Index ii = 0; ii < abs_species_active.
nelem(); ++ii) {
493 const Index i = abs_species_active[ii];
496 if (i >= tgs.
nelem()) {
498 os <<
"*abs_species_active* contains an invalid species index.\n" 499 <<
"Species index must be between 0 and " << tgs.
nelem() - 1;
500 throw std::runtime_error(os.
str());
503 abs_xsec_per_species[i].resize(f_grid.
nelem(), abs_p.
nelem());
504 abs_xsec_per_species[i] = 0;
506 src_xsec_per_species[i].resize(f_grid.
nelem(), abs_p.
nelem());
507 src_xsec_per_species[i] = 0;
509 src_xsec_per_species[i].resize(0, 0);
513 dabs_xsec_per_species_dx[ii] =
517 dsrc_xsec_per_species_dx[ii] =
524 os <<
" Initialized abs_xsec_per_species.\n" 525 <<
" Number of frequencies : " << f_grid.
nelem() <<
"\n" 526 <<
" Number of pressure levels : " << abs_p.
nelem() <<
"\n";
549 Vector abs_h2o, abs_n2, abs_o2;
555 const Index n_xsec = abs_xsec_per_species.
nelem();
558 if (n_tgs != n_xsec || n_tgs != n_vmrs) {
560 os <<
"The following variables must all have the same dimension:\n" 561 <<
"tgs: " << tgs.
nelem() <<
"\n" 562 <<
"abs_xsec_per_species: " << abs_xsec_per_species.
nelem() <<
"\n" 563 <<
"abs_vmrs.nrows(): " << abs_vmrs.
nrows();
564 throw runtime_error(os.
str());
575 jacobian_quantities);
586 for (
Index iv = 0; iv < f_grid.
nelem(); iv++) dfreq[iv] = f_grid[iv] + df;
590 for (
Index it = 0; it < abs_t.
nelem(); it++) dabs_t[it] = abs_t[it] + dt;
593 Matrix jacs_df, jacs_dt, normal;
603 if (abs_cont_names.
nelem() != abs_cont_parameters.
nelem()) {
607 os <<
"abs_xsec_per_speciesAddConts: " <<
i 608 <<
" name : " << abs_cont_names[
i] <<
"\n";
611 os <<
"abs_xsec_per_speciesAddConts: " <<
i 612 <<
" param: " << abs_cont_parameters[
i] <<
"\n";
615 os <<
"abs_xsec_per_speciesAddConts: " <<
i 616 <<
" option: " << abs_cont_models[
i] <<
"\n";
618 os <<
"The following variables must have the same dimension:\n" 619 <<
"abs_cont_names: " << abs_cont_names.
nelem() <<
"\n" 620 <<
"abs_cont_parameters: " << abs_cont_parameters.
nelem();
622 throw runtime_error(os.
str());
631 os <<
"Variable abs_t must have the same dimension as abs_p.\n" 632 <<
"abs_t.nelem() = " << abs_t.
nelem() <<
'\n' 633 <<
"abs_p.nelem() = " << abs_p.
nelem();
634 throw runtime_error(os.
str());
639 os <<
"Variable dimension abs_vmrs.ncols() must\n" 640 <<
"be the same as abs_p.nelem().\n" 641 <<
"abs_vmrs.ncols() = " << abs_vmrs.
ncols() <<
'\n' 642 <<
"abs_p.nelem() = " << abs_p.
nelem();
643 throw runtime_error(os.
str());
649 out3 <<
" Calculating continuum spectra.\n";
652 for (
Index ii = 0; ii < abs_species_active.
nelem(); ++ii) {
653 const Index i = abs_species_active[ii];
669 .Isotopologue()[tgs[i][s].Isotopologue()]
672 if (name ==
"O2-MPM2020")
continue;
678 find(abs_cont_names.begin(), abs_cont_names.end(), name) -
679 abs_cont_names.begin();
683 if (n == abs_cont_names.
nelem()) {
685 os <<
"Cannot find model " << name <<
" in abs_cont_names.";
686 throw runtime_error(os.
str());
692 if (out3.sufficient_priority()) {
694 os <<
" Adding " << name <<
" to tag group " << i <<
".\n";
700 const String ContOption = abs_cont_models[n];
729 abs_cont_parameters[n],
742 for (
Index iv = 0; iv < f_grid.
nelem(); iv++) {
743 for (
Index ip = 0; ip < abs_p.
nelem(); ip++) {
744 if (do_freq_jac) jacs_df(iv, ip) = 0.0;
745 if (do_temp_jac) jacs_dt(iv, ip) = 0.0;
746 normal(iv, ip) = 0.0;
753 abs_cont_parameters[n],
768 abs_cont_parameters[n],
783 abs_cont_parameters[n],
793 for (
Index iv = 0; iv < f_grid.
nelem(); iv++) {
794 for (
Index ip = 0; ip < abs_p.
nelem(); ip++) {
795 abs_xsec_per_species[i](iv, ip) += normal(iv, ip);
796 for (
Index iq = 0; iq < jacobian_quantities_position.
nelem();
799 jacobian_quantities[jacobian_quantities_position[iq]]))
800 dabs_xsec_per_species_dx[i][iq](iv, ip) +=
801 (jacs_df(iv, ip) - normal(iv, ip)) * (1. / df);
802 else if (jacobian_quantities
803 [jacobian_quantities_position[iq]] ==
805 dabs_xsec_per_species_dx[i][iq](iv, ip) +=
806 (jacs_dt(iv, ip) - normal(iv, ip)) * (1. / dt);
830 abs_cont_names.resize(0);
831 abs_cont_options.resize(0);
832 abs_cont_parameters.resize(0);
833 out2 <<
" Initialized abs_cont_names \n" 835 " abs_cont_parameters.\n";
846 const Vector& userparameters,
856 abs_cont_names.push_back(tagname);
857 abs_cont_models.push_back(model);
858 abs_cont_parameters.push_back(userparameters);
871 const Numeric& rtp_temperature,
878 Index n_species = src_coef_per_species.
nelem();
882 os <<
"Must have at least one species.";
883 throw runtime_error(os.
str());
886 Index n_f = src_coef_per_species[0].nrows();
889 if (1 not_eq src_coef_per_species[0].ncols()) {
891 os <<
"Must have exactly one pressure.";
892 throw runtime_error(os.
str());
896 if (nlte_source.
nelem() not_eq n_species) {
898 os <<
"Species dimension of propmat_clearsky does not\n" 899 <<
"match src_coef_per_species.";
900 throw std::runtime_error(os.
str());
904 if (nlte_source[0].NumberOfFrequencies() not_eq n_f) {
906 os <<
"Frequency dimension of propmat_clearsky does not\n" 907 <<
"match abs_coef_per_species.";
908 throw runtime_error(os.
str());
915 for (
Index iv = 0; iv < n_f; iv++)
916 B[iv] =
planck(f_grid[iv], rtp_temperature);
918 StokesVector sv(n_f, nlte_source[0].StokesDimensions());
919 for (
Index si = 0; si < n_species; ++si) {
920 sv.
Kjj() = src_coef_per_species[si](
joker, 0);
922 nlte_source[si].Kjj() += sv.Kjj();
926 for (
Index ii = 0; ii < jacobian_quantities_position.nelem(); ii++) {
927 if (jacobian_quantities[jacobian_quantities_position[ii]] ==
930 for (
Index iv = 0; iv < n_f; iv++)
931 dB[iv] =
dplanck_dt(f_grid[iv], rtp_temperature);
933 for (
Index si = 0; si < n_species; ++si) {
934 sv.
Kjj() = src_coef_per_species[si](
joker, 0);
936 nlte_dsource_dx[ii].Kjj() += sv.Kjj();
939 sv.
Kjj() = dsrc_coef_dx[ii](
joker, 0);
941 dnlte_dx_source[ii].Kjj() += sv.Kjj();
943 jacobian_quantities[jacobian_quantities_position[ii]])) {
945 for (
Index iv = 0; iv < n_f; iv++)
946 dB[iv] =
dplanck_df(f_grid[iv], rtp_temperature);
948 for (
Index si = 0; si < n_species; ++si) {
949 sv.
Kjj() = src_coef_per_species[si](
joker, 0);
951 nlte_dsource_dx[ii].Kjj() += sv.Kjj();
954 sv.
Kjj() = dsrc_coef_dx[ii](
joker, 0);
956 dnlte_dx_source[ii].Kjj() += sv.Kjj();
957 }
else if (jacobian_quantities[jacobian_quantities_position[ii]] not_eq
959 sv.
Kjj() = dsrc_coef_dx[ii](
joker, 0);
961 dnlte_dx_source[ii].Kjj() += sv.Kjj();
980 Index n_species = abs_coef_per_species.
nelem();
982 if (0 == n_species) {
984 os <<
"Must have at least one species.";
985 throw runtime_error(os.
str());
988 Index n_f = abs_coef_per_species[0].nrows();
991 if (1 not_eq abs_coef_per_species[0].ncols()) {
993 os <<
"Must have exactly one pressure.";
994 throw runtime_error(os.
str());
998 if (propmat_clearsky.
nelem() not_eq n_species) {
1000 os <<
"Species dimension of propmat_clearsky does not\n" 1001 <<
"match abs_coef_per_species.";
1002 throw runtime_error(os.
str());
1006 if (propmat_clearsky[0].NumberOfFrequencies() not_eq n_f) {
1008 os <<
"Frequency dimension of propmat_clearsky does not\n" 1009 <<
"match abs_coef_per_species.";
1010 throw runtime_error(os.
str());
1014 for (
Index si = 0; si < n_species; ++si)
1015 propmat_clearsky[si].Kjj() += abs_coef_per_species[si](
joker, 0);
1017 for (
Index iqn = 0; iqn < dabs_coef_dx.
nelem(); iqn++) {
1018 if (dabs_coef_dx[iqn].nrows() == n_f) {
1019 if (dabs_coef_dx[iqn].ncols() == 1) {
1020 dpropmat_clearsky_dx[iqn].Kjj() += dabs_coef_dx[iqn](
joker, 0);
1022 throw std::runtime_error(
"Must have exactly one pressure.");
1038 const Index& stokes_dim,
1039 const Index& propmat_clearsky_agenda_checked,
1040 const Index& nlte_do,
1042 if (!propmat_clearsky_agenda_checked)
1043 throw runtime_error(
1044 "You must call *propmat_clearsky_agenda_checkedCalc* before calling this method.");
1048 if (not abs_species.
nelem())
1049 throw std::runtime_error(
"abs_species.nelem() = 0");
1051 if (not nf)
throw runtime_error(
"nf = 0");
1053 if (not stokes_dim)
throw runtime_error(
"stokes_dim = 0");
1059 dpropmat_clearsky_dx =
1065 dnlte_dx_source = nlte_do
1068 nlte_dsource_dx = nlte_do
1077 const Index& stokes_dim,
1078 const Index& atmosphere_dim,
1088 static const Numeric FRconst =
1094 throw runtime_error(
1095 "To include Faraday rotation, stokes_dim >= 3 is required.");
1097 if (atmosphere_dim == 1 && rtp_los.
nelem() < 1) {
1099 os <<
"For applying propmat_clearskyAddFaraday, los needs to be specified\n" 1100 <<
"(at least zenith angle component for atmosphere_dim==1),\n" 1101 <<
"but it is not.\n";
1102 throw runtime_error(os.
str());
1103 }
else if (atmosphere_dim > 1 && rtp_los.
nelem() < 2) {
1105 os <<
"For applying propmat_clearskyAddFaraday, los needs to be specified\n" 1106 <<
"(both zenith and azimuth angle components for atmosphere_dim>1),\n" 1107 <<
"but it is not.\n";
1108 throw runtime_error(os.
str());
1118 for (
Index sp = 0; sp < abs_species.
nelem() && ife < 0; sp++) {
1125 throw runtime_error(
1126 "Free electrons not found in *abs_species* and " 1127 "Faraday rotation can not be calculated.");
1129 const Numeric ne = rtp_vmr[ife];
1131 if (ne != 0 && (rtp_mag[0] != 0 || rtp_mag[1] != 0 || rtp_mag[2] != 0)) {
1136 rtp_los, rtp_mag[0], rtp_mag[1], rtp_mag[2], atmosphere_dim);
1138 Numeric dc1_u = 0.0, dc1_v = 0.0, dc1_w = 0.0;
1140 dc1_u = (2 * FRconst * ne *
1148 dc1_v = (2 * FRconst * ne *
1156 dc1_w = (2 * FRconst * ne *
1167 for (
Index iv = 0; iv < f_grid.
nelem(); iv++) {
1168 const Numeric r = c1 / (f_grid[iv] * f_grid[iv]);
1169 propmat_clearsky[ife].SetFaraday(r, iv);
1172 for (
Index iv = 0; iv < f_grid.
nelem(); iv++) {
1173 const Numeric f2 = f_grid[iv] * f_grid[iv];
1175 propmat_clearsky[ife].SetFaraday(r, iv);
1178 for (
Index iq = 0; iq < jacobian_quantities_position.
nelem(); iq++) {
1180 jacobian_quantities[jacobian_quantities_position[iq]]))
1181 dpropmat_clearsky_dx[iq].AddFaraday(-2.0 * r / f_grid[iv], iv);
1182 else if (jacobian_quantities[jacobian_quantities_position[iq]] ==
1184 dpropmat_clearsky_dx[iq].AddFaraday(dc1_u / f2, iv);
1185 else if (jacobian_quantities[jacobian_quantities_position[iq]] ==
1187 dpropmat_clearsky_dx[iq].AddFaraday(dc1_v / f2, iv);
1188 else if (jacobian_quantities[jacobian_quantities_position[iq]] ==
1190 dpropmat_clearsky_dx[iq].AddFaraday(dc1_w / f2, iv);
1191 else if (jacobian_quantities[jacobian_quantities_position[iq]] ==
1193 dpropmat_clearsky_dx[iq].AddFaraday(r / ne, iv);
1207 const Index& stokes_dim,
1208 const Index& atmosphere_dim,
1214 const Numeric& rtp_temperature,
1216 const Index& scat_data_checked,
1217 const Index& use_abs_as_ext,
1229 if (scat_data_checked != 1)
1230 throw runtime_error(
1231 "The scat_data must be flagged to have " 1232 "passed a consistency check (scat_data_checked=1).");
1236 for (
Index sp = 0; sp < abs_species.
nelem(); sp++) {
1244 os <<
"For applying propmat_clearskyAddParticles, *abs_species* needs to" 1245 <<
"contain species 'particles', but it does not.\n";
1246 throw runtime_error(os.
str());
1251 os <<
"Number of 'particles' entries in abs_species and of elements in\n" 1252 <<
"*scat_data* needs to be identical. But you have " << np
1253 <<
" 'particles' entries\n" 1254 <<
"and " << ns <<
" *scat_data* elements.\n";
1255 throw runtime_error(os.
str());
1258 if (atmosphere_dim == 1 && rtp_los.
nelem() < 1) {
1260 os <<
"For applying *propmat_clearskyAddParticles*, *rtp_los* needs to be specified\n" 1261 <<
"(at least zenith angle component for atmosphere_dim==1),\n" 1262 <<
"but it is not.\n";
1263 throw runtime_error(os.
str());
1264 }
else if (atmosphere_dim > 1 && rtp_los.
nelem() < 2) {
1266 os <<
"For applying *propmat_clearskyAddParticles*, *rtp_los* needs to be specified\n" 1267 <<
"(both zenith and azimuth angle components for atmosphere_dim>1),\n" 1268 <<
"but it is not.\n";
1269 throw runtime_error(os.
str());
1285 mirror_los(rtp_los_back, rtp_los, atmosphere_dim);
1291 if (do_jac_frequencies) {
1292 out1 <<
"WARNING:\n" 1293 <<
"Frequency perturbation not available for absorbing particles.\n";
1304 if (do_jac_temperature) {
1306 T_array = rtp_temperature;
1310 T_array = rtp_temperature;
1313 dir_array(0,
joker) = rtp_los_back;
1326 const Index nf = abs_vec_Nse[0][0].nbooks();
1327 Tensor3 tmp(nf, stokes_dim, stokes_dim);
1332 Index i_se_flat = 0;
1333 for (
Index i_ss = 0; i_ss < scat_data.
nelem(); i_ss++) {
1334 for (
Index i_se = 0; i_se < scat_data[i_ss].
nelem(); i_se++) {
1342 if (rtp_vmr[sp] < 0.) {
1344 os <<
"Negative absorbing particle 'vmr' (aka number density)" 1345 <<
" encountered:\n" 1346 <<
"scat species #" << i_ss <<
", scat elem #" << i_se
1347 <<
" (vmr_field entry #" << sp <<
")\n";
1348 throw runtime_error(os.
str());
1349 }
else if (rtp_vmr[sp] > 0.) {
1350 if (t_ok(i_se_flat, 0) < 0.) {
1352 os <<
"Temperature interpolation error:\n" 1353 <<
"scat species #" << i_ss <<
", scat elem #" << i_se <<
"\n";
1354 throw runtime_error(os.
str());
1356 if (use_abs_as_ext) {
1358 for (
Index iv = 0; iv < f_grid.
nelem(); iv++)
1359 propmat_clearsky[sp].AddAbsorptionVectorAtPosition(
1360 abs_vec_Nse[i_ss][i_se](iv, 0, 0,
joker), iv);
1362 for (
Index iv = 0; iv < f_grid.
nelem(); iv++)
1363 propmat_clearsky[sp].AddAbsorptionVectorAtPosition(
1364 abs_vec_Nse[i_ss][i_se](0, 0, 0,
joker), iv);
1367 for (
Index iv = 0; iv < f_grid.
nelem(); iv++)
1368 propmat_clearsky[sp].SetAtPosition(
1369 ext_mat_Nse[i_ss][i_se](iv, 0, 0,
joker,
joker), iv);
1371 for (
Index iv = 0; iv < f_grid.
nelem(); iv++)
1372 propmat_clearsky[sp].SetAtPosition(
1373 ext_mat_Nse[i_ss][i_se](0, 0, 0,
joker,
joker), iv);
1375 propmat_clearsky[sp] *= rtp_vmr[sp];
1379 if (do_jac_temperature) {
1380 if (t_ok(i_se_flat, 1) < 0.) {
1382 os <<
"Temperature interpolation error (in perturbation):\n" 1383 <<
"scat species #" << i_ss <<
", scat elem #" << i_se <<
"\n";
1384 throw runtime_error(os.
str());
1389 if (do_jac) rtp_vmr_sum += rtp_vmr[sp];
1391 for (
Index iq = 0; iq < jacobian_quantities_position.
nelem(); iq++) {
1402 if (jacobian_quantities[jacobian_quantities_position[iq]] ==
1404 if (use_abs_as_ext) {
1407 tmp(joker, joker, 0) -=
1418 for (
Index iv = 0; iv < f_grid.
nelem(); iv++)
1420 dpropmat_clearsky_dx[iq].AddAbsorptionVectorAtPosition(
1421 tmp(iv,
joker, 0), iv);
1423 dpropmat_clearsky_dx[iq].AddAtPosition(tmp(iv,
joker,
joker),
1426 for (
Index iv = 0; iv < f_grid.
nelem(); iv++)
1428 dpropmat_clearsky_dx[iq].AddAbsorptionVectorAtPosition(
1429 tmp(0,
joker, 0), iv);
1431 dpropmat_clearsky_dx[iq].AddAtPosition(tmp(0,
joker,
joker),
1473 else if (jacobian_quantities[jacobian_quantities_position[iq]] ==
1475 for (
Index iv = 0; iv < f_grid.
nelem(); iv++)
1476 dpropmat_clearsky_dx[iq].AddAtPosition(propmat_clearsky[sp], iv);
1493 if (rtp_vmr_sum != 0.0) {
1494 for (
Index iq = 0; iq < jacobian_quantities_position.
nelem(); iq++) {
1495 if (jacobian_quantities[jacobian_quantities_position[iq]] ==
1497 dpropmat_clearsky_dx[iq] /= rtp_vmr_sum;
1517 const Numeric& rtp_temperature,
1520 const Agenda& abs_xsec_agenda,
1531 Matrix abs_coef, src_coef;
1532 ArrayOfMatrix abs_coef_per_species, src_coef_per_species, dabs_coef_dx,
1550 for (
Index i = 0;
i < abs_species.
nelem(); ++
i) abs_species_active[
i] =
i;
1554 abs_xsec_per_species,
1555 src_xsec_per_species,
1556 dabs_xsec_per_species_dx,
1557 dsrc_xsec_per_species_dx,
1559 jacobian_quantities,
1573 abs_coef_per_species,
1574 src_coef_per_species,
1575 abs_xsec_per_species,
1576 src_xsec_per_species,
1577 dabs_xsec_per_species_dx,
1578 dsrc_xsec_per_species_dx,
1580 jacobian_quantities,
1588 dpropmat_clearsky_dx,
1589 abs_coef_per_species,
1594 if (not nlte_source.empty())
1598 src_coef_per_species,
1600 jacobian_quantities,
1609 const Index& stokes_dim,
1611 propmat_clearsky.resize(1);
1613 propmat_clearsky[0].SetZero();
1619 for (
auto&
pm : propmat_clearsky)
1620 for (
Index i = 0;
i <
pm.NumberOfFrequencies();
i++)
1621 if (
pm.Kjj()[
i] < 0.0)
pm.SetAtPosition(0.0,
i);
1636 #ifdef ENABLE_NETCDF 1642 const Tensor7& propmat_clearsky_field,
1643 const Index& atmosphere_dim,
1648 int nlev_dimid, nlyr_dimid, nwvl_dimid, stokes_dimid, none_dimid;
1650 int wvlmin_varid, wvlmax_varid, z_varid, wvl_varid, tau_varid;
1652 if (atmosphere_dim != 1)
1653 throw runtime_error(
"WriteMolTau can only be used for atmosphere_dim=1");
1655 #pragma omp critical(netcdf__critical_region) 1658 if ((retval = nc_create(filename.c_str(), NC_CLOBBER, &ncid)))
1662 if ((retval = nc_def_dim(ncid,
"nlev", (
int)z_field.
npages(), &nlev_dimid)))
1666 nc_def_dim(ncid,
"nlyr", (
int)z_field.
npages() - 1, &nlyr_dimid)))
1669 if ((retval = nc_def_dim(ncid,
"nwvl", (
int)f_grid.
nelem(), &nwvl_dimid)))
1672 if ((retval = nc_def_dim(ncid,
"none", 1, &none_dimid)))
1675 if ((retval = nc_def_dim(ncid,
1677 (
int)propmat_clearsky_field.
nbooks(),
1682 if ((retval = nc_def_var(
1683 ncid,
"wvlmin", NC_DOUBLE, 1, &none_dimid, &wvlmin_varid)))
1686 if ((retval = nc_def_var(
1687 ncid,
"wvlmax", NC_DOUBLE, 1, &none_dimid, &wvlmax_varid)))
1690 if ((retval = nc_def_var(ncid,
"z", NC_DOUBLE, 1, &nlev_dimid, &z_varid)))
1694 nc_def_var(ncid,
"wvl", NC_DOUBLE, 1, &nwvl_dimid, &wvl_varid)))
1697 dimids[0] = nlyr_dimid;
1698 dimids[1] = nwvl_dimid;
1699 dimids[2] = stokes_dimid;
1700 dimids[3] = stokes_dimid;
1703 nc_def_var(ncid,
"tau", NC_DOUBLE, 4, &dimids[0], &tau_varid)))
1707 if ((retval = nc_put_att_text(ncid, wvlmin_varid,
"units", 2,
"nm")))
1710 if ((retval = nc_put_att_text(ncid, wvlmax_varid,
"units", 2,
"nm")))
1713 if ((retval = nc_put_att_text(ncid, z_varid,
"units", 2,
"km")))
1716 if ((retval = nc_put_att_text(ncid, wvl_varid,
"units", 2,
"nm")))
1719 if ((retval = nc_put_att_text(ncid, tau_varid,
"units", 1,
"-")))
1724 if ((retval = nc_enddef(ncid)))
nca_error(retval,
"nc_enddef");
1729 if ((retval = nc_put_var_double(ncid, wvlmin_varid, &wvlmin[0])))
1734 if ((retval = nc_put_var_double(ncid, wvlmax_varid, &wvlmax[0])))
1737 double z[z_field.
npages()];
1738 for (
int iz = 0; iz < z_field.
npages(); iz++)
1739 z[iz] = z_field(z_field.
npages() - 1 - iz, 0, 0) * 1e-3;
1741 if ((retval = nc_put_var_double(ncid, z_varid, &z[0])))
1744 double wvl[f_grid.
nelem()];
1745 for (
int iv = 0; iv < f_grid.
nelem(); iv++)
1748 if ((retval = nc_put_var_double(ncid, wvl_varid, &wvl[0])))
1753 const Index amfnb = propmat_clearsky_field.
nbooks();
1758 for (
int is = 0; is < propmat_clearsky_field.
nlibraries(); is++)
1759 for (
int iz = 0; iz < zfnp; iz++)
1760 for (
int iv = 0; iv < fgne; iv++)
1761 for (
int is1 = 0; is1 < amfnb; is1++)
1762 for (
int is2 = 0; is2 < amfnb; is2++)
1764 tau(iz, iv, is1, is2) +=
1766 (propmat_clearsky_field(is,
1767 f_grid.
nelem() - 1 - iv,
1770 z_field.
npages() - 1 - iz,
1773 propmat_clearsky_field(is,
1774 f_grid.
nelem() - 1 - iv,
1777 z_field.
npages() - 2 - iz,
1780 (z_field(z_field.
npages() - 1 - iz, 0, 0) -
1781 z_field(z_field.
npages() - 2 - iz, 0, 0));
1783 if ((retval = nc_put_var_double(ncid, tau_varid, tau.
get_c_array())))
1787 if ((retval = nc_close(ncid)))
nca_error(retval,
"nc_close");
1801 throw runtime_error(
1802 "The workspace method WriteMolTau is not available" 1803 "because ARTS was compiled without NetCDF support.");
1827 const Index& lbl_checked,
1829 if (not abs_lines_per_species.
nelem())
return;
1831 if (not lbl_checked)
1832 throw std::runtime_error(
"Please set lbl_checked true to use this function");
1835 if (
min(abs_t) < 0) {
1837 os <<
"Temperature must be at least 0 K. But you request an absorption\n" 1838 <<
"calculation at " <<
min(abs_t) <<
" K!";
1839 throw std::runtime_error(os.str());
1846 const Index n_xsec = abs_xsec_per_species.
nelem();
1848 const Index n_lines = abs_lines_per_species.
nelem();
1850 if (n_tgs not_eq n_xsec or n_tgs not_eq n_vmrs or n_tgs not_eq n_lines) {
1852 os <<
"The following variables must all have the same dimension:\n" 1853 <<
"abs_species: " << abs_species.
nelem() <<
'\n' 1854 <<
"abs_xsec_per_species: " << abs_xsec_per_species.
nelem() <<
'\n' 1855 <<
"abs_vmrs: " << abs_vmrs.
nrows() <<
'\n' 1856 <<
"abs_lines_per_species: " << abs_lines_per_species.
nelem() <<
'\n';
1857 throw std::runtime_error(os.str());
1863 const bool do_lte = abs_nlte.
Data().
empty();
1867 static Matrix dummy1(0, 0);
1871 for (
Index ii = 0; ii < abs_species_active.
nelem(); ++ii) {
1872 const Index i = abs_species_active[ii];
1877 for (
auto& lines: abs_lines_per_species[i]) {
1879 abs_xsec_per_species[i],
1880 src_xsec_per_species[i],
1882 do_jac ? dabs_xsec_per_species_dx[i] : dummy2,
1883 (do_jac and not do_lte) ? dsrc_xsec_per_species_dx[i] : dummy2,
1885 jacobian_quantities,
1895 partition_functions.
getParamType(lines.QuantumIdentity()),
1896 partition_functions.
getParam(lines.QuantumIdentity()));
Numeric dotprod_with_los(ConstVectorView los, const Numeric &u, const Numeric &v, const Numeric &w, const Index &atmosphere_dim)
Calculates the dot product between a field and a LOS.
INDEX Index
The type to use for all integer numbers and indices.
ArrayOfIndex equivalent_propmattype_indexes(const ArrayOfRetrievalQuantity &js)
Returns a list of positions for the derivatives in Propagation Matrix calculations.
Array< PropagationMatrix > ArrayOfPropagationMatrix
void abs_speciesDefineAll(ArrayOfArrayOfSpeciesTag &abs_species, Index &propmat_clearsky_agenda_checked, Index &abs_xsec_agenda_checked, const Verbosity &verbosity)
WORKSPACE METHOD: abs_speciesDefineAll.
void isotopologue_ratiosInitFromBuiltin(SpeciesAuxData &isotopologue_ratios, const Verbosity &)
WORKSPACE METHOD: isotopologue_ratiosInitFromBuiltin.
This file contains basic functions to handle NetCDF data files.
Index nelem() const
Number of elements.
void propmat_clearskyAddFaraday(ArrayOfPropagationMatrix &propmat_clearsky, ArrayOfPropagationMatrix &dpropmat_clearsky_dx, const Index &stokes_dim, const Index &atmosphere_dim, const Vector &f_grid, const ArrayOfArrayOfSpeciesTag &abs_species, const ArrayOfRetrievalQuantity &jacobian_quantities, const Vector &rtp_vmr, const Vector &rtp_los, const Vector &rtp_mag, const Verbosity &)
WORKSPACE METHOD: propmat_clearskyAddFaraday.
bool do_magnetic_jacobian(const ArrayOfRetrievalQuantity &js) noexcept
Returns if the array wants a magnetic derivative.
Declarations having to do with the four output streams.
void propmat_clearskyAddFromAbsCoefPerSpecies(ArrayOfPropagationMatrix &propmat_clearsky, ArrayOfPropagationMatrix &dpropmat_clearsky_dx, const ArrayOfMatrix &abs_coef_per_species, const ArrayOfMatrix &dabs_coef_dx, const Verbosity &)
WORKSPACE METHOD: propmat_clearskyAddFromAbsCoefPerSpecies.
void abs_speciesSet(ArrayOfArrayOfSpeciesTag &abs_species, Index &abs_xsec_agenda_checked, Index &propmat_clearsky_agenda_checked, const ArrayOfString &names, const Verbosity &verbosity)
WORKSPACE METHOD: abs_speciesSet.
Routines for setting up the jacobian.
void ReverseLines() noexcept
Reverses the order of the internal lines.
void nca_error(const int e, const String s)
Throws a runtime error for the given NetCDF error code.
void propmat_clearskyForceNegativeToZero(ArrayOfPropagationMatrix &propmat_clearsky, const Verbosity &)
WORKSPACE METHOD: propmat_clearskyForceNegativeToZero.
const Numeric VACUUM_PERMITTIVITY
const Tensor4 & Data() const noexcept
Energy level type.
Numeric frequency_perturbation(const ArrayOfRetrievalQuantity &js) noexcept
Returns the frequency perturbation if it exists.
void propmat_clearskyAddParticles(ArrayOfPropagationMatrix &propmat_clearsky, ArrayOfPropagationMatrix &dpropmat_clearsky_dx, const Index &stokes_dim, const Index &atmosphere_dim, const Vector &f_grid, const ArrayOfArrayOfSpeciesTag &abs_species, const ArrayOfRetrievalQuantity &jacobian_quantities, const Vector &rtp_vmr, const Vector &rtp_los, const Numeric &rtp_temperature, const ArrayOfArrayOfSingleScatteringData &scat_data, const Index &scat_data_checked, const Index &use_abs_as_ext, const Verbosity &verbosity)
WORKSPACE METHOD: propmat_clearskyAddParticles.
Array< StokesVector > ArrayOfStokesVector
void fillSpeciesAuxDataWithPartitionFunctionsFromSpeciesData(SpeciesAuxData &sad)
Fill SpeciesAuxData with default partition functions from species data.
void abs_xsec_per_speciesAddLines(ArrayOfMatrix &abs_xsec_per_species, ArrayOfMatrix &src_xsec_per_species, ArrayOfArrayOfMatrix &dabs_xsec_per_species_dx, ArrayOfArrayOfMatrix &dsrc_xsec_per_species_dx, const ArrayOfArrayOfSpeciesTag &abs_species, const ArrayOfRetrievalQuantity &jacobian_quantities, const ArrayOfIndex &abs_species_active, const Vector &f_grid, const Vector &abs_p, const Vector &abs_t, const EnergyLevelMap &abs_nlte, const Matrix &abs_vmrs, const ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const SpeciesAuxData &isotopologue_ratios, const SpeciesAuxData &partition_functions, const Index &lbl_checked, const Verbosity &)
WORKSPACE METHOD: abs_xsec_per_speciesAddLines.
Index NumLines() const noexcept
Number of lines.
This file contains basic functions to handle XML data files.
This file contains basic functions to handle ASCII files.
void find_xml_file(String &filename, const Verbosity &verbosity)
Find an xml file.
Stokes vector is as Propagation matrix but only has 4 possible values.
Numeric number_density(const Numeric &p, const Numeric &t)
number_density
bool supports_continuum(const ArrayOfRetrievalQuantity &js)
Returns if the array supports continuum derivatives.
Index nelem() const
Returns the number of elements.
const Array< SpeciesRecord > species_data
Species Data.
const Numeric ELECTRON_CHARGE
const Numeric SPEED_OF_LIGHT
Numeric magnetic_field_perturbation(const ArrayOfRetrievalQuantity &js) noexcept
Returns the magnetic field perturbation if it exists.
This file contains the definition of Array.
bool is_frequency_parameter(const RetrievalQuantity &t) noexcept
Returns if the Retrieval quantity is a frequency parameter in propagation matrix calculations.
const SpeciesRecord & SpeciesDataOfBand(const AbsorptionLines &band)
Returns the species data.
const Array< IsotopologueRecord > & Isotopologue() const
Index ncols() const
Returns the number of columns.
const AuxType & getParamType(const Index species, const Index isotopologue) const
Return a constant reference to the parameter types.
Numeric dplanck_dt(const Numeric &f, const Numeric &t)
dplanck_dt
bool supports_propmat_clearsky(const ArrayOfRetrievalQuantity &js)
Returns if the array supports propagation matrix derivatives.
Index TotalNumberOfElements(const Array< Array< base > > &aa)
Determine total number of elements in an ArrayOfArray.
The global header file for ARTS.
_CS_string_type str() const
void partition_functionsInitFromBuiltin(SpeciesAuxData &partition_functions, const Verbosity &)
WORKSPACE METHOD: partition_functionsInitFromBuiltin.
void AbsInputFromRteScalars(Vector &abs_p, Vector &abs_t, Matrix &abs_vmrs, const Numeric &rtp_pressure, const Numeric &rtp_temperature, const Vector &rtp_vmr, const Verbosity &)
WORKSPACE METHOD: AbsInputFromRteScalars.
Numeric getIsotopologueRatio(const SpeciesTag &st) const
Returns mparams[st.Species()][st.Isotopologue()][0].data[0] if st.Isotopologue() > 0...
Numeric dplanck_df(const Numeric &f, const Numeric &t)
dplanck_df
void abs_cont_descriptionInit(ArrayOfString &abs_cont_names, ArrayOfString &abs_cont_options, ArrayOfVector &abs_cont_parameters, const Verbosity &verbosity)
WORKSPACE METHOD: abs_cont_descriptionInit.
void propmat_clearskyAddOnTheFly(Workspace &ws, ArrayOfPropagationMatrix &propmat_clearsky, ArrayOfStokesVector &nlte_source, ArrayOfPropagationMatrix &dpropmat_clearsky_dx, ArrayOfStokesVector &dnlte_dx_source, ArrayOfStokesVector &nlte_dsource_dx, const Vector &f_grid, const ArrayOfArrayOfSpeciesTag &abs_species, const ArrayOfRetrievalQuantity &jacobian_quantities, const Numeric &rtp_pressure, const Numeric &rtp_temperature, const EnergyLevelMap &rtp_nlte, const Vector &rtp_vmr, const Agenda &abs_xsec_agenda, const Verbosity &verbosity)
WORKSPACE METHOD: propmat_clearskyAddOnTheFly.
void xsec_species(Matrix &xsec, Matrix &source, Matrix &phase, ArrayOfMatrix &dxsec_dx, ArrayOfMatrix &dsource_dx, ArrayOfMatrix &dphase_dx, const ArrayOfRetrievalQuantity &jacobian_quantities, const ArrayOfIndex &jacobian_propmat_positions, const Vector &f_grid, const Vector &abs_p, const Vector &abs_t, const EnergyLevelMap &abs_nlte, const Matrix &abs_vmrs, const ArrayOfArrayOfSpeciesTag &abs_species, const AbsorptionLines &band, const Numeric &isot_ratio, const SpeciesAuxData::AuxType &partfun_type, const ArrayOfGriddedField1 &partfun_data)
Cross-section algorithm.
A tag group can consist of the sum of several of these.
void AbsInputFromAtmFields(Vector &abs_p, Vector &abs_t, Matrix &abs_vmrs, const Index &atmosphere_dim, const Vector &p_grid, const Tensor3 &t_field, const Tensor4 &vmr_field, const Verbosity &)
WORKSPACE METHOD: AbsInputFromAtmFields.
void abs_coefCalcFromXsec(Matrix &abs_coef, Matrix &src_coef, ArrayOfMatrix &dabs_coef_dx, ArrayOfMatrix &dsrc_coef_dx, ArrayOfMatrix &abs_coef_per_species, ArrayOfMatrix &src_coef_per_species, const ArrayOfMatrix &abs_xsec_per_species, const ArrayOfMatrix &src_xsec_per_species, const ArrayOfArrayOfMatrix &dabs_xsec_per_species_dx, const ArrayOfArrayOfMatrix &dsrc_xsec_per_species_dx, const ArrayOfArrayOfSpeciesTag &abs_species, const ArrayOfRetrievalQuantity &jacobian_quantities, const Matrix &abs_vmrs, const Vector &abs_p, const Vector &abs_t, const Verbosity &verbosity)
WORKSPACE METHOD: abs_coefCalcFromXsec.
void AppendSingleLine(SingleLine &&sl)
Appends a single line to the absorption lines.
void WriteMolTau(const Vector &f_grid, const Tensor3 &z_field, const Tensor7 &propmat_clearsky_field, const Index &atmosphere_dim, const String &filename, const Verbosity &)
WORKSPACE METHOD: WriteMolTau.
void abs_speciesDefineAllInScenario(ArrayOfArrayOfSpeciesTag &tgs, Index &propmat_clearsky_agenda_checked, Index &abs_xsec_agenda_checked, const String &basename, const Verbosity &verbosity)
WORKSPACE METHOD: abs_speciesDefineAllInScenario.
Numeric temperature_perturbation(const ArrayOfRetrievalQuantity &js) noexcept
Returns the temperature perturbation if it exists.
const ArrayOfGriddedField1 & getParam(const Index species, const Index isotopologue) const
Return a constant reference to the parameters.
Numeric dnumber_density_dt(const Numeric &p, const Numeric &t)
dnumber_density_dT
NUMERIC Numeric
The type to use for all floating point numbers.
Index nlibraries() const
Returns the number of libraries.
Declarations required for the calculation of absorption coefficients.
Array< Matrix > ArrayOfMatrix
An array of matrices.
void xsec_continuum_tag(MatrixView xsec, const String &name, ConstVectorView parameters, const String &model, ConstVectorView f_grid, ConstVectorView abs_p, ConstVectorView abs_t, ConstVectorView abs_n2, ConstVectorView abs_h2o, ConstVectorView abs_o2, ConstVectorView vmr, const Verbosity &verbosity)
Calculates model absorption for one continuum or full model tag.
int main(int argc, char **argv)
This is the main function of ARTS.
void abs_xsec_per_speciesAddConts(ArrayOfMatrix &abs_xsec_per_species, ArrayOfArrayOfMatrix &dabs_xsec_per_species_dx, const ArrayOfArrayOfSpeciesTag &tgs, const ArrayOfRetrievalQuantity &jacobian_quantities, const ArrayOfIndex &abs_species_active, const Vector &f_grid, const Vector &abs_p, const Vector &abs_t, const Matrix &abs_vmrs, const ArrayOfString &abs_cont_names, const ArrayOfVector &abs_cont_parameters, const ArrayOfString &abs_cont_models, const Verbosity &verbosity)
WORKSPACE METHOD: abs_xsec_per_speciesAddConts.
Implementation of Matrix, Vector, and such stuff.
bool do_temperature_jacobian(const ArrayOfRetrievalQuantity &js) noexcept
Returns if the array wants the temperature derivative.
void abs_xsec_per_speciesInit(ArrayOfMatrix &abs_xsec_per_species, ArrayOfMatrix &src_xsec_per_species, ArrayOfArrayOfMatrix &dabs_xsec_per_species_dx, ArrayOfArrayOfMatrix &dsrc_xsec_per_species_dx, const ArrayOfArrayOfSpeciesTag &tgs, const ArrayOfRetrievalQuantity &jacobian_quantities, const ArrayOfIndex &abs_species_active, const Vector &f_grid, const Vector &abs_p, const Index &abs_xsec_agenda_checked, const Index &nlte_do, const Verbosity &verbosity)
WORKSPACE METHOD: abs_xsec_per_speciesInit.
bool species_match(const RetrievalQuantity &rq, const ArrayOfSpeciesTag &ast)
Returns if the Retrieval quantity is VMR derivative for all the species in the species tags...
basic_ostringstream< char, string_char_traits< char >, alloc > ostringstream
Index npages() const
Returns the number of pages.
This can be used to make arrays out of anything.
VectorView Kjj(const Index iz=0, const Index ia=0)
Vector view to diagonal elements.
void nlte_sourceFromTemperatureAndSrcCoefPerSpecies(ArrayOfStokesVector &nlte_source, ArrayOfStokesVector &dnlte_dx_source, ArrayOfStokesVector &nlte_dsource_dx, const ArrayOfMatrix &src_coef_per_species, const ArrayOfMatrix &dsrc_coef_dx, const ArrayOfRetrievalQuantity &jacobian_quantities, const Vector &f_grid, const Numeric &rtp_temperature, const Verbosity &)
WORKSPACE METHOD: nlte_sourceFromTemperatureAndSrcCoefPerSpecies.
void resize(Index n)
Resize function.
bool empty() const
Check if variable is empty.
void abs_cont_descriptionAppend(ArrayOfString &abs_cont_names, ArrayOfString &abs_cont_models, ArrayOfVector &abs_cont_parameters, const String &tagname, const String &model, const Vector &userparameters, const Verbosity &)
WORKSPACE METHOD: abs_cont_descriptionAppend.
void abs_xsec_agendaExecute(Workspace &ws, ArrayOfMatrix &abs_xsec_per_species, ArrayOfMatrix &src_xsec_per_species, ArrayOfArrayOfMatrix &dabs_xsec_per_species_dx, ArrayOfArrayOfMatrix &dsrc_xsec_per_species_dx, const ArrayOfArrayOfSpeciesTag &abs_species, const ArrayOfRetrievalQuantity &jacobian_quantities, const ArrayOfIndex &abs_species_active, const Vector &f_grid, const Vector &abs_p, const Vector &abs_t, const EnergyLevelMap &abs_nlte, const Matrix &abs_vmrs, const Agenda &input_agenda)
Index nelem(const Lines &l)
Number of lines.
Workspace methods and template functions for supergeneric XML IO.
Lines createEmptyCopy(const Lines &al) noexcept
Creates a copy of the input lines structure.
bool supports_faraday(const ArrayOfRetrievalQuantity &js)
Returns if the array supports Faraday derivatives.
Numeric planck(const Numeric &f, const Numeric &t)
planck
const Numeric ELECTRON_MASS
void opt_prop_NScatElems(ArrayOfArrayOfTensor5 &ext_mat, ArrayOfArrayOfTensor4 &abs_vec, ArrayOfArrayOfIndex &ptypes, Matrix &t_ok, const ArrayOfArrayOfSingleScatteringData &scat_data, const Index &stokes_dim, const Vector &T_array, const Matrix &dir_array, const Index &f_index, const Index &t_interp_order)
Extinction and absorption from all scattering elements.
void abs_lines_per_speciesCreateFromLines(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const ArrayOfAbsorptionLines &abs_lines, const ArrayOfArrayOfSpeciesTag &tgs, const Verbosity &)
WORKSPACE METHOD: abs_lines_per_speciesCreateFromLines.
void fillSpeciesAuxDataWithIsotopologueRatiosFromSpeciesData(SpeciesAuxData &sad)
Fill SpeciesAuxData with default isotopologue ratios from species data.
bool species_iso_match(const RetrievalQuantity &rq, const Index species, const Index iso)
Returns if the Retrieval quantity is VMR derivative for all the species in the species tags...
void mirror_los(Vector &los_mirrored, ConstVectorView los, const Index &atmosphere_dim)
Determines the backward direction for a given line-of-sight.
void propmat_clearskyZero(ArrayOfPropagationMatrix &propmat_clearsky, const Vector &f_grid, const Index &stokes_dim, const Verbosity &)
WORKSPACE METHOD: propmat_clearskyZero.
Auxiliary data for isotopologues.
This file contains header information for the dealing with command line parameters.
bool supports_particles(const ArrayOfRetrievalQuantity &js)
Returns if the array supports particulate derivatives.
void propmat_clearskyInit(ArrayOfPropagationMatrix &propmat_clearsky, ArrayOfStokesVector &nlte_source, ArrayOfPropagationMatrix &dpropmat_clearsky_dx, ArrayOfStokesVector &dnlte_dx_source, ArrayOfStokesVector &nlte_dsource_dx, const ArrayOfArrayOfSpeciesTag &abs_species, const ArrayOfRetrievalQuantity &jacobian_quantities, const Vector &f_grid, const Index &stokes_dim, const Index &propmat_clearsky_agenda_checked, const Index &nlte_do, const Verbosity &)
WORKSPACE METHOD: propmat_clearskyInit.
void set_vmr_from_first_species(Vector &vmr, const String &species_name, const ArrayOfArrayOfSpeciesTag &abs_species, const Matrix &abs_vmrs)
set_abs_from_first_species.
invlib::Matrix< ArtsMatrix > Matrix
invlib wrapper type for ARTS matrices.
Scattering database structure and functions.
bool do_frequency_jacobian(const ArrayOfRetrievalQuantity &js) noexcept
Returns if the array wants a frequency derivative.
This file contains declerations of functions of physical character.
Index nrows() const
Returns the number of rows.
Index nbooks() const
Returns the number of books.
void check_continuum_model(const String &name)
An auxiliary functions that checks if a given continuum model is listed in species_data.cc.
Declaration of functions in rte.cc.
void resize(Index r, Index c)
Resize function.
const Numeric * get_c_array() const
Conversion to plain C-array.