ARTS  2.2.66
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 <ostream>
29 #include <algorithm>
30 #include <iterator>
31 
32 #include "arts.h"
33 #include "agenda_class.h"
34 #include "agenda_record.h" // only for test functions
35 #include "methods.h"
36 #include "messages.h"
37 #include "workspace_ng.h"
38 #include "arts_omp.h"
39 #include "auto_md.h"
40 #include "global_data.h"
41 
42 
44 
59 void Agenda::append(const String& methodname,
60  const TokVal& keywordvalue)
61 {
62  using global_data::MdMap;
63 
64  const map<String, Index>::const_iterator i2 = MdMap.find(methodname);
65  assert(i2 != MdMap.end());
66  Index id = i2->second;
67 
69  ArrayOfIndex output = md_data[id].Out();
70 
71  // Find explicit method id in MdMap.
72  ArrayOfIndex input = md_data[id].InOnly();
73 
74  mml.push_back(MRecord(id, output, input, keywordvalue, Agenda()));
75  mchecked = false;
76 }
77 
78 
80 
84 void Agenda::check(Workspace& ws, const Verbosity& verbosity)
85 {
86  // Make external data visible
89 
90  // First we have to find the lookup information for this agenda. We
91  // use AgendaMap for this.
92 
93  map<String, Index>::const_iterator mi = AgendaMap.find(mname);
94 
95  // Find return end() if the string is not found. This means we deal with
96  // agenda defined in the control file and therefore we don't check its
97  // consistency. Custom agendas can't be executed and we delay the check
98  // until it is copied to a predefined agenda.
99  if (mi == AgendaMap.end()) {
100  mchecked = false;
101  return;
102  }
103 
104  const AgRecord& this_data = agenda_data[mi->second];
105 
106  // Ok, we have the lookup data now.
107 
108  // Check that the output produced by the actual methods in the
109  // agenda corresponds to what is desired in the lookup data:
110  for (Index i = 0; i < this_data.Out().nelem(); ++i)
111  {
112  // The WSV for which to check:
113  Index this_wsv = this_data.Out()[i];
114 
115  if (!is_output(this_wsv))
116  {
117  ostringstream os;
118  os << "The agenda " << mname
119  << " must generate the output WSV "
120  << Workspace::wsv_data[this_wsv].Name() << ",\n"
121  << "but it does not. It only generates:\n";
122  for (Index j = 0; j < Workspace::wsv_data.nelem(); ++j)
123  if (is_output(j))
124  os << Workspace::wsv_data[j].Name() << "\n";
125  throw runtime_error(os.str());
126  }
127  }
128 
129  // Check that the input used by the actual methods in the
130  // agenda corresponds to what is desired in the lookup data:
131  for (Index i = 0; i < this_data.In().nelem(); ++i)
132  {
133  // The WSV for which to check:
134  Index this_wsv = this_data.In()[i];
135 
136  if (!is_input(ws, this_wsv))
137  {
138  ostringstream os;
139  os << "The agenda " << mname
140  << " must use the input WSV "
141  << Workspace::wsv_data[this_wsv].Name() << ",\n"
142  << "but it does not. It only uses:\n";
143  for (Index j = 0; j < Workspace::wsv_data.nelem(); ++j)
144  if (is_input(ws, j))
145  os << Workspace::wsv_data[j].Name() << "\n";
146  throw runtime_error(os.str());
147  }
148  }
149 
150  set_outputs_to_push_and_dup(verbosity);
151 
152  mchecked = true;
153 }
154 
155 
157 
162 void Agenda::execute(Workspace& ws) const
163 {
164 
165  if (!mchecked)
166  {
167  ostringstream os;
168  os << "Agenda *" << mname << "* hasn't been checked for consistency yet." << endl
169  << "This check is usually done by AgendaSet or AgendaAppend." << endl
170  << "There are two possible causes for this:" << endl
171  << "1) You're trying to execute an agenda that has been created in" << endl
172  << " the controlfile with AgendaCreate. This is not allowed. You have" << endl
173  << " to use *Copy* to store it into one of the predefined agendas and" << endl
174  << " execute that one." << endl
175  << "2) Developer error: If you have written code that modifies an Agenda" << endl
176  << " directly (changing its name or altering its method list), it's up" << endl
177  << " to you to call Agenda::check in your code after your modifications.";
178  throw runtime_error(os.str());
179  }
180 
181  // An empty Agenda name indicates that something going wrong here
182  assert(mname != "");
183 
184  // The method description lookup table:
185  using global_data::md_data;
186 
187  // The array holding the pointers to the getaway functions:
188  extern void (*getaways[])(Workspace&, const MRecord&);
189 
190  const Index wsv_id_verbosity = get_wsv_id("verbosity");
191  ws.duplicate(wsv_id_verbosity);
192 
193  Verbosity& averbosity = *((Verbosity*)ws[wsv_id_verbosity]);
194 
195  averbosity.set_main_agenda(is_main_agenda());
196 
197  ArtsOut1 aout1(averbosity);
198  {
199  // ostringstream os; // disabled for performance reasons
200  // os << "Executing " << name() << "\n"
201  // << "{\n";
202  // aout1 << os.str();
203  aout1 << "Executing " << name() << "\n"
204  << "{\n";
205  }
206 
207  for (Index i = 0; i < mml.nelem(); ++i)
208  {
209  const Verbosity& verbosity = *((Verbosity*)ws[wsv_id_verbosity]);
210  CREATE_OUT1;
211  CREATE_OUT3;
212 
213  // Runtime method data for this method:
214  const MRecord& mrr = mml[i];
215  // Method data for this method:
216  const MdRecord& mdd = md_data[mrr.Id()];
217 
218  try
219  {
220  {
221  if (mrr.isInternal())
222  {
223  out3 << "- " + mdd.Name() + "\n";
224  }
225  else
226  {
227  out1 << "- " + mdd.Name() + "\n";
228  }
229  }
230 
231  { // Check if all input variables are initialized:
232  const ArrayOfIndex& v(mrr.In());
233  for (Index s = 0; s < v.nelem(); ++s)
234  if ((s != v.nelem()-1 || !mdd.SetMethod())
235  && !ws.is_initialized(v[s]))
236  throw runtime_error("Method "+mdd.Name()+" needs input variable: "+
237  Workspace::wsv_data[v[s]].Name());
238  }
239 
240  { // Check if all output variables which are also used as input
241  // are initialized
242  const ArrayOfIndex& v = mdd.InOut();
243  for (Index s = 0; s < v.nelem(); ++s)
244  if (!ws.is_initialized(mrr.Out()[v[s]]))
245  throw runtime_error("Method "+mdd.Name()+" needs input variable: "+
246  Workspace::wsv_data[mrr.Out()[v[s]]].Name());
247  }
248 
249  // Call the getaway function:
250  getaways[mrr.Id()](ws, mrr);
251 
252  }
253  catch (runtime_error x)
254  {
255  aout1 << "}\n";
256 
257  ostringstream os;
258  os << "Run-time error in method: " << mdd.Name() << '\n'
259  << x.what();
260 
261  throw runtime_error(os.str());
262  }
263  catch (std::bad_alloc x)
264  {
265  aout1 << "}\n";
266 
267  ostringstream os;
268  os << "Memory allocation error in method: " << mdd.Name() << '\n'
269  << "For memory intensive jobs it could help to limit the\n"
270  << "number of threads with the -n option.\n"
271  << x.what();
272 
273  throw runtime_error(os.str());
274  }
275  }
276 
277  aout1 << "}\n";
278 
279  ws.pop_free(wsv_id_verbosity);
280 }
281 
282 
284 
290 {
291  using global_data::md_data;
292 
293  set<Index> inputs;
294  set<Index> outputs;
295  set<Index> outs2push;
296  set<Index> outs2dup;
297 
298  for (Array<MRecord>::const_iterator method = mml.begin();
299  method != mml.end(); method++)
300  {
301  // Collect output WSVs
302  const ArrayOfIndex& outs = md_data[method->Id()].Out();
303  const ArrayOfIndex& gouts = method->Out();
304 
305  // Put the outputs into a new set to sort them. Otherwise
306  // set_intersection and set_difference screw up.
307  set<Index> souts;
308  souts.insert(outs.begin(), outs.end());
309  souts.insert(gouts.begin(), gouts.end());
310 
311  // Collect generic input WSVs
312  const ArrayOfIndex& gins = method->In();
313  inputs.insert(gins.begin(), gins.end());
314 
315  /* Special case: For the Delete WSM add its input to the list
316  * of output variables to force a duplication of those variables.
317  * It avoids deleting variables outside the agenda's scope.
318  */
319  if (md_data[method->Id()].Name() == "Delete")
320  {
321  souts.insert(gins.begin(), gins.end());
322  }
323 
324  // Collect input WSVs
325  const ArrayOfIndex& ins = md_data[method->Id()].In();
326  inputs.insert(ins.begin(), ins.end());
327 
328  // Add all outputs of this WSM to global list of outputs
329  outputs.insert(souts.begin(), souts.end());
330 
331  // Find out all output WSVs of current WSM which were
332  // already used as input. We have to place a copy of them on
333  // the WSV stack.
334  set_intersection(souts.begin(), souts.end(),
335  inputs.begin(), inputs.end(),
336  insert_iterator< set<Index> >(outs2dup,
337  outs2dup.begin()));
338 
339  }
340 
341  // Find all outputs which are not in the list of WSVs to duplicate
342  set_difference(outputs.begin(), outputs.end(),
343  outs2dup.begin(), outs2dup.end(),
344  insert_iterator< set<Index> >(outs2push,
345  outs2push.begin()));
346 
349 
350  const AgRecord& agr = agenda_data[AgendaMap.find(name())->second];
351  const ArrayOfIndex& aout = agr.Out();
352  const ArrayOfIndex& ain = agr.In();
353 
354  // We have to build a new set of agenda input and output because the
355  // set_difference function only works properly on sorted input.
356  set<Index> saout;
357  set<Index> sain;
358 
359  saout.insert(aout.begin(), aout.end());
360  sain.insert(ain.begin(), ain.end());
361 
362  moutput_push.clear();
363  moutput_dup.clear();
364 
365  // Remove the WSVs which are agenda input from the list of
366  // output variables for which we have to create an new
367  // entry on the stack. This is already done for agenda inputs.
368  set<Index> outs2push_without_agenda_input;
369  set_difference(outs2push.begin(), outs2push.end(),
370  sain.begin(), sain.end(),
371  insert_iterator< set<Index> >(outs2push_without_agenda_input,
372  outs2push_without_agenda_input.begin()));
373 
374  // Same for agenda output variables.
375  set_difference(outs2push_without_agenda_input.begin(),
376  outs2push_without_agenda_input.end(),
377  saout.begin(), saout.end(),
378  insert_iterator<ArrayOfIndex>(moutput_push,
379  moutput_push.begin()));
380 
381  // Remove the WSVs which are agenda input from the list of
382  // output variables for which we have to create a duplicate
383  // on the stack. This is already done for agenda inputs.
384  set<Index> outs2dup_without_agenda_input;
385  set_difference(outs2dup.begin(), outs2dup.end(),
386  sain.begin(), sain.end(),
387  insert_iterator< set<Index> >(outs2dup_without_agenda_input,
388  outs2dup_without_agenda_input.begin()));
389 
390  // Same for agenda output variables.
391  set_difference(outs2dup_without_agenda_input.begin(),
392  outs2dup_without_agenda_input.end(),
393  saout.begin(), saout.end(),
394  insert_iterator<ArrayOfIndex>(moutput_dup,
395  moutput_dup.begin()));
396 
397  // Special case: Variables which are defined in the agenda only
398  // as output but are used first as input in one of the WSMs
399  // For those the current WSV value must be copied to the agenda
400  // input variable
401  set<Index> saout_only;
402 
403  set_difference(saout.begin(), saout.end(),
404  sain.begin(), sain.end(),
405  insert_iterator< set<Index> >(saout_only,
406  saout_only.begin()));
407 
408  ArrayOfIndex agenda_only_out_wsm_in;
409  set_intersection(outs2dup.begin(), outs2dup.end(),
410  saout_only.begin(), saout_only.end(),
411  insert_iterator<ArrayOfIndex>(agenda_only_out_wsm_in,
412  agenda_only_out_wsm_in.begin()));
413 
414  // Special case: Variables which are defined in the agenda only
415  // as input but are used as output in one of the WSMs
416  // For those the current WSV value must be copied to the agenda
417  // input variable
418  set<Index> sain_only;
419 
420  set_difference(sain.begin(), sain.end(),
421  saout.begin(), saout.end(),
422  insert_iterator< set<Index> >(sain_only,
423  sain_only.begin()));
424 
425  ArrayOfIndex agenda_only_in_wsm_out;
426  set_intersection(outs2push.begin(), outs2push.end(),
427  sain_only.begin(), sain_only.end(),
428  insert_iterator<ArrayOfIndex>(agenda_only_in_wsm_out,
429  agenda_only_in_wsm_out.begin()));
430 
431  CREATE_OUT3;
432 
433  out3 << " [Agenda::pushpop] : " << name() << "\n";
434  out3 << " [Agenda::pushpop] - # Funcs in Ag : " << mml.nelem() << "\n";
435  out3 << " [Agenda::pushpop] - AgOut : ";
436  PrintWsvNames(out3, aout);
437  out3 << "\n";
438  out3 << " [Agenda::pushpop] - AgIn : ";
439  PrintWsvNames(out3, ain);
440  out3 << "\n";
441  out3 << " [Agenda::pushpop] - All WSM output: ";
442  PrintWsvNames(out3, outputs);
443  out3 << "\n";
444  out3 << " [Agenda::pushpop] - WSVs push : ";
445  PrintWsvNames(out3, moutput_push);
446  out3 << "\n";
447  out3 << " [Agenda::pushpop] - WSVs dup : ";
448  PrintWsvNames(out3, moutput_dup);
449  out3 << "\n";
450  out3 << " [Agenda::pushpop] - Ag inp dup : ";
451  PrintWsvNames(out3, agenda_only_in_wsm_out);
452  out3 << "\n";
453  out3 << " [Agenda::pushpop] - Ag out dup : ";
454  PrintWsvNames(out3, agenda_only_out_wsm_in);
455  out3 << "\n";
456 
457  if (agenda_only_in_wsm_out.nelem())
458  {
459  ostringstream err;
460  err << "At least one variable is only defined as input\n"
461  << "in agenda " << name() << ", but\n"
462  << "used as output in a WSM called by the agenda!!!\n"
463  << "This is not allowed.\n"
464  << "Variable(s): ";
465  PrintWsvNames(err, agenda_only_in_wsm_out);
466  throw runtime_error(err.str());
467  }
468 }
469 
471 
480 bool Agenda::is_input(Workspace& ws, Index var) const
481 {
482  // Make global method data visible:
483  using global_data::md_data;
485 
486  // Make sure that var is the index of a valid method:
487  assert(0 <= var);
488  assert(var < md_data.nelem());
489 
490  // Determine the index of WsvGroup Agenda
491  Index WsvAgendaGroupIndex = 0;
492  for (Index i = 0; !WsvAgendaGroupIndex && i < wsv_group_names.nelem(); i++)
493  {
494  if (wsv_group_names[i] == "Agenda")
495  WsvAgendaGroupIndex = i;
496  }
497 
498  // Loop all methods in this agenda:
499  for (Index i = 0; i < nelem(); ++i)
500  {
501  // Get a handle on this methods runtime data record:
502  const MRecord& this_method = mml[i];
503 
504  // Is var a specific input?
505  {
506  // Get a handle on the Input list for the current method:
507  const ArrayOfIndex& input = md_data[this_method.Id()].In();
508 
509  for (Index j = 0; j < input.nelem(); ++j)
510  {
511  if (var == input[j]) return true;
512  }
513  }
514 
515  // Is var a generic input?
516  {
517  // Get a handle on the Input list:
518  const ArrayOfIndex& input = this_method.In();
519 
520  for (Index j = 0; j < input.nelem(); ++j)
521  {
522  if (var == input[j]) return true;
523  }
524  }
525 
526  // If a General Input variable of this method (e.g. AgendaExecute)
527  // is of type Agenda, check its input recursively for matches
528  for (Index j = 0; j < md_data[this_method.Id()].GInType().nelem(); j++)
529  {
530  if (md_data[this_method.Id()].GInType()[j] == WsvAgendaGroupIndex)
531  {
532  Agenda* AgendaFromGeneralInput =
533  (Agenda*)ws[this_method.In()[j]];
534 
535  if ((*AgendaFromGeneralInput).is_input(ws, var))
536  {
537  return true;
538  }
539  }
540  }
541  }
542 
543  // Ok, that means var is no input at all.
544  return false;
545 }
546 
548 
556 bool Agenda::is_output(Index var) const
557 {
558  // Loop all methods in this agenda:
559  for (Index i = 0; i < nelem(); ++i)
560  {
561  // Get a handle on this methods runtime data record:
562  const MRecord& this_method = mml[i];
563 
564  // Is var a specific output?
565  {
566  // Make global method data visible:
567  using global_data::md_data;
568 
569  // Get a handle on the Output list for the current method:
570  const ArrayOfIndex& output = md_data[this_method.Id()].Out();
571 
572  for (Index j = 0; j < output.nelem(); ++j)
573  {
574  if (var == output[j]) return true;
575  }
576  }
577 
578  // Is var a generic output?
579  {
580  // Get a handle on the Output list:
581  const ArrayOfIndex& output = this_method.Out();
582 
583  for (Index j = 0; j < output.nelem(); ++j)
584  {
585  if (var == output[j]) return true;
586  }
587  }
588  }
589 
590  // Ok, that means var is no output at all.
591  return false;
592 }
593 
595 
600 void Agenda::set_name(const String& nname)
601 {
602  mname = nname;
603  mchecked = false;
604 }
605 
607 
613 {
614  return mname;
615 }
616 
618 {
619  using global_data::md_data;
620 
621  MdRecord tmd;
622 
623  ArrayOfIndex in_vars;
624  ArrayOfIndex out_vars;
625  Array<MRecord>::iterator mr = mml.end();
626  do
627  {
628  mr--;
629  cout << md_data[mr->Id()].Name() << ": ";
630  cout << mr->In() << endl;
631 
632  if (md_data[mr->Id()].Name() == "AgendaExecute")
633  {
634  cout << "AgendaExecute" << endl;
635  }
636  else
637  {
638  for (ArrayOfIndex::const_iterator it = mr->In().begin();
639  it != mr->In().end(); it++)
640  if (find(in_vars.begin(), in_vars.end(), *it) == in_vars.end())
641  in_vars.push_back(*it);
642 
643  for (ArrayOfIndex::const_iterator it = mr->Out().begin();
644  it != mr->Out().end(); it++)
645  if (find(out_vars.begin(), out_vars.end(), *it) == out_vars.end())
646  out_vars.push_back(*it);
647  }
648  }
649  while (mr != mml.begin());
650 
651  cout << "In : " << in_vars << endl;
652  cout << "Out: " << out_vars << endl;
653 }
654 
655 
657 
668 bool Agenda::has_method(const String& methodname) const
669 {
670  using global_data::md_data;
671 
672  bool found = false;
673  for (Array<MRecord>::const_iterator it = mml.begin();
674  !found && it != mml.end();
675  it++)
676  {
677  if (md_data[it->Id()].Name() == methodname)
678  found = true;
679  }
680 
681  return found;
682 }
683 
684 
686 
696 void Agenda::print(ostream& os,
697  const String& indent) const
698 {
699  for (Index i = 0; i < mml.nelem(); ++i)
700  {
701  // Print member methods with 3 characters more indentation:
702  mml[i].print(os, indent);
703  }
704 }
705 
706 
708 
719 ostream& operator<<(ostream& os, const Agenda& a)
720 {
721  // Print agenda as it would apear in a controlfile.
722  a.print(os, " ");
723  return os;
724 }
725 
726 
727 //--------------------------------
728 // Functions for MRecord:
729 //--------------------------------
730 
732 
752 void MRecord::print(ostream& os, const String& indent) const
753 {
754  using global_data::md_data;
755 
756  // Get a handle on the right record:
757  const MdRecord tmd = md_data[Id()];
758 
759  os << indent << tmd.Name();
760 
761  // Is this a generic method? -- Then we need round braces.
762  if (0 != tmd.GOutType().nelem()+tmd.GInType().nelem())
763  {
764  // First entry needs no leading comma:
765  bool first = true;
766 
767  os << "(";
768 
769  for (Index i = 0; i < Out().nelem(); ++i)
770  {
771  if (first) first = false;
772  else os << ",";
773 
774  os << Workspace::wsv_data[Out()[i]].Name();
775  }
776 
777  for (Index i = 0; i < In().nelem(); ++i)
778  {
779  if (first) first = false;
780  else os << ",";
781 
782  os << Workspace::wsv_data[In()[i]].Name();
783  }
784 
785  os << ")";
786  }
787 
788  if (0 != Tasks().nelem())
789  {
790  os << " {\n";
791  Tasks().print(os, indent+" ");
792  os << indent << "}\n";
793  }
794  else os << "\n";
795 }
796 
798 
809 ostream& operator<<(ostream& os, const MRecord& a)
810 {
811  a.print(os, "");
812  return os;
813 }
814 
INDEX Index
The type to use for all integer numbers and indices.
Definition: matpack.h:35
static Array< WsvRecord > wsv_data
Definition: workspace_ng.h:64
Lookup information for one agenda.
Definition: agenda_record.h:44
void set_outputs_to_push_and_dup(const Verbosity &verbosity)
Retrieve indexes of all input and output WSVs.
void(* getaways[])(Workspace &, const MRecord &)
Definition: auto_md.cc:11847
void find_unused_variables()
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:176
void check(Workspace &ws, const Verbosity &verbosity)
Checks consistency of an agenda.
Definition: agenda_class.cc:84
Declarations having to do with the four output streams.
const ArrayOfIndex & In() const
Definition: agenda_class.h:146
map< String, Index > AgendaMap
The map associated with agenda_data.
void duplicate(Index i)
Duplicate WSV.
Definition: workspace_ng.cc:96
bool SetMethod() const
Definition: methods.h:106
void pop_free(Index i)
Pop 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:84
Index Id() const
Definition: agenda_class.h:144
const ArrayOfIndex & Out() const
Definition: agenda_record.h:64
const ArrayOfIndex & Out() const
Definition: agenda_class.h:145
void PrintWsvNames(OutputStream &outstream, const Container &container)
Print list of WSV names to output stream.
Definition: workspace_ng.h:125
All information for one workspace method.
Definition: methods.h:42
ArrayOfIndex moutput_dup
Definition: agenda_class.h:92
const String & Name() const
Definition: methods.h:89
const map< String, Index > MdMap
The map associated with md_data.
Definition: methods_aux.cc:39
This file contains the declaration and partly the implementation of the workspace class...
Index get_wsv_id(const String &name)
Get index of WSV.
Definition: workspace.cc:4998
The global header file for ARTS.
bool mchecked
Flag indicating that the agenda was checked for consistency.
Definition: agenda_class.h:98
bool has_method(const String &methodname) const
Check if method is in Agenda.
bool is_main_agenda() const
Definition: agenda_class.h:82
Declarations for agendas.
void set_main_agenda(bool main_agenda)
Definition: messages.h:72
ArrayOfIndex moutput_push
Definition: agenda_class.h:90
Method runtime data.
Definition: agenda_class.h:113
#define CREATE_OUT1
Definition: messages.h:212
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:65
Index nelem() const
Return the number of agenda elements.
Definition: agenda_class.h:260
String mname
Definition: agenda_class.h:87
const ArrayOfIndex & InOut() const
Definition: methods.h:104
bool isInternal() const
Indicates the origin of this method.
Definition: agenda_class.h:158
const ArrayOfIndex & GOutType() const
Definition: methods.h:94
const ArrayOfString wsv_group_names
The names associated with Wsv groups as Strings.
Definition: global_data.h:94
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.
bool is_output(Index var) const
Check if given variable is agenda output.
Workspace class.
Definition: workspace_ng.h:47
Array< MRecord > mml
Definition: agenda_class.h:88
const Array< MdRecord > md_data
Lookup information for workspace methods.
Definition: methods_aux.cc:48
#define CREATE_OUT3
Definition: messages.h:214
const ArrayOfIndex & GInType() const
Definition: methods.h:99
Header file for helper functions for OpenMP.
This stores arbitrary token values and remembers the type.
Definition: token.h:33
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:59