Go to the documentation of this file.
35 #include <sys/times.h>
36 #include <sys/types.h>
62 cerr <<
"Try `arts --help' for help.\n";
99 cerr <<
"Illegal value specified for --reporting (-r).\n"
100 <<
"The specified value is " << r <<
", which would be\n"
101 <<
"interpreted as:\n"
102 <<
"Verbosity for agendas: "
104 <<
"Verbosity for screen: "
106 <<
"Verbosity for report file: "
108 <<
"Only values of 0-3 are allowed for each verbosity.\n";
138 <<
"\n*-------------------------------------------------------------------*\n"
139 <<
"Complete list of ARTS workspace methods:\n"
140 <<
"---------------------------------------------------------------------\n";
149 <<
"*-------------------------------------------------------------------*\n\n";
161 Index wsv_key = mi->second;
166 <<
"\n*-------------------------------------------------------------------*\n"
167 <<
"Generic and supergeneric methods that can generate "
169 <<
"---------------------------------------------------------------------\n";
181 cout <<
"- " << mdd.
Name() <<
"\n";
183 }
else if (count(mdd.
GOutType().begin(),
192 cout <<
"- " << mdd.
Name() <<
"\n";
196 cout <<
"- " << mdd.
Name() <<
"\n";
203 if (0 == hitcount) cout <<
"none\n";
208 <<
"\n---------------------------------------------------------------------\n"
209 <<
"Specific methods that can generate "
211 <<
"---------------------------------------------------------------------\n";
219 if (count(mdd.
Out().begin(), mdd.
Out().end(), wsv_key)) {
220 cout <<
"- " << mdd.
Name() <<
"\n";
224 if (0 == hitcount) cout <<
"none\n";
227 <<
"*-------------------------------------------------------------------*\n\n";
247 <<
"\n*-------------------------------------------------------------------*\n"
248 <<
"Generic and supergeneric methods that can generate variables of group "
250 <<
"---------------------------------------------------------------------\n";
260 cout <<
"- " << mdd.
Name() <<
"\n";
262 }
else if (count(mdd.
GOutType().begin(),
271 cout <<
"- " << mdd.
Name() <<
"\n";
275 cout <<
"- " << mdd.
Name() <<
"\n";
282 if (0 == hitcount) cout <<
"none\n";
285 <<
"*-------------------------------------------------------------------*\n\n";
292 cerr <<
"The name " <<
methods <<
" matches neither `all',\n"
293 <<
"nor the name of a workspace variable, nor the name\n"
294 <<
"of a workspace variable group.\n";
321 Index wsv_key = mi->second;
325 <<
"\n*-------------------------------------------------------------------*\n"
326 <<
"Generic and supergeneric methods that can use "
328 <<
"---------------------------------------------------------------------\n";
337 if (count(mdd.
GInType().begin(),
340 cout <<
"- " << mdd.
Name() <<
"\n";
342 }
else if (count(mdd.
GInType().begin(),
351 cout <<
"- " << mdd.
Name() <<
"\n";
355 cout <<
"- " << mdd.
Name() <<
"\n";
362 if (0 == hitcount) cout <<
"none\n";
367 <<
"\n---------------------------------------------------------------------\n"
368 <<
"Specific methods that require "
370 <<
"---------------------------------------------------------------------\n";
378 if (count(mdd.
In().begin(), mdd.
In().end(), wsv_key)) {
379 cout <<
"- " << mdd.
Name() <<
"\n";
383 if (0 == hitcount) cout <<
"none\n";
386 <<
"*-------------------------------------------------------------------*\n\n";
409 <<
"\n*-------------------------------------------------------------------*\n"
410 <<
"Generic and supergeneric methods that require a variable of group "
412 <<
"---------------------------------------------------------------------\n";
421 if (count(mdd.
GInType().begin(), mdd.
GInType().end(), group_key)) {
422 cout <<
"- " << mdd.
Name() <<
"\n";
424 }
else if (count(mdd.
GInType().begin(),
433 cout <<
"- " << mdd.
Name() <<
"\n";
437 cout <<
"- " << mdd.
Name() <<
"\n";
444 if (0 == hitcount) cout <<
"none\n";
447 <<
"*-------------------------------------------------------------------*\n\n";
454 cerr <<
"The name " << input <<
" matches neither the name of a\n"
455 <<
"workspace variable, nor the name of a workspace variable group.\n";
479 if (
"all" == workspacevariables) {
482 <<
"\n*-------------------------------------------------------------------*\n"
483 <<
"Complete list of ARTS workspace variables:\n"
484 <<
"---------------------------------------------------------------------\n";
494 <<
"*-------------------------------------------------------------------*\n\n";
499 map<String, Index>::const_iterator mi =
MdMap.find(workspacevariables);
500 if (mi !=
MdMap.end()) {
509 <<
"\n*-------------------------------------------------------------------*\n"
510 <<
"Generic workspace variables required by " << mdr.
Name()
512 <<
"---------------------------------------------------------------------\n";
517 if (0 == hitcount) cout <<
"none\n";
522 <<
"\n---------------------------------------------------------------------\n"
523 <<
"Specific workspace variables required by " << mdr.
Name() <<
":\n"
524 <<
"---------------------------------------------------------------------\n";
529 if (0 == hitcount) cout <<
"none\n";
532 <<
"*-------------------------------------------------------------------*\n\n";
538 cerr <<
"The name " << workspacevariables <<
" matches neither `all',\n"
539 <<
"nor the name of a workspace method.\n";
577 cerr <<
"The name " <<
describe <<
" matches neither method nor variable.\n";
588 if (stat(filename.c_str(), &buf) != -1) {
589 String ts = ctime(&buf.st_mtime);
590 return String(
" (compiled ") + ts.substr(0, ts.length() - 1) +
")";
612 int main(
int argc,
char** argv) {
618 struct tms arts_cputime_start;
619 clock_t arts_realtime_start;
620 arts_realtime_start = times(&arts_cputime_start);
637 ostringstream osfeatures;
644 osfeatures <<
"Features in this build: " << endl
645 <<
" Numeric precision: "
646 << ((
sizeof(
Numeric) ==
sizeof(
double)) ?
"double" :
"float")
648 <<
" OpenMP support: "
652 <<
"disabled" << endl
654 <<
" Documentation server: "
655 #ifdef ENABLE_DOCSERVER
658 <<
"disabled" << endl
660 <<
" Zipped XML support: "
664 <<
"disabled" << endl
666 <<
" NetCDF support: "
670 <<
"disabled" << endl
672 <<
" Fortran support: "
673 #ifdef FORTRAN_COMPILER
676 <<
"disabled" << endl
678 <<
" Legacy Fortran Disort:"
682 <<
"disabled" << endl
688 <<
"disabled" << endl
690 <<
" FASTEM support: "
694 <<
"disabled" << endl
699 <<
" MPI support for OEM: "
703 <<
"disabled" << endl
706 <<
"disabled" << endl
708 <<
" Refice support: "
712 <<
"disabled" << endl
714 <<
" Tmatrix support: "
715 #ifdef ENABLE_TMATRIX
716 #ifdef ENABLE_TMATRIX_QUAD
717 <<
"enabled (quad-precision)" << endl
719 <<
"enabled (double-precision)" << endl
722 <<
"disabled" << endl
724 <<
" Hitran Xsec support: "
726 <<
"enabled (experimental)" << endl
728 <<
"enabled (experimental, no FFTW support, using slow convolution method)"
733 osfeatures <<
"Include search paths: " << endl;
735 osfeatures <<
" " << path << endl;
738 osfeatures <<
"Data searchpaths: " << endl;
740 osfeatures <<
" " << path << endl;
746 cout << osfeatures.str();
754 cerr <<
"Ignoring commandline option --numthreads/-n.\n"
755 <<
"This option only works with an OpenMP enabled ARTS build.\n";
808 #ifdef ENABLE_DOCSERVER
811 const auto broken_links = Docserver::list_broken_description_links();
812 const size_t nbroken = std::get<0>(broken_links);
813 for (
auto&& s : std::get<1>(broken_links)) {
814 std::cout << s << std::endl;
816 std::cout << std::endl
817 << nbroken <<
" broken link" << (nbroken == 1 ?
"" :
"s")
818 <<
" found." << std::endl;
819 arts_exit(nbroken ? EXIT_FAILURE : EXIT_SUCCESS);
861 <<
"\n*-------------------------------------------------------------------*\n"
862 <<
"Complete list of ARTS workspace variable groups:\n"
863 <<
"---------------------------------------------------------------------\n";
873 <<
"*-------------------------------------------------------------------*\n\n";
877 #ifdef ENABLE_DOCSERVER
886 cout <<
"Docserver daemon started with PID: " << pid << endl;
891 cout <<
"Starting the arts documentation server." << endl;
902 cerr <<
"You must specify at least one control file name.\n";
921 cerr <<
"The controlfile must have the extension .arts.\n";
952 ostringstream report_file_ext;
954 report_file_ext <<
".rep";
956 }
catch (
const std::runtime_error&
x) {
957 cerr <<
x.what() <<
"\n"
958 <<
"I have to be able to write to my report file.\n";
965 out1 <<
"Executing ARTS.\n";
968 out1 <<
"Command line:\n";
969 for (
Index i = 0; i < argc; ++i) {
970 out1 << argv[i] <<
" ";
978 out2 << osfeatures.str() <<
"\n";
982 out2 <<
"Running with OpenMP, "
986 out2 <<
"Running without OpenMP.\n";
991 #pragma omp parallel default(none) shared(out3)
995 os <<
" Thread " << tn <<
": ready.\n";
1002 struct tm* timeinfo;
1005 timeinfo = localtime(&rawtime);
1006 out2 <<
"Run started: " << asctime(timeinfo) <<
"\n";
1010 out3 <<
"Verbosity settings: Agendas: "
1011 <<
verbosity.get_agenda_verbosity() <<
"\n"
1013 <<
verbosity.get_screen_verbosity() <<
"\n"
1015 <<
verbosity.get_file_verbosity() <<
"\n";
1017 out3 <<
"\nReading control files:\n";
1043 }
catch (
const std::exception&
x) {
1048 throw runtime_error(os.str());
1051 }
catch (
const std::runtime_error&
x) {
1053 struct tms arts_cputime_end;
1054 clock_t arts_realtime_end;
1057 clktck = sysconf(_SC_CLK_TCK);
1058 arts_realtime_end = times(&arts_cputime_end);
1059 if (clktck > 0 && arts_realtime_start != (clock_t)-1 &&
1060 arts_realtime_end != (clock_t)-1) {
1061 out1 <<
"This run took " << fixed << setprecision(2)
1062 << (
Numeric)(arts_realtime_end - arts_realtime_start) /
1064 <<
"s (" << fixed << setprecision(2)
1066 (arts_cputime_end.tms_stime - arts_cputime_start.tms_stime) +
1067 (arts_cputime_end.tms_utime - arts_cputime_start.tms_utime)) /
1077 struct tms arts_cputime_end;
1078 clock_t arts_realtime_end;
1081 clktck = sysconf(_SC_CLK_TCK);
1082 arts_realtime_end = times(&arts_cputime_end);
1083 if (clktck > 0 && arts_realtime_start != (clock_t)-1 &&
1084 arts_realtime_end != (clock_t)-1) {
1085 out1 <<
"This run took " << fixed << setprecision(2)
1086 << (
Numeric)(arts_realtime_end - arts_realtime_start) / (
Numeric)clktck
1087 <<
"s (" << fixed << setprecision(2)
1089 (arts_cputime_end.tms_stime - arts_cputime_start.tms_stime) +
1090 (arts_cputime_end.tms_utime - arts_cputime_start.tms_utime)) /
1096 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.
void define_species_map()
static Array< WsvRecord > wsv_data
Global WSV data.
const ArrayOfArrayOfIndex & GOutSpecType() const
const ArrayOfIndex & GOutType() const
The declarations of all the exception classes.
String out_basename
The basename for the report file and for all other output files.
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.
Verbosity verbosity(Workspace &ws) noexcept
void initialize()
Initialization dispatch functions.
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
Parameters parameters
Holds the command line parameters.
String workspacevariables
If this is given the argument ‘all’, it simply prints a list of all workspace variables.
bool plain
Generate plain help out suitable for script processing.
std::vector< Method > methods()
Index nelem(const Lines &l)
Number of lines.
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.
String describe(ConstTensor7View x)
Describe Tensor7.
WorkspaceMemoryHandler workspace_memory_handler
The workspace memory handler Defined in workspace_ng.cc.
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.
static void define_wsv_data()
Define workspace variables.
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.
Verbosity verbosity_at_launch
The global message verbosity settings:
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.
Time time(Workspace &ws) noexcept
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.
constexpr Rational end(Rational Ju, Rational Jl, Polarization type) noexcept
Gives the largest M for a polarization type of this transition.
void open_output_file(ofstream &file, const String &name)
Open a file for writing.
bool daemon
Flag to run the docserver in the background.
void initialize()
Reset the size of the workspace.
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 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 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.
void option_methods(const String &methods)
React to option ‘methods’.
my_basic_string< char > String
The String type for ARTS.
bool check_docs
Flag to check built-in documentation.
static map< String, Index > WsvMap
Global map associated with wsv_data.
void set_file_verbosity(Index v)
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.
Vector x(Workspace &ws) noexcept
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()
Map WSV names to indices.
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.