60 const TokVal& keywordvalue)
64 const map<String, Index>::const_iterator i2 =
MdMap.find(methodname);
65 assert(i2 !=
MdMap.end());
66 Index id = i2->second;
113 Index this_wsv = this_data.
Out()[i];
118 os <<
"The agenda " <<
mname
119 <<
" must generate the output WSV "
121 <<
"but it does not. It only generates:\n";
125 throw runtime_error(os.str());
134 Index this_wsv = this_data.
In()[i];
139 os <<
"The agenda " <<
mname
140 <<
" must use the input WSV "
142 <<
"but it does not. It only uses:\n";
146 throw runtime_error(os.str());
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());
203 aout1 <<
"Executing " <<
name() <<
"\n"
223 out3 <<
"- " + mdd.
Name() +
"\n";
227 out1 <<
"- " + mdd.
Name() +
"\n";
236 throw runtime_error(
"Method "+mdd.
Name()+
" needs input variable: "+
245 throw runtime_error(
"Method "+mdd.
Name()+
" needs input variable: "+
253 catch (runtime_error x)
258 os <<
"Run-time error in method: " << mdd.
Name() <<
'\n'
261 throw runtime_error(os.str());
263 catch (std::bad_alloc x)
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"
273 throw runtime_error(os.str());
295 set<Index> outs2push;
299 method !=
mml.end(); method++)
308 souts.insert(outs.begin(), outs.end());
309 souts.insert(gouts.begin(), gouts.end());
313 inputs.insert(gins.begin(), gins.end());
319 if (
md_data[method->Id()].Name() ==
"Delete")
321 souts.insert(gins.begin(), gins.end());
326 inputs.insert(ins.begin(), ins.end());
329 outputs.insert(souts.begin(), souts.end());
334 set_intersection(souts.begin(), souts.end(),
335 inputs.begin(), inputs.end(),
336 insert_iterator< set<Index> >(outs2dup,
342 set_difference(outputs.begin(), outputs.end(),
343 outs2dup.begin(), outs2dup.end(),
344 insert_iterator< set<Index> >(outs2push,
359 saout.insert(aout.begin(), aout.end());
360 sain.insert(ain.begin(), ain.end());
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()));
375 set_difference(outs2push_without_agenda_input.begin(),
376 outs2push_without_agenda_input.end(),
377 saout.begin(), saout.end(),
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()));
391 set_difference(outs2dup_without_agenda_input.begin(),
392 outs2dup_without_agenda_input.end(),
393 saout.begin(), saout.end(),
401 set<Index> saout_only;
403 set_difference(saout.begin(), saout.end(),
404 sain.begin(), sain.end(),
405 insert_iterator< set<Index> >(saout_only,
406 saout_only.begin()));
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()));
418 set<Index> sain_only;
420 set_difference(sain.begin(), sain.end(),
421 saout.begin(), saout.end(),
422 insert_iterator< set<Index> >(sain_only,
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()));
433 out3 <<
" [Agenda::pushpop] : " <<
name() <<
"\n";
434 out3 <<
" [Agenda::pushpop] - # Funcs in Ag : " <<
mml.
nelem() <<
"\n";
435 out3 <<
" [Agenda::pushpop] - AgOut : ";
438 out3 <<
" [Agenda::pushpop] - AgIn : ";
441 out3 <<
" [Agenda::pushpop] - All WSM output: ";
444 out3 <<
" [Agenda::pushpop] - WSVs push : ";
447 out3 <<
" [Agenda::pushpop] - WSVs dup : ";
450 out3 <<
" [Agenda::pushpop] - Ag inp dup : ";
453 out3 <<
" [Agenda::pushpop] - Ag out dup : ";
457 if (agenda_only_in_wsm_out.
nelem())
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"
466 throw runtime_error(err.str());
491 Index WsvAgendaGroupIndex = 0;
495 WsvAgendaGroupIndex = i;
511 if (var == input[j])
return true;
522 if (var == input[j])
return true;
528 for (
Index j = 0; j <
md_data[this_method.
Id()].GInType().nelem(); j++)
530 if (
md_data[this_method.
Id()].GInType()[j] == WsvAgendaGroupIndex)
532 Agenda* AgendaFromGeneralInput =
535 if ((*AgendaFromGeneralInput).is_input(ws, var))
574 if (var == output[j])
return true;
585 if (var == output[j])
return true;
629 cout <<
md_data[mr->Id()].Name() <<
": ";
630 cout << mr->In() << endl;
632 if (
md_data[mr->Id()].Name() ==
"AgendaExecute")
634 cout <<
"AgendaExecute" << endl;
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);
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);
649 while (mr !=
mml.begin());
651 cout <<
"In : " << in_vars << endl;
652 cout <<
"Out: " << out_vars << endl;
674 !found && it !=
mml.end();
677 if (
md_data[it->Id()].Name() == methodname)
697 const String& indent)
const
702 mml[i].print(os, indent);
759 os << indent << tmd.
Name();
771 if (first) first =
false;
779 if (first) first =
false;
788 if (0 !=
Tasks().nelem())
792 os << indent <<
"}\n";