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