ARTS 2.5.4 (git: 31ce4f0e)
Agenda Class Referencefinal

The Agenda class. More...

#include <agenda_class.h>

Public Member Functions

 Agenda ()
 
 Agenda (Workspace &workspace)
 
 Agenda (const Agenda &x)=default
 
void append (const String &methodname, const TokVal &keywordvalue)
 Appends methods to an agenda. More...
 
void check (Workspace &ws_in, 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_in) const
 Execute an agenda. More...
 
void resize (Index n)
 Resize the method list. More...
 
Index nelem () const
 Return the number of agenda elements. More...
 
Agendaoperator= (const Agenda &x)
 
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_in, 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 ArrayOfIndexget_output2push () const
 
const ArrayOfIndexget_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
 
bool has_same_origin (const Workspace &ws2) const
 
Workspaceworkspace ()
 
const Workspaceworkspace () const
 

Private Attributes

std::shared_ptr< Workspacews
 
String mname
 
Array< MRecordmml
 
ArrayOfIndex moutput_push
 
ArrayOfIndex moutput_dup
 
bool main_agenda {false}
 Is set to true if this is the main agenda. More...
 
bool mchecked {false}
 Flag indicating that the agenda was checked for consistency. More...
 

Friends

ostream & operator<< (ostream &os, const Agenda &a)
 Output operator for Agenda. More...
 

Detailed Description

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 69 of file agenda_class.h.

Constructor & Destructor Documentation

◆ Agenda() [1/3]

Agenda::Agenda ( )

Definition at line 63 of file agenda_class.cc.

Referenced by append().

◆ Agenda() [2/3]

Agenda::Agenda ( Workspace workspace)
explicit

Definition at line 65 of file agenda_class.cc.

◆ Agenda() [3/3]

Agenda::Agenda ( const Agenda x)
default

Copies an agenda.

Member Function Documentation

◆ append()

void Agenda::append ( const String methodname,
const TokVal keywordvalue 
)

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.

Parameters
methodnameThe name of the WSM
keywordvalueThe value of the keyword
Author
Mattias Ekstrom
Date
2005-01-05

Definition at line 87 of file agenda_class.cc.

References Agenda(), ARTS_ASSERT, mchecked, global_data::md_data, global_data::MdMap, mml, and ws.

Referenced by jacobianAddAbsSpecies(), jacobianAddBasicCatalogParameter(), jacobianAddFreqShift(), jacobianAddFreqStretch(), jacobianAddMagField(), jacobianAddNLTE(), jacobianAddPointingZa(), jacobianAddPolyfit(), jacobianAddScatSpecies(), jacobianAddShapeCatalogParameter(), jacobianAddSinefit(), jacobianAddSpecialSpecies(), jacobianAddSurfaceQuantity(), jacobianAddTemperature(), and jacobianAddWind().

◆ check()

void Agenda::check ( Workspace ws_in,
const Verbosity verbosity 
)

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 109 of file agenda_class.cc.

References global_data::agenda_data, global_data::AgendaMap, ARTS_USER_ERROR_IF, has_same_origin(), AgRecord::In(), is_input(), is_output(), mchecked, mname, nelem(), AgRecord::Out(), set_outputs_to_push_and_dup(), ws, and Workspace::wsv_data_ptr.

Referenced by AgendaAppend(), AgendaSet(), ArrayOfAgendaAppend(), Copy(), AgendaManip::AgendaCreator::finalize(), and jacobianClose().

◆ checked()

◆ execute()

void Agenda::execute ( Workspace ws_in) const

◆ get_output2dup()

const ArrayOfIndex & Agenda::get_output2dup ( ) const
inline

Definition at line 95 of file agenda_class.h.

References moutput_dup.

Referenced by AgendaExecute(), and auto_md_agenda_execute_helper().

◆ get_output2push()

const ArrayOfIndex & Agenda::get_output2push ( ) const
inline

Definition at line 94 of file agenda_class.h.

References moutput_push.

Referenced by AgendaExecute(), and auto_md_agenda_execute_helper().

◆ has_method()

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.

Parameters
methodnameName of method to look for.
Returns
True if method is part of Agenda.
Author
Oliver Lemke
Date
2013-03-18

Definition at line 711 of file agenda_class.cc.

References global_data::md_data, and mml.

Referenced by abs_xsec_agenda_checkedCalc(), and propmat_clearsky_agenda_checkedCalc().

◆ has_same_origin()

bool Agenda::has_same_origin ( const Workspace ws2) const
inline

Definition at line 106 of file agenda_class.h.

References Workspace::original_workspace, and ws.

Referenced by check(), and execute().

◆ is_input()

bool Agenda::is_input ( Workspace ws_in,
Index  var 
) const

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.

Parameters
[in]varThe workspace variable to check.
Returns
True if var is an input variable of this agenda.

Definition at line 537 of file agenda_class.cc.

References global_data::agenda_data, global_data::AgendaMap, ARTS_ASSERT, MRecord::Id(), MRecord::In(), Constant::k, global_data::md_data, global_data::MdMap, mml, nelem(), Array< base >::nelem(), ConstVectorView::nelem(), MRecord::Out(), Raw::Average::var(), Workspace::wsv_data_ptr, and global_data::WsvGroupMap.

Referenced by check().

◆ is_main_agenda()

bool Agenda::is_main_agenda ( ) const
inline

Definition at line 101 of file agenda_class.h.

References main_agenda.

Referenced by execute().

◆ is_output()

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.

Parameters
varThe workspace variable to check.
Returns
True if var is an output variable of this agenda.

Definition at line 619 of file agenda_class.cc.

References global_data::agenda_data, global_data::AgendaMap, MRecord::Id(), MRecord::In(), Constant::k, global_data::md_data, global_data::MdMap, mml, nelem(), Array< base >::nelem(), MRecord::Out(), Raw::Average::var(), ws, and global_data::WsvGroupMap.

Referenced by check().

◆ Methods()

const Array< MRecord > & Agenda::Methods ( ) const
inline

Definition at line 86 of file agenda_class.h.

References mml.

Referenced by AgendaAppend(), and AgendaManip::AgendaCreator::finalize().

◆ name()

◆ nelem()

Index Agenda::nelem ( ) const

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.

Returns
Number of agenda elements.

Definition at line 760 of file agenda_class.cc.

References mml, and Array< base >::nelem().

Referenced by check(), chk_not_empty(), is_input(), is_output(), and set_outputs_to_push_and_dup().

◆ operator=()

Agenda & Agenda::operator= ( const Agenda x)

Definition at line 773 of file agenda_class.cc.

References mchecked, mml, mname, moutput_dup, moutput_push, and ws.

◆ print()

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.

Parameters
osOutput stream.
indentHow many characters of indentation.
Author
Stefan Buehler
Date
2002-12-02

Definition at line 740 of file agenda_class.cc.

References mml, and Array< base >::nelem().

Referenced by MRecord::print(), and Print().

◆ push_back()

void Agenda::push_back ( const MRecord n)

Append a new method to end of list.

This is used by the parser to fill up the agenda.

Parameters
nNew method to add.

Definition at line 768 of file agenda_class.cc.

References mchecked, and mml.

Referenced by AgendaManip::AgendaCreator::finalize(), ArtsParser::parse_agenda(), AgendaManip::AgendaCreator::set(), and ArtsParser::tasklist_insert_set_delete().

◆ resize()

void Agenda::resize ( Index  n)

Resize the method list.

Resizes the agenda's method list to n elements

Definition at line 751 of file agenda_class.cc.

References mml.

Referenced by ArtsParser::parse_method().

◆ set_main_agenda()

void Agenda::set_main_agenda ( )
inline

Definition at line 97 of file agenda_class.h.

References main_agenda, and mchecked.

◆ set_methods()

void Agenda::set_methods ( const Array< MRecord > &  ml)

Definition at line 724 of file agenda_class.cc.

References mchecked, and mml.

Referenced by AgendaAppend().

◆ set_name()

void Agenda::set_name ( const String nname)

Set agenda name.

This sets the private member mname to the given string.

Parameters
nnameThe name for the agenda.

Definition at line 686 of file agenda_class.cc.

References mchecked, and mname.

Referenced by AgendaManip::AgendaCreator::AgendaCreator(), AgendaSet(), ArrayOfAgendaAppend(), cloudboxOff(), Copy(), gas_scatteringOff(), and jacobianInit().

◆ set_outputs_to_push_and_dup()

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 310 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(), ws, and global_data::WsvGroupMap.

Referenced by check().

◆ workspace() [1/2]

Workspace & Agenda::workspace ( )
inline

Definition at line 108 of file agenda_class.h.

References ws.

Referenced by MRecord::print().

◆ workspace() [2/2]

const Workspace & Agenda::workspace ( ) const
inline

Definition at line 109 of file agenda_class.h.

References ws.

Friends And Related Function Documentation

◆ operator<<

ostream & operator<< ( ostream &  os,
const Agenda a 
)
friend

Output operator for Agenda.

This is useful for debugging.

Parameters
osOutput stream.
aThe Agenda to write.
Returns
Output stream.
Author
Stefan Buehler
Date
2002-12-02

Definition at line 795 of file agenda_class.cc.

Member Data Documentation

◆ main_agenda

bool Agenda::main_agenda {false}
private

Is set to true if this is the main agenda.

Definition at line 121 of file agenda_class.h.

Referenced by is_main_agenda(), and set_main_agenda().

◆ mchecked

bool Agenda::mchecked {false}
private

Flag indicating that the agenda was checked for consistency.

Definition at line 124 of file agenda_class.h.

Referenced by append(), check(), checked(), execute(), operator=(), push_back(), set_main_agenda(), set_methods(), and set_name().

◆ mml

Array<MRecord> Agenda::mml
private

The actual list of methods to execute.

Definition at line 114 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().

◆ mname

String Agenda::mname
private

Agenda name.

Definition at line 113 of file agenda_class.h.

Referenced by check(), execute(), name(), operator=(), and set_name().

◆ moutput_dup

ArrayOfIndex Agenda::moutput_dup
private

Definition at line 118 of file agenda_class.h.

Referenced by get_output2dup(), operator=(), and set_outputs_to_push_and_dup().

◆ moutput_push

ArrayOfIndex Agenda::moutput_push
private

Definition at line 116 of file agenda_class.h.

Referenced by get_output2push(), operator=(), and set_outputs_to_push_and_dup().

◆ ws

std::shared_ptr<Workspace> Agenda::ws
private

The workspace upon which this Agenda lives.

Definition at line 112 of file agenda_class.h.

Referenced by append(), check(), has_same_origin(), is_output(), operator=(), set_outputs_to_push_and_dup(), and workspace().


The documentation for this class was generated from the following files: