ARTS  1.0.222
main.cc
Go to the documentation of this file.
1 /* Copyright (C) 2000, 2001 Stefan Buehler <sbuehler@uni-bremen.de>
2 
3  This program is free software; you can redistribute it and/or modify it
4  under the terms of the GNU General Public License as published by the
5  Free Software Foundation; either version 2, or (at your option) any
6  later version.
7 
8  This program is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  GNU General Public License for more details.
12 
13  You should have received a copy of the GNU General Public License
14  along with this program; if not, write to the Free Software
15  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
16  USA. */
17 
31 #include "arts.h"
32 
33 #if HAVE_CONFIG_H
34 #include "config.h"
35 #endif
36 
37 #include <algorithm>
38 #include <map>
39 #include "parameters.h"
40 #include "messages.h"
41 #include "exceptions.h"
42 #include "file.h"
43 #include "auto_wsv.h"
44 #include "methods.h"
45 #include "parser.h"
46 #include "auto_md.h"
47 #include "absorption.h"
48 #include "wsv_aux.h"
49 
50 // This must be here rather than in arts.h, because arts.h does not
51 // know about Array.
54 
55 
57 void give_up(const String& message)
58 {
59  out0 << message << '\n';
60  exit(1);
61 }
62 
63 
73 void executor(WorkSpace& workspace, const Array<MRecord>& tasklist)
74 {
75  // The method description lookup table:
76  extern const Array<MdRecord> md_data;
77 
78  // The workspace variable lookup table:
79  extern const Array<WsvRecord> wsv_data;
80 
81  // The array holding the pointers to the getaway functions:
82  extern void (*getaways[])(WorkSpace&, const MRecord&);
83 
84  // We need a place to remember which workspace variables are
85  // occupied and which aren't.
86  //
87  // For some weird reason, Arrays of bool do not work, although all
88  // other types seem to work fine. So in this case, I'll use
89  // the stl vector directly. The other place where this is done is in
90  // the function lines_per_tgCreateFromLines in m_abs.cc.
91  // FIXME: Fix this when Array<bool> works.
92  std::vector<bool> occupied(wsv_data.nelem(),false);
93 
94  out3 << "\nExecuting methods:\n";
95 
96 // for (Index i=0; i<tasklist.nelem(); ++i)
97 // {
98 // const MRecord& mrr = tasklist[i];
99 // cout << "id, input: " << mrr.Id() << ", ";
100 // print_vector(mrr.Input());
101 // cout << "id, output: " << mrr.Id() << ", ";
102 // print_vector(mrr.Output());
103 // }
104 
105 
106  for (Index i=0; i<tasklist.nelem(); ++i)
107  {
108  // Runtime method data for this method:
109  const MRecord& mrr = tasklist[i];
110  // Method data for this method:
111  const MdRecord& mdd = md_data[mrr.Id()];
112 
113  try
114  {
115  out1 << "- " << mdd.Name() << '\n';
116 
117 
118  { // Check if all specific input variables are occupied:
119  const ArrayOfIndex& v(mdd.Input());
120  for (Index s=0; s<v.nelem(); ++s)
121  if (!occupied[v[s]])
122  give_up("Method "+mdd.Name()+" needs input variable: "+
123  wsv_data[v[s]].Name());
124  }
125 
126  { // Check if all generic input variables are occupied:
127  const ArrayOfIndex& v(mrr.Input());
128  // cout << "v.nelem(): " << v.nelem() << endl;
129  for (Index s=0; s<v.nelem(); ++s)
130  if (!occupied[v[s]])
131  give_up("Generic Method "+mdd.Name()+" needs input variable: "+
132  wsv_data[v[s]].Name());
133  }
134 
135  // Call the getaway function:
136  getaways[mrr.Id()]
137  ( workspace, mrr );
138 
139  { // Flag the specific output variables as occupied:
140  const ArrayOfIndex& v(mdd.Output());
141  for (Index s=0; s<v.nelem(); ++s) occupied[v[s]] = true;
142  }
143 
144  { // Flag the generic output variables as occupied:
145  const ArrayOfIndex& v(mrr.Output());
146  for (Index s=0; s<v.nelem(); ++s) occupied[v[s]] = true;
147  }
148 
149  }
150  catch (runtime_error x)
151  {
152  out0 << "Run-time error in method: " << mdd.Name() << '\n'
153  << x.what() << '\n';
154  exit(1);
155  }
156  catch (logic_error x)
157  {
158  out0 << "Logic error in method: " << mdd.Name() << '\n'
159  << x.what() << '\n';
160  exit(1);
161  }
162  }
163 }
164 
165 
168 {
169  cerr << "Try `arts --help' for help.\n";
170  exit(1);
171 }
172 
181 {
182  // The global variable that holds the message levels for screen and file.
183  extern Messages messages;
184 
185  if ( -1 == r )
186  {
187  // Reporting was not specified, set default. (Only the
188  // important stuff to the screen, everything to the file.)
189  messages.screen = 1;
190  messages.file = 3;
191  }
192  else
193  {
194  // Reporting was specified. Check consistency and set report
195  // level accordingly.
196 
197  // Separate the two digits by taking modulo 10:
198  Index s = r / 10;
199  Index f = r % 10;
200  // cout << "s=" << s << " f=" << f << '\n';
201 
202  if ( s<0 || s>3 || f<0 || f>3 )
203  {
204  cerr << "Illegal value specified for --reporting (-r).\n"
205  << "The specified value is " << r << ", which would be\n"
206  << "interpreted as screen=" << s << ", file=" << f << ".\n"
207  << "Only values of 0-3 are allowed for screen and file.\n";
208  exit(1);
209  }
210  messages.screen = s;
211  messages.file = f;
212  }
213 }
214 
215 
223 void option_methods(const String& methods)
224 {
225  // Make global data visible:
226  extern const Array<MdRecord> md_data;
227  extern const Array<WsvRecord> wsv_data;
228  // extern const std::map<String, Index> MdMap;
229  extern const std::map<String, Index> WsvMap;
230  extern const ArrayOfString wsv_group_names;
231 
232  // This is used to count the number of matches to a query, so
233  // that `none' can be output if necessary
234  Index hitcount;
235 
236  // First check if the user gave the special name `all':
237 
238  if ( "all" == methods )
239  {
240  cout
241  << "\n*--------------------------------------------------------------*\n"
242  << "Complete list of ARTS workspace methods:\n"
243  << "----------------------------------------------------------------\n";
244  for ( Index i=0; i<md_data.nelem(); ++i )
245  {
246  cout << "- " << md_data[i].Name() << '\n';
247  }
248  cout
249  << "*--------------------------------------------------------------*\n\n";
250  return;
251  }
252 
253  // Ok, so the user has probably specified a workspace variable or
254  // workspace variable group.
255 
256  // Check if the user gave the name of a specific variable.
257  map<String, Index>::const_iterator mi =
258  WsvMap.find(methods);
259  if ( mi != WsvMap.end() )
260  {
261  // If we are here, then the given name matches a variable.
262  Index wsv_key = mi->second;
263 
264  // List generic methods:
265  hitcount = 0;
266  cout
267  << "\n*--------------------------------------------------------------*\n"
268  << "Generic methods that can generate " << wsv_data[wsv_key].Name()
269  << ":\n"
270  << "----------------------------------------------------------------\n";
271  for ( Index i=0; i<md_data.nelem(); ++i )
272  {
273  // This if statement checks whether GOutput, the list
274  // of output variable types contains the group of the
275  // requested variable.
276  if ( count( md_data[i].GOutput().begin(),
277  md_data[i].GOutput().end(),
278  wsv_data[wsv_key].Group() ) )
279  {
280  cout << "- " << md_data[i].Name() << '\n';
281  ++hitcount;
282  }
283  }
284  if ( 0==hitcount )
285  cout << "none\n";
286 
287  // List specific methods:
288  hitcount = 0;
289  cout
290  << "\n----------------------------------------------------------------\n"
291  << "Specific methods that can generate " << wsv_data[wsv_key].Name()
292  << ":\n"
293  << "----------------------------------------------------------------\n";
294  for ( Index i=0; i<md_data.nelem(); ++i )
295  {
296  // This if statement checks whether Output, the list
297  // of output variables contains the workspace
298  // variable key.
299  if ( count( md_data[i].Output().begin(),
300  md_data[i].Output().end(),
301  wsv_key ) )
302  {
303  cout << "- " << md_data[i].Name() << '\n';
304  ++hitcount;
305  }
306  }
307  if ( 0==hitcount )
308  cout << "none\n";
309 
310  cout
311  << "*--------------------------------------------------------------*\n\n";
312 
313  return;
314  }
315 
316  // Check if the user gave the name of a variable group.
317 
318  // We use the find algorithm from the STL to do this. It
319  // returns an iterator, so to get the index we take the
320  // difference to the begin() iterator.
321  Index group_key =
322  (Index)(find( wsv_group_names.begin(),
323  wsv_group_names.end(),
324  methods ) - wsv_group_names.begin());
325 
326  // group_key == wsv_goup_names.nelem() indicates that a
327  // group with this name was not found.
328  if ( group_key != wsv_group_names.nelem() )
329  {
330  // List generic methods:
331  hitcount = 0;
332  cout
333  << "\n*--------------------------------------------------------------*\n"
334  << "Generic methods that can generate variables of group "
335  << wsv_group_names[group_key] << ":\n"
336  << "----------------------------------------------------------------\n";
337  for ( Index i=0; i<md_data.nelem(); ++i )
338  {
339  // This if statement checks whether GOutput, the list
340  // of output variable types contains the
341  // requested group.
342  if ( count( md_data[i].GOutput().begin(),
343  md_data[i].GOutput().end(),
344  group_key ) )
345  {
346  cout << "- " << md_data[i].Name() << '\n';
347  ++hitcount;
348  }
349  }
350  if ( 0==hitcount )
351  cout << "none\n";
352 
353  cout
354  << "*--------------------------------------------------------------*\n\n";
355 
356  return;
357  }
358 
359  // If we are here it means that what the user specified is neither
360  // `all', nor a variable, nor a variable group.
361  cerr << "The name " << methods << " matches neither `all',\n"
362  << "nor the name of a workspace variable, nor the name\n"
363  << "of a workspace variable group.\n";
364  exit(1);
365 }
366 
374 void option_input(const String& input)
375 {
376  // Make global data visible:
377  extern const Array<MdRecord> md_data;
378  extern const Array<WsvRecord> wsv_data;
379  // extern const std::map<String, Index> MdMap;
380  extern const std::map<String, Index> WsvMap;
381  extern const ArrayOfString wsv_group_names;
382 
383  // This is used to count the number of matches to a query, so
384  // that `none' can be output if necessary
385  Index hitcount;
386 
387  // Ok, so the user has probably specified a workspace variable or
388  // workspace variable group.
389 
390  // Check if the user gave the name of a specific variable.
391  map<String, Index>::const_iterator mi =
392  WsvMap.find(input);
393  if ( mi != WsvMap.end() )
394  {
395  // If we are here, then the given name matches a variable.
396  Index wsv_key = mi->second;
397 
398  // List generic methods:
399  hitcount = 0;
400  cout
401  << "\n*--------------------------------------------------------------*\n"
402  << "Generic methods that can use " << wsv_data[wsv_key].Name() << ":\n"
403  << "----------------------------------------------------------------\n";
404  for ( Index i=0; i<md_data.nelem(); ++i )
405  {
406  // This if statement checks whether GInput, the list
407  // of input variable types contains the group of the
408  // requested variable.
409  if ( count( md_data[i].GInput().begin(),
410  md_data[i].GInput().end(),
411  wsv_data[wsv_key].Group() ) )
412  {
413  cout << "- " << md_data[i].Name() << '\n';
414  ++hitcount;
415  }
416  }
417  if ( 0==hitcount )
418  cout << "none\n";
419 
420  // List specific methods:
421  hitcount = 0;
422  cout
423  << "\n----------------------------------------------------------------\n"
424  << "Specific methods that require " << wsv_data[wsv_key].Name()
425  << ":\n"
426  << "----------------------------------------------------------------\n";
427  for ( Index i=0; i<md_data.nelem(); ++i )
428  {
429  // This if statement checks whether Output, the list
430  // of output variables contains the workspace
431  // variable key.
432  if ( count( md_data[i].Input().begin(),
433  md_data[i].Input().end(),
434  wsv_key ) )
435  {
436  cout << "- " << md_data[i].Name() << '\n';
437  ++hitcount;
438  }
439  }
440  if ( 0==hitcount )
441  cout << "none\n";
442 
443  cout
444  << "*--------------------------------------------------------------*\n\n";
445 
446  return;
447  }
448 
449  // Check if the user gave the name of a variable group.
450 
451  // We use the find algorithm from the STL to do this. It
452  // returns an iterator, so to get the index we take the
453  // difference to the begin() iterator.
454  Index group_key =
455  (Index)(find( wsv_group_names.begin(),
456  wsv_group_names.end(),
457  input ) - wsv_group_names.begin());
458 
459  // group_key == wsv_goup_names.nelem() indicates that a
460  // group with this name was not found.
461  if ( group_key != wsv_group_names.nelem() )
462  {
463  // List generic methods:
464  hitcount = 0;
465  cout
466  << "\n*--------------------------------------------------------------*\n"
467  << "Generic methods that require a variable of group "
468  << wsv_group_names[group_key] << ":\n"
469  << "----------------------------------------------------------------\n";
470  for ( Index i=0; i<md_data.nelem(); ++i )
471  {
472  // This if statement checks whether GOutput, the list
473  // of output variable types contains the
474  // requested group.
475  if ( count( md_data[i].GInput().begin(),
476  md_data[i].GInput().end(),
477  group_key ) )
478  {
479  cout << "- " << md_data[i].Name() << '\n';
480  ++hitcount;
481  }
482  }
483  if ( 0==hitcount )
484  cout << "none\n";
485 
486  cout
487  << "*--------------------------------------------------------------*\n\n";
488 
489  return;
490  }
491 
492  // If we are here it means that what the user specified is neither
493  // a variable nor a variable group.
494  cerr << "The name " << input << " matches neither the name of a\n"
495  << "workspace variable, nor the name of a workspace variable group.\n";
496  exit(1);
497 }
498 
499 
507 void option_workspacevariables(const String& workspacevariables)
508 {
509  // Make global data visible:
510  extern const Array<MdRecord> md_data;
511  extern const Array<WsvRecord> wsv_data;
512  extern const std::map<String, Index> MdMap;
513  // extern const std::map<String, Index> WsvMap;
514  extern const ArrayOfString wsv_group_names;
515 
516  // This is used to count the number of matches to a query, so
517  // that `none' can be output if necessary
518  Index hitcount;
519 
520  // First check for `all':
521 
522  if ( "all" == workspacevariables )
523  {
524  cout
525  << "\n*--------------------------------------------------------------*\n"
526  << "Complete list of ARTS workspace variables:\n"
527  << "----------------------------------------------------------------\n";
528  for ( Index i=0; i<wsv_data.nelem(); ++i )
529  {
530  cout << "- " << wsv_data[i].Name() << '\n';
531  }
532  cout
533  << "*--------------------------------------------------------------*\n\n";
534  return;
535  }
536 
537 
538  // Now check if the user gave the name of a method.
539  map<String, Index>::const_iterator mi =
540  MdMap.find(workspacevariables);
541  if ( mi != MdMap.end() )
542  {
543  // If we are here, then the given name matches a method.
544  // Assign the data record for this method to a local
545  // variable for easier access:
546  const MdRecord& mdr = md_data[mi->second];
547 
548  // List generic variables required by this method.
549  hitcount = 0;
550  cout
551  << "\n*--------------------------------------------------------------*\n"
552  << "Generic workspace variables required by " << mdr.Name()
553  << " are of type:\n"
554  << "----------------------------------------------------------------\n";
555  for ( Index i=0; i<mdr.GInput().nelem(); ++i )
556  {
557  cout << "- " << wsv_group_names[mdr.GInput()[i]] << "\n";
558  ++hitcount;
559  }
560  if ( 0==hitcount )
561  cout << "none\n";
562 
563  // List specific variables required by this method.
564  hitcount = 0;
565  cout
566  << "\n----------------------------------------------------------------\n"
567  << "Specific workspace variables required by " << mdr.Name() << ":\n"
568  << "----------------------------------------------------------------\n";
569  for ( Index i=0; i<mdr.Input().nelem(); ++i )
570  {
571  cout << "- " << wsv_data[mdr.Input()[i]].Name() << '\n';
572  ++hitcount;
573  }
574  if ( 0==hitcount )
575  cout << "none\n";
576 
577  cout
578  << "*--------------------------------------------------------------*\n\n";
579 
580  return;
581  }
582 
583  // If we are here, then the user specified nothing that makes sense.
584  cerr << "The name " << workspacevariables << " matches neither `all',\n"
585  << "nor the name of a workspace method.\n";
586  exit(1);
587 }
588 
589 
595 void option_describe(const String& describe)
596 {
597  // Make global data visible:
598  extern const Array<MdRecord> md_data;
599  extern const Array<WsvRecord> wsv_data;
600  extern const std::map<String, Index> MdMap;
601  extern const std::map<String, Index> WsvMap;
602  // extern const ArrayOfString wsv_group_names;
603 
604  // Let's first assume it is a method that the user wants to have
605  // described.
606 
607  // Find method id:
608  map<String, Index>::const_iterator i =
609  MdMap.find(describe);
610  if ( i != MdMap.end() )
611  {
612  // If we are here, then the given name matches a method.
613  cout << md_data[i->second] << '\n';
614  return;
615  }
616 
617  // Ok, let's now assume it is a variable that the user wants to have
618  // described.
619 
620  // Find wsv id:
621  i = WsvMap.find(describe);
622  if ( i != WsvMap.end() )
623  {
624  // If we are here, then the given name matches a workspace
625  // variable.
626  cout << wsv_data[i->second] << '\n';
627  return;
628  }
629 
630  // If we are here, then the given name does not match anything.
631  cerr << "The name " << describe
632  << " matches neither method nor variable.\n";
633  exit(1);
634 }
635 
636 
638 
649 {
650  // Make lookup data visible:
651  // extern const Array<MdRecord> md_data;
652  extern const ArrayOfString wsv_group_names;
653  extern const Array<WsvRecord> wsv_data;
654 
655  // Checks:
656  assert( N_WSV_GROUPS == wsv_group_names.nelem() );
657  assert( N_WSV == wsv_data.nelem() );
658 
659 }
660 
675 int main (int argc, char **argv)
676 {
677  extern const Parameters parameters; // Global variable that holds
678  // all command line parameters.
679 
680  //---------------< 1. Get command line parameters >---------------
681  if ( get_parameters(argc, argv) )
682  {
683  // Print an error message and exit:
684  polite_goodby();
685  }
686 
687  //----------< 2. Evaluate the command line parameters >----------
688  if (parameters.help)
689  {
690  // Just print a help message and then exit.
691  cerr << '\n' << parameters.usage << "\n\n";
692  cerr << parameters.helptext << "\n\n";
693  return(0);
694  }
695 
696  if (parameters.version)
697  {
698  extern const String full_name;
699  // Just print version information and then exit.
700  cerr << "This is " << full_name
701 #ifdef HDF_SUPPORT
702  << " with HDF support."
703 #endif // HDF_SUPPORT
704  << '\n'
705  << "Compiled on " << OS_NAME << " " << OS_VERSION
706  << " with "
707  << ((sizeof (Numeric) == sizeof (double)) ? "double" : "float")
708  << " precision." << endl
709  << "Compile flags: " << COMPILE_FLAGS << endl;
710  return(0);
711  }
712 
713 
714 
715  // For the next couple of options we need to have the workspce and
716  // method lookup data.
717 
718 
719  // Initialize the md data:
720  define_md_data();
721 
722  // Initialize the wsv group name array:
724 
725  // Initialize the wsv data:
726  define_wsv_data();
727 
728  // Initialize wsv pointers:
729  {
730  // We need to make the workspace and the wsv_pointers visible for
731  // a moment. This is because the pointers will be inititalized for
732  // this particular workspace. There can be other (local)
733  // workspaces, which have their own pointers associated with
734  // them.
735  extern WorkSpace workspace;
736  extern Array<WsvP*> wsv_pointers;
738  }
739 
740  // Initialize MdMap
741  define_md_map();
742 
743  // Initialize WsvMap
744  define_wsv_map();
745 
746 
747  // While we are at it, we can also initialize the molecular data and
748  // the coefficients of the partition function that we need for the
749  // absorption part, and check that the inputs are sorted the same way:
751 
752  // And also the species map:
754 
755  // And the lineshape lookup data:
758 
759  // Make all these data visible:
760  // extern const Array<MdRecord> md_data;
761  // extern const Array<WsvRecord> wsv_data;
762  // extern const std::map<String, Index> MdMap;
763  // extern const std::map<String, Index> WsvMap;
764  extern const ArrayOfString wsv_group_names;
765 
766  // Now we are set to deal with the more interesting command line
767  // switches.
768 
769 
770  // React to option `methods'. If given the argument `all', it
771  // should simply prints a list of all methods. If given the name of
772  // a variable, it should print all methods that produce this
773  // variable as output.
774  if ( "" != parameters.methods )
775  {
777  return(0);
778  }
779 
780  // React to option `input'. Given the name of a variable (or group)
781  // it should print all methods that need this variable (or group) as
782  // input.
783  if ( "" != parameters.input )
784  {
786  return(0);
787  }
788 
789  // React to option `workspacevariables'. If given the argument `all',
790  // it should simply prints a list of all variables. If given the
791  // name of a method, it should print all variables that are needed
792  // by that method.
793  if ( "" != parameters.workspacevariables )
794  {
796  return(0);
797  }
798 
799  // React to option `describe'. This should print the description
800  // String of the given workspace variable or method.
801  if ( "" != parameters.describe )
802  {
804  return(0);
805  }
806 
807 
808  // React to option `groups'. This should simply print a list of all
809  // workspace variable groups.
810  if ( parameters.groups )
811  {
812  cout
813  << "\n*--------------------------------------------------------------*\n"
814  << "Complete list of ARTS workspace variable groups:\n"
815  << "----------------------------------------------------------------\n";
816  for ( Index i=0; i<wsv_group_names.nelem(); ++i )
817  {
818  cout << "- " << wsv_group_names[i] << '\n';
819  }
820  cout
821  << "*--------------------------------------------------------------*\n\n";
822  return(0);
823  }
824 
825 
826  // Ok, we are past all the special options. This means the user
827  // wants to get serious and really do a calculation. Check if we
828  // have at least one control file:
829  if ( 0 == parameters.controlfiles.nelem() )
830  {
831  cerr << "You must specify at least one control file name.\n";
832  polite_goodby();
833  }
834 
835  // Set the basename according to the first control file, if not
836  // explicitly specified.
837  if ( "" == parameters.basename )
838  {
839  extern String out_basename;
841  // Find the last . in the name
842  String::size_type p = out_basename.rfind('.');
843  // Kill everything starting from the `.'
844  out_basename.erase(p);
845  }
846  else
847  {
848  extern String out_basename;
850  }
851 
852  // Set the reporting level, either from reporting command line
853  // option or default.
855 
856 
857  //--------------------< Open report file >--------------------
858  // This one needs its own little try block, because we have to
859  // write error messages to cerr directly since the report file
860  // will not exist.
861  try
862  {
863  extern const String out_basename; // Basis for file name
864  extern ofstream report_file; // Report file pointer
865 
866  // cout << "rep = " << out_basename+".rep" << '\n';
868  }
869  catch (runtime_error x)
870  {
871  cerr << x.what() << '\n'
872  << "I have to be able to write to my report file.";
873  exit(1);
874  }
875 
876  // Now comes the global try block. Exceptions caught after this
877  // one are general stuff like file opening errors.
878  // FIXME: Maybe this is not really necessary, since methods
879  // using files could always check for these errors? Think about
880  // which way is easier.
881  try
882  {
883  // Some global variables that we need:
884  extern WorkSpace workspace;
885  // extern Array<WsvRecord> wsv_data;
886  // extern Array<MdRecord> md_data;
887 
888  {
889  // Output program name and version number:
890  // The name (PACKAGE) and the major and minor version number
891  // (VERSION) are set in configure.in. The configuration tools
892  // place them in the file config.h, which is included in arts.h.
893 
894  extern const String full_name;
895 
896  out1 << full_name << '\n';
897  }
898 
899 
900  // The list of methods to execute and their keyword data from
901  // the control file.
902  Array<MRecord> tasklist;
903 
904  // The text of the controlfile.
905  SourceText text;
906 
907  // Read the control text from the control files:
908  out3 << "\nReading control files:\n";
909  for ( Index i=0; i<parameters.controlfiles.nelem(); ++i )
910  {
911  out3 << "- " << parameters.controlfiles[i] << '\n';
913  }
914 
915  // Call the parser to parse the control text:
916  parse_main(tasklist, text);
917 
918  // Call the executor:
919  executor(workspace, tasklist);
920 
921  }
922  catch (runtime_error x)
923  {
924  out0 << x.what() << '\n';
925  exit(1);
926  }
927 
928  out1 << "Goodbye.\n";
929  return(0);
930 }
Parameters::input
String input
This is complementary to the methods switch.
Definition: parameters.h:87
workspace
WorkSpace workspace
The workspace itself.
Definition: globals_2.cc:45
wsv_pointers
const Array< WsvP * > wsv_pointers
The array of WSV pointers.
Definition: auto_wsv_pointers.cc:19
SourceText::AppendFile
void AppendFile(const String &name)
Appends contents of file to the source text.
Definition: parser.cc:28
exceptions.h
The declarations of all the exception classes.
auto_md.h
MRecord::Input
const ArrayOfIndex & Input() const
Definition: parser.h:48
absorption.h
Declarations required for the calculation of absorption coefficients.
Parameters::reporting
Index reporting
This should be a two digit integer.
Definition: parameters.h:79
define_wsv_map
void define_wsv_map()
Define WsvMap.
Definition: workspace_aux.cc:40
Parameters::describe
String describe
Print the description String of the given workspace variable or method.
Definition: parameters.h:94
out0
Out0 out0
Level 0 output stream.
Definition: messages.cc:50
option_input
void option_input(const String &input)
React to option ‘input’.
Definition: main.cc:374
Parameters::groups
bool groups
Print a list of all workspace variable groups.
Definition: parameters.h:96
define_wsv_data
void define_wsv_data()
Define the lookup data for the workspace variables.
Definition: workspace.cc:44
MRecord
Method runtime data.
Definition: parser.h:32
Parameters::methods
String methods
If this is given the argument ‘all’, it simply prints a list of all methods.
Definition: parameters.h:83
Messages
The verbosity level for screen and file output.
Definition: messages.h:63
messages
Messages messages
Verbosity levels.
Definition: messages.cc:45
MdRecord::Output
const ArrayOfIndex & Output() const
Definition: methods.h:80
define_wsv_pointers
void define_wsv_pointers(Array< WsvP * > &wsv_pointers, WorkSpace &workspace)
Definition: auto_wsv_pointers.cc:21
Parameters::helptext
String helptext
Longer message explaining the options.
Definition: parameters.h:60
wsv_data
const Array< WsvRecord > wsv_data
Definition: workspace.cc:42
executor
void executor(WorkSpace &workspace, const Array< MRecord > &tasklist)
The arts executor.
Definition: main.cc:73
N_WSV_GROUPS
#define N_WSV_GROUPS
Definition: auto_wsv_groups.h:21
WsvMap
std::map< String, Index > WsvMap
Definition: workspace_aux.cc:38
MdRecord::Input
const ArrayOfIndex & Input() const
Definition: methods.h:81
Parameters::controlfiles
ArrayOfString controlfiles
The filenames of the controlfiles.
Definition: parameters.h:71
Array
This can be used to make arrays out of anything.
Definition: array.h:48
Parameters::basename
String basename
If this is specified (with the -b –basename option), it is used as the base name for the report file ...
Definition: parameters.h:68
MdMap
std::map< String, Index > MdMap
The map associated with md_data.
Definition: globals_2.cc:56
full_name
String full_name
The ARTS running version number.
Definition: version.cc:32
define_md_data
void define_md_data()
Define the lookup data for the workspace methods.
Definition: methods.cc:42
messages.h
Declarations having to do with the four output streams.
Messages::screen
Index screen
Verbosity of screen output.
Definition: messages.h:69
give_up
void give_up(const String &message)
Print the error message and exit.
Definition: main.cc:57
my_basic_string< char >
out1
Out1 out1
Level 1 output stream.
Definition: messages.cc:52
Numeric
NUMERIC Numeric
The type to use for all floating point numbers.
Definition: arts.h:147
get_parameters
bool get_parameters(int argc, char **argv)
Get the command line parameters.
Definition: parameters.cc:36
define_lineshape_data
void define_lineshape_data()
Definition: lineshapes.cc:2064
wsv_group_names
ArrayOfString wsv_group_names
Definition: groups.cc:36
report_file
ofstream report_file
The report file.
Definition: messages.cc:41
define_species_map
void define_species_map()
Define the species data map.
Definition: absorption.cc:64
define_wsv_group_names
void define_wsv_group_names()
Define the array of workspace variable group names.
Definition: groups.cc:51
main
int main(int argc, char **argv)
This is the main function of ARTS.
Definition: main.cc:675
set_reporting_level
void set_reporting_level(Index r)
Set the reporting level, either the default or based on reporting.
Definition: main.cc:180
MdRecord::Name
const String & Name() const
Definition: methods.h:78
check_built_headers
void check_built_headers()
Checks the dimensions of stuff in generated headers.
Definition: main.cc:648
SourceText
A smart class to hold the text for parsing.
Definition: parser.h:74
MdRecord::GInput
const ArrayOfIndex & GInput() const
Definition: methods.h:83
parameters.h
This file contains header information for the dealing with command line parameters.
out_basename
String out_basename
The basename for the report file and for all other output files.
Definition: messages.cc:38
open_output_file
void open_output_file(ofstream &file, const String &name)
Open a file for writing.
Definition: file.cc:91
define_lineshape_norm_data
void define_lineshape_norm_data()
Definition: lineshapes.cc:2161
WorkSpace
The declaration of the (great) workspace.
Definition: auto_wsv.h:90
polite_goodby
void polite_goodby()
Remind the user of –help and exit return value 1.
Definition: main.cc:167
md_data
Array< MdRecord > md_data
The lookup information for the workspace methods.
Definition: globals_2.cc:53
out3
Out3 out3
Level 3 output stream.
Definition: messages.cc:56
N_WSV
#define N_WSV
Definition: auto_wsv.h:19
parser.h
Index
INDEX Index
The type to use for all integer numbers and indices.
Definition: arts.h:153
MdRecord
This class contains all information for one workspace method.
Definition: methods.h:35
getaways
void(* getaways[])(WorkSpace &, const MRecord &)
Definition: auto_md.cc:1659
Parameters
Structure to hold all command line Parameters.
Definition: parameters.h:42
Parameters::version
bool version
Display version information.
Definition: parameters.h:64
parameters
Parameters parameters
Holds the command line parameters.
Definition: parameters.cc:34
option_methods
void option_methods(const String &methods)
React to option ‘methods’.
Definition: main.cc:223
MRecord::Id
Index Id() const
Definition: parser.h:45
parse_main
void parse_main(Array< MRecord > &tasklist, SourceText &text)
The main function of the parser.
Definition: parser.cc:1033
Parameters::usage
String usage
Short message how to call the program.
Definition: parameters.h:58
option_workspacevariables
void option_workspacevariables(const String &workspacevariables)
React to option ‘workspacevariables’.
Definition: main.cc:507
Messages::file
Index file
Verbosity of file output.
Definition: messages.h:71
file.h
This file contains basic functions to handle ASCII and binary (HDF) data files.
option_describe
void option_describe(const String &describe)
React to option ‘describe’.
Definition: main.cc:595
Parameters::workspacevariables
String workspacevariables
If this is given the argument ‘all’, it simply prints a list of all workspace variables.
Definition: parameters.h:91
define_species_data
void define_species_data()
Definition: species_data.cc:132
define_md_map
void define_md_map()
Define MdMap.
Definition: methods_aux.cc:37
Parameters::help
bool help
Only display the help text.
Definition: parameters.h:62
Array::nelem
Index nelem() const
Number of elements.
Definition: array.h:115
methods.h
Declaration of the class MdRecord.
wsv_aux.h
Auxiliary header stuff related to workspace variable groups.
MRecord::Output
const ArrayOfIndex & Output() const
Definition: parser.h:47
auto_wsv.h
Declares the enum type that acts as a handle for workspace variables. Also declares the workspace its...
arts.h
The global header file for ARTS.