ARTS
2.2.66
|
Workspace functions of a general and overall character. More...
#include "arts.h"
#include <stdexcept>
#include "m_general.h"
#include "array.h"
#include "check_input.h"
#include "messages.h"
#include "mystring.h"
#include "math_funcs.h"
#include "make_vector.h"
#include "wsv_aux.h"
#include "auto_md.h"
#include "workspace_ng.h"
#include "sensor.h"
Go to the source code of this file.
Functions | |
void | INCLUDE (const Verbosity &) |
WORKSPACE METHOD: INCLUDE. More... | |
void | Print (Workspace &ws, const Agenda &x, const Index &level, const Verbosity &verbosity) |
void | Print (const ArrayOfGridPos &x, const Index &level, const Verbosity &verbosity) |
void | Print (const ArrayOfCIARecord &cia_data, const Index &level, const Verbosity &verbosity) |
void | Print (const ArrayOfString &x, const Index &level, const Verbosity &verbosity) |
void | Print (const Ppath &x, const Index &level, const Verbosity &verbosity) |
void | Print (const ArrayOfPpath &x, const Index &level, const Verbosity &verbosity) |
void | Print (const Timer &, const Index &level, const Verbosity &verbosity) |
void | PrintWorkspace (Workspace &ws, const Index &only_allocated, const Index &level, const Verbosity &verbosity) |
void | StringCompose (String &out, const String &in1, const String &in2, const String &in3, const String &in4, const String &in5, const String &in6, const String &in7, const String &in8, const String &in9, const String &in10, const Verbosity &) |
WORKSPACE METHOD: StringCompose. More... | |
void | timerStart (Timer &, const Verbosity &) |
WORKSPACE METHOD: timerStart. More... | |
void | timerStop (const Timer &, const Verbosity &) |
void | Error (const String &msg, const Verbosity &verbosity) |
WORKSPACE METHOD: Error. More... | |
void | Exit (const Verbosity &verbosity) |
WORKSPACE METHOD: Exit. More... | |
void | Test (const Verbosity &verbosity) |
WORKSPACE METHOD: Test. More... | |
void | verbosityInit (Verbosity &verbosity) |
WORKSPACE METHOD: verbosityInit. More... | |
void | verbositySet (Verbosity &verbosity, const Index &agenda, const Index &screen, const Index &file) |
WORKSPACE METHOD: verbositySet. More... | |
void | verbositySetAgenda (Verbosity &verbosity, const Index &level) |
WORKSPACE METHOD: verbositySetAgenda. More... | |
void | verbositySetFile (Verbosity &verbosity, const Index &level) |
WORKSPACE METHOD: verbositySetFile. More... | |
void | verbositySetScreen (Verbosity &verbosity, const Index &level) |
WORKSPACE METHOD: verbositySetScreen. More... | |
Variables | |
const Numeric | SPEED_OF_LIGHT |
Workspace functions of a general and overall character.
This file is for general functions that do not fit in any other "m_"-file.
These functions are listed in the doxygen documentation as entries of the file auto_md.h.
Definition in file m_general.cc.
WORKSPACE METHOD: Error.
Issues an error and exits ARTS.
This method can be placed in agendas that must be specified, but are expected not to be used for the particular case. An inclusion in surface_rtprop_agenda could look like: <br> Error{"Surface interceptions of propagation path not expected."}
Ignore and other dummy method calls must still be included.
[in] | msg | Generic Input |
Definition at line 405 of file m_general.cc.
References CREATE_OUT0.
Referenced by Error_g().
void Exit | ( | const Verbosity & | verbosity | ) |
WORKSPACE METHOD: Exit.
Stops the execution and exits ARTS.
This method is handy if you want to debug one of your control files. You can insert it anywhere in the control file. When it is reached, it will terminate the program.
Definition at line 414 of file m_general.cc.
References arts_exit(), and CREATE_OUT1.
Referenced by Exit_g().
void INCLUDE | ( | const Verbosity & | verbosity | ) |
WORKSPACE METHOD: INCLUDE.
Includes the contents of another controlfile.
The INCLUDE statement inserts the contents of the controlfile with the given name into the current controlfile. If the filename is given without path information, ARTS will first search for the file in all directories specified with the -I (see arts -h) commandline option and then in directories given in the environment variable ARTS_INCLUDE_PATH. In the environment variable multiple paths have to be separated by colons.
Note that INCLUDE is not a workspace method and thus the syntax is different:
Arts { <br> INCLUDE "general.arts" }
Includes can also be nested. In the example above general.arts can contain further includes which will then be treated the same way.
The idea behind this mechanism is that you can write common settings for a bunch of calculations into one file. Then, you can create several controlfiles which include the basic settings and tweak them for different cases. When you decide to make changes to your setup that should apply to all calculations, you only have to make a single change in the include file instead of modifying all your controlfiles.
Definition at line 75 of file m_general.cc.
Referenced by INCLUDE_g().
Definition at line 81 of file m_general.cc.
References CREATE_OUTS, Agenda::name(), Agenda::print(), and SWITCH_OUTPUT.
Referenced by CIAInfo(), main(), Print(), Print_sg_Agenda_g(), Print_sg_ArrayOfArrayOfGriddedField1_g(), Print_sg_ArrayOfArrayOfGriddedField2_g(), Print_sg_ArrayOfArrayOfGriddedField3_g(), Print_sg_ArrayOfArrayOfIndex_g(), Print_sg_ArrayOfArrayOfLineMixingRecord_g(), Print_sg_ArrayOfArrayOfLineRecord_g(), Print_sg_ArrayOfArrayOfMatrix_g(), Print_sg_ArrayOfArrayOfSpeciesTag_g(), Print_sg_ArrayOfArrayOfTensor3_g(), Print_sg_ArrayOfArrayOfTensor6_g(), Print_sg_ArrayOfArrayOfVector_g(), Print_sg_ArrayOfCIARecord_g(), Print_sg_ArrayOfGriddedField1_g(), Print_sg_ArrayOfGriddedField2_g(), Print_sg_ArrayOfGriddedField3_g(), Print_sg_ArrayOfGriddedField4_g(), Print_sg_ArrayOfIndex_g(), Print_sg_ArrayOfLineMixingRecord_g(), Print_sg_ArrayOfLineRecord_g(), Print_sg_ArrayOfLineshapeSpec_g(), Print_sg_ArrayOfMatrix_g(), Print_sg_ArrayOfRetrievalQuantity_g(), Print_sg_ArrayOfScatteringMetaData_g(), Print_sg_ArrayOfSingleScatteringData_g(), Print_sg_ArrayOfSparse_g(), Print_sg_ArrayOfString_g(), Print_sg_ArrayOfTensor3_g(), Print_sg_ArrayOfTensor4_g(), Print_sg_ArrayOfTensor6_g(), Print_sg_ArrayOfTensor7_g(), Print_sg_ArrayOfVector_g(), Print_sg_GasAbsLookup_g(), Print_sg_GriddedField1_g(), Print_sg_GriddedField2_g(), Print_sg_GriddedField3_g(), Print_sg_GriddedField4_g(), Print_sg_GriddedField5_g(), Print_sg_GriddedField6_g(), Print_sg_GridPos_g(), Print_sg_Index_g(), Print_sg_Matrix_g(), Print_sg_MCAntenna_g(), Print_sg_Numeric_g(), Print_sg_Ppath_g(), Print_sg_ScatteringMetaData_g(), Print_sg_SingleScatteringData_g(), Print_sg_Sparse_g(), Print_sg_SpeciesAuxData_g(), Print_sg_String_g(), Print_sg_Tensor3_g(), Print_sg_Tensor4_g(), Print_sg_Tensor5_g(), Print_sg_Tensor6_g(), Print_sg_Tensor7_g(), Print_sg_Timer_g(), Print_sg_Vector_g(), and Print_sg_Verbosity_g().
void Print | ( | const ArrayOfGridPos & | x, |
const Index & | level, | ||
const Verbosity & | verbosity | ||
) |
Definition at line 98 of file m_general.cc.
References CREATE_OUTS, Array< base >::nelem(), and SWITCH_OUTPUT.
void Print | ( | const ArrayOfCIARecord & | cia_data, |
const Index & | level, | ||
const Verbosity & | verbosity | ||
) |
Definition at line 116 of file m_general.cc.
References CREATE_OUTS, Array< base >::nelem(), ConstVectorView::nelem(), SPEED_OF_LIGHT, and SWITCH_OUTPUT.
void Print | ( | const ArrayOfString & | x, |
const Index & | level, | ||
const Verbosity & | verbosity | ||
) |
Definition at line 147 of file m_general.cc.
References CREATE_OUTS, Array< base >::nelem(), and SWITCH_OUTPUT.
Definition at line 166 of file m_general.cc.
References Ppath::background, Ppath::constant, CREATE_OUTS, Ppath::dim, Ppath::end_los, Ppath::end_lstep, Ppath::end_pos, Ppath::gp_lat, Ppath::gp_lon, Ppath::gp_p, Ppath::los, Ppath::lstep, Ppath::ngroup, Ppath::np, Ppath::nreal, Ppath::pos, Print(), Ppath::r, Ppath::start_los, Ppath::start_lstep, Ppath::start_pos, and SWITCH_OUTPUT.
void Print | ( | const ArrayOfPpath & | x, |
const Index & | level, | ||
const Verbosity & | verbosity | ||
) |
Definition at line 221 of file m_general.cc.
References CREATE_OUTS, Timer::finished, Array< base >::nelem(), Print(), and SWITCH_OUTPUT.
Definition at line 288 of file m_general.cc.
References SWITCH_OUTPUT.
void PrintWorkspace | ( | Workspace & | ws, |
const Index & | only_allocated, | ||
const Index & | level, | ||
const Verbosity & | verbosity | ||
) |
Definition at line 300 of file m_general.cc.
References CREATE_OUTS, Workspace::is_initialized(), Workspace::nelem(), PrintWsvName(), and SWITCH_OUTPUT.
Referenced by Print(), and PrintWorkspace_g().
void StringCompose | ( | String & | out, |
const String & | in1, | ||
const String & | in2, | ||
const String & | in3, | ||
const String & | in4, | ||
const String & | in5, | ||
const String & | in6, | ||
const String & | in7, | ||
const String & | in8, | ||
const String & | in9, | ||
const String & | in10, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: StringCompose.
Concatenate two or more strings.
The output string is overwritten, but is allowed to appear in the input list. Up to 10 strings can be concatenated at once.
[out] | out | Generic output |
[in] | in1 | Generic Input |
[in] | in2 | Generic Input |
[in] | in3 | Generic Input (Default: "") |
[in] | in4 | Generic Input (Default: "") |
[in] | in5 | Generic Input (Default: "") |
[in] | in6 | Generic Input (Default: "") |
[in] | in7 | Generic Input (Default: "") |
[in] | in8 | Generic Input (Default: "") |
[in] | in9 | Generic Input (Default: "") |
[in] | in10 | Generic Input (Default: "") |
Definition at line 336 of file m_general.cc.
References Timer::finished, Timer::running, and timerStart().
Referenced by StringCompose_g().
void Test | ( | const Verbosity & | verbosity | ) |
WORKSPACE METHOD: Test.
A dummy method that can be used for test purposes.
This method can be used by ARTS developers to quickly test stuff. The implementation is in file m_general.cc. This just saves you the trouble of adding a dummy method everytime you want to try something out quickly.
Definition at line 424 of file m_general.cc.
References ConstVectorView::nelem(), sensor_integration_vector(), sensor_integration_vector2(), and VectorLinSpace().
Referenced by Test_g().
WORKSPACE METHOD: timerStart.
Initializes the CPU timer. Use timerStop to stop the timer.
Usage example: <br> timerStart <br> ReadXML(f_grid,"frequencies.xml") <br> timerStop <br> Print(timer)
[out] | timer | WS Output |
Definition at line 369 of file m_general.cc.
References Timer::finished, Timer::running, and timerStop().
Referenced by main(), StringCompose(), and timerStart_g().
Definition at line 396 of file m_general.cc.
Referenced by main(), timerStart(), and timerStop_g().
void verbosityInit | ( | Verbosity & | verbosity | ) |
WORKSPACE METHOD: verbosityInit.
Initializes the verbosity levels.
Sets verbosity to defaults or the levels specified by -r on the command line.
[out] | verbosity | WS Output |
Definition at line 457 of file m_general.cc.
References Verbosity::get_agenda_verbosity(), Verbosity::get_file_verbosity(), Verbosity::get_screen_verbosity(), Verbosity::set_agenda_verbosity(), Verbosity::set_file_verbosity(), Verbosity::set_screen_verbosity(), and verbosity_at_launch.
Referenced by verbosityInit_g().
void verbositySet | ( | Verbosity & | verbosity, |
const Index & | agenda, | ||
const Index & | screen, | ||
const Index & | file | ||
) |
WORKSPACE METHOD: verbositySet.
Sets the verbosity levels.
Sets the reporting level for agenda calls, screen and file. All reporting levels can reach from 0 (only error messages) to 3 (everything). The agenda setting applies in addition to both screen and file output.
[out] | verbosity | WS Output |
[in] | agenda | Generic Input |
[in] | screen | Generic Input |
[in] | file | Generic Input |
Definition at line 469 of file m_general.cc.
References Verbosity::set_agenda_verbosity(), Verbosity::set_file_verbosity(), and Verbosity::set_screen_verbosity().
Referenced by verbositySet_g().
WORKSPACE METHOD: verbositySetAgenda.
Sets the verbosity level for agenda output.
See verbositySet
[out] | verbosity | WS Output |
[in] | level | Generic Input |
Definition at line 483 of file m_general.cc.
References Verbosity::set_agenda_verbosity().
Referenced by verbositySetAgenda_g().
WORKSPACE METHOD: verbositySetFile.
Sets the verbosity level for report file output.
See verbositySet
[out] | verbosity | WS Output |
[in] | level | Generic Input |
Definition at line 493 of file m_general.cc.
References Verbosity::set_file_verbosity().
Referenced by verbositySetFile_g().
WORKSPACE METHOD: verbositySetScreen.
Sets the verbosity level for screen output.
See verbositySet
[out] | verbosity | WS Output |
[in] | level | Generic Input |
Definition at line 503 of file m_general.cc.
References Verbosity::set_screen_verbosity().
Referenced by verbositySetScreen_g().