ARTS
2.4.0(git:4fb77825)
|
#include <agenda_class.h>
Public Member Functions | |
Agenda () | |
Agenda (const Agenda &x) | |
void | append (const String &methodname, const TokVal &keywordvalue) |
Appends methods to an agenda. More... | |
void | check (Workspace &ws, const Verbosity &verbosity) |
Checks consistency of an agenda. More... | |
void | push_back (const MRecord &n) |
Append a new method to end of list. More... | |
void | execute (Workspace &ws) const |
Execute an agenda. More... | |
void | resize (Index n) |
Resize the method list. More... | |
Index | nelem () const |
Return the number of agenda elements. More... | |
Agenda & | operator= (const Agenda &x) |
Assignment operator. More... | |
const Array< MRecord > & | Methods () const |
bool | has_method (const String &methodname) const |
Check if method is in Agenda. More... | |
void | set_methods (const Array< MRecord > &ml) |
void | set_outputs_to_push_and_dup (const Verbosity &verbosity) |
Retrieve indexes of all input and output WSVs. More... | |
bool | is_input (Workspace &ws, Index var) const |
Check if given variable is agenda input. More... | |
bool | is_output (Index var) const |
Check if given variable is agenda output. More... | |
void | set_name (const String &nname) |
Set agenda name. More... | |
String | name () const |
Agenda name. More... | |
const ArrayOfIndex & | get_output2push () const |
const ArrayOfIndex & | get_output2dup () const |
void | print (ostream &os, const String &indent) const |
Print an agenda. More... | |
void | set_main_agenda () |
bool | is_main_agenda () const |
bool | checked () const |
Private Attributes | |
String | mname |
Array< MRecord > | mml |
ArrayOfIndex | moutput_push |
ArrayOfIndex | moutput_dup |
bool | main_agenda |
Is set to true if this is the main agenda. More... | |
bool | mchecked |
Flag indicating that the agenda was checked for consistency. More... | |
The Agenda class.
An agenda is a list of workspace methods (including keyword data) to be executed. There are workspace variables of class agenda that can contain a list of methods to execute for a particular purpose, for example to compute the lineshape in an absorption calculation.
Definition at line 44 of file agenda_class.h.
|
inline |
Definition at line 46 of file agenda_class.h.
Referenced by append().
|
inline |
Copies an agenda.
Definition at line 58 of file agenda_class.h.
Appends methods to an agenda.
This function appends a workspace method to the agenda. It currently only supports appending WSMs which have no generic input or output, and which are defined as Set methods which take only one keyword.
The keyword value has to be a string, which for no value should be of length zero.
ws | Workspace reference |
methodname | The name of the WSM |
keywordvalue | The value of the keyword |
Definition at line 58 of file agenda_class.cc.
References Agenda(), mchecked, global_data::md_data, global_data::MdMap, and mml.
Checks consistency of an agenda.
Checks that the input used by the agenda and the output produced by the actual methods corresponds to what is desired in the lookup data.
Definition at line 80 of file agenda_class.cc.
References global_data::agenda_data, global_data::AgendaMap, AgRecord::In(), is_input(), is_output(), mchecked, mname, nelem(), Array< base >::nelem(), AgRecord::Out(), set_outputs_to_push_and_dup(), ARTS::Var::verbosity(), and Workspace::wsv_data.
Referenced by AgendaAppend(), AgendaSet(), ArrayOfAgendaAppend(), Copy(), and InteractiveWorkspace::set_agenda_variable().
|
inline |
Definition at line 93 of file agenda_class.h.
References mchecked.
Referenced by abs_xsec_agendaExecute(), AgendaExecute(), dobatch_calc_agendaExecute(), doit_conv_test_agendaExecute(), doit_mono_agendaExecute(), doit_rte_agendaExecute(), doit_scat_field_agendaExecute(), forloop_agendaExecute(), g0_agendaExecute(), geo_pos_agendaExecute(), inversion_iterate_agendaExecute(), iy_cloudbox_agendaExecute(), iy_independent_beam_approx_agendaExecute(), iy_loop_freqs_agendaExecute(), iy_main_agendaExecute(), iy_space_agendaExecute(), iy_surface_agenda_arrayExecute(), iy_surface_agendaExecute(), iy_transmitter_agendaExecute(), jacobian_agendaExecute(), met_profile_calc_agendaExecute(), pha_mat_spt_agendaExecute(), pnd_agenda_arrayExecute(), ppath_agendaExecute(), ppath_step_agendaExecute(), propmat_clearsky_agendaExecute(), refr_index_air_agendaExecute(), sensor_response_agendaExecute(), spt_calc_agendaExecute(), surface_rtprop_agenda_arrayExecute(), surface_rtprop_agendaExecute(), surface_rtprop_sub_agendaExecute(), test_agenda_arrayExecute(), water_p_eq_agendaExecute(), and ybatch_calc_agendaExecute().
void Agenda::execute | ( | Workspace & | ws | ) | const |
Execute an agenda.
This executes the methods specified in tasklist on the given workspace. It also checks for errors during the method execution and stops the program if an error has occured.
Definition at line 148 of file agenda_class.cc.
References CREATE_OUT1, CREATE_OUT3, Workspace::duplicate(), get_wsv_id(), getaways, MRecord::Id(), MRecord::In(), MdRecord::InOut(), Workspace::is_initialized(), is_main_agenda(), MRecord::isInternal(), mchecked, global_data::md_data, mml, mname, name(), MdRecord::Name(), Array< base >::nelem(), MRecord::Out(), Workspace::pop_free(), Verbosity::set_main_agenda(), MdRecord::SetMethod(), ARTS::Var::verbosity(), Workspace::wsv_data, and ARTS::Var::x().
Referenced by AgendaExecute(), Arts2(), auto_md_agenda_execute_helper(), and InteractiveWorkspace::execute_agenda().
|
inline |
Definition at line 86 of file agenda_class.h.
References moutput_dup.
Referenced by AgendaExecute(), and auto_md_agenda_execute_helper().
|
inline |
Definition at line 85 of file agenda_class.h.
References moutput_push.
Referenced by AgendaExecute(), and auto_md_agenda_execute_helper().
bool Agenda::has_method | ( | const String & | methodname | ) | const |
Check if method is in Agenda.
This function checks if the method with the given name is called by this agenda.
methodname | Name of method to look for. |
Definition at line 672 of file agenda_class.cc.
References global_data::md_data, and mml.
Check if given variable is agenda input.
A variable is agenda input if it is an input variable to any of the methods making up the agenda.
[in,out] | ws | Current Workspace |
[in] | var | The workspace variable to check. |
Definition at line 498 of file agenda_class.cc.
References global_data::agenda_data, global_data::AgendaMap, MRecord::Id(), MRecord::In(), global_data::md_data, global_data::MdMap, mml, nelem(), Array< base >::nelem(), MRecord::Out(), linalg::var(), Workspace::wsv_data, and global_data::WsvGroupMap.
Referenced by check().
|
inline |
bool Agenda::is_output | ( | Index | var | ) | const |
Check if given variable is agenda output.
A variable is agenda output if it is an output variable to any of the methods making up the agenda.
var | The workspace variable to check. |
Definition at line 580 of file agenda_class.cc.
References global_data::agenda_data, global_data::AgendaMap, MRecord::Id(), MRecord::In(), global_data::md_data, global_data::MdMap, mml, nelem(), Array< base >::nelem(), MRecord::Out(), linalg::var(), Workspace::wsv_data, and global_data::WsvGroupMap.
Referenced by check().
Definition at line 74 of file agenda_class.h.
References mml.
Referenced by agenda_append(), AgendaAppend(), and ArtsParser::parse_agenda().
String Agenda::name | ( | ) | const |
Agenda name.
Returns the private member mname.
Definition at line 658 of file agenda_class.cc.
References mname.
Referenced by abs_xsec_agendaExecute(), AgendaExecute(), dobatch_calc_agendaExecute(), doit_conv_test_agendaExecute(), doit_mono_agendaExecute(), doit_rte_agendaExecute(), doit_scat_field_agendaExecute(), execute(), forloop_agendaExecute(), g0_agendaExecute(), geo_pos_agendaExecute(), inversion_iterate_agendaExecute(), iy_cloudbox_agendaExecute(), iy_independent_beam_approx_agendaExecute(), iy_loop_freqs_agendaExecute(), iy_main_agendaExecute(), iy_space_agendaExecute(), iy_surface_agenda_arrayExecute(), iy_surface_agendaExecute(), iy_transmitter_agendaExecute(), jacobian_agendaExecute(), met_profile_calc_agendaExecute(), pha_mat_spt_agendaExecute(), pnd_agenda_arrayExecute(), ppath_agendaExecute(), ppath_step_agendaExecute(), propmat_clearsky_agendaExecute(), refr_index_air_agendaExecute(), sensor_response_agendaExecute(), InteractiveWorkspace::set_agenda_variable(), set_outputs_to_push_and_dup(), spt_calc_agendaExecute(), surface_rtprop_agenda_arrayExecute(), surface_rtprop_agendaExecute(), surface_rtprop_sub_agendaExecute(), test_agenda_arrayExecute(), water_p_eq_agendaExecute(), and ybatch_calc_agendaExecute().
|
inline |
Return the number of agenda elements.
This is needed, so that we can find out the correct size for resize, befor we do a copy.
Definition at line 266 of file agenda_class.h.
References mml, and Array< base >::nelem().
Referenced by check(), is_input(), is_output(), ArtsParser::parse_agenda(), and set_outputs_to_push_and_dup().
Assignment operator.
Copies an agenda.
Definition at line 283 of file agenda_class.h.
References mchecked, mml, mname, moutput_dup, moutput_push, and ARTS::Var::x().
void Agenda::print | ( | ostream & | os, |
const String & | indent | ||
) | const |
Print an agenda.
This prints an agenda, by printing the individual methods, just as they would appear in the controlfile.
os | Output stream. |
indent | How many characters of indentation. |
Definition at line 696 of file agenda_class.cc.
References mml, and Array< base >::nelem().
Referenced by operator<<(), and MRecord::print().
|
inline |
Append a new method to end of list.
This is used by the parser to fill up the agenda.
n | New method to add. |
Definition at line 274 of file agenda_class.h.
Referenced by agenda_add_method(), agenda_append(), agenda_insert_callback(), agenda_insert_set(), ARTS::AgendaDefine::Append(), ArtsParser::parse_agenda(), and ArtsParser::tasklist_insert_set_delete().
|
inline |
Resize the method list.
Resizes the agenda's method list to n elements
Definition at line 257 of file agenda_class.h.
References mml.
Referenced by MRecord::operator=(), and ArtsParser::parse_method().
|
inline |
Definition at line 88 of file agenda_class.h.
References main_agenda, and mchecked.
Referenced by execute_agenda(), main(), and parse_agenda().
Definition at line 76 of file agenda_class.h.
Referenced by AgendaAppend().
void Agenda::set_name | ( | const String & | nname | ) |
Set agenda name.
This sets the private member mname to the given string.
nname | The name for the agenda. |
Definition at line 647 of file agenda_class.cc.
References mchecked, and mname.
Referenced by AgendaSet(), ArrayOfAgendaAppend(), Copy(), create_agenda(), InteractiveWorkspace::InteractiveWorkspace(), main(), parse_agenda(), and InteractiveWorkspace::set_agenda_variable().
void Agenda::set_outputs_to_push_and_dup | ( | const Verbosity & | verbosity | ) |
Retrieve indexes of all input and output WSVs.
Builds arrays of WSM output variables which need to be duplicated or pushed on the WSV stack before the agenda is executed.
Definition at line 269 of file agenda_class.cc.
References global_data::agenda_data, global_data::AgendaMap, CREATE_OUT3, AgRecord::In(), global_data::md_data, global_data::MdMap, mml, moutput_dup, moutput_push, name(), nelem(), Array< base >::nelem(), AgRecord::Out(), PrintWsvNames(), Workspace::wsv_data, and global_data::WsvGroupMap.
Referenced by check().
|
private |
Is set to true if this is the main agenda.
Definition at line 104 of file agenda_class.h.
Referenced by is_main_agenda(), and set_main_agenda().
|
private |
Flag indicating that the agenda was checked for consistency.
Definition at line 107 of file agenda_class.h.
Referenced by append(), check(), checked(), execute(), operator=(), push_back(), set_main_agenda(), set_methods(), and set_name().
The actual list of methods to execute.
Definition at line 97 of file agenda_class.h.
Referenced by append(), execute(), has_method(), is_input(), is_output(), Methods(), nelem(), operator=(), print(), push_back(), resize(), set_methods(), and set_outputs_to_push_and_dup().
|
private |
Agenda name.
Definition at line 96 of file agenda_class.h.
Referenced by check(), execute(), name(), operator=(), and set_name().
|
private |
Definition at line 101 of file agenda_class.h.
Referenced by get_output2dup(), operator=(), and set_outputs_to_push_and_dup().
|
private |
Definition at line 99 of file agenda_class.h.
Referenced by get_output2push(), operator=(), and set_outputs_to_push_and_dup().