ARTS 2.5.0 (git: 9ee3ac6c)
isotopologues.h
Go to the documentation of this file.
1#ifndef isotopologues_h
2#define isotopologues_h
3
4#include <limits>
5
6#include "mystring.h"
7#include "nonstd.h"
8#include "species.h"
9
10namespace Species {
11constexpr std::string_view Joker = "*";
12
17
19 std::string_view isotname;
20
23
26 constexpr explicit IsotopeRecord(Species spec_, const std::string_view isotname_=Joker, Numeric mass_=std::numeric_limits<Numeric>::quiet_NaN(), Index gi_=-1) noexcept
27 : spec(spec_), isotname(isotname_), mass(mass_), gi(gi_) {}
28 constexpr IsotopeRecord() noexcept : IsotopeRecord(Species::FINAL) {}
29 friend std::ostream& operator<<(std::ostream& os, const IsotopeRecord& ir) {
30 return os << ir.spec << ' ' << ir.isotname << ' ' << ir.mass << ' ' << ir.gi;
31 }
32 constexpr bool operator==(const IsotopeRecord& that) const noexcept {
33 return that.spec == spec and that.isotname == isotname;
34 }
35
37 constexpr bool operator==(const std::string_view specstr) const noexcept {
38 auto lim = specstr.find('-');
39 return (lim not_eq specstr.npos) and (fromShortName(specstr.substr(0, lim)) == spec) and (specstr.substr(lim+1) == isotname);
40 }
41
42 template <typename T> constexpr bool operator!=(T x)const noexcept {return not operator==(x);}
43
44 [[nodiscard]] String FullName() const noexcept {return String(toShortName(spec)) + String("-") + String(isotname);}
45 [[nodiscard]] constexpr bool joker() const noexcept {return isotname == Joker;}
46};
47
48#define deal_with_spec(SPEC) IsotopeRecord(Species::SPEC),
49
50constexpr std::array Isotopologues {
52 deal_with_spec(Water)
53 IsotopeRecord(fromShortName("H2O"), "161", 18.010565, 1),
54 IsotopeRecord(fromShortName("H2O"), "162", 19.016740, 6),
55 IsotopeRecord(fromShortName("H2O"), "171", 19.014780, 6),
56 IsotopeRecord(fromShortName("H2O"), "172", 20.020956, 36),
57 IsotopeRecord(fromShortName("H2O"), "181", 20.014811, 1),
58 IsotopeRecord(fromShortName("H2O"), "182", 21.020985, 6),
59 IsotopeRecord(fromShortName("H2O"), "262", 20.022915, 1),
60 IsotopeRecord(fromShortName("H2O"), "CP98"),
61 IsotopeRecord(fromShortName("H2O"), "ContMPM93"),
62 IsotopeRecord(fromShortName("H2O"), "ForeignContATM01"),
63 IsotopeRecord(fromShortName("H2O"), "ForeignContCKD222"),
64 IsotopeRecord(fromShortName("H2O"), "ForeignContCKD24"),
65 IsotopeRecord(fromShortName("H2O"), "ForeignContCKD242"),
66 IsotopeRecord(fromShortName("H2O"), "ForeignContCKDMT100"),
67 IsotopeRecord(fromShortName("H2O"), "ForeignContCKDMT252"),
68 IsotopeRecord(fromShortName("H2O"), "ForeignContCKDMT320"),
69 IsotopeRecord(fromShortName("H2O"), "ForeignContMaTippingType"),
70 IsotopeRecord(fromShortName("H2O"), "ForeignContStandardType"),
71 IsotopeRecord(fromShortName("H2O"), "MPM87"),
72 IsotopeRecord(fromShortName("H2O"), "MPM89"),
73 IsotopeRecord(fromShortName("H2O"), "MPM93"),
74 IsotopeRecord(fromShortName("H2O"), "PWR98"),
75 IsotopeRecord(fromShortName("H2O"), "SelfContCKD222"),
76 IsotopeRecord(fromShortName("H2O"), "SelfContCKD24"),
77 IsotopeRecord(fromShortName("H2O"), "SelfContCKD242"),
78 IsotopeRecord(fromShortName("H2O"), "SelfContCKDMT100"),
79 IsotopeRecord(fromShortName("H2O"), "SelfContCKDMT252"),
80 IsotopeRecord(fromShortName("H2O"), "SelfContCKDMT320"),
81 IsotopeRecord(fromShortName("H2O"), "SelfContStandardType"),
85 deal_with_spec(CarbonDioxide)
86 IsotopeRecord(fromShortName("CO2"), "626", 43.989830, 1),
87 IsotopeRecord(fromShortName("CO2"), "627", 44.994045, 6),
88 IsotopeRecord(fromShortName("CO2"), "628", 45.994076, 1),
89 IsotopeRecord(fromShortName("CO2"), "636", 44.993185, 2),
90 IsotopeRecord(fromShortName("CO2"), "637", 45.997400, 12),
91 IsotopeRecord(fromShortName("CO2"), "638", 46.997431, 2),
92 IsotopeRecord(fromShortName("CO2"), "727", 45.998262, 1),
93 IsotopeRecord(fromShortName("CO2"), "737", 47.001618, 2),
94 IsotopeRecord(fromShortName("CO2"), "827", 46.998291, 6),
95 IsotopeRecord(fromShortName("CO2"), "828", 47.998322, 1),
96 IsotopeRecord(fromShortName("CO2"), "837", 48.001646, 12),
97 IsotopeRecord(fromShortName("CO2"), "838", 49.001675, 2),
98 IsotopeRecord(fromShortName("CO2"), "CKD241"),
99 IsotopeRecord(fromShortName("CO2"), "CKDMT100"),
100 IsotopeRecord(fromShortName("CO2"), "CKDMT252"),
101 IsotopeRecord(fromShortName("CO2"), "ForeignContHo66"),
102 IsotopeRecord(fromShortName("CO2"), "ForeignContPWR93"),
103 IsotopeRecord(fromShortName("CO2"), "SelfContHo66"),
104 IsotopeRecord(fromShortName("CO2"), "SelfContPWR93"),
108 deal_with_spec(Ozone)
109 IsotopeRecord(fromShortName("O3"), "666", 47.984745, 1),
110 IsotopeRecord(fromShortName("O3"), "667", 48.988960, 6),
111 IsotopeRecord(fromShortName("O3"), "668", 49.988991, 1),
112 IsotopeRecord(fromShortName("O3"), "676", 48.988960, 6),
113 IsotopeRecord(fromShortName("O3"), "686", 49.988991, 1),
117 deal_with_spec(NitrogenOxide)
118 IsotopeRecord(fromShortName("N2O"), "446", 44.001062, 9),
119 IsotopeRecord(fromShortName("N2O"), "447", 45.005278, 54),
120 IsotopeRecord(fromShortName("N2O"), "448", 46.005308, 9),
121 IsotopeRecord(fromShortName("N2O"), "456", 44.998096, 6),
122 IsotopeRecord(fromShortName("N2O"), "546", 44.998096, 6),
126 deal_with_spec(CarbonMonoxide)
127 IsotopeRecord(fromShortName("CO"), "26", 27.994915, 1),
128 IsotopeRecord(fromShortName("CO"), "27", 28.999130, 6),
129 IsotopeRecord(fromShortName("CO"), "28", 29.999161, 1),
130 IsotopeRecord(fromShortName("CO"), "36", 28.998270, 2),
131 IsotopeRecord(fromShortName("CO"), "37", 30.002485, 12),
132 IsotopeRecord(fromShortName("CO"), "38", 31.002516, 2),
136 deal_with_spec(Methane)
137 IsotopeRecord(fromShortName("CH4"), "211", 16.031300, 1),
138 IsotopeRecord(fromShortName("CH4"), "212", 17.037475, 3),
139 IsotopeRecord(fromShortName("CH4"), "311", 17.034655, 2),
140 IsotopeRecord(fromShortName("CH4"), "312", 18.040830, 6),
144 deal_with_spec(Oxygen)
145 IsotopeRecord(fromShortName("O2"), "66", 31.989830, 1),
146 IsotopeRecord(fromShortName("O2"), "67", 32.994045, 6),
147 IsotopeRecord(fromShortName("O2"), "68", 33.994076, 1),
148 IsotopeRecord(fromShortName("O2"), "CIAfunCKDMT100"),
149 IsotopeRecord(fromShortName("O2"), "MPM2020"),
150 IsotopeRecord(fromShortName("O2"), "MPM85"),
151 IsotopeRecord(fromShortName("O2"), "MPM87"),
152 IsotopeRecord(fromShortName("O2"), "MPM89"),
153 IsotopeRecord(fromShortName("O2"), "MPM92"),
154 IsotopeRecord(fromShortName("O2"), "MPM93"),
155 IsotopeRecord(fromShortName("O2"), "PWR88"),
156 IsotopeRecord(fromShortName("O2"), "PWR93"),
157 IsotopeRecord(fromShortName("O2"), "PWR98"),
158 IsotopeRecord(fromShortName("O2"), "SelfContMPM93"),
159 IsotopeRecord(fromShortName("O2"), "SelfContPWR93"),
160 IsotopeRecord(fromShortName("O2"), "SelfContStandardType"),
161 IsotopeRecord(fromShortName("O2"), "TRE05"),
162 IsotopeRecord(fromShortName("O2"), "v0v0CKDMT100"),
163 IsotopeRecord(fromShortName("O2"), "v1v0CKDMT100"),
164 IsotopeRecord(fromShortName("O2"), "visCKDMT252"),
168 deal_with_spec(NitricOxide)
169 IsotopeRecord(fromShortName("NO"), "46", 29.997989, 3),
170 IsotopeRecord(fromShortName("NO"), "48", 32.002234, 3),
171 IsotopeRecord(fromShortName("NO"), "56", 30.995023, 2),
175 deal_with_spec(SulfurDioxide)
176 IsotopeRecord(fromShortName("SO2"), "626", 63.961901, 1),
177 IsotopeRecord(fromShortName("SO2"), "628", 66), // FIXME: Better mass and some gj?
178 IsotopeRecord(fromShortName("SO2"), "636", 65), // FIXME: Better mass and some gj?
179 IsotopeRecord(fromShortName("SO2"), "646", 65.957695, 1),
183 deal_with_spec(NitrogenDioxide)
184 IsotopeRecord(fromShortName("NO2"), "646", 45.992904, 3),
185 IsotopeRecord(fromShortName("NO2"), "656", 46.989938, 2),
189 deal_with_spec(Ammonia)
190 IsotopeRecord(fromShortName("NH3"), "4111", 17.026549, 3),
191 IsotopeRecord(fromShortName("NH3"), "4112", 18), // FIXME: Better mass and some gj?
192 IsotopeRecord(fromShortName("NH3"), "5111", 18.023583, 2),
196 deal_with_spec(NitricAcid)
197 IsotopeRecord(fromShortName("HNO3"), "146", 62.995644, 6),
198 IsotopeRecord(fromShortName("HNO3"), "156", 63.992680, 4),
202 deal_with_spec(Hydroxyl)
203 IsotopeRecord(fromShortName("OH"), "61", 17.002740, 2),
204 IsotopeRecord(fromShortName("OH"), "62", 18.008915, 3),
205 IsotopeRecord(fromShortName("OH"), "81", 19.006986, 2),
209 deal_with_spec(HydrogenFluoride)
210 IsotopeRecord(fromShortName("HF"), "19", 20.006229, 4),
211 IsotopeRecord(fromShortName("HF"), "29", 21.012404, 6),
215 deal_with_spec(HydrogenChloride)
216 IsotopeRecord(fromShortName("HCl"), "15", 35.976678, 8),
217 IsotopeRecord(fromShortName("HCl"), "17", 37.973729, 8),
218 IsotopeRecord(fromShortName("HCl"), "25", 36.982853, 12),
219 IsotopeRecord(fromShortName("HCl"), "27", 38.979904, 12),
223 deal_with_spec(HydrogenBromide)
224 IsotopeRecord(fromShortName("HBr"), "11", 81.924115, 8),
225 IsotopeRecord(fromShortName("HBr"), "19", 79.926160, 8),
226 IsotopeRecord(fromShortName("HBr"), "21", 82.930289, 12),
227 IsotopeRecord(fromShortName("HBr"), "29", 80.932336, 12),
231 deal_with_spec(HydrogenIodide)
232 IsotopeRecord(fromShortName("HI"), "17", 127.912297, 12),
233 IsotopeRecord(fromShortName("HI"), "27", 128.918472, 18),
237 deal_with_spec(ChlorineMonoxide)
238 IsotopeRecord(fromShortName("ClO"), "56", 50.963768, 4),
239 IsotopeRecord(fromShortName("ClO"), "76", 52.960819, 4),
243 deal_with_spec(CarbonylSulfide)
244 IsotopeRecord(fromShortName("OCS"), "622", 59.966986, 1),
245 IsotopeRecord(fromShortName("OCS"), "623", 60.966371, 4),
246 IsotopeRecord(fromShortName("OCS"), "624", 61.962780, 1),
247 IsotopeRecord(fromShortName("OCS"), "632", 60.970341, 2),
248 IsotopeRecord(fromShortName("OCS"), "634", 62.966137, 2),
249 IsotopeRecord(fromShortName("OCS"), "822", 61.971231, 1),
253 deal_with_spec(Formaldehyde)
254 IsotopeRecord(fromShortName("H2CO"), "126", 30.010565, 1),
255 IsotopeRecord(fromShortName("H2CO"), "128", 32.014811, 1),
256 IsotopeRecord(fromShortName("H2CO"), "136", 31.013920, 2),
260 deal_with_spec(HeavyFormaldehyde)
261 IsotopeRecord(fromShortName("HDCO"), "26", 31), // FIXME: Better mass and some gj? What is the AFGL code???
265 deal_with_spec(VeryHeavyFormaldehyde)
266 IsotopeRecord(fromShortName("D2CO"), "26", 32), // FIXME: Better mass and some gj? What is the AFGL code???
270 deal_with_spec(HypochlorousAcid)
271 IsotopeRecord(fromShortName("HOCl"), "165", 51.971593, 8),
272 IsotopeRecord(fromShortName("HOCl"), "167", 53.968644, 8),
276 deal_with_spec(Nitrogen)
277 IsotopeRecord(fromShortName("N2"), "44", 28.006148, 1),
278 IsotopeRecord(fromShortName("N2"), "45", 29.003182, 6),
279 IsotopeRecord(fromShortName("N2"), "CIAfunCKDMT100"),
280 IsotopeRecord(fromShortName("N2"), "CIAfunCKDMT252"),
281 IsotopeRecord(fromShortName("N2"), "CIArotCKDMT100"),
282 IsotopeRecord(fromShortName("N2"), "CIArotCKDMT252"),
283 IsotopeRecord(fromShortName("N2"), "DryContATM01"),
284 IsotopeRecord(fromShortName("N2"), "SelfContBorysow"),
285 IsotopeRecord(fromShortName("N2"), "SelfContMPM93"),
286 IsotopeRecord(fromShortName("N2"), "SelfContPWR93"),
287 IsotopeRecord(fromShortName("N2"), "SelfContStandardType"),
291 deal_with_spec(HydrogenCyanide)
292 IsotopeRecord(fromShortName("HCN"), "124", 27.010899, 6),
293 IsotopeRecord(fromShortName("HCN"), "125", 28.007933, 4),
294 IsotopeRecord(fromShortName("HCN"), "134", 28.014254, 12),
295 IsotopeRecord(fromShortName("HCN"), "224", 28), // FIXME: Better mass and some gj?
299 deal_with_spec(Chloromethane)
300 IsotopeRecord(fromShortName("CH3Cl"), "215", 49.992328, 4),
301 IsotopeRecord(fromShortName("CH3Cl"), "217", 51.989379, 4),
305 deal_with_spec(HydrogenPeroxide)
306 IsotopeRecord(fromShortName("H2O2"), "1661", 34.005480, 1),
310 deal_with_spec(Acetylene)
311 IsotopeRecord(fromShortName("C2H2"), "1221", 26.015650, 1),
312 IsotopeRecord(fromShortName("C2H2"), "1222", 27.021825, 6),
313 IsotopeRecord(fromShortName("C2H2"), "1231", 27.019005, 8),
317 deal_with_spec(Ethane)
318 IsotopeRecord(fromShortName("C2H6"), "1221", 30.046950, 1),
319 IsotopeRecord(fromShortName("C2H6"), "1231", 31.050305, 2),
323 deal_with_spec(Phosphine)
324 IsotopeRecord(fromShortName("PH3"), "1111", 33.997238, 2),
328 deal_with_spec(CarbonylFluoride)
329 IsotopeRecord(fromShortName("COF2"), "269", 65.991722, 1),
330 IsotopeRecord(fromShortName("COF2"), "369", 66.995083, 2),
334 deal_with_spec(SulfurHexafluoride)
335 IsotopeRecord(fromShortName("SF6"), "29", 145.962492, 1),
339 deal_with_spec(HydrogenSulfide)
340 IsotopeRecord(fromShortName("H2S"), "121", 33.987721, 1),
341 IsotopeRecord(fromShortName("H2S"), "122", 35), // FIXME: Better mass and some gj?
342 IsotopeRecord(fromShortName("H2S"), "131", 34.987105, 4),
343 IsotopeRecord(fromShortName("H2S"), "141", 35.983515, 1),
347 deal_with_spec(FormicAcid)
348 IsotopeRecord(fromShortName("HCOOH"), "126", 46.005480, 4),
349 IsotopeRecord(fromShortName("HCOOH"), "136", 47), // FIXME: Better mass and some gj?
353 deal_with_spec(LeftHeavyFormicAcid)
354 IsotopeRecord(fromShortName("DCOOH"), "266", 47), // FIXME: Better mass and some gj? What is the AFGL code???
358 deal_with_spec(RightHeavyFormicAcid)
359 IsotopeRecord(fromShortName("HCOOD"), "266", 47), // FIXME: Better mass and some gj? What is the AFGL code???
363 deal_with_spec(Hydroperoxyl)
364 IsotopeRecord(fromShortName("HO2"), "166", 32.997655, 2),
368 deal_with_spec(OxygenAtom)
369 IsotopeRecord(fromShortName("O"), "6", 15.994915, 1),
373 deal_with_spec(ChlorineNitrate)
374 IsotopeRecord(fromShortName("ClONO2"), "5646", 96.956672, 12),
375 IsotopeRecord(fromShortName("ClONO2"), "7646", 98.953723, 12),
379 deal_with_spec(NitricOxideCation)
380 IsotopeRecord(fromShortName("NO+"), "46", 29.997989, 3),
384 deal_with_spec(ChlorineDioxide)
385 IsotopeRecord(fromShortName("OClO"), "656", 67), // FIXME: Better mass and some gj?
386 IsotopeRecord(fromShortName("OClO"), "676", 69), // FIXME: Better mass and some gj?
390 deal_with_spec(BromineMonoxide)
391 IsotopeRecord(fromShortName("BrO"), "16", 97), // FIXME: Better mass and some gj?
392 IsotopeRecord(fromShortName("BrO"), "96", 95), // FIXME: Better mass and some gj?
396 deal_with_spec(SulfuricAcid)
397 IsotopeRecord(fromShortName("H2SO4"), "126", 98), // FIXME: Better mass and some gj?
401 deal_with_spec(ChlorineMonoxideDimer)
402 IsotopeRecord(fromShortName("Cl2O2"), "565", 102), // FIXME: Better mass and some gj?
403 IsotopeRecord(fromShortName("Cl2O2"), "765", 104), // FIXME: Better mass and some gj?
407 deal_with_spec(HypobromousAcid)
408 IsotopeRecord(fromShortName("HOBr"), "161", 97.919027, 8),
409 IsotopeRecord(fromShortName("HOBr"), "169", 95.921076, 8),
413 deal_with_spec(Ethylene)
414 IsotopeRecord(fromShortName("C2H4"), "221", 28.031300, 1),
415 IsotopeRecord(fromShortName("C2H4"), "231", 29.034655, 2),
419 deal_with_spec(Methanol)
420 IsotopeRecord(fromShortName("CH3OH"), "2161", 32.026215, 2),
424 deal_with_spec(Bromomethane)
425 IsotopeRecord(fromShortName("CH3Br"), "211", 95.939764, 4),
426 IsotopeRecord(fromShortName("CH3Br"), "219", 93.941811, 4),
430 deal_with_spec(Acetonitrile)
431 IsotopeRecord(fromShortName("CH3CN"), "2124", 41.026549, 3),
432 IsotopeRecord(fromShortName("CH3CN"), "2125", 42), // FIXME: Better mass and some gj?
433 IsotopeRecord(fromShortName("CH3CN"), "2134", 42), // FIXME: Better mass and some gj?
434 IsotopeRecord(fromShortName("CH3CN"), "3124", 42), // FIXME: Better mass and some gj?
438 deal_with_spec(HeavyAcetonitrile)
439 IsotopeRecord(fromShortName("CH2DCN"), "224", 42), // FIXME: Better mass and some gj? What is the AFGL code???
443 deal_with_spec(CarbonTetrafluoride)
444 IsotopeRecord(fromShortName("CF4"), "29", 87.993616, 1),
448 deal_with_spec(Diacetylene)
449 IsotopeRecord(fromShortName("C4H2"), "2211", 50.015650, 1),
453 deal_with_spec(Cyanoacetylene)
454 IsotopeRecord(fromShortName("HC3N"), "12224", 51.010899, 6),
455 IsotopeRecord(fromShortName("HC3N"), "12225", 52), // FIXME: Better mass and some gj?
456 IsotopeRecord(fromShortName("HC3N"), "12234", 52), // FIXME: Better mass and some gj?
457 IsotopeRecord(fromShortName("HC3N"), "12324", 52), // FIXME: Better mass and some gj?
458 IsotopeRecord(fromShortName("HC3N"), "13224", 52), // FIXME: Better mass and some gj?
459 IsotopeRecord(fromShortName("HC3N"), "22224", 52), // FIXME: Better mass and some gj?
463 deal_with_spec(Hydrogen)
464 IsotopeRecord(fromShortName("H2"), "11", 2.015650, 1),
465 IsotopeRecord(fromShortName("H2"), "12", 3.021825, 6),
469 deal_with_spec(CarbonMonosulfide)
470 IsotopeRecord(fromShortName("CS"), "22", 43.971036, 1),
471 IsotopeRecord(fromShortName("CS"), "23", 44.970399, 4),
472 IsotopeRecord(fromShortName("CS"), "24", 45.966787, 1),
473 IsotopeRecord(fromShortName("CS"), "32", 44.974368, 2),
477 deal_with_spec(HydrogenIsocyanide)
478 IsotopeRecord(fromShortName("HNC"), "142", 27), // FIXME: Better mass and some gj?
479 IsotopeRecord(fromShortName("HNC"), "143", 28), // FIXME: Better mass and some gj?
480 IsotopeRecord(fromShortName("HNC"), "152", 28), // FIXME: Better mass and some gj?
481 IsotopeRecord(fromShortName("HNC"), "242", 28), // FIXME: Better mass and some gj?
485 deal_with_spec(SulfurMonoxide)
486 IsotopeRecord(fromShortName("SO"), "26", 48), // FIXME: Better mass and some gj?
487 IsotopeRecord(fromShortName("SO"), "28", 50), // FIXME: Better mass and some gj?
488 IsotopeRecord(fromShortName("SO"), "46", 50), // FIXME: Better mass and some gj?
492 deal_with_spec(Propane)
493 IsotopeRecord(fromShortName("C3H8"), "21", 54), // FIXME: Better mass and some gj?
497 deal_with_spec(HydrogenAtom)
498 IsotopeRecord(fromShortName("H"), "1", 1), // FIXME: Better mass and some gj?
502 deal_with_spec(Helium)
503 IsotopeRecord(fromShortName("He"), "4", 4), // FIXME: Better mass and some gj?
507 deal_with_spec(Argon)
508 IsotopeRecord(fromShortName("Ar"), "8", 18), // FIXME: Better mass and some gj?
512 deal_with_spec(SulfurTrioxide)
513 IsotopeRecord(fromShortName("SO3"), "26", 79.956820, 1),
517 deal_with_spec(Cyanogen)
518 IsotopeRecord(fromShortName("C2N2"), "4224", 52.006148, 1),
522 deal_with_spec(Phosgene)
523 IsotopeRecord(fromShortName("COCl2"), "2655", 97.932620, 1),
524 IsotopeRecord(fromShortName("COCl2"), "2657", 99.929670, 16),
528 deal_with_spec(CarbonDisulfide)
529 IsotopeRecord(fromShortName("CS2"), "222", 75.944140, 1),
530 IsotopeRecord(fromShortName("CS2"), "223", 76.943256, 4),
531 IsotopeRecord(fromShortName("CS2"), "224", 77.939940, 1),
532 IsotopeRecord(fromShortName("CS2"), "232", 76.947495, 2),
536 deal_with_spec(Methyl)
537 deal_with_spec(Cyclopropene)
538 deal_with_spec(Hexafluoroethane)
539 deal_with_spec(Perfluoropropane)
540 deal_with_spec(Perfluorobutane)
541 deal_with_spec(Perfluoropentane)
542 deal_with_spec(Perfluorohexane)
543 deal_with_spec(Perfluorooctane)
544 deal_with_spec(Perfluorocyclobutane)
545 deal_with_spec(CarbonTetrachloride)
546 deal_with_spec(CFC11)
547 deal_with_spec(CFC113)
548 deal_with_spec(CFC114)
549 deal_with_spec(CFC115)
550 deal_with_spec(CFC12)
551 deal_with_spec(Dichloromethane)
552 deal_with_spec(Trichloroethane)
553 deal_with_spec(Trichloromethane)
554 deal_with_spec(Bromochlorodifluoromethane)
555 deal_with_spec(Bromotrifluoromethane)
556 deal_with_spec(Dibromotetrafluoroethane)
557 deal_with_spec(HCFC141b)
558 deal_with_spec(HCFC142b)
559 deal_with_spec(HCFC22)
560 deal_with_spec(HFC125)
561 deal_with_spec(HFC134a)
562 deal_with_spec(HFC143a)
563 deal_with_spec(HFC152a)
564 deal_with_spec(HFC227ea)
565 deal_with_spec(HFC23)
566 deal_with_spec(HFC245fa)
567 deal_with_spec(HFC32)
568 deal_with_spec(NitrogenTrifluoride)
569 deal_with_spec(SulfurylFluoride)
570 deal_with_spec(HFC4310mee)
571 deal_with_spec(Germane)
572 deal_with_spec(Iodomethane)
573 deal_with_spec(Fluoromethane)
577 deal_with_spec(liquidcloud)
578 IsotopeRecord(Species::liquidcloud, "ELL07"),
579 IsotopeRecord(Species::liquidcloud, "MPM93"),
580 deal_with_spec(icecloud)
581 IsotopeRecord(Species::icecloud, "MPM93"),
582 deal_with_spec(rain)
583 IsotopeRecord(Species::rain, "MPM93"),
584 deal_with_spec(free_electrons)
585 deal_with_spec(particles)
587};
588
589#undef deal_with_spec
590
591constexpr std::array<std::size_t, std::size_t(Species::FINAL)+1> start_positions() noexcept {
592 std::array<bool, std::size_t(Species::FINAL)> found{};
593 for (auto& x: found) x = false;
594
595 std::array<std::size_t, std::size_t(Species::FINAL)+1> out{};
596 for (auto& x: out) x = Isotopologues.size();
597
598 for (std::size_t i=0; i<Isotopologues.size(); i++) {
599 const auto ind = std::size_t(Isotopologues[i].spec);
600 if (not found[ind]) {
601 found[ind] = true;
602 out[ind] = i;
603 }
604 }
605 return out;
606}
607
609
610template <Species spec>
611constexpr std::size_t count_isotopologues() noexcept {
612 return IsotopologuesStart[std::size_t(spec) + 1] - IsotopologuesStart[std::size_t(spec)];
613}
614
615template <Species spec>
616constexpr std::array<IsotopeRecord, count_isotopologues<spec>()> isotopologues() noexcept {
617 static_assert(count_isotopologues<spec>() not_eq 0, "All species must be defined in the Isotopologues!");
618 std::array<IsotopeRecord, count_isotopologues<spec>()> isots;
619 for (std::size_t i=0; i<count_isotopologues<spec>(); i++) {
620 isots[i] = Isotopologues[i + IsotopologuesStart[std::size_t(spec)]];
621 }
622 return isots;
623}
624
626
627constexpr Index find_species_index(const Species spec,
628 const std::string_view isot) noexcept {
629 for (std::size_t i=IsotopologuesStart[std::size_t(spec)]; i<IsotopologuesStart[std::size_t(spec) + 1]; i++) {
630 if (isot == Isotopologues[i].isotname) {
631 return i;
632 }
633 }
634 return -1;
635}
636
637
638constexpr Index find_species_index(const IsotopeRecord ir) noexcept {
639 return find_species_index(ir.spec, ir.isotname);
640}
641
642constexpr Index find_species_index(const std::string_view spec,
643 const std::string_view isot) noexcept {
644 return find_species_index(fromShortName(spec), isot);
645}
646
647constexpr const IsotopeRecord& select(Species spec, const std::string_view isotname) noexcept {
648 return Isotopologues[find_species_index(spec, isotname)];
649}
650
651constexpr const IsotopeRecord& select(const std::string_view spec,
652 const std::string_view isotname) noexcept {
653 return Isotopologues[find_species_index(spec, isotname)];
654}
655
656constexpr const IsotopeRecord& select_joker(Species spec) noexcept {
657 return select(spec, Joker);
658}
659
660constexpr const IsotopeRecord& select_joker(std::string_view spec) noexcept {
661 return select(fromShortName(spec), Joker);
662}
663
665
666constexpr bool is_predefined_model(const IsotopeRecord& ir) noexcept {
667 return not (nonstd::isdigit(ir.isotname[0]) or ir.isotname == Joker);
668}
669
671
672constexpr bool same_or_joker(const IsotopeRecord& ir1, const IsotopeRecord& ir2) noexcept {
673 if (ir1.spec not_eq ir2.spec) return false;
674 if (ir1.joker() or ir2.joker()) return true;
675 return ir1.isotname == ir2.isotname;
676}
677
679 static constexpr Index maxsize = Index(Isotopologues.size());
680 std::array<Numeric, maxsize> data;
681
682 constexpr IsotopologueRatios() noexcept : data() {
683 for (auto& x: data) x = std::numeric_limits<Numeric>::quiet_NaN();
684 }
685
686 constexpr Numeric operator[](const Index spec_ind) const ARTS_NOEXCEPT {
687 ARTS_ASSERT(spec_ind < maxsize and spec_ind >= 0)
688 return data[spec_ind];
689 }
690
691 constexpr Numeric operator[](const IsotopeRecord& ir) const {
692 const Index spec_ind = find_species_index(ir);
693 ARTS_USER_ERROR_IF(spec_ind >= maxsize or spec_ind < 0,
694 "Cannot understand: ", ir.FullName(), " as a valid species")
695 return data[spec_ind];
696 }
697
698 friend std::ostream& operator<<(std::ostream& os, const IsotopologueRatios& iso_rat) {
699 for (size_t i=0; i<iso_rat.maxsize; i++) {
700 if (i not_eq 0)
701 os << '\n';
702 os << Isotopologues[i].FullName() << ' ' << iso_rat.data[i];
703 }
704 return os;
705 }
706
707 [[nodiscard]] constexpr bool all_isotopes_have_a_value() const noexcept {
708 for (Index i=0; i<maxsize; i++) {
709 if (not is_predefined_model(Isotopologues[i]) and not Isotopologues[i].joker() and nonstd::isnan(data[i])) {
710 return false;
711 }
712 }
713 return true;
714 }
715};
716
719
720 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("H2O", ISOT)] = VAL
721 set_isot_val("161", .997317E+00);
722 set_isot_val("181", 1.99983E-03);
723 set_isot_val("171", 3.71884E-04);
724 set_isot_val("162", 3.10693E-04);
725 set_isot_val("182", 6.23003E-07);
726 set_isot_val("172", 1.15853E-07);
727 set_isot_val("262", 2.41970E-08);
728 #undef set_isot_val
729
730 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("CO2", ISOT)] = VAL
731 set_isot_val("626", .984204E+00);
732 set_isot_val("636", 1.10574E-02);
733 set_isot_val("628", 3.94707E-03);
734 set_isot_val("627", 7.33989E-04);
735 set_isot_val("638", 4.43446E-05);
736 set_isot_val("637", 8.24623E-06);
737 set_isot_val("828", 3.95734E-06);
738 set_isot_val("827", 1.47180E-06);
739 set_isot_val("727", 1.36847E-07);
740 set_isot_val("838", 4.44600E-08);
741 set_isot_val("837", 1.65354E-08);
742 set_isot_val("737", 1.53750E-09);
743 #undef set_isot_val
744
745 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("O3", ISOT)] = VAL
746 set_isot_val("666", .992901E+00);
747 set_isot_val("668", 3.98194E-03);
748 set_isot_val("686", 1.99097E-03);
749 set_isot_val("667", 7.40475E-04);
750 set_isot_val("676", 3.70237E-04);
751 #undef set_isot_val
752
753 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("N2O", ISOT)] = VAL
754 set_isot_val("446", .990333E+00);
755 set_isot_val("456", 3.64093E-03);
756 set_isot_val("546", 3.64093E-03);
757 set_isot_val("448", 1.98582E-03);
758 set_isot_val("447", 3.69280E-04);
759 #undef set_isot_val
760
761 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("CO", ISOT)] = VAL
762 set_isot_val("26", .986544E+00);
763 set_isot_val("36", 1.10836E-02);
764 set_isot_val("28", 1.97822E-03);
765 set_isot_val("27", 3.67867E-04);
766 set_isot_val("38", 2.22250E-05);
767 set_isot_val("37", 4.13292E-06);
768 #undef set_isot_val
769
770 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("CH4", ISOT)] = VAL
771 set_isot_val("211", .988274E+00);
772 set_isot_val("311", 1.11031E-02);
773 set_isot_val("212", 6.15751E-04);
774 set_isot_val("312", 6.91785E-06);
775 #undef set_isot_val
776
777 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("O2", ISOT)] = VAL
778 set_isot_val("66", .995262E+00);
779 set_isot_val("68", 3.99141E-03);
780 set_isot_val("67", 7.42235E-04);
781 #undef set_isot_val
782
783 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("NO", ISOT)] = VAL
784 set_isot_val("46", .993974E+00);
785 set_isot_val("56", 3.65431E-03);
786 set_isot_val("48", 1.99312E-03);
787 #undef set_isot_val
788
789 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("SO2", ISOT)] = VAL
790 set_isot_val("626", .945678E+00);
791 set_isot_val("646", 4.19503E-02);
792 set_isot_val("636", 0.0074989421);
793 set_isot_val("628", 0.0020417379);
794 #undef set_isot_val
795
796 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("NO2", ISOT)] = VAL
797 set_isot_val("646", .991616E+00);
798 set_isot_val("656", 3.64564E-03);
799 #undef set_isot_val
800
801 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("NH3", ISOT)] = VAL
802 set_isot_val("4111", .995872E+00);
803 set_isot_val("5111", 3.66129E-03);
804 set_isot_val("4112", 0.00044792294);
805 #undef set_isot_val
806
807 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("HNO3", ISOT)] = VAL
808 set_isot_val("146", .989110E+00);
809 set_isot_val("156", 3.63600E-03);
810 #undef set_isot_val
811
812 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("OH", ISOT)] = VAL
813 set_isot_val("61", .997473E+00);
814 set_isot_val("81", 2.00014E-03);
815 set_isot_val("62", 1.55371E-04);
816 #undef set_isot_val
817
818 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("HF", ISOT)] = VAL
819 set_isot_val("19", .999844E+00);
820 set_isot_val("29", 1.55741E-04);
821 #undef set_isot_val
822
823 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("HCl", ISOT)] = VAL
824 set_isot_val("15", .757587E+00);
825 set_isot_val("17", .242257E+00);
826 set_isot_val("25", 1.18005E-04);
827 set_isot_val("27", 3.77350E-05);
828 #undef set_isot_val
829
830 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("HBr", ISOT)] = VAL
831 set_isot_val("19", .506781E+00);
832 set_isot_val("11", .493063E+00);
833 set_isot_val("29", 7.89384E-05);
834 set_isot_val("21", 7.68016E-05);
835 #undef set_isot_val
836
837 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("HI", ISOT)] = VAL
838 set_isot_val("17", .999844E+00);
839 set_isot_val("27", 1.55741E-04);
840 #undef set_isot_val
841
842 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("ClO", ISOT)] = VAL
843 set_isot_val("56", .755908E+00);
844 set_isot_val("76", .241720E+00);
845 #undef set_isot_val
846
847 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("OCS", ISOT)] = VAL
848 set_isot_val("622", .937395E+00);
849 set_isot_val("624", 4.15828E-02);
850 set_isot_val("632", 1.05315E-02);
851 set_isot_val("623", 7.39908E-03);
852 set_isot_val("822", 1.87967E-03);
853 set_isot_val("634", 4.67508E-04);
854 #undef set_isot_val
855
856 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("H2CO", ISOT)] = VAL
857 set_isot_val("126", .986237E+00);
858 set_isot_val("136", 1.10802E-02);
859 set_isot_val("128", 1.97761E-03);
860 #undef set_isot_val
861
862 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("HDCO", ISOT)] = VAL
863 set_isot_val("26", 0.00029578940);
864 #undef set_isot_val
865
866 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("D2CO", ISOT)] = VAL
867 set_isot_val("26", 2.2181076E-08);
868 #undef set_isot_val
869
870 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("HOCl", ISOT)] = VAL
871 set_isot_val("165", .755790E+00);
872 set_isot_val("167", .241683E+00);
873 #undef set_isot_val
874
875 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("N2", ISOT)] = VAL
876 set_isot_val("44", .992687E+00);
877 set_isot_val("45", 7.47809E-03);
878 #undef set_isot_val
879
880 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("HCN", ISOT)] = VAL
881 set_isot_val("124", .985114E+00);
882 set_isot_val("134", 1.10676E-02);
883 set_isot_val("125", 3.62174E-03);
884 set_isot_val("224", 0.00014773545);
885 #undef set_isot_val
886
887 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("CH3Cl", ISOT)] = VAL
888 set_isot_val("215", .748937E+00);
889 set_isot_val("217", .239491E+00);
890 #undef set_isot_val
891
892 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("H2O2", ISOT)] = VAL
893 set_isot_val("1661", .994952E+00);
894 #undef set_isot_val
895
896 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("C2H2", ISOT)] = VAL
897 set_isot_val("1221", .977599E+00);
898 set_isot_val("1231", 2.19663E-02);
899 set_isot_val("1222", 3.04550E-04);
900 #undef set_isot_val
901
902 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("C2H6", ISOT)] = VAL
903 set_isot_val("1221", .976990E+00);
904 set_isot_val("1231", 2.19526E-02);
905 #undef set_isot_val
906
907 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("PH3", ISOT)] = VAL
908 set_isot_val("1111", .999533E+00);
909 #undef set_isot_val
910
911 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("COF2", ISOT)] = VAL
912 set_isot_val("269", .986544E+00);
913 set_isot_val("369", 1.10834E-02);
914 #undef set_isot_val
915
916 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("SF6", ISOT)] = VAL
917 set_isot_val("29", .950180E+00);
918 #undef set_isot_val
919
920 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("H2S", ISOT)] = VAL
921 set_isot_val("121", .949884E+00);
922 set_isot_val("141", 4.21369E-02);
923 set_isot_val("131", 7.49766E-03);
924 set_isot_val("122", 0.00029991625);
925 #undef set_isot_val
926
927 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("HCOOH", ISOT)] = VAL
928 set_isot_val("126", .983898E+00);
929 set_isot_val("136", 0.010913149);
930 #undef set_isot_val
931
932 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("DCOOH", ISOT)] = VAL
933 set_isot_val("266", 0.00014755369);
934 #undef set_isot_val
935
936 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("HCOOD", ISOT)] = VAL
937 set_isot_val("266", 0.00014755369);
938 #undef set_isot_val
939
940 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("HO2", ISOT)] = VAL
941 set_isot_val("166", .995107E+00);
942 #undef set_isot_val
943
944 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("O", ISOT)] = VAL
945 set_isot_val("6", .997628E+00);
946 #undef set_isot_val
947
948 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("ClONO2", ISOT)] = VAL
949 set_isot_val("5646", .749570E+00);
950 set_isot_val("7646", .239694E+00);
951 #undef set_isot_val
952
953 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("NO+", ISOT)] = VAL
954 set_isot_val("46", .993974E+00);
955 #undef set_isot_val
956
957 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("OClO", ISOT)] = VAL
958 set_isot_val("656", 0.75509223);
959 set_isot_val("676", 0.24490632);
960 #undef set_isot_val
961
962 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("BrO", ISOT)] = VAL
963 set_isot_val("96", 0.50582466);
964 set_isot_val("16", 0.49431069);
965 #undef set_isot_val
966
967 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("H2SO4", ISOT)] = VAL
968 set_isot_val("126", 0.95060479);
969 #undef set_isot_val
970
971 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("Cl2O2", ISOT)] = VAL
972 set_isot_val("565", 0.57016427);
973 set_isot_val("765", 0.36982818);
974 #undef set_isot_val
975
976 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("HOBr", ISOT)] = VAL
977 set_isot_val("169", .505579E+00);
978 set_isot_val("161", .491894E+00);
979 #undef set_isot_val
980
981 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("C2H4", ISOT)] = VAL
982 set_isot_val("221", .977294E+00);
983 set_isot_val("231", .219595E-01);
984 #undef set_isot_val
985
986 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("CH3OH", ISOT)] = VAL
987 set_isot_val("2161", .985930E+00);
988 #undef set_isot_val
989
990 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("CH3Br", ISOT)] = VAL
991 set_isot_val("219", .500995E+00);
992 set_isot_val("211", .487433E+00);
993 #undef set_isot_val
994
995 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("CH3CN", ISOT)] = VAL
996 set_isot_val("2124", .973866E+00);
997 set_isot_val("3124", .102683e-01);
998 set_isot_val("2134", .102683e-01);
999 set_isot_val("2125", .347136e-02);
1000 #undef set_isot_val
1001
1002 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("CH2DCN", ISOT)] = VAL
1003 set_isot_val("224", .441185e-03);
1004 #undef set_isot_val
1005
1006 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("CF4", ISOT)] = VAL
1007 set_isot_val("29", .988890E+00);
1008 #undef set_isot_val
1009
1010 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("HC3N", ISOT)] = VAL
1011 set_isot_val("12224", .963346E+00);
1012 set_isot_val("12234", .106852e-01);
1013 set_isot_val("12324", .106852e-01);
1014 set_isot_val("13224", .106852e-01);
1015 set_isot_val("12225", .356272e-02);
1016 set_isot_val("22224", .144472e-03);
1017 #undef set_isot_val
1018
1019 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("CS", ISOT)] = VAL
1020 set_isot_val("22", .939624E+00);
1021 set_isot_val("24", .416817E-01);
1022 set_isot_val("32", .105565E-01);
1023 set_isot_val("23", .741668E-02);
1024 #undef set_isot_val
1025
1026 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("HNC", ISOT)] = VAL
1027 set_isot_val("142", .985280e+00);
1028 set_isot_val("143", .109285e-01);
1029 set_isot_val("152", .364384e-02);
1030 set_isot_val("242", .147761e-03);
1031 #undef set_isot_val
1032
1033 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("SO", ISOT)] = VAL
1034 set_isot_val("26", .950605e+00);
1035 set_isot_val("46", .420727e-01);
1036 set_isot_val("28", .194089e-02);
1037 #undef set_isot_val
1038
1039 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("C3H8", ISOT)] = VAL
1040 set_isot_val("21", 9.66290e-01);
1041 #undef set_isot_val
1042
1043 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("H2", ISOT)] = VAL
1044 set_isot_val("11", .999688E+00);
1045 set_isot_val("12", 3.11432E-04);
1046 #undef set_isot_val
1047
1048 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("H", ISOT)] = VAL
1049 set_isot_val("1", 1.00);
1050 #undef set_isot_val
1051
1052 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("He", ISOT)] = VAL
1053 set_isot_val("4", 1.00);
1054 #undef set_isot_val
1055
1056 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("Ar", ISOT)] = VAL
1057 set_isot_val("8", 1.00);
1058 #undef set_isot_val
1059
1060 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("C4H2", ISOT)] = VAL
1061 set_isot_val("2211", .955998E+00);
1062 #undef set_isot_val
1063
1064 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("SO3", ISOT)] = VAL
1065 set_isot_val("26", .943400E+00);
1066 #undef set_isot_val
1067
1068 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("CS2", ISOT)] = VAL
1069 set_isot_val("222", 8.92811E-01);
1070 set_isot_val("224", 7.92600E-02);
1071 set_isot_val("223", 1.40940E-02);
1072 set_isot_val("232", 1.03100E-02);
1073 #undef set_isot_val
1074
1075 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("C2N2", ISOT)] = VAL
1076 set_isot_val("4224", 9.70752E-01);
1077 #undef set_isot_val
1078
1079 #define set_isot_val(ISOT, VAL) isotopologue_ratios.data[find_species_index("COCl2", ISOT)] = VAL
1080 set_isot_val("2655", 5.66392E-01);
1081 set_isot_val("2657", 3.62235E-01);
1082 #undef set_isot_val
1083
1084 return isotopologue_ratios;
1085}
1086
1097constexpr Numeric mean_mass(Species spec, const IsotopologueRatios& ir) noexcept {
1098 Numeric sum_rm=0;
1099 Numeric sum_r =0;
1100 for (std::size_t i=IsotopologuesStart[std::size_t(spec)]; i <IsotopologuesStart[std::size_t(spec) + 1]; i++) {
1101 if (not nonstd::isnan(Isotopologues[i].mass) and not nonstd::isnan(ir[i])) {
1102 sum_rm += ir[i] * Isotopologues[i].mass;
1103 sum_r += ir[i];
1104 }
1105 }
1106 if (sum_r not_eq 0) return sum_rm / sum_r;
1107 return std::numeric_limits<Numeric>::signaling_NaN();
1108}
1109
1119String update_isot_name(const String& old_name);
1120
1121constexpr bool all_have_ratio(const Species spec, const IsotopologueRatios& ir) noexcept {
1122 for (std::size_t i=IsotopologuesStart[std::size_t(spec)]; i<IsotopologuesStart[std::size_t(spec) + 1]; i++) {
1123 if (not Isotopologues[i].joker() and not is_predefined_model(Isotopologues[i]) and nonstd::isnan(ir[i])) {
1124 return false;
1125 }
1126 }
1127 return true;
1128}
1129
1130std::pair<ArrayOfString, ArrayOfString> names_of_have_and_havenot_ratio(const Species spec, const IsotopologueRatios& ir) noexcept;
1131} // namespace Species
1132
1134
1136
1138
1140
1141#endif // isotopologues_h
char * isot
This can be used to make arrays out of anything.
Definition: array.h:107
The Joker class.
Definition: matpackI.h:131
#define ARTS_NOEXCEPT
Definition: debug.h:80
#define ARTS_ASSERT(condition,...)
Definition: debug.h:83
#define ARTS_USER_ERROR_IF(condition,...)
Definition: debug.h:134
#define deal_with_spec(SPEC)
Definition: isotopologues.h:48
#define set_isot_val(ISOT, VAL)
INDEX Index
The type to use for all integer numbers and indices.
Definition: matpack.h:39
NUMERIC Numeric
The type to use for all floating point numbers.
Definition: matpack.h:33
const Joker joker
This file contains the definition of String, the ARTS string class.
my_basic_string< char > String
The String type for ARTS.
Definition: mystring.h:287
SpeciesIsotopologueRatios isotopologue_ratios(Type type)
Vector mass(const ConstVectorView &atmospheric_vmrs, const ArrayOfArrayOfSpeciesTag &atmospheric_species, const ArrayOfSpecies &lineshape_species, const SpeciesIsotopologueRatios &ir) ARTS_NOEXCEPT
Returns a mass vector for this model's main calculations.
String isotopologues_names(Species spec)
constexpr bool all_have_ratio(const Species spec, const IsotopologueRatios &ir) noexcept
constexpr Numeric mean_mass(Species spec, const IsotopologueRatios &ir) noexcept
constexpr std::array< std::size_t, std::size_t(Species::FINAL)+1 > start_positions() noexcept
constexpr const IsotopeRecord & select_joker(Species spec) noexcept
constexpr bool is_predefined_model(const IsotopeRecord &ir) noexcept
constexpr std::array Isotopologues
Definition: isotopologues.h:50
constexpr bool same_or_joker(const IsotopeRecord &ir1, const IsotopeRecord &ir2) noexcept
constexpr auto IsotopologuesStart
std::pair< ArrayOfString, ArrayOfString > names_of_have_and_havenot_ratio(const Species spec, const IsotopologueRatios &ir) noexcept
constexpr IsotopologueRatios isotopologue_ratiosInitFromBuiltin()
ArrayOfIsotopeRecord isotopologues(Species spec)
Definition: isotopologues.cc:6
String update_isot_name(const String &old_name)
Updates the name of the isotopologue based on updates of the isotopologues.
String predefined_model_names() noexcept
constexpr const IsotopeRecord & select(Species spec, const std::string_view isotname) noexcept
constexpr Index find_species_index(const Species spec, const std::string_view isot) noexcept
constexpr std::size_t count_isotopologues() noexcept
constexpr std::string_view Joker
Definition: isotopologues.h:11
constexpr int isdigit(int ch) noexcept
Definition: nonstd.h:24
constexpr bool isnan(double d) noexcept
Definition: nonstd.h:39
Struct containing all information needed about one isotope.
Definition: isotopologues.h:14
String FullName() const noexcept
Definition: isotopologues.h:44
Index gi
The degeneracy of states of the molecule. It is -1 if not defined.
Definition: isotopologues.h:25
Species spec
Species type as defined in species.h.
Definition: isotopologues.h:16
Numeric mass
The mass of the isotope in units of grams per mol. It is Nan if not defined.
Definition: isotopologues.h:22
std::string_view isotname
A custom name that is unique for this Species type.
Definition: isotopologues.h:19
constexpr bool joker() const noexcept
Definition: isotopologues.h:45
friend std::ostream & operator<<(std::ostream &os, const IsotopeRecord &ir)
Definition: isotopologues.h:29
constexpr IsotopeRecord(Species spec_, const std::string_view isotname_=Joker, Numeric mass_=std::numeric_limits< Numeric >::quiet_NaN(), Index gi_=-1) noexcept
Definition: isotopologues.h:26
constexpr IsotopeRecord() noexcept
Definition: isotopologues.h:28
constexpr bool operator==(const IsotopeRecord &that) const noexcept
Definition: isotopologues.h:32
constexpr bool operator!=(T x) const noexcept
Definition: isotopologues.h:42
constexpr bool operator==(const std::string_view specstr) const noexcept
A comparison with pure named string (this is not an exact comparison)
Definition: isotopologues.h:37
constexpr bool all_isotopes_have_a_value() const noexcept
friend std::ostream & operator<<(std::ostream &os, const IsotopologueRatios &iso_rat)
constexpr Numeric operator[](const IsotopeRecord &ir) const
constexpr IsotopologueRatios() noexcept
constexpr Numeric operator[](const Index spec_ind) const ARTS_NOEXCEPT
std::array< Numeric, maxsize > data
static constexpr Index maxsize