ARTS 2.5.0 (git: 9ee3ac6c)
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(HFC245fa)
107 deal_with_spec(HFC32)
108 deal_with_spec(NitrogenTrifluoride)
109 deal_with_spec(SulfurylFluoride)
110 deal_with_spec(HFC4310mee)
111 deal_with_spec(Germane)
112 deal_with_spec(Iodomethane)
113 deal_with_spec(Fluoromethane)
114 deal_with_spec(liquidcloud)
115 deal_with_spec(icecloud)
116 deal_with_spec(rain)
117 deal_with_spec(free_electrons)
118 deal_with_spec(particles)
119 case Species::FINAL: { /* leave last */
120 }
121 }
122
123 #undef deal_with_spec
124
125 ARTS_USER_ERROR("Cannot understand: ", spec)
126}
127
129 auto x = isotopologues(spec);
130 std::ostringstream os;
131 for(auto& s: x) os << s.FullName() << '\n';
132 return os.str();
133}
134
136 std::ostringstream os;
137 for (auto& x: Isotopologues) {
138 if (is_predefined_model(x)) {
139 os << x.FullName() << '\n';
140 }
141 }
142 return os.str();
143}
144
146 if (old_name == "CH3CN-211224") return "CH2DCN-224";
147 if (old_name == "CH3CN-211124") return "CH3CN-2124";
148 if (old_name == "CH3CN-211125") return "CH3CN-2125";
149 if (old_name == "CH3CN-211134") return "CH3CN-2134";
150 if (old_name == "CH3CN-311124") return "CH3CN-3124";
151 if (old_name == "CO2-728") return "CO2-827";
152 if (old_name == "HCOOH-2261") return "DCOOH-266";
153 if (old_name == "HCOOH-1262") return "HCOOD-266";
154 if (old_name == "HCOOH-1261") return "HCOOH-126";
155 if (old_name == "HCOOH-1361") return "HCOOH-136";
156 if (old_name == "H2CO-1126") return "H2CO-126";
157 if (old_name == "H2CO-1128") return "H2CO-128";
158 if (old_name == "H2CO-1136") return "H2CO-136";
159 if (old_name == "H2CO-1226") return "HDCO-26";
160 if (old_name == "H2CO-2226") return "D2CO-26";
161 return old_name;
162}
163
164std::pair<ArrayOfString, ArrayOfString> names_of_have_and_havenot_ratio(const Species spec, const IsotopologueRatios& ir) noexcept {
165 ArrayOfString h, hnot;
166 for (std::size_t i=IsotopologuesStart[std::size_t(spec)]; i<IsotopologuesStart[std::size_t(spec) + 1]; i++) {
167 if (not Isotopologues[i].joker() and not is_predefined_model(Isotopologues[i])) {
168 if (nonstd::isnan(ir[i])) {
169 hnot.emplace_back(Isotopologues[i].FullName());
170 } else {
171 h.emplace_back(Isotopologues[i].FullName());
172 }
173 }
174 }
175 return {h, hnot};
176}
177} // namespace Species
This can be used to make arrays out of anything.
Definition: array.h:107
#define ARTS_USER_ERROR(...)
Definition: debug.h:150
#define deal_with_spec(SPEC)
const Joker joker
String isotopologues_names(Species spec)
constexpr bool is_predefined_model(const IsotopeRecord &ir) noexcept
constexpr std::array Isotopologues
Definition: isotopologues.h:50
constexpr auto IsotopologuesStart
std::pair< ArrayOfString, ArrayOfString > names_of_have_and_havenot_ratio(const Species spec, const IsotopologueRatios &ir) noexcept
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 bool isnan(double d) noexcept
Definition: nonstd.h:39