ARTS 2.5.4 (git: 4c0d3b4d)
m_predefined_absorption_models.cc
Go to the documentation of this file.
1/* Copyright (C) 2020
2 * Richard Larsson <ric.larsson@gmail.com>
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2, or (at your option) any
7 * later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
17 * USA. */
18
27#include "debug.h"
29
30/* Workspace method: Doxygen documentation will be auto-generated */
32 PropagationMatrix& propmat_clearsky,
33 ArrayOfPropagationMatrix& dpropmat_clearsky_dx,
34 const ArrayOfArrayOfSpeciesTag& abs_species,
35 const ArrayOfRetrievalQuantity& jacobian_quantities,
36 const Vector& f_grid,
37 const Numeric& rtp_pressure,
38 const Numeric& rtp_temperature,
39 const Vector& rtp_vmr,
40 const Verbosity&) {
41 // Forward simulations and their error handling
42 ARTS_USER_ERROR_IF(rtp_vmr.nelem() not_eq abs_species.nelem(),
43 "Mismatch dimensions on species and VMR inputs");
45 propmat_clearsky.NumberOfFrequencies() not_eq f_grid.nelem(),
46 "Mismatch dimensions on internal matrices of xsec and frequency");
47
48 // Derivatives and their error handling
49 if (dpropmat_clearsky_dx.nelem()) {
51 dpropmat_clearsky_dx.nelem() not_eq jacobian_quantities.nelem(),
52 "Mismatch dimensions on xsec derivatives and Jacobian grids");
54 std::any_of(dpropmat_clearsky_dx.cbegin(),
55 dpropmat_clearsky_dx.cend(),
56 [&f_grid](auto& x) {
57 return x.NumberOfFrequencies() not_eq f_grid.nelem();
58 }),
59 "Mismatch dimensions on internal matrices of xsec derivatives and frequency");
60 }
61
62 const Absorption::PredefinedModel::VMRS vmr(abs_species, rtp_vmr);
63 for (auto& tag_groups : abs_species) {
64 for (auto& tag : tag_groups) {
66 propmat_clearsky,
67 dpropmat_clearsky_dx,
68 tag.Isotopologue(),
69 f_grid,
70 rtp_pressure,
71 rtp_temperature,
72 vmr,
73 jacobian_quantities);
74 }
75 }
76}
This can be used to make arrays out of anything.
Definition: array.h:108
Index nelem() const ARTS_NOEXCEPT
Number of elements.
Definition: array.h:197
Index nelem() const noexcept
Returns the number of elements.
Definition: matpackI.h:541
Index NumberOfFrequencies() const
The number of frequencies of the propagation matrix.
The Vector class.
Definition: matpackI.h:908
Helper macros for debugging.
#define ARTS_USER_ERROR_IF(condition,...)
Definition: debug.h:134
void propmat_clearskyAddPredefined(PropagationMatrix &propmat_clearsky, ArrayOfPropagationMatrix &dpropmat_clearsky_dx, const ArrayOfArrayOfSpeciesTag &abs_species, const ArrayOfRetrievalQuantity &jacobian_quantities, const Vector &f_grid, const Numeric &rtp_pressure, const Numeric &rtp_temperature, const Vector &rtp_vmr, const Verbosity &)
WORKSPACE METHOD: propmat_clearskyAddPredefined.
NUMERIC Numeric
The type to use for all floating point numbers.
Definition: matpack.h:33
void compute(PropagationMatrix &propmat_clearsky, ArrayOfPropagationMatrix &dpropmat_clearsky_dx, const SpeciesIsotopeRecord &model, const Vector &f_grid, const Numeric &rtp_pressure, const Numeric &rtp_temperature, const VMRS &vmr, const ArrayOfRetrievalQuantity &jacobian_quantities)
Compute the predefined model.
Contains known required VMR values.