ARTS  2.2.66
m_general.cc File Reference

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"
Include dependency graph for m_general.cc:

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
 

Detailed Description

Workspace functions of a general and overall character.

Author
Patrick Eriksson Patri.nosp@m.ck.E.nosp@m.rikss.nosp@m.on@c.nosp@m.halme.nosp@m.rs.s.nosp@m.e
Date
2002-05-08

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.

Function Documentation

◆ Error()

void Error ( const String msg,
const Verbosity verbosity 
)

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.

Author
Patrick Eriksson
Parameters
[in]msgGeneric Input

Definition at line 405 of file m_general.cc.

References CREATE_OUT0.

Referenced by Error_g().

◆ Exit()

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.

Author
Patrick Eriksson

Definition at line 414 of file m_general.cc.

References arts_exit(), and CREATE_OUT1.

Referenced by Exit_g().

◆ INCLUDE()

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.

Author
Oliver Lemke

Definition at line 75 of file m_general.cc.

Referenced by INCLUDE_g().

◆ Print() [1/7]

void Print ( Workspace ws,
const Agenda x,
const Index level,
const Verbosity verbosity 
)

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().

◆ Print() [2/7]

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.

◆ Print() [3/7]

void Print ( const ArrayOfCIARecord cia_data,
const Index level,
const Verbosity verbosity 
)

◆ Print() [4/7]

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.

◆ Print() [5/7]

◆ Print() [6/7]

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.

◆ Print() [7/7]

void Print ( const Timer ,
const Index level,
const Verbosity verbosity 
)

Definition at line 288 of file m_general.cc.

References SWITCH_OUTPUT.

◆ PrintWorkspace()

void PrintWorkspace ( Workspace ws,
const Index only_allocated,
const Index level,
const Verbosity verbosity 
)

◆ StringCompose()

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.

Author
Oliver Lemke
Parameters
[out]outGeneric output
[in]in1Generic Input
[in]in2Generic Input
[in]in3Generic Input (Default: "")
[in]in4Generic Input (Default: "")
[in]in5Generic Input (Default: "")
[in]in6Generic Input (Default: "")
[in]in7Generic Input (Default: "")
[in]in8Generic Input (Default: "")
[in]in9Generic Input (Default: "")
[in]in10Generic Input (Default: "")

Definition at line 336 of file m_general.cc.

References Timer::finished, Timer::running, and timerStart().

Referenced by StringCompose_g().

◆ Test()

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.

Author
Patrick Eriksson

Definition at line 424 of file m_general.cc.

References ConstVectorView::nelem(), sensor_integration_vector(), sensor_integration_vector2(), and VectorLinSpace().

Referenced by Test_g().

◆ timerStart()

void timerStart ( Timer timer,
const Verbosity verbosity 
)

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)

Author
Oliver Lemke
Parameters
[out]timerWS Output

Definition at line 369 of file m_general.cc.

References Timer::finished, Timer::running, and timerStop().

Referenced by main(), StringCompose(), and timerStart_g().

◆ timerStop()

void timerStop ( const Timer ,
const Verbosity  
)

Definition at line 396 of file m_general.cc.

Referenced by main(), timerStart(), and timerStop_g().

◆ verbosityInit()

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.

Author
Oliver Lemke
Parameters
[out]verbosityWS 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().

◆ verbositySet()

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.

Author
Oliver Lemke
Parameters
[out]verbosityWS Output
[in]agendaGeneric Input
[in]screenGeneric Input
[in]fileGeneric 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().

◆ verbositySetAgenda()

void verbositySetAgenda ( Verbosity verbosity,
const Index level 
)

WORKSPACE METHOD: verbositySetAgenda.

Sets the verbosity level for agenda output.

See verbositySet

Author
Oliver Lemke
Parameters
[out]verbosityWS Output
[in]levelGeneric Input

Definition at line 483 of file m_general.cc.

References Verbosity::set_agenda_verbosity().

Referenced by verbositySetAgenda_g().

◆ verbositySetFile()

void verbositySetFile ( Verbosity verbosity,
const Index level 
)

WORKSPACE METHOD: verbositySetFile.

Sets the verbosity level for report file output.

See verbositySet

Author
Oliver Lemke
Parameters
[out]verbosityWS Output
[in]levelGeneric Input

Definition at line 493 of file m_general.cc.

References Verbosity::set_file_verbosity().

Referenced by verbositySetFile_g().

◆ verbositySetScreen()

void verbositySetScreen ( Verbosity verbosity,
const Index level 
)

WORKSPACE METHOD: verbositySetScreen.

Sets the verbosity level for screen output.

See verbositySet

Author
Oliver Lemke
Parameters
[out]verbosityWS Output
[in]levelGeneric Input

Definition at line 503 of file m_general.cc.

References Verbosity::set_screen_verbosity().

Referenced by verbositySetScreen_g().

Variable Documentation

◆ SPEED_OF_LIGHT

const Numeric SPEED_OF_LIGHT

Referenced by Print().