Go to the documentation of this file.
38 #include <sys/types.h>
42 #include <sys/times.h>
66 cerr <<
"Try `arts --help' for help.\n";
108 cerr <<
"Illegal value specified for --reporting (-r).\n"
109 <<
"The specified value is " << r <<
", which would be\n"
110 <<
"interpreted as:\n"
114 <<
"Only values of 0-3 are allowed for each verbosity.\n";
144 if (
"all" == methods )
149 <<
"\n*-------------------------------------------------------------------*\n"
150 <<
"Complete list of ARTS workspace methods:\n"
151 <<
"---------------------------------------------------------------------\n";
160 cout <<
"*-------------------------------------------------------------------*\n\n";
169 map<String, Index>::const_iterator mi =
174 Index wsv_key = mi->second;
179 <<
"\n*-------------------------------------------------------------------*\n"
180 <<
"Generic and supergeneric methods that can generate " <<
Workspace::wsv_data[wsv_key].Name()
182 <<
"---------------------------------------------------------------------\n";
196 cout <<
"- " << mdd.
Name() <<
"\n";
199 else if ( count( mdd.
GOutType().begin(),
213 cout <<
"- " << mdd.
Name() <<
"\n";
219 cout <<
"- " << mdd.
Name() <<
"\n";
232 <<
"\n---------------------------------------------------------------------\n"
235 <<
"---------------------------------------------------------------------\n";
244 if ( count( mdd.
Out().begin(),
248 cout <<
"- " << mdd.
Name() <<
"\n";
256 <<
"*-------------------------------------------------------------------*\n\n";
278 <<
"\n*-------------------------------------------------------------------*\n"
279 <<
"Generic and supergeneric methods that can generate variables of group "
281 <<
"---------------------------------------------------------------------\n";
295 cout <<
"- " << mdd.
Name() <<
"\n";
298 else if ( count( mdd.
GOutType().begin(),
312 cout <<
"- " << mdd.
Name() <<
"\n";
318 cout <<
"- " << mdd.
Name() <<
"\n";
329 <<
"*-------------------------------------------------------------------*\n\n";
336 cerr <<
"The name " << methods <<
" matches neither `all',\n"
337 <<
"nor the name of a workspace variable, nor the name\n"
338 <<
"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";
549 extern const map<String, Index>
MdMap;
560 if (
"all" == workspacevariables )
565 <<
"\n*-------------------------------------------------------------------*\n"
566 <<
"Complete list of ARTS workspace variables:\n"
567 <<
"---------------------------------------------------------------------\n";
577 cout <<
"*-------------------------------------------------------------------*\n\n";
583 map<String, Index>::const_iterator mi =
584 MdMap.find(workspacevariables);
585 if ( mi !=
MdMap.end() )
595 <<
"\n*-------------------------------------------------------------------*\n"
596 <<
"Generic workspace variables required by " << mdr.
Name()
598 <<
"---------------------------------------------------------------------\n";
610 <<
"\n---------------------------------------------------------------------\n"
611 <<
"Specific workspace variables required by " << mdr.
Name() <<
":\n"
612 <<
"---------------------------------------------------------------------\n";
613 for (
Index i=0; i<mdr.
In().nelem(); ++i )
622 <<
"*-------------------------------------------------------------------*\n\n";
628 cerr <<
"The name " << workspacevariables <<
" matches neither `all',\n"
629 <<
"nor the name of a workspace method.\n";
643 extern const map<String, Index>
MdRawMap;
650 map<String, Index>::const_iterator i =
674 <<
" matches neither method nor variable.\n";
687 if (stat (filename.c_str(), &buf) != -1)
689 String ts = ctime (&buf.st_mtime);
690 return String(
" (") + ts.substr (0, ts.length()-1) +
")";
717 int main (
int argc,
char **argv)
730 struct tms arts_cputime_start;
731 clock_t arts_realtime_start;
732 arts_realtime_start = times (&arts_cputime_start);
752 ostringstream osfeatures;
761 <<
"Features in this build: " << endl
762 <<
" Numeric precision: "
763 << ((
sizeof (
Numeric) ==
sizeof (
double)) ?
"double" :
"float") << endl
764 <<
" OpenMP support: "
768 <<
"disabled" << endl
770 <<
" Documentation server: "
771 #ifdef ENABLE_DOCSERVER
774 <<
"disabled" << endl
776 <<
" Zipped XML support: "
780 <<
"disabled" << endl
782 <<
" NetCDF support: "
786 <<
"disabled" << endl
788 <<
" Disort algorithm: "
792 <<
"disabled" << endl
795 <<
"Include search paths: " << endl;
800 osfeatures <<
" " << (*it) << endl;
807 cout << osfeatures.str();
816 cerr <<
"Ignoring commandline option --numthreads/-n.\n"
817 <<
"This option only works with an OpenMP enabled ARTS build.\n";
921 <<
"\n*-------------------------------------------------------------------*\n"
922 <<
"Complete list of ARTS workspace variable groups:\n"
923 <<
"---------------------------------------------------------------------\n";
933 cout <<
"*-------------------------------------------------------------------*\n\n";
937 #ifdef ENABLE_DOCSERVER
950 cout <<
"Docserver daemon started with PID: " << pid << endl;
957 cout <<
"Starting the arts documentation server." << endl;
978 cerr <<
"You must specify at least one control file name.\n";
997 cerr <<
"The controlfile must have the extension .arts.\n";
1031 ostringstream report_file_ext;
1033 report_file_ext <<
".rep";
1036 catch (runtime_error x)
1038 cerr << x.what() <<
"\n"
1039 <<
"I have to be able to write to my report file.\n";
1042 catch (ios_base::failure x)
1044 cerr << x.what() <<
"\n"
1045 <<
"I have to be able to write to my report file.\n"
1046 <<
"Make sure you have write permissions for the directory where\n"
1047 <<
"the report file is written.\n";
1059 out2 << osfeatures.str() <<
"\n";
1063 out2 <<
"Running with OpenMP, "
1064 <<
"maximum number of threads = "
1067 out2 <<
"Running without OpenMP.\n";
1073 #pragma omp parallel \
1079 os <<
" Thread " << tn <<
": ready.\n";
1086 struct tm * timeinfo;
1089 timeinfo = localtime ( &rawtime );
1090 out2 <<
"Run started: " << asctime(timeinfo) <<
"\n";
1099 out3 <<
"\nReading control files:\n";
1124 Arts2(workspace, tasklist, verbosity);
1127 catch (runtime_error x)
1130 struct tms arts_cputime_end;
1131 clock_t arts_realtime_end;
1134 clktck = sysconf (_SC_CLK_TCK);
1135 arts_realtime_end = times (&arts_cputime_end);
1137 && arts_realtime_start != (clock_t)-1
1138 && arts_realtime_end != (clock_t)-1)
1140 out1 <<
"This run took " << fixed << setprecision(2)
1142 (arts_realtime_end - arts_realtime_start)
1144 <<
"s (" << fixed << setprecision(2) << (
Numeric)
1145 ((arts_cputime_end.tms_stime - arts_cputime_start.tms_stime)
1146 + (arts_cputime_end.tms_utime - arts_cputime_start.tms_utime))
1147 / (
Numeric)clktck <<
"s CPU time)\n";
1155 struct tms arts_cputime_end;
1156 clock_t arts_realtime_end;
1159 clktck = sysconf (_SC_CLK_TCK);
1160 arts_realtime_end = times (&arts_cputime_end);
1162 && arts_realtime_start != (clock_t)-1
1163 && arts_realtime_end != (clock_t)-1)
1165 out1 <<
"This run took " << fixed << setprecision(2)
1167 (arts_realtime_end - arts_realtime_start)
1169 <<
"s (" << fixed << setprecision(2) << (
Numeric)
1170 ((arts_cputime_end.tms_stime - arts_cputime_start.tms_stime)
1171 + (arts_cputime_end.tms_utime - arts_cputime_start.tms_utime))
1172 / (
Numeric)clktck <<
"s CPU time)\n";
1176 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()
Array< MdRecord > md_data_raw
Lookup information for workspace methods.
const ArrayOfIndex & GInType() const
Structure to hold all command line Parameters.
String usage
Short message how to call the program.
bool version
Display version information.
void option_input(const String &input)
React to option ‘input’.
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 describe(ConstTensor7View x)
Describe Tensor7.
String helptext
Longer message explaining the options.
Declarations having to do with the four output streams.
Verbosity verbosity_at_launch
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 ...
bool get_parameters(int argc, char **argv)
Get the command line parameters.
void define_lineshape_data()
static void define_wsv_data()
ArrayOfString wsv_group_names
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.
map< String, Index > MdRawMap
The map associated with md_data_raw.
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
void arts_omp_set_nested(int i)
Wrapper for omp_set_nested.
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.
void define_lineshape_norm_data()
void polite_goodby()
Remind the user of –help and exit return value 1.
Array< MdRecord > md_data
Lookup information for workspace methods.
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.
map< String, Index > MdMap
The map associated with md_data.
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
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)
void arts_exit_with_error_message(const String &m, ArtsOut &out)
Print error message and exit.
void set_screen_verbosity(Index v)
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.