43 out3 <<
" Manual agenda execution\n";
46 std::ostringstream os;
48 os <<
"This agenda is uninitialized. We don't even know its name.";
50 os <<
"*" << this_agenda.
name() <<
"* is uninitialized.";
51 os <<
" Use *AgendaSet* or *@arts_agenda* to add methods to it.";
52 throw std::runtime_error(os.str());
61 sain.insert(ain.begin(), ain.end());
62 saout.insert(aout.begin(), aout.end());
65 set_difference(sain.begin(),
69 insert_iterator<set<Index> >(in_only, in_only.begin()));
70 for (
Index it : in_only) {
77 for (
Index it : outputs_to_push) {
78 if (ws.is_initialized(it))
84 for (
auto it : outputs_to_dup) ws.duplicate(it);
87 bool agenda_failed =
false;
91 }
catch (
const std::exception& e) {
96 for (
auto it : outputs_to_push) ws.pop(it);
98 for (
auto it : outputs_to_dup) ws.pop(it);
100 for (
auto it : in_only) ws.pop(it);
103 "Run-time error in agenda: ",
112 const Index& agenda_array_index,
115 if (agenda_array_index < 0 || agenda_array_index >= agenda_array.
nelem()) {
116 std::ostringstream os;
117 os <<
"Agenda index " << agenda_array_index
118 <<
" out of bounds. 0 <= index < " << agenda_array.
nelem();
119 throw std::runtime_error(os.str());
121 AgendaExecute(ws, agenda_array[agenda_array_index], verbosity);
127 const Agenda& this_agenda,
130 out3 <<
" Manual, exclusive agenda execution\n";
132#pragma omp critical(AgendaExecuteExclusive_region)
141 const String& agenda_name,
143 const Agenda& input_agenda,
145 output_agenda = input_agenda;
147 output_agenda.
set_name(agenda_name);
149 output_agenda.
check(ws, verbosity);
157 const String& agenda_name,
159 const Agenda& input_agenda,
161 out.push_back(input_agenda);
164 appended_agenda.
set_name(agenda_name);
166 appended_agenda.
check(ws, verbosity);
174 const String& output_agenda_name,
176 const Agenda& in_agenda [[maybe_unused]],
178 const String& in_agenda_name,
180 const Agenda& input_agenda,
182 if (output_agenda_name != in_agenda_name) {
184 os <<
"Output and input agenda must be the same!" << endl
185 <<
"*" << output_agenda_name <<
"* and *" << in_agenda_name <<
"* "
187 throw runtime_error(os.str());
191 for (
Index i = 0; i < input_agenda.
Methods().nelem(); i++)
192 methods.push_back(input_agenda.
Methods()[i]);
195 output_agenda.
check(ws, verbosity);
205 "The 'Arts' method is obsolete. Arts1 controlfiles are no longer supported.",
212 const Agenda& input_agenda,
219 if (
v == &verbosity) {
Declarations for agendas.
Declarations for AgRecord, storing lookup information for one agenda.
void arts_exit_with_error_message(const String &m, ArtsOut &out)
Print error message and exit.
const ArrayOfIndex & get_output2push() const
String name() const
Agenda name.
void execute(Workspace &ws_in) const
Execute an agenda.
void set_methods(const Array< MRecord > &ml)
void check(Workspace &ws_in, const Verbosity &verbosity)
Checks consistency of an agenda.
const ArrayOfIndex & get_output2dup() const
std::pair< ArrayOfIndex, ArrayOfIndex > get_global_inout() const
Get index lists of global input and output variables from agenda_data of this agenda.
void set_name(const String &nname)
Set agenda name.
const Array< MRecord > & Methods() const
Index nelem() const ARTS_NOEXCEPT
T * get(const char *name)
Retrieve a value ptr if it exist (FIXME: C++20 allows const char* as template argument)
std::shared_ptr< WsvMap_type > WsvMap_ptr
Helper macros for debugging.
#define ARTS_USER_ERROR_IF(condition,...)
void AgendaAppend(Workspace &ws, Agenda &output_agenda, const String &output_agenda_name, const Agenda &in_agenda, const String &in_agenda_name, const Agenda &input_agenda, const Verbosity &verbosity)
WORKSPACE METHOD: AgendaAppend.
void ArrayOfAgendaAppend(Workspace &ws, ArrayOfAgenda &out, const String &agenda_name, const Agenda &input_agenda, const Verbosity &verbosity)
WORKSPACE METHOD: ArrayOfAgendaAppend.
void AgendaSet(Workspace &ws, Agenda &output_agenda, const String &agenda_name, const Agenda &input_agenda, const Verbosity &verbosity)
WORKSPACE METHOD: AgendaSet.
void AgendaExecute(Workspace &ws, const Agenda &this_agenda, const Verbosity &verbosity)
WORKSPACE METHOD: AgendaExecute.
void ArrayOfAgendaExecute(Workspace &ws, const Index &agenda_array_index, const ArrayOfAgenda &agenda_array, const Verbosity &verbosity)
WORKSPACE METHOD: ArrayOfAgendaExecute.
void Arts(Workspace &, const Agenda &, const Verbosity &verbosity)
WORKSPACE METHOD: Arts.
void AgendaExecuteExclusive(Workspace &ws, const Agenda &this_agenda, const Verbosity &verbosity)
WORKSPACE METHOD: AgendaExecuteExclusive.
void Arts2(Workspace &ws, const Agenda &input_agenda, const Verbosity &verbosity)
WORKSPACE METHOD: Arts2.
INDEX Index
The type to use for all integer numbers and indices.
Declarations having to do with the four output streams.
This file contains the Workspace class.
Auxiliary header stuff related to workspace variable groups.