m_general.cc File Reference

Workspace functions of a general and overall character. More...

#include <stdexcept>
#include "arts.h"
#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 "workspace_ng.h"

Include dependency graph for m_general.cc:

Go to the source code of this file.

Functions

void INCLUDE ()
 WORKSPACE METHOD: INCLUDE.
void Print (Workspace &ws, const Agenda &x, const Index &level)
void Print (const ArrayOfGridPos &x, const Index &level)
void Print (const Ppath &x, const Index &level)
void Print (const Timer &, const Index &)
void PrintWorkspace (Workspace &ws, const Index &only_allocated, const Index &level)
void timerStart (Timer &)
 WORKSPACE METHOD: timerStart.
void timerStop (const Timer &starttime)
 WORKSPACE METHOD: timerStop.
void Error (const String &msg)
 WORKSPACE METHOD: Error.
void Exit ()
 WORKSPACE METHOD: Exit.
void Test ()
 WORKSPACE METHOD: Test.


Detailed Description

Workspace functions of a general and overall character.

Author:
Patrick Eriksson <Patrick.Eriksson@rss.chalmers.se>
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

void Error ( const String msg  ) 

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_prop_agenda* could look like: <br> Error{"Surface interceptions of propagation path not expected."} (ignore and other dummy method calls must still be included)

Keywords: <br> msg : String describing the error.

Author:
Patrick Eriksson
Parameters:
[in] msg Generic Input

Definition at line 318 of file m_general.cc.

References arts_exit(), and out0.

Referenced by Error_g().

void Exit (  ) 

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 327 of file m_general.cc.

References arts_exit(), and out1.

Referenced by Exit_g().

void INCLUDE (  ) 

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 66 of file m_general.cc.

Referenced by INCLUDE_g().

void Print ( const Timer ,
const Index  
)

Definition at line 199 of file m_general.cc.

void Print ( const Ppath x,
const Index level 
)

void Print ( const ArrayOfGridPos x,
const Index level 
)

Definition at line 86 of file m_general.cc.

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

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

Definition at line 72 of file m_general.cc.

References SWITCH_OUTPUT.

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

Definition at line 215 of file m_general.cc.

References Workspace::is_initialized(), Workspace::nelem(), PrintWsvName(), and SWITCH_OUTPUT.

Referenced by PrintWorkspace_g().

void Test (  ) 

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 335 of file m_general.cc.

Referenced by Test_g().

void timerStart ( Timer timer  ) 

WORKSPACE METHOD: timerStart.

Initializes the CPU timer. Use *timerStop* to output the consumed cpu time since *timerStart*.

Usage example:

timerStart() ReadXML(f_grid){"frequencies.xml"} timerStop() Prints the CPU time spent for reading the XML file

Author:
Oliver Lemke
Parameters:
[out] timer WS Output

Definition at line 259 of file m_general.cc.

Referenced by timerStart_g().

void timerStop ( const Timer timer  ) 

WORKSPACE METHOD: timerStop.

Stops the CPU timer. Use *timerStop* to output the consumed cpu time since *timerStart*. See *timerStart* for example

Author:
Oliver Lemke
Parameters:
[in] timer WS Input

Definition at line 310 of file m_general.cc.

Referenced by timerStop_g().


Generated on Mon Mar 23 14:06:40 2009 for ARTS by  doxygen 1.5.6