ARTS  2.2.66
main.cc File Reference

This file contains the main function of ARTS, as well as functions to deal with command line parameters. More...

#include "arts.h"
#include <algorithm>
#include <map>
#include "auto_version.h"
#include "parameters.h"
#include "messages.h"
#include "exceptions.h"
#include "file.h"
#include "methods.h"
#include "parser.h"
#include "auto_md.h"
#include "absorption.h"
#include "wsv_aux.h"
#include "agenda_record.h"
#include "mystring.h"
#include "workspace_ng.h"
#include "arts_omp.h"
#include "docserver.h"
#include "global_data.h"
Include dependency graph for main.cc:

Go to the source code of this file.

Functions

void polite_goodby ()
 Remind the user of –help and exit return value 1. More...
 
void set_reporting_level (Index r)
 Set the reporting level. More...
 
void option_methods (const String &methods)
 React to option `methods'. More...
 
void option_input (const String &input)
 React to option `input'. More...
 
void option_workspacevariables (const String &workspacevariables)
 React to option `workspacevariables'. More...
 
void option_describe (const String &describe)
 React to option `describe'. More...
 
String arts_mod_time (String)
 This function returns the modification time of the arts executable as a string. More...
 
int main (int argc, char **argv)
 This is the main function of ARTS. More...
 

Detailed Description

This file contains the main function of ARTS, as well as functions to deal with command line parameters.

It also contains the executor, which is the `engine' that executes workspace methods in a controlfile one by one, in order to carry out an ARTS calculations.

Author
Stefan Buehler
Date
2001-07-24

Definition in file main.cc.

Function Documentation

◆ arts_mod_time()

String arts_mod_time ( String  )

This function returns the modification time of the arts executable as a string.

Author
Oliver Lemke

Definition at line 694 of file main.cc.

Referenced by main(), and option_describe().

◆ main()

int main ( int  argc,
char **  argv 
)

This is the main function of ARTS.

(You never guessed that, did you?) The getopt_long function is used to parse the command line parameters.

Overview:
1. Get command line parameters.
2. Evaluate the command line parameters. (This also checks if the
   parameters make sense, where necessary.) 
Returns
0=ok, 1=error
Parameters
argcNumber of command line parameters
argvValues of command line parameters
Author
Stefan Buehler

Definition at line 715 of file main.cc.

References Arts2(), arts_exit(), arts_exit_with_error_message(), ARTS_FULL_VERSION, arts_mod_time(), arts_omp_get_max_threads(), arts_omp_get_thread_num(), Parameters::basename, Parameters::baseurl, check_agenda_data(), COMPILE_FLAGS, COMPILER, Parameters::controlfiles, CREATE_OUTS, Parameters::daemon, Parameters::datapath, define_agenda_data(), define_agenda_map(), define_lineshape_data(), define_lineshape_norm_data(), define_md_data_raw(), define_md_map(), define_md_raw_map(), define_species_data(), define_species_map(), Workspace::define_wsv_data(), define_wsv_group_names(), Workspace::define_wsv_map(), Parameters::describe, Parameters::docserver, expand_md_data_raw_to_md_data(), FORTRAN_COMPILER, Verbosity::get_agenda_verbosity(), Verbosity::get_file_verbosity(), get_parameters(), Verbosity::get_screen_verbosity(), Parameters::groups, Parameters::gui, Parameters::help, Parameters::helptext, Parameters::includepath, Workspace::initialize(), Parameters::input, Parameters::methods, Array< base >::nelem(), my_basic_string< charT >::npos, Parameters::numthreads, open_output_file(), option_describe(), option_input(), option_methods(), option_workspacevariables(), out_basename, parameters, ArtsParser::parse_tasklist(), Parameters::plain, polite_goodby(), report_file, Parameters::reporting, Verbosity::set_main_agenda(), Agenda::set_main_agenda(), Agenda::set_name(), set_reporting_level(), Parameters::usage, verbosity_at_launch, Parameters::version, Parameters::workspacevariables, and global_data::wsv_group_names.

◆ option_describe()

void option_describe ( const String describe)

React to option `describe'.

This should print the description String of the given workspace variable or method.

Parameters
describeWhat to describe.
Author
Stefan Buehler

Definition at line 638 of file main.cc.

References arts_exit(), arts_mod_time(), global_data::md_data_raw, global_data::MdRawMap, Workspace::wsv_data, and Workspace::WsvMap.

Referenced by main().

◆ option_input()

void option_input ( const String input)

React to option `input'.

Given the name of a variable, it should print all methods that need this variable as input.

Parameters
inputName of a variable.
Author
Stefan Buehler
Date
2001-07-24

Definition at line 350 of file main.cc.

References arts_exit(), get_wsv_group_id(), MdRecord::GInSpecType(), MdRecord::GInType(), MdRecord::In(), global_data::md_data_raw, MdRecord::Name(), Array< base >::nelem(), Workspace::wsv_data, global_data::wsv_group_names, and Workspace::WsvMap.

Referenced by main().

◆ option_methods()

void option_methods ( const String methods)

React to option `methods'.

If given the argument `all', it should simply prints a list of all methods. If given the name of a variable, it should print all methods that produce this variable as output.

Parameters
methodsAll or name of a variable.
Author
Stefan Buehler

Definition at line 130 of file main.cc.

References arts_exit(), get_wsv_group_id(), MdRecord::GOutSpecType(), MdRecord::GOutType(), Workspace::initialize(), global_data::md_data_raw, MdRecord::Name(), Array< base >::nelem(), MdRecord::Out(), parameters, Parameters::plain, Workspace::wsv_data, global_data::wsv_group_names, and Workspace::WsvMap.

Referenced by main().

◆ option_workspacevariables()

void option_workspacevariables ( const String workspacevariables)

React to option `workspacevariables'.

If given the argument `all', it should simply prints a list of all variables. If given the name of a method, it should print all variables that are needed by that method.

Parameters
workspacevariablesAll or name of a method.
Author
Stefan Buehler

Definition at line 545 of file main.cc.

References arts_exit(), MdRecord::GInType(), MdRecord::In(), global_data::md_data, global_data::MdMap, MdRecord::Name(), Array< base >::nelem(), parameters, Parameters::plain, Workspace::wsv_data, and global_data::wsv_group_names.

Referenced by main().

◆ polite_goodby()

void polite_goodby ( )

Remind the user of –help and exit return value 1.

Definition at line 65 of file main.cc.

References arts_exit().

Referenced by main().

◆ set_reporting_level()

void set_reporting_level ( Index  r)

Set the reporting level.

Set the global reporting level, either the default or based on reporting. If reporting was specified, check if the values make sense. The value -1 for reporting means that it was (probably) not given on the command line, since this is the initialization value.

Parameters
[in]rReporting level from Command line.
Author
Stefan Buehler

Definition at line 85 of file main.cc.

References arts_exit(), Verbosity::get_agenda_verbosity(), Verbosity::get_file_verbosity(), Verbosity::get_screen_verbosity(), Verbosity::set_agenda_verbosity(), Verbosity::set_file_verbosity(), Verbosity::set_screen_verbosity(), Verbosity::valid(), and verbosity_at_launch.

Referenced by main().