ARTS  2.3.1285(git:92a29ea9-dirty)
agenda_class.cc
Go to the documentation of this file.
1 /* Copyright (C) 2002-2012
2  Stefan Buehler <sbuehler@ltu.se>
3  Oliver Lemke <olemke@core-dump.info>
4 
5  This program is free software; you can redistribute it and/or modify it
6  under the terms of the GNU General Public License as published by the
7  Free Software Foundation; either version 2, or (at your option) any
8  later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program; if not, write to the Free Software
17  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
18  USA. */
19 
28 #include <algorithm>
29 #include <iterator>
30 #include <ostream>
31 
32 #include "agenda_class.h"
33 #include "agenda_record.h" // only for test functions
34 #include "arts.h"
35 #include "arts_omp.h"
36 #include "auto_md.h"
37 #include "global_data.h"
38 #include "messages.h"
39 #include "methods.h"
40 #include "workspace_ng.h"
41 
43 
58 void Agenda::append(const String& methodname, const TokVal& keywordvalue) {
59  using global_data::MdMap;
60 
61  const map<String, Index>::const_iterator i2 = MdMap.find(methodname);
62  assert(i2 != MdMap.end());
63  Index id = i2->second;
64 
66  ArrayOfIndex output = md_data[id].Out();
67 
68  // Find explicit method id in MdMap.
69  ArrayOfIndex input = md_data[id].InOnly();
70 
71  mml.push_back(MRecord(id, output, input, keywordvalue, Agenda()));
72  mchecked = false;
73 }
74 
76 
80 void Agenda::check(Workspace& ws, const Verbosity& verbosity) {
81  // Make external data visible
84 
85  // First we have to find the lookup information for this agenda. We
86  // use AgendaMap for this.
87 
88  map<String, Index>::const_iterator mi = AgendaMap.find(mname);
89 
90  // Find return end() if the string is not found. This means we deal with
91  // agenda defined in the control file and therefore we don't check its
92  // consistency. Custom agendas can't be executed and we delay the check
93  // until it is copied to a predefined agenda.
94  if (mi == AgendaMap.end()) {
95  mchecked = false;
96  return;
97  }
98 
99  const AgRecord& this_data = agenda_data[mi->second];
100 
101  // Ok, we have the lookup data now.
102 
103  // Check that the output produced by the actual methods in the
104  // agenda corresponds to what is desired in the lookup data:
105  for (Index i = 0; i < this_data.Out().nelem(); ++i) {
106  // The WSV for which to check:
107  Index this_wsv = this_data.Out()[i];
108 
109  if (!is_output(this_wsv)) {
110  ostringstream os;
111  os << "The agenda " << mname << " must generate the output WSV "
112  << Workspace::wsv_data[this_wsv].Name() << ",\n"
113  << "but it does not. It only generates:\n";
114  for (Index j = 0; j < Workspace::wsv_data.nelem(); ++j)
115  if (is_output(j)) os << Workspace::wsv_data[j].Name() << "\n";
116  throw runtime_error(os.str());
117  }
118  }
119 
120  // Check that the input used by the actual methods in the
121  // agenda corresponds to what is desired in the lookup data:
122  for (Index i = 0; i < this_data.In().nelem(); ++i) {
123  // The WSV for which to check:
124  Index this_wsv = this_data.In()[i];
125 
126  if (!is_input(ws, this_wsv)) {
127  ostringstream os;
128  os << "The agenda " << mname << " must use the input WSV "
129  << Workspace::wsv_data[this_wsv].Name() << ",\n"
130  << "but it does not. It only uses:\n";
131  for (Index j = 0; j < Workspace::wsv_data.nelem(); ++j)
132  if (is_input(ws, j)) os << Workspace::wsv_data[j].Name() << "\n";
133  throw runtime_error(os.str());
134  }
135  }
136 
137  set_outputs_to_push_and_dup(verbosity);
138 
139  mchecked = true;
140 }
141 
143 
148 void Agenda::execute(Workspace& ws) const {
149  if (!mchecked) {
150  ostringstream os;
151  os << "Agenda *" << mname << "* hasn't been checked for consistency yet."
152  << endl
153  << "This check is usually done by AgendaSet or AgendaAppend." << endl
154  << "There are two possible causes for this:" << endl
155  << "1) You're trying to execute an agenda that has been created in"
156  << endl
157  << " the controlfile with AgendaCreate. This is not allowed. You have"
158  << endl
159  << " to use *Copy* to store it into one of the predefined agendas and"
160  << endl
161  << " execute that one." << endl
162  << "2) Developer error: If you have written code that modifies an Agenda"
163  << endl
164  << " directly (changing its name or altering its method list), it's up"
165  << endl
166  << " to you to call Agenda::check in your code after your modifications.";
167  throw runtime_error(os.str());
168  }
169 
170  // An empty Agenda name indicates that something going wrong here
171  assert(mname != "");
172 
173  // The method description lookup table:
174  using global_data::md_data;
175 
176  // The array holding the pointers to the getaway functions:
177  extern void (*getaways[])(Workspace&, const MRecord&);
178 
179  const Index wsv_id_verbosity = get_wsv_id("verbosity");
180  ws.duplicate(wsv_id_verbosity);
181 
182  Verbosity& averbosity = *((Verbosity*)ws[wsv_id_verbosity]);
183 
184  averbosity.set_main_agenda(is_main_agenda());
185 
186  ArtsOut1 aout1(averbosity);
187  {
188  // ostringstream os; // disabled for performance reasons
189  // os << "Executing " << name() << "\n"
190  // << "{\n";
191  // aout1 << os.str();
192  aout1 << "Executing " << name() << "\n"
193  << "{\n";
194  }
195 
196  for (Index i = 0; i < mml.nelem(); ++i) {
197  const Verbosity& verbosity = *((Verbosity*)ws[wsv_id_verbosity]);
198  CREATE_OUT1;
199  CREATE_OUT3;
200 
201  // Runtime method data for this method:
202  const MRecord& mrr = mml[i];
203  // Method data for this method:
204  const MdRecord& mdd = md_data[mrr.Id()];
205 
206  try {
207  {
208  if (mrr.isInternal()) {
209  out3 << "- " + mdd.Name() + "\n";
210  } else {
211  out1 << "- " + mdd.Name() + "\n";
212  }
213  }
214 
215  { // Check if all input variables are initialized:
216  const ArrayOfIndex& v(mrr.In());
217  for (Index s = 0; s < v.nelem(); ++s)
218  if ((s != v.nelem() - 1 || !mdd.SetMethod()) &&
219  !ws.is_initialized(v[s]))
220  throw runtime_error(
221  "Method " + mdd.Name() +
222  " needs input variable: " + Workspace::wsv_data[v[s]].Name());
223  }
224 
225  { // Check if all output variables which are also used as input
226  // are initialized
227  const ArrayOfIndex& v = mdd.InOut();
228  for (Index s = 0; s < v.nelem(); ++s)
229  if (!ws.is_initialized(mrr.Out()[v[s]]))
230  throw runtime_error("Method " + mdd.Name() +
231  " needs input variable: " +
232  Workspace::wsv_data[mrr.Out()[v[s]]].Name());
233  }
234 
235  // Call the getaway function:
236  getaways[mrr.Id()](ws, mrr);
237 
238  } catch (const std::bad_alloc& x) {
239  aout1 << "}\n";
240 
241  ostringstream os;
242  os << "Memory allocation error in method: " << mdd.Name() << '\n'
243  << "For memory intensive jobs it could help to limit the\n"
244  << "number of threads with the -n option.\n"
245  << x.what();
246 
247  throw runtime_error(os.str());
248  } catch (const std::exception& x) {
249  aout1 << "}\n";
250 
251  ostringstream os;
252  os << "Run-time error in method: " << mdd.Name() << '\n' << x.what();
253 
254  throw runtime_error(os.str());
255  }
256  }
257 
258  aout1 << "}\n";
259 
260  ws.pop_free(wsv_id_verbosity);
261 }
262 
264 
272  using global_data::md_data;
273  using global_data::MdMap;
275 
276  set<Index> inputs;
277  set<Index> outputs;
278  set<Index> outs2push;
279  set<Index> outs2dup;
280 
281  const Index WsmAgendaExecuteIndex = MdMap.find("AgendaExecute")->second;
282  const Index WsmAgendaExecuteExclIndex =
283  MdMap.find("AgendaExecuteExclusive")->second;
284  const Index WsmDeleteIndex = MdMap.find("Delete")->second;
285  const Index WsvAgendaGroupIndex = WsvGroupMap.find("Agenda")->second;
286 
287  for (Array<MRecord>::const_iterator method = mml.begin(); method != mml.end();
288  method++) {
289  // Collect output WSVs
290  const ArrayOfIndex& gouts = method->Out();
291 
292  // Put the outputs into a new set to sort them. Otherwise
293  // set_intersection and set_difference screw up.
294  set<Index> souts;
295  souts.insert(gouts.begin(), gouts.end());
296 
297  // Collect generic input WSVs
298  const ArrayOfIndex& gins = method->In();
299  inputs.insert(gins.begin(), gins.end());
300 
301  /* Special case: For the Delete WSM add its input to the list
302  * of output variables to force a duplication of those variables.
303  * It avoids deleting variables outside the agenda's scope.
304  */
305  if (method->Id() == WsmDeleteIndex) {
306  souts.insert(gins.begin(), gins.end());
307  }
308 
309  /* Special case: For WSMs that execute generic input Agendas
310  it is necessary for proper scoping to also add the output and input variables of the
311  agenda to our output and input variable lists.
312  */
313  if (method->Id() == WsmAgendaExecuteIndex ||
314  method->Id() == WsmAgendaExecuteExclIndex) {
315  for (Index j = 0; j < md_data[method->Id()].GInType().nelem(); j++) {
316  if (md_data[method->Id()].GInType()[j] == WsvAgendaGroupIndex) {
317  const String& agenda_name = Workspace::wsv_data[gins[j]].Name();
318  const map<String, Index>::const_iterator agenda_it =
319  AgendaMap.find(agenda_name);
320  // The executed agenda must not be a user created agenda
321  if (agenda_it == AgendaMap.end()) {
322  ostringstream os;
323  os << "Manual execution of the agenda \"" << agenda_name
324  << "\" is not supported.";
325  throw std::runtime_error(os.str());
326  }
327  const ArrayOfIndex& agouts = agenda_data[agenda_it->second].Out();
328  souts.insert(agouts.begin(), agouts.end());
329  const ArrayOfIndex& agins = agenda_data[agenda_it->second].In();
330  inputs.insert(agins.begin(), agins.end());
331  }
332  }
333  }
334 
335  // Add all outputs of this WSM to global list of outputs
336  outputs.insert(souts.begin(), souts.end());
337 
338  // Find out all output WSVs of current WSM which were
339  // already used as input. We have to place a copy of them on
340  // the WSV stack.
341  set_intersection(souts.begin(),
342  souts.end(),
343  inputs.begin(),
344  inputs.end(),
345  insert_iterator<set<Index> >(outs2dup, outs2dup.begin()));
346 
347  // Get a handle on the InOut list for the current method:
348  const ArrayOfIndex& mdinout = md_data[method->Id()].InOut();
349  const ArrayOfIndex& output = method->Out();
350 
351  for (Index j = 0; j < mdinout.nelem(); j++) {
352  inputs.insert(output[mdinout[j]]);
353  }
354  }
355 
356  // Find all outputs which are not in the list of WSVs to duplicate
357  set_difference(outputs.begin(),
358  outputs.end(),
359  outs2dup.begin(),
360  outs2dup.end(),
361  insert_iterator<set<Index> >(outs2push, outs2push.begin()));
362 
363  const AgRecord& agr = agenda_data[AgendaMap.find(name())->second];
364  const ArrayOfIndex& aout = agr.Out();
365  const ArrayOfIndex& ain = agr.In();
366 
367  // We have to build a new set of agenda input and output because the
368  // set_difference function only works properly on sorted input.
369  set<Index> saout;
370  set<Index> sain;
371 
372  saout.insert(aout.begin(), aout.end());
373  sain.insert(ain.begin(), ain.end());
374 
375  moutput_push.clear();
376  moutput_dup.clear();
377 
378  // Remove the WSVs which are agenda input from the list of
379  // output variables for which we have to create an new
380  // entry on the stack. This is already done for agenda inputs.
381  set<Index> outs2push_without_agenda_input;
382  set_difference(
383  outs2push.begin(),
384  outs2push.end(),
385  sain.begin(),
386  sain.end(),
387  insert_iterator<set<Index> >(outs2push_without_agenda_input,
388  outs2push_without_agenda_input.begin()));
389 
390  // Same for agenda output variables.
391  set_difference(
392  outs2push_without_agenda_input.begin(),
393  outs2push_without_agenda_input.end(),
394  saout.begin(),
395  saout.end(),
396  insert_iterator<ArrayOfIndex>(moutput_push, moutput_push.begin()));
397 
398  // Remove the WSVs which are agenda input from the list of
399  // output variables for which we have to create a duplicate
400  // on the stack. This is already done for agenda inputs.
401  set<Index> outs2dup_without_agenda_input;
402  set_difference(
403  outs2dup.begin(),
404  outs2dup.end(),
405  sain.begin(),
406  sain.end(),
407  insert_iterator<set<Index> >(outs2dup_without_agenda_input,
408  outs2dup_without_agenda_input.begin()));
409 
410  // Same for agenda output variables.
411  set_difference(
412  outs2dup_without_agenda_input.begin(),
413  outs2dup_without_agenda_input.end(),
414  saout.begin(),
415  saout.end(),
416  insert_iterator<ArrayOfIndex>(moutput_dup, moutput_dup.begin()));
417 
418  // Special case: Variables which are defined in the agenda only
419  // as output but are used first as input in one of the WSMs
420  // For those the current WSV value must be copied to the agenda
421  // input variable
422  set<Index> saout_only;
423 
424  set_difference(saout.begin(),
425  saout.end(),
426  sain.begin(),
427  sain.end(),
428  insert_iterator<set<Index> >(saout_only, saout_only.begin()));
429 
430  ArrayOfIndex agenda_only_out_wsm_in;
431  set_intersection(outs2dup.begin(),
432  outs2dup.end(),
433  saout_only.begin(),
434  saout_only.end(),
435  insert_iterator<ArrayOfIndex>(
436  agenda_only_out_wsm_in, agenda_only_out_wsm_in.begin()));
437 
438  // Special case: Variables which are defined in the agenda only
439  // as input but are used as output in one of the WSMs
440  // For those the current WSV value must be copied to the agenda
441  // input variable
442  set<Index> sain_only;
443 
444  set_difference(sain.begin(),
445  sain.end(),
446  saout.begin(),
447  saout.end(),
448  insert_iterator<set<Index> >(sain_only, sain_only.begin()));
449 
450  ArrayOfIndex agenda_only_in_wsm_out;
451  set_intersection(outs2push.begin(),
452  outs2push.end(),
453  sain_only.begin(),
454  sain_only.end(),
455  insert_iterator<ArrayOfIndex>(
456  agenda_only_in_wsm_out, agenda_only_in_wsm_out.begin()));
457 
458  CREATE_OUT3;
459 
460  out3 << " [Agenda::pushpop] : " << name() << "\n";
461  out3 << " [Agenda::pushpop] - # Funcs in Ag : " << mml.nelem() << "\n";
462  out3 << " [Agenda::pushpop] - AgOut : ";
463  PrintWsvNames(out3, aout);
464  out3 << "\n";
465  out3 << " [Agenda::pushpop] - AgIn : ";
466  PrintWsvNames(out3, ain);
467  out3 << "\n";
468  out3 << " [Agenda::pushpop] - All WSM output: ";
469  PrintWsvNames(out3, outputs);
470  out3 << "\n";
471  out3 << " [Agenda::pushpop] - All WSM input : ";
472  PrintWsvNames(out3, inputs);
473  out3 << "\n";
474  out3 << " [Agenda::pushpop] - Output WSVs push : ";
475  PrintWsvNames(out3, moutput_push);
476  out3 << "\n";
477  out3 << " [Agenda::pushpop] - Output WSVs dup : ";
478  PrintWsvNames(out3, moutput_dup);
479  out3 << "\n";
480  out3 << " [Agenda::pushpop] - Ag inp dup : ";
481  PrintWsvNames(out3, agenda_only_in_wsm_out);
482  out3 << "\n";
483  out3 << " [Agenda::pushpop] - Ag out dup : ";
484  PrintWsvNames(out3, agenda_only_out_wsm_in);
485  out3 << "\n";
486 }
487 
489 
499  // Make global method data visible:
502  using global_data::md_data;
503  using global_data::MdMap;
505 
506  const Index WsmAgendaExecuteIndex = MdMap.find("AgendaExecute")->second;
507  const Index WsmAgendaExecuteExclIndex =
508  MdMap.find("AgendaExecuteExclusive")->second;
509 
510  // Make sure that var is the index of a valid WSV:
511  assert(0 <= var);
512  assert(var < Workspace::wsv_data.nelem());
513 
514  // Determine the index of WsvGroup Agenda
515  const Index WsvAgendaGroupIndex = WsvGroupMap.find("Agenda")->second;
516 
517  // Loop all methods in this agenda:
518  for (Index i = 0; i < nelem(); ++i) {
519  // Get a handle on this methods runtime data record:
520  const MRecord& this_method = mml[i];
521 
522  // Is var a generic input?
523  {
524  // Get a handle on the Input list:
525  const ArrayOfIndex& input = this_method.In();
526 
527  for (Index j = 0; j < input.nelem(); ++j) {
528  if (var == input[j]) return true;
529  }
530 
531  // Get a handle on the InOut list for the current method:
532  const ArrayOfIndex& mdinout = md_data[this_method.Id()].InOut();
533  const ArrayOfIndex& output = this_method.Out();
534 
535  for (Index j = 0; j < mdinout.nelem(); j++) {
536  if (var == output[mdinout[j]]) return true;
537  }
538 
539  /* Special case: For WSMs that execute generic input Agendas
540  it is necessary to check their inputs.
541  */
542  if (this_method.Id() == WsmAgendaExecuteIndex ||
543  this_method.Id() == WsmAgendaExecuteExclIndex) {
544  for (Index j = 0; j < md_data[this_method.Id()].GInType().nelem();
545  j++) {
546  if (md_data[this_method.Id()].GInType()[j] == WsvAgendaGroupIndex) {
547  const String& agenda_name = Workspace::wsv_data[input[j]].Name();
548  const map<String, Index>::const_iterator agenda_it =
549  AgendaMap.find(agenda_name);
550  // The executed agenda must not be a user created agenda
551  if (agenda_it == AgendaMap.end()) {
552  ostringstream os;
553  os << "Manual execution of the agenda \"" << agenda_name
554  << "\" is not supported.";
555  throw std::runtime_error(os.str());
556  }
557  const ArrayOfIndex& agins = agenda_data[agenda_it->second].In();
558  for (Index k = 0; k < agins.nelem(); ++k) {
559  if (var == agins[k]) return true;
560  }
561  }
562  }
563  }
564  }
565  }
566 
567  // Ok, that means var is no input at all.
568  return false;
569 }
570 
572 
581  // Make global method data visible:
584  using global_data::md_data;
585  using global_data::MdMap;
587 
588  const Index WsmAgendaExecuteIndex = MdMap.find("AgendaExecute")->second;
589  const Index WsmAgendaExecuteExclIndex =
590  MdMap.find("AgendaExecuteExclusive")->second;
591 
592  // Determine the index of WsvGroup Agenda
593  const Index WsvAgendaGroupIndex = WsvGroupMap.find("Agenda")->second;
594 
595  // Loop all methods in this agenda:
596  for (Index i = 0; i < nelem(); ++i) {
597  // Get a handle on this methods runtime data record:
598  const MRecord& this_method = mml[i];
599 
600  // Is var a generic output?
601  {
602  // Get a handle on the Output list:
603  const ArrayOfIndex& output = this_method.Out();
604 
605  for (Index j = 0; j < output.nelem(); ++j) {
606  if (var == output[j]) return true;
607  }
608 
609  /* Special case: For WSMs that execute generic input Agendas
610  it is necessary to check their outputs.
611  */
612  if (this_method.Id() == WsmAgendaExecuteIndex ||
613  this_method.Id() == WsmAgendaExecuteExclIndex) {
614  for (Index j = 0; j < md_data[this_method.Id()].GInType().nelem();
615  j++) {
616  if (md_data[this_method.Id()].GInType()[j] == WsvAgendaGroupIndex) {
617  const String& agenda_name =
618  Workspace::wsv_data[this_method.In()[j]].Name();
619  const map<String, Index>::const_iterator agenda_it =
620  AgendaMap.find(agenda_name);
621  // The executed agenda must not be a user created agenda
622  if (agenda_it == AgendaMap.end()) {
623  ostringstream os;
624  os << "Manual execution of the agenda \"" << agenda_name
625  << "\" is not supported.";
626  throw std::runtime_error(os.str());
627  }
628  const ArrayOfIndex& agouts = agenda_data[agenda_it->second].Out();
629  for (Index k = 0; k < agouts.nelem(); k++)
630  if (agouts[k] == var) return true;
631  }
632  }
633  }
634  }
635  }
636 
637  // Ok, that means var is no output at all.
638  return false;
639 }
640 
642 
647 void Agenda::set_name(const String& nname) {
648  mname = nname;
649  mchecked = false;
650 }
651 
653 
658 String Agenda::name() const { return mname; }
659 
661 
672 bool Agenda::has_method(const String& methodname) const {
673  using global_data::md_data;
674 
675  bool found = false;
676  for (Array<MRecord>::const_iterator it = mml.begin();
677  !found && it != mml.end();
678  it++) {
679  if (md_data[it->Id()].Name() == methodname) found = true;
680  }
681 
682  return found;
683 }
684 
686 
696 void Agenda::print(ostream& os, const String& indent) const {
697  for (Index i = 0; i < mml.nelem(); ++i) {
698  // Print member methods with 3 characters more indentation:
699  mml[i].print(os, indent);
700  }
701 }
702 
704 
715 ostream& operator<<(ostream& os, const Agenda& a) {
716  // Print agenda as it would apear in a controlfile.
717  a.print(os, " ");
718  return os;
719 }
720 
721 //--------------------------------
722 // Functions for MRecord:
723 //--------------------------------
724 
726 
746 void MRecord::print(ostream& os, const String& indent) const {
747  using global_data::md_data;
748 
749  // Get a handle on the right record:
750  const MdRecord tmd = md_data[Id()];
751 
752  os << indent << tmd.Name();
753 
754  // Is this a generic method? -- Then we need round braces.
755  if (0 != tmd.GOutType().nelem() + tmd.GInType().nelem()) {
756  // First entry needs no leading comma:
757  bool first = true;
758 
759  os << "(";
760 
761  for (Index i = 0; i < Out().nelem(); ++i) {
762  if (first)
763  first = false;
764  else
765  os << ",";
766 
767  os << Workspace::wsv_data[Out()[i]].Name();
768  }
769 
770  for (Index i = 0; i < In().nelem(); ++i) {
771  if (first)
772  first = false;
773  else
774  os << ",";
775 
776  os << Workspace::wsv_data[In()[i]].Name();
777  }
778 
779  os << ")";
780  }
781 
782  if (0 != Tasks().nelem()) {
783  os << " {\n";
784  Tasks().print(os, indent + " ");
785  os << indent << "}\n";
786  } else
787  os << "\n";
788 }
789 
791 
802 ostream& operator<<(ostream& os, const MRecord& a) {
803  a.print(os, "");
804  return os;
805 }
INDEX Index
The type to use for all integer numbers and indices.
Definition: matpack.h:39
static Array< WsvRecord > wsv_data
Global WSV data.
Definition: workspace_ng.h:58
Lookup information for one agenda.
Definition: agenda_record.h:43
void set_outputs_to_push_and_dup(const Verbosity &verbosity)
Retrieve indexes of all input and output WSVs.
void var(VectorView var, const Vector &y, const ArrayOfVector &ys, const Index start=0, const Index end=-1)
Compute the variance of the ranged ys.
Definition: raw.cc:49
void print(ostream &os, const String &indent) const
Print an MRecord.
The Agenda class.
Definition: agenda_class.h:44
String name() const
Agenda name.
Index nelem() const
Number of elements.
Definition: array.h:195
void check(Workspace &ws, const Verbosity &verbosity)
Checks consistency of an agenda.
Definition: agenda_class.cc:80
Declarations having to do with the four output streams.
map< String, Index > AgendaMap
The map associated with agenda_data.
const ArrayOfIndex & In() const
Definition: agenda_class.h:157
void duplicate(Index i)
Duplicate WSV.
Definition: workspace_ng.cc:77
void(* getaways[])(Workspace &, const MRecord &)
Definition: auto_md.cc:21480
bool SetMethod() const
Definition: methods.h:105
void pop_free(Index i)
Remove the topmost WSV from its stack and free its memory.
bool is_initialized(Index i)
Checks existence of the given WSV.
Definition: workspace_ng.h:118
Index Id() const
Definition: agenda_class.h:155
const ArrayOfIndex & Out() const
Definition: agenda_record.h:60
const ArrayOfIndex & Out() const
Definition: agenda_class.h:156
void PrintWsvNames(OutputStream &outstream, const Container &container)
Print list of WSV names to output stream.
Definition: workspace_ng.h:193
All information for one workspace method.
Definition: methods.h:41
ArrayOfIndex moutput_dup
Definition: agenda_class.h:101
const String & Name() const
Definition: methods.h:88
const map< String, Index > MdMap
The map associated with md_data.
Definition: methods_aux.cc:39
This file contains the Workspace class.
Index get_wsv_id(const String &name)
Get index of WSV.
Definition: workspace.cc:5751
The global header file for ARTS.
bool mchecked
Flag indicating that the agenda was checked for consistency.
Definition: agenda_class.h:107
bool has_method(const String &methodname) const
Check if method is in Agenda.
_CS_string_type str() const
Definition: sstream.h:491
bool is_main_agenda() const
Definition: agenda_class.h:92
Declarations for agendas.
void set_main_agenda(bool main_agenda)
Definition: messages.h:73
ArrayOfIndex moutput_push
Definition: agenda_class.h:99
Method runtime data.
Definition: agenda_class.h:121
#define CREATE_OUT1
Definition: messages.h:205
bool is_input(Workspace &ws, Index var) const
Check if given variable is agenda input.
void execute(Workspace &ws) const
Execute an agenda.
const Array< AgRecord > agenda_data
The lookup information for the agendas.
Definition: agendas.cc:41
const ArrayOfIndex & In() const
Definition: agenda_record.h:61
Index nelem() const
Return the number of agenda elements.
Definition: agenda_class.h:266
String mname
Definition: agenda_class.h:96
const ArrayOfIndex & InOut() const
Definition: methods.h:103
bool isInternal() const
Indicates the origin of this method.
Definition: agenda_class.h:169
const ArrayOfIndex & GOutType() const
Definition: methods.h:93
void print(ostream &os, const String &indent) const
Print an agenda.
void set_name(const String &nname)
Set agenda name.
ostream & operator<<(ostream &os, const Agenda &a)
Output operator for Agenda.
const map< String, Index > WsvGroupMap
The map associated with wsv_group_names.
Definition: groups.cc:41
bool is_output(Index var) const
Check if given variable is agenda output.
Workspace class.
Definition: workspace_ng.h:40
Array< MRecord > mml
Definition: agenda_class.h:97
const Array< MdRecord > md_data
Lookup information for workspace methods.
#define CREATE_OUT3
Definition: messages.h:207
const ArrayOfIndex & GInType() const
Definition: methods.h:98
Header file for helper functions for OpenMP.
This stores arbitrary token values and remembers the type.
Definition: token.h:40
Declaration of the class MdRecord.
Declarations for AgRecord, storing lookup information for one agenda.
void append(const String &methodname, const TokVal &keywordvalue)
Appends methods to an agenda.
Definition: agenda_class.cc:58