ARTS 2.5.11 (git: 725533f0)
isotopologues.cc
Go to the documentation of this file.
1#include <cctype>
2
3#include "isotopologues.h"
4
5namespace Species {
7 #define deal_with_spec(SPEC) case Species::SPEC: return ArrayOfIsotopeRecord(isotopologues<Species::SPEC>());
8
9 switch (spec) {
10 case Species::Bath: break;
11 deal_with_spec(Water)
12 deal_with_spec(CarbonDioxide)
13 deal_with_spec(Ozone)
14 deal_with_spec(NitrogenOxide)
15 deal_with_spec(CarbonMonoxide)
16 deal_with_spec(Methane)
17 deal_with_spec(Oxygen)
18 deal_with_spec(NitricOxide)
19 deal_with_spec(SulfurDioxide)
20 deal_with_spec(NitrogenDioxide)
21 deal_with_spec(Ammonia)
22 deal_with_spec(NitricAcid)
23 deal_with_spec(Hydroxyl)
24 deal_with_spec(HydrogenFluoride)
25 deal_with_spec(HydrogenChloride)
26 deal_with_spec(HydrogenBromide)
27 deal_with_spec(HydrogenIodide)
28 deal_with_spec(ChlorineMonoxide)
29 deal_with_spec(CarbonylSulfide)
30 deal_with_spec(Formaldehyde)
31 deal_with_spec(HeavyFormaldehyde)
32 deal_with_spec(VeryHeavyFormaldehyde)
33 deal_with_spec(HypochlorousAcid)
34 deal_with_spec(Nitrogen)
35 deal_with_spec(HydrogenCyanide)
36 deal_with_spec(Chloromethane)
37 deal_with_spec(HydrogenPeroxide)
38 deal_with_spec(Acetylene)
39 deal_with_spec(Ethane)
40 deal_with_spec(Phosphine)
41 deal_with_spec(CarbonylFluoride)
42 deal_with_spec(SulfurHexafluoride)
43 deal_with_spec(HydrogenSulfide)
44 deal_with_spec(FormicAcid)
45 deal_with_spec(LeftHeavyFormicAcid)
46 deal_with_spec(RightHeavyFormicAcid)
47 deal_with_spec(Hydroperoxyl)
48 deal_with_spec(OxygenAtom)
49 deal_with_spec(ChlorineNitrate)
50 deal_with_spec(NitricOxideCation)
51 deal_with_spec(HypobromousAcid)
52 deal_with_spec(Ethylene)
53 deal_with_spec(Methanol)
54 deal_with_spec(Bromomethane)
55 deal_with_spec(Acetonitrile)
56 deal_with_spec(HeavyAcetonitrile)
57 deal_with_spec(CarbonTetrafluoride)
58 deal_with_spec(Diacetylene)
59 deal_with_spec(Cyanoacetylene)
60 deal_with_spec(Hydrogen)
61 deal_with_spec(CarbonMonosulfide)
62 deal_with_spec(SulfurTrioxide)
63 deal_with_spec(Cyanogen)
64 deal_with_spec(Phosgene)
65 deal_with_spec(SulfurMonoxide)
66 deal_with_spec(CarbonDisulfide)
67 deal_with_spec(Methyl)
68 deal_with_spec(Cyclopropene)
69 deal_with_spec(SulfuricAcid)
70 deal_with_spec(HydrogenIsocyanide)
71 deal_with_spec(BromineMonoxide)
72 deal_with_spec(ChlorineDioxide)
73 deal_with_spec(Propane)
74 deal_with_spec(Helium)
75 deal_with_spec(ChlorineMonoxideDimer)
76 deal_with_spec(HydrogenAtom)
77 deal_with_spec(Argon)
78 deal_with_spec(Hexafluoroethane)
79 deal_with_spec(Perfluoropropane)
80 deal_with_spec(Perfluorobutane)
81 deal_with_spec(Perfluoropentane)
82 deal_with_spec(Perfluorohexane)
83 deal_with_spec(Perfluorooctane)
84 deal_with_spec(Perfluorocyclobutane)
85 deal_with_spec(CarbonTetrachloride)
86 deal_with_spec(CFC11)
87 deal_with_spec(CFC113)
88 deal_with_spec(CFC114)
89 deal_with_spec(CFC115)
90 deal_with_spec(CFC12)
91 deal_with_spec(Dichloromethane)
92 deal_with_spec(Trichloroethane)
93 deal_with_spec(Trichloromethane)
94 deal_with_spec(Bromochlorodifluoromethane)
95 deal_with_spec(Bromotrifluoromethane)
96 deal_with_spec(Dibromotetrafluoroethane)
97 deal_with_spec(HCFC141b)
98 deal_with_spec(HCFC142b)
99 deal_with_spec(HCFC22)
100 deal_with_spec(HFC125)
101 deal_with_spec(HFC134a)
102 deal_with_spec(HFC143a)
103 deal_with_spec(HFC152a)
104 deal_with_spec(HFC227ea)
105 deal_with_spec(HFC23)
106 deal_with_spec(HFC236fa)
107 deal_with_spec(HFC245fa)
108 deal_with_spec(HFC32)
109 deal_with_spec(HFC365mfc)
110 deal_with_spec(NitrogenTrifluoride)
111 deal_with_spec(SulfurylFluoride)
112 deal_with_spec(HFC4310mee)
113 deal_with_spec(Germane)
114 deal_with_spec(Iodomethane)
115 deal_with_spec(Fluoromethane)
116 deal_with_spec(liquidcloud)
117 deal_with_spec(icecloud)
118 deal_with_spec(rain)
119 deal_with_spec(free_electrons)
120 deal_with_spec(particles)
121 case Species::FINAL: { /* leave last */
122 }
123 }
124
125 #undef deal_with_spec
126
127 ARTS_USER_ERROR("Cannot understand: ", spec)
128}
129
131 auto x = isotopologues(spec);
132 std::ostringstream os;
133 for(auto& s: x) os << s.FullName() << '\n';
134 return os.str();
135}
136
138 std::ostringstream os;
139 for (auto& x: Isotopologues) {
140 if (is_predefined_model(x)) {
141 os << x.FullName() << '\n';
142 }
143 }
144 return os.str();
145}
146
148 if (old_name == "CH3CN-211224") return "CH2DCN-224";
149 if (old_name == "CH3CN-211124") return "CH3CN-2124";
150 if (old_name == "CH3CN-211125") return "CH3CN-2125";
151 if (old_name == "CH3CN-211134") return "CH3CN-2134";
152 if (old_name == "CH3CN-311124") return "CH3CN-3124";
153 if (old_name == "CO2-728") return "CO2-827";
154 if (old_name == "HCOOH-2261") return "DCOOH-266";
155 if (old_name == "HCOOH-1262") return "HCOOD-266";
156 if (old_name == "HCOOH-1261") return "HCOOH-126";
157 if (old_name == "HCOOH-1361") return "HCOOH-136";
158 if (old_name == "H2CO-1126") return "H2CO-126";
159 if (old_name == "H2CO-1128") return "H2CO-128";
160 if (old_name == "H2CO-1136") return "H2CO-136";
161 if (old_name == "H2CO-1226") return "HDCO-26";
162 if (old_name == "H2CO-2226") return "D2CO-26";
163 return old_name;
164}
165
166std::pair<ArrayOfString, ArrayOfString> names_of_have_and_havenot_ratio(const Species spec, const IsotopologueRatios& ir) noexcept {
167 ArrayOfString h, hnot;
168 for (std::size_t i=IsotopologuesStart[std::size_t(spec)]; i<IsotopologuesStart[std::size_t(spec) + 1]; i++) {
169 if (not Isotopologues[i].joker() and not is_predefined_model(Isotopologues[i])) {
170 if (nonstd::isnan(ir[i])) {
171 hnot.emplace_back(Isotopologues[i].FullName());
172 } else {
173 h.emplace_back(Isotopologues[i].FullName());
174 }
175 }
176 }
177 return {h, hnot};
178}
179} // namespace Species
This can be used to make arrays out of anything.
Definition array.h:31
#define ARTS_USER_ERROR(...)
Definition debug.h:153
#define deal_with_spec(SPEC)
String isotopologues_names(Species spec)
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.
constexpr auto IsotopologuesStart
std::pair< ArrayOfString, ArrayOfString > names_of_have_and_havenot_ratio(const Species spec, const IsotopologueRatios &ir) noexcept
consteval std::array< IsotopeRecord, count_isotopologues< spec >()> isotopologues() noexcept
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 bool isnan(double d) noexcept
Definition nonstd.h:53