The TDRP parameter file

The parameter file consists of comments and parameter values. A default parameter file may be produced using the -print_params command line argument.

An example parameter file is provided for reference.
This file matches the parameter definitions in the example paramdef file.

White space

The position of white space in the file is unimportant except in strings. New-lines, tabs and spaces are ignored except within double-quoted strings.

Comments

You may insert comments into a parameter file using either the C /* */ or C++ // style.
Lines starting with # are also considered comments.

Embedded environment variables

Environment variables may be imbedded in string values, using the syntax $(ENV_VAR), for example $(HOME) or $(USER). The environment variable will be expanded before its use by the client program.

For example,

  dir = "$(HOME)/data";
might expand to
  dir = /home/dixon/data.;

Repeated parameters

A parameter entry may appear more than once in a parameter file. In such a case, the last entry will be used and all previous entries will be ignored. No warnings are generated for repeated entries.

Single-valued parameters

These appear as:

  param_name = param_value;
For example:

  age = 10;                        // integer
  debug = FALSE;                   // boolean
  file_path = "/usr/local/junk";   // string - note quotes
  speed = 21.4;                    // float
  mode = ARCHIVE;                  // enum

1D arrays

These appear as:

  param_name = {value1, value2, value3, ... };
For example:

  ages = {10, 11, 12};                 // integer
  flags = {FALSE, TRUE, TRUE, FALSE};  // bool
  file_paths = {"/usr/local/junk",
                "$(HOME)/.cshrc",
                "/etc/printcap"},      // string
  speeds = {21.4, 10.2, 15.9};         // float
  modes = {ARCHIVE, REALTIME};         // enum
Note the use of the imbedded environment variable in file_paths. This is expanded to the environment variable value before use by the program.

If the array length is fixed, the number of elements must match the expected length.

2D arrays

These appear as:

  param_name = {{value11, value12, value13, ... },
                {value21, value22, value23, ... },
                {value31, value32, value33, ... },
                {value41, value42, value43, ... },
                ......
                {valueN1, valueN2, valueN3, ... }
               };
For example:

  // int
  item_count = {
    { 0, 5, 6, 11, 2, 3 },
    { 9, 8, 15, 12, 4, 4 },
    { 17, 18, 3, 7, 0, 12 },
    { 15, 10, 10, 1, 9, 1 }
  };

  // float
  rain_accumulation = {
    { 0.1, 0.6, 1.9, 12.4, 1.1 },
    { 2.3, 5.7, 12.8, 19.4, 0 },
    { 14.3, 19.3, 12.1, 3.3, 7.5 },
    { 8, 6.1, 0, 15.1, 10 }
  };

  // boolean
  compute_length = {
    { FALSE, FALSE, TRUE, TRUE, TRUE },
    { FALSE, FALSE, FALSE, FALSE, TRUE },
    { FALSE, TRUE, FALSE, TRUE, FALSE },
    { FALSE, FALSE, FALSE, TRUE, TRUE }
  };

  // string
  output_file_paths = {
    { "$(USER)/path11", "$(USER)/path21", "$(USER)/path31" },
    { "$(USER)/path12", "$(USER)/path22", "$(USER)/path32" },
    { "$(USER)/path13", "$(USER)/path23", "$(USER)/path33" },
    { "$(USER)/path14", "$(USER)/path24", "$(USER)/path34" },
    { "$(USER)/path15", "$(USER)/path25", "$(USER)/path35" },
    { "$(USER)/path16", "$(USER)/path26", "$(USER)/path36" }
  };

  // boolean
  mode = {
    { REALTIME, REALTIME, ARCHIVE, OTHER },
    { OTHER, ARCHIVE, ARCHIVE, REALTIME }
  };
If the array length is fixed, the number of elements for both dimensions must match the expected lengths.

Structs

Single-valued structs appear rather like 1D arrays:

 param_name = {field1, field2, field3, ...};
or

 param_name = {name1 = field1, name2 = field2, name3 = field3, ...};
The name descriptors are optional. They are useful in long printouts of large structs, to help the user identify which field is which.

For example:

  grid = { 100, 100, -50, -50, 2, 2.5 };
or
  grid = { nx = 100, ny = 100, -50, -50, 2, 2.5 };
1D struct arrays appeas like 2D other arrays:

  param_name = {{field1, field2, field3, ...},
                {field1, field2, field3, ...},
                {field1, field2, field3, ...}};
or
  param_name = {
                 {name1 = field1,
                  name2 = field2,
                  name3 =  field3, ...},
                 {name1 = field1,
                  name2 = field2,
                  name3 =  field3, ...},
                 {name1 = field1,
                  name2 = field2,
                  name3 =  field3, ...}};
Once again, the name descriptors are optional.

If the array length is fixed, the number of elements must match the expected length.

For example:

  surface_stations = {
    { 40.1012, -104.231, 10, ETI, TRUE},
    { 40.2109, -104.576, 10, GEONOR, FALSE},
    { 39.1379, -104.908, 3, CAMPBELL, FALSE}
  };

  data_field = {
    {
      scale = 0.5,
      bias = 1,
      nplanes = 16,
      name = "Reflectivity",
      units = "dBZ",
      origin = BOTLEFT
    }
    ,
    {
      scale = 0.6,
      bias = 1.1,
      nplanes = 17,
      name = "Velocity",
      units = "m/s",
      origin = TOPLEFT
    }
  };