ARTS
2.3.1285(git:92a29ea9-dirty)
|
Workspace functions of a general and overall character. More...
#include "arts.h"
#include <cstdlib>
#include <stdexcept>
#include "array.h"
#include "check_input.h"
#include "m_general.h"
#include "messages.h"
#include "mystring.h"
#include "math_funcs.h"
#include "wsv_aux.h"
#include "auto_md.h"
#include "workspace_ng.h"
#include "sensor.h"
#include "fastem.h"
#include "tessem.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 (Workspace &ws, const ArrayOfAgenda &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 | Print (const TessemNN &x, const Index &level, const Verbosity &verbosity) |
void | PrintWorkspace (Workspace &ws, const Index &only_allocated, const Index &level, const Verbosity &verbosity) |
void | StringJoin (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: StringJoin. 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 | TestArrayOfAgenda (Workspace &ws, const ArrayOfAgenda &test_agenda_array, const Index &index, const Verbosity &) |
WORKSPACE METHOD: TestArrayOfAgenda. More... | |
void | Test (const 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... | |
void | GetEnvironmentVariable (String &str, const String &envvar, const Verbosity &) |
WORKSPACE METHOD: GetEnvironmentVariable. More... | |
void | GetNumberOfThreads (Index &nthreads, const Verbosity &) |
WORKSPACE METHOD: GetNumberOfThreads. More... | |
void | GetEnvironmentVariable (Index &i, const String &envvar, const Verbosity &) |
WORKSPACE METHOD: GetEnvironmentVariable. More... | |
void | SetNumberOfThreads (const Index &, const Verbosity &verbosity) |
WORKSPACE METHOD: SetNumberOfThreads. 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 398 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 404 of file m_general.cc.
References arts_exit(), and CREATE_OUT1.
Referenced by Exit_g().
WORKSPACE METHOD: GetEnvironmentVariable.
Copy the contents of an environment variable to an ARTS String or Index.
[out] | out | Supergeneric output |
[in] | in | Generic Input |
Definition at line 477 of file m_general.cc.
Referenced by GetEnvironmentVariable_sg_Index_g(), and GetEnvironmentVariable_sg_String_g().
WORKSPACE METHOD: GetEnvironmentVariable.
Copy the contents of an environment variable to an ARTS String or Index.
[out] | out | Supergeneric output |
[in] | in | Generic Input |
Definition at line 498 of file m_general.cc.
References SetNumberOfThreads(), and _CS_basic_sstream_base< _CS_cT, _CS_Tr, _CS_Al >::str().
WORKSPACE METHOD: GetNumberOfThreads.
Returns the number of threads used by ARTS.
[out] | nthreads | Generic output |
Definition at line 493 of file m_general.cc.
References arts_omp_get_max_threads().
Referenced by GetNumberOfThreads_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 73 of file m_general.cc.
Referenced by INCLUDE_g().
Definition at line 76 of file m_general.cc.
References CREATE_OUTS, Agenda::name(), Agenda::print(), _CS_basic_sstream_base< _CS_cT, _CS_Tr, _CS_Al >::str(), and SWITCH_OUTPUT.
Referenced by CIAInfo(), Print(), Print_sg_AbsorptionLines_g(), Print_sg_Agenda_g(), Print_sg_ArrayOfAbsorptionLines_g(), Print_sg_ArrayOfAgenda_g(), Print_sg_ArrayOfArrayOfAbsorptionLines_g(), Print_sg_ArrayOfArrayOfGriddedField1_g(), Print_sg_ArrayOfArrayOfGriddedField2_g(), Print_sg_ArrayOfArrayOfGriddedField3_g(), Print_sg_ArrayOfArrayOfIndex_g(), Print_sg_ArrayOfArrayOfMatrix_g(), Print_sg_ArrayOfArrayOfPropagationMatrix_g(), Print_sg_ArrayOfArrayOfRadiationVector_g(), Print_sg_ArrayOfArrayOfScatteringMetaData_g(), Print_sg_ArrayOfArrayOfSingleScatteringData_g(), Print_sg_ArrayOfArrayOfSpeciesTag_g(), Print_sg_ArrayOfArrayOfStokesVector_g(), Print_sg_ArrayOfArrayOfString_g(), Print_sg_ArrayOfArrayOfTensor3_g(), Print_sg_ArrayOfArrayOfTensor6_g(), Print_sg_ArrayOfArrayOfTime_g(), Print_sg_ArrayOfArrayOfTransmissionMatrix_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_ArrayOfMatrix_g(), Print_sg_ArrayOfPpath_g(), Print_sg_ArrayOfPropagationMatrix_g(), Print_sg_ArrayOfQuantumIdentifier_g(), Print_sg_ArrayOfRadiationVector_g(), Print_sg_ArrayOfRetrievalQuantity_g(), Print_sg_ArrayOfScatteringMetaData_g(), Print_sg_ArrayOfSingleScatteringData_g(), Print_sg_ArrayOfSparse_g(), Print_sg_ArrayOfStokesVector_g(), Print_sg_ArrayOfString_g(), Print_sg_ArrayOfTelsemAtlas_g(), Print_sg_ArrayOfTensor3_g(), Print_sg_ArrayOfTensor4_g(), Print_sg_ArrayOfTensor5_g(), Print_sg_ArrayOfTensor6_g(), Print_sg_ArrayOfTensor7_g(), Print_sg_ArrayOfTime_g(), Print_sg_ArrayOfTransmissionMatrix_g(), Print_sg_ArrayOfVector_g(), Print_sg_ArrayOfXsecRecord_g(), Print_sg_CIARecord_g(), Print_sg_CovarianceMatrix_g(), Print_sg_EnergyLevelMap_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_HitranRelaxationMatrixData_g(), Print_sg_Index_g(), Print_sg_Matrix_g(), Print_sg_MCAntenna_g(), Print_sg_Numeric_g(), Print_sg_Ppath_g(), Print_sg_PropagationMatrix_g(), Print_sg_QuantumIdentifier_g(), Print_sg_RadiationVector_g(), Print_sg_Rational_g(), Print_sg_ScatteringMetaData_g(), Print_sg_SingleScatteringData_g(), Print_sg_Sparse_g(), Print_sg_SpeciesAuxData_g(), Print_sg_StokesVector_g(), Print_sg_String_g(), Print_sg_TelsemAtlas_g(), Print_sg_Tensor3_g(), Print_sg_Tensor4_g(), Print_sg_Tensor5_g(), Print_sg_Tensor6_g(), Print_sg_Tensor7_g(), Print_sg_TessemNN_g(), Print_sg_Time_g(), Print_sg_Timer_g(), Print_sg_TransmissionMatrix_g(), Print_sg_Vector_g(), and Print_sg_Verbosity_g().
void Print | ( | Workspace & | ws, |
const ArrayOfAgenda & | x, | ||
const Index & | level, | ||
const Verbosity & | verbosity | ||
) |
Definition at line 92 of file m_general.cc.
References CREATE_OUTS, i, Array< base >::nelem(), _CS_basic_sstream_base< _CS_cT, _CS_Tr, _CS_Al >::str(), and SWITCH_OUTPUT.
void Print | ( | const ArrayOfGridPos & | x, |
const Index & | level, | ||
const Verbosity & | verbosity | ||
) |
Definition at line 113 of file m_general.cc.
References CREATE_OUTS, i, Array< base >::nelem(), _CS_basic_sstream_base< _CS_cT, _CS_Tr, _CS_Al >::str(), and SWITCH_OUTPUT.
void Print | ( | const ArrayOfCIARecord & | cia_data, |
const Index & | level, | ||
const Verbosity & | verbosity | ||
) |
Definition at line 128 of file m_general.cc.
References CREATE_OUTS, i, Array< base >::nelem(), ConstVectorView::nelem(), SPEED_OF_LIGHT, _CS_basic_sstream_base< _CS_cT, _CS_Tr, _CS_Al >::str(), and SWITCH_OUTPUT.
void Print | ( | const ArrayOfString & | x, |
const Index & | level, | ||
const Verbosity & | verbosity | ||
) |
Definition at line 154 of file m_general.cc.
References CREATE_OUTS, i, Array< base >::nelem(), _CS_basic_sstream_base< _CS_cT, _CS_Tr, _CS_Al >::str(), and SWITCH_OUTPUT.
Definition at line 169 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 220 of file m_general.cc.
References CREATE_OUTS, Timer::finished, i, Array< base >::nelem(), Print(), _CS_basic_sstream_base< _CS_cT, _CS_Tr, _CS_Al >::str(), and SWITCH_OUTPUT.
Definition at line 286 of file m_general.cc.
References SWITCH_OUTPUT.
Definition at line 296 of file m_general.cc.
References CREATE_OUTS, TessemNN::nb_cache, TessemNN::nb_inputs, TessemNN::nb_outputs, _CS_basic_sstream_base< _CS_cT, _CS_Tr, _CS_Al >::str(), and SWITCH_OUTPUT.
void PrintWorkspace | ( | Workspace & | ws, |
const Index & | only_allocated, | ||
const Index & | level, | ||
const Verbosity & | verbosity | ||
) |
Definition at line 309 of file m_general.cc.
References CREATE_OUTS, Workspace::depth(), i, Workspace::is_initialized(), Workspace::nelem(), PrintWsvName(), _CS_basic_sstream_base< _CS_cT, _CS_Tr, _CS_Al >::str(), and SWITCH_OUTPUT.
Referenced by Print(), and PrintWorkspace_g().
WORKSPACE METHOD: SetNumberOfThreads.
Change the number of threads used by ARTS.
[in] | nthreads | Generic Input |
Definition at line 527 of file m_general.cc.
References CREATE_OUT1.
Referenced by GetEnvironmentVariable(), and SetNumberOfThreads_g().
void StringJoin | ( | 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: StringJoin.
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 338 of file m_general.cc.
References Timer::finished, Timer::running, and timerStart().
Referenced by StringJoin_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 421 of file m_general.cc.
References add_za_aa(), and diff_za_aa().
Referenced by Test_g().
void TestArrayOfAgenda | ( | Workspace & | ws, |
const ArrayOfAgenda & | test_agenda_array, | ||
const Index & | index, | ||
const Verbosity & | verbosity | ||
) |
WORKSPACE METHOD: TestArrayOfAgenda.
A method that is used for the TestArrayOfAgenda test case.
[in,out] | ws | Workspace |
[in] | test_agenda_array | WS Input |
[in] | index | Generic Input (Default: "0") |
Definition at line 411 of file m_general.cc.
References Array< base >::nelem(), _CS_basic_sstream_base< _CS_cT, _CS_Tr, _CS_Al >::str(), and test_agenda_arrayExecute().
Referenced by TestArrayOfAgenda_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 365 of file m_general.cc.
References Timer::finished, Timer::running, and timerStop().
Referenced by main(), StringJoin(), and timerStart_g().
Definition at line 389 of file m_general.cc.
Referenced by 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.
[in,out] | verbosity | WS Input/Output |
Definition at line 431 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.
[in,out] | verbosity | WS Input/Output |
[in] | agenda | Generic Input |
[in] | screen | Generic Input |
[in] | file | Generic Input |
Definition at line 441 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
[in,out] | verbosity | WS Input/Output |
[in] | level | Generic Input |
Definition at line 453 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
[in,out] | verbosity | WS Input/Output |
[in] | level | Generic Input |
Definition at line 461 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
[in,out] | verbosity | WS Input/Output |
[in] | level | Generic Input |
Definition at line 469 of file m_general.cc.
References Verbosity::set_screen_verbosity().
Referenced by verbositySetScreen_g().