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