Go to the documentation of this file.
38 #include <sys/types.h>
42 #include <sys/times.h>
67 cerr <<
"Try `arts --help' for help.\n";
110 cerr <<
"Illegal value specified for --reporting (-r).\n"
111 <<
"The specified value is " << r <<
", which would be\n"
112 <<
"interpreted as:\n"
116 <<
"Only values of 0-3 are allowed for each verbosity.\n";
145 if (
"all" == methods )
150 <<
"\n*-------------------------------------------------------------------*\n"
151 <<
"Complete list of ARTS workspace methods:\n"
152 <<
"---------------------------------------------------------------------\n";
161 cout <<
"*-------------------------------------------------------------------*\n\n";
170 map<String, Index>::const_iterator mi =
175 Index wsv_key = mi->second;
180 <<
"\n*-------------------------------------------------------------------*\n"
181 <<
"Generic and supergeneric methods that can generate " <<
Workspace::wsv_data[wsv_key].Name()
183 <<
"---------------------------------------------------------------------\n";
197 cout <<
"- " << mdd.
Name() <<
"\n";
200 else if ( count( mdd.
GOutType().begin(),
214 cout <<
"- " << mdd.
Name() <<
"\n";
220 cout <<
"- " << mdd.
Name() <<
"\n";
233 <<
"\n---------------------------------------------------------------------\n"
236 <<
"---------------------------------------------------------------------\n";
245 if ( count( mdd.
Out().begin(),
249 cout <<
"- " << mdd.
Name() <<
"\n";
257 <<
"*-------------------------------------------------------------------*\n\n";
279 <<
"\n*-------------------------------------------------------------------*\n"
280 <<
"Generic and supergeneric methods that can generate variables of group "
282 <<
"---------------------------------------------------------------------\n";
296 cout <<
"- " << mdd.
Name() <<
"\n";
299 else if ( count( mdd.
GOutType().begin(),
313 cout <<
"- " << mdd.
Name() <<
"\n";
319 cout <<
"- " << mdd.
Name() <<
"\n";
330 <<
"*-------------------------------------------------------------------*\n\n";
337 cerr <<
"The name " << methods <<
" matches neither `all',\n"
338 <<
"nor the name of a workspace variable, nor the name\n"
339 <<
"of a workspace variable group.\n";
360 map<String, Index>::const_iterator mi =
369 Index wsv_key = mi->second;
373 <<
"\n*-------------------------------------------------------------------*\n"
374 <<
"Generic and supergeneric methods that can use " <<
Workspace::wsv_data[wsv_key].Name() <<
":\n"
375 <<
"---------------------------------------------------------------------\n";
385 if ( count( mdd.
GInType().begin(),
389 cout <<
"- " << mdd.
Name() <<
"\n";
392 else if ( count( mdd.
GInType().begin(),
406 cout <<
"- " << mdd.
Name() <<
"\n";
412 cout <<
"- " << mdd.
Name() <<
"\n";
425 <<
"\n---------------------------------------------------------------------\n"
428 <<
"---------------------------------------------------------------------\n";
437 if ( count( mdd.
In().begin(),
441 cout <<
"- " << mdd.
Name() <<
"\n";
449 <<
"*-------------------------------------------------------------------*\n\n";
474 <<
"\n*-------------------------------------------------------------------*\n"
475 <<
"Generic and supergeneric methods that require a variable of group "
477 <<
"---------------------------------------------------------------------\n";
487 if ( count( mdd.
GInType().begin(),
491 cout <<
"- " << mdd.
Name() <<
"\n";
494 else if ( count( mdd.
GInType().begin(),
508 cout <<
"- " << mdd.
Name() <<
"\n";
514 cout <<
"- " << mdd.
Name() <<
"\n";
525 <<
"*-------------------------------------------------------------------*\n\n";
532 cerr <<
"The name " << input <<
" matches neither the name of a\n"
533 <<
"workspace variable, nor the name of a workspace variable group.\n";
559 if (
"all" == workspacevariables )
564 <<
"\n*-------------------------------------------------------------------*\n"
565 <<
"Complete list of ARTS workspace variables:\n"
566 <<
"---------------------------------------------------------------------\n";
576 cout <<
"*-------------------------------------------------------------------*\n\n";
582 map<String, Index>::const_iterator mi =
583 MdMap.find(workspacevariables);
584 if ( mi !=
MdMap.end() )
594 <<
"\n*-------------------------------------------------------------------*\n"
595 <<
"Generic workspace variables required by " << mdr.
Name()
597 <<
"---------------------------------------------------------------------\n";
609 <<
"\n---------------------------------------------------------------------\n"
610 <<
"Specific workspace variables required by " << mdr.
Name() <<
":\n"
611 <<
"---------------------------------------------------------------------\n";
612 for (
Index i=0; i<mdr.
In().nelem(); ++i )
621 <<
"*-------------------------------------------------------------------*\n\n";
627 cerr <<
"The name " << workspacevariables <<
" matches neither `all',\n"
628 <<
"nor the name of a workspace method.\n";
648 map<String, Index>::const_iterator i =
672 <<
" matches neither method nor variable.\n";
685 if (stat (filename.c_str(), &buf) != -1)
687 String ts = ctime (&buf.st_mtime);
688 return String(
" (compiled ") + ts.substr (0, ts.length()-1) +
")";
715 int main (
int argc,
char **argv)
723 struct tms arts_cputime_start;
724 clock_t arts_realtime_start;
725 arts_realtime_start = times (&arts_cputime_start);
745 ostringstream osfeatures;
754 <<
"Features in this build: " << endl
755 <<
" Numeric precision: "
756 << ((
sizeof (
Numeric) ==
sizeof (
double)) ?
"double" :
"float") << endl
757 <<
" OpenMP support: "
761 <<
"disabled" << endl
763 <<
" Documentation server: "
764 #ifdef ENABLE_DOCSERVER
767 <<
"disabled" << endl
769 <<
" Zipped XML support: "
773 <<
"disabled" << endl
775 <<
" NetCDF support: "
779 <<
"disabled" << endl
781 <<
" Fortran support: "
782 #ifdef FORTRAN_COMPILER
785 <<
"disabled" << endl
787 <<
" Refice support: "
791 <<
"disabled" << endl
793 <<
" Tmatrix support: "
794 #ifdef ENABLE_TMATRIX
797 <<
"disabled" << endl
800 <<
"Include search paths: " << endl;
805 osfeatures <<
" " << (*it) << endl;
807 osfeatures <<
"Data search paths: " << endl;
812 osfeatures <<
" " << (*it) << endl;
819 cout << osfeatures.str();
828 cerr <<
"Ignoring commandline option --numthreads/-n.\n"
829 <<
"This option only works with an OpenMP enabled ARTS build.\n";
931 <<
"\n*-------------------------------------------------------------------*\n"
932 <<
"Complete list of ARTS workspace variable groups:\n"
933 <<
"---------------------------------------------------------------------\n";
943 cout <<
"*-------------------------------------------------------------------*\n\n";
947 #ifdef ENABLE_DOCSERVER
960 cout <<
"Docserver daemon started with PID: " << pid << endl;
967 cout <<
"Starting the arts documentation server." << endl;
988 cerr <<
"You must specify at least one control file name.\n";
1009 cerr <<
"The controlfile must have the extension .arts.\n";
1043 ostringstream report_file_ext;
1045 report_file_ext <<
".rep";
1048 catch (runtime_error x)
1050 cerr << x.what() <<
"\n"
1051 <<
"I have to be able to write to my report file.\n";
1059 out1 <<
"Executing ARTS.\n";
1062 out1 <<
"Command line:\n";
1063 for (
Index i=0; i<argc; ++i) {
1064 out1 << argv[i] <<
" ";
1072 out2 << osfeatures.str() <<
"\n";
1076 out2 <<
"Running with OpenMP, "
1077 <<
"maximum number of threads = "
1080 out2 <<
"Running without OpenMP.\n";
1086 #pragma omp parallel \
1092 os <<
" Thread " << tn <<
": ready.\n";
1099 struct tm * timeinfo;
1102 timeinfo = localtime ( &rawtime );
1103 out2 <<
"Run started: " << asctime(timeinfo) <<
"\n";
1112 out3 <<
"\nReading control files:\n";
1138 Arts2(workspace, tasklist, verbosity);
1140 catch (
const runtime_error x)
1145 throw runtime_error(os.str());
1149 catch (
const runtime_error x)
1152 struct tms arts_cputime_end;
1153 clock_t arts_realtime_end;
1156 clktck = sysconf (_SC_CLK_TCK);
1157 arts_realtime_end = times (&arts_cputime_end);
1159 && arts_realtime_start != (clock_t)-1
1160 && arts_realtime_end != (clock_t)-1)
1162 out1 <<
"This run took " << fixed << setprecision(2)
1164 (arts_realtime_end - arts_realtime_start)
1166 <<
"s (" << fixed << setprecision(2) << (
Numeric)
1167 ((arts_cputime_end.tms_stime - arts_cputime_start.tms_stime)
1168 + (arts_cputime_end.tms_utime - arts_cputime_start.tms_utime))
1169 / (
Numeric)clktck <<
"s CPU time)\n";
1177 struct tms arts_cputime_end;
1178 clock_t arts_realtime_end;
1181 clktck = sysconf (_SC_CLK_TCK);
1182 arts_realtime_end = times (&arts_cputime_end);
1184 && arts_realtime_start != (clock_t)-1
1185 && arts_realtime_end != (clock_t)-1)
1187 out1 <<
"This run took " << fixed << setprecision(2)
1189 (arts_realtime_end - arts_realtime_start)
1191 <<
"s (" << fixed << setprecision(2) << (
Numeric)
1192 ((arts_cputime_end.tms_stime - arts_cputime_start.tms_stime)
1193 + (arts_cputime_end.tms_utime - arts_cputime_start.tms_utime))
1194 / (
Numeric)clktck <<
"s CPU time)\n";
1198 out1 <<
"Everything seems fine. Goodbye.\n";
Declarations for AgRecord, storing lookup information for one agenda.
Index reporting
This should be a two digit integer.
bool help
Only display the help text.
int arts_omp_get_thread_num()
Wrapper for omp_get_thread_num.
Declarations for the arts documentation server.
static Array< WsvRecord > wsv_data
const ArrayOfArrayOfIndex & GOutSpecType() const
const ArrayOfIndex & GOutType() const
The declarations of all the exception classes.
Index docserver
Port to use for the docserver.
Declarations required for the calculation of absorption coefficients.
void define_agenda_data()
const ArrayOfIndex & GInType() const
Structure to hold all command line Parameters.
const Array< MdRecord > md_data_raw
Lookup information for workspace methods.
String usage
Short message how to call the program.
bool version
Display version information.
void option_input(const String &input)
React to option ‘input’.
const map< String, Index > MdRawMap
The map associated with md_data_raw.
int arts_omp_get_max_threads()
Wrapper for omp_get_max_threads.
#define ARTS_FULL_VERSION
bool gui
Flag to run with graphical user interface.
String workspacevariables
If this is given the argument ‘all’, it simply prints a list of all workspace variables.
This can be used to make arrays out of anything.
bool plain
Generate plain help out suitable for script processing.
String describe
Print the description String of the given workspace variable or method.
String helptext
Longer message explaining the options.
Declarations having to do with the four output streams.
Verbosity verbosity_at_launch
String describe(ConstTensor7View x)
Describe Tensor7.
The implementation for String, the ARTS string class.
String basename
If this is specified (with the -b –basename option), it is used as the base name for the report file ...
const map< String, Index > MdMap
The map associated with md_data.
bool get_parameters(int argc, char **argv)
Get the command line parameters.
void define_lineshape_data()
static void define_wsv_data()
ofstream report_file
The report file.
void parse_tasklist()
Public interface to the main function of the parser.
void expand_md_data_raw_to_md_data()
Expand supergeneric methods.
NUMERIC Numeric
The type to use for all floating point numbers.
void set_agenda_verbosity(Index v)
ArrayOfString controlfiles
The filenames of the controlfiles.
void define_species_map()
Define the species data map.
Index get_agenda_verbosity() const
void define_wsv_group_names()
Define the array of workspace variable group names.
int main(int argc, char **argv)
This is the main function of ARTS.
void set_reporting_level(Index r)
Set the reporting level.
const String & Name() const
const ArrayOfIndex & In() const
bool check_agenda_data()
Check that agendas.cc and workspace.cc are consistent.
This file contains header information for the dealing with command line parameters.
bool groups
Print a list of all workspace variable groups.
String out_basename
The basename for the report file and for all other output files.
void open_output_file(ofstream &file, const String &name)
Open a file for writing.
bool daemon
Flag to run the docserver in the background.
String methods
If this is given the argument ‘all’, it simply prints a list of all methods.
const Array< MdRecord > md_data
Lookup information for workspace methods.
void define_lineshape_norm_data()
void polite_goodby()
Remind the user of –help and exit return value 1.
bool valid() const
Check if artsmessages contains valid message levels.
void define_md_raw_map()
Define MdRawMap.
This file contains the declaration and partly the implementation of the workspace class.
All information for one workspace method.
void Arts2(Workspace &ws, const Agenda &input_agenda, const Verbosity &verbosity)
WORKSPACE METHOD: Arts2.
String baseurl
Baseurl for the docserver.
Parameters parameters
Holds the command line parameters.
void option_methods(const String &methods)
React to option ‘methods’.
my_basic_string< char > String
The String type for ARTS.
static map< String, Index > WsvMap
void set_file_verbosity(Index v)
void set_main_agenda(bool main_agenda)
const ArrayOfArrayOfIndex & GInSpecType() const
void set_name(const String &nname)
Set agenda name.
void option_workspacevariables(const String &workspacevariables)
React to option ‘workspacevariables’.
Index get_screen_verbosity() const
This file contains basic functions to handle ASCII files.
Index get_file_verbosity() const
String input
This is complementary to the methods switch.
void option_describe(const String &describe)
React to option ‘describe’.
Index numthreads
The maximum number of threads to use.
INDEX Index
The type to use for all integer numbers and indices.
const ArrayOfIndex & Out() const
const ArrayOfString wsv_group_names
The names associated with Wsv groups as Strings.
void define_species_data()
void arts_exit(int status)
This is the exit function of ARTS.
void define_md_map()
Define MdMap.
static void define_wsv_map()
static const Index npos
Define npos:
ArrayOfString includepath
List of paths to search for include files.
String arts_mod_time(String)
This function returns the modification time of the arts executable as a string.
Header file for helper functions for OpenMP.
Index get_wsv_group_id(const String &name)
Returns the id of the given group.
void arts_exit_with_error_message(const String &m, ArtsOut &out)
Print error message and exit.
void set_screen_verbosity(Index v)
ArrayOfString datapath
List of paths to search for data files.
Index nelem() const
Number of elements.
Declaration of the class MdRecord.
Auxiliary header stuff related to workspace variable groups.
void define_md_data_raw()
This file contains the definition of String, the ARTS string class.
The global header file for ARTS.