Learn R Programming

SplitR (version 0.3)

dispersion_preset_add: Add dispersion preset information

Description

The function allows for the setting of presets specific to dispersion runs. Presets are effectively blocks of parameters that are stored on the disk. Having presets is useful because these groups of parameters can be called in different dispersion runs (and across projects) without having to specify dozens of parameters with every type of run. Furthermore, dispersion runs can utilize multiple presets of each type simply by calling the identifier for each preset (e.g., multiple predefined emissions locations can be added to a run or series of runs with a numeric vector). The presets are divided into three groups: 'emissions', 'grids', and 'species'. Each preset has a plaintext file that resides on disk of the same name (located in the SplitR folder). For removing presets from the associated files, the interactive function 'dispersion_preset_delete' can be used.

Usage

dispersion_preset_add(type, interactive = TRUE, species_name = NULL,
  particle_pdiam = NULL, particle_density = NULL,
  particle_shape_factor = NULL, ddep_velocity = NULL, ddep_MW = NULL,
  ddep_A_ratio = NULL, ddep_D_ratio = NULL, ddep_Henrys_Law_coeff = NULL,
  wdep_Henrys_Law_coeff = NULL, wdep_in_cloud_dep = NULL,
  wdep_below_cloud_dep = NULL, rad_decay = NULL,
  pollutant_resuspension_factor = NULL, emissions_name = NULL,
  emissions_rate = NULL, emissions_duration = NULL,
  emissions_start_time = NULL, grid_name = NULL, grid_center = NULL,
  grid_spacing = NULL, grid_span = NULL, grid_folder = NULL,
  grid_filename = NULL, grid_number_vertical = NULL, grid_heights = NULL,
  grid_start_time = NULL, grid_end_time = NULL,
  sampling_interval_type_rate = NULL, path_wd)

Arguments

type

the type of preset to add. The three types are "emissions", "grids", and "species". Only a single type can be specified. Once specified, the function interactively asks for input on the parameters specific to each preset.

interactive

determines whether the function should run in an interactive mode, prompting the for input on which kinds of values to supply for each parameter.

species_name

a case sensitive name that identifies the species preset. The use of a name is useful since presets can be referenced by this name when using the 'dispersion_preset_list' function.

particle_pdiam

the particle diameter in units of <U+00B5>m.

particle_density

the particle density in units of g/cm3.

particle_shape_factor

the particle shape factor as a value between 0-1.

ddep_velocity

the dry deposition velocity in units of m/s.

ddep_MW

the molecular weight in units of g/mol.

ddep_A_ratio

the dry deposition A ratio.

ddep_D_ratio

the dry deposition D ratio.

ddep_Henrys_Law_coeff

the Henry's Law value associated with dry deposition.

wdep_Henrys_Law_coeff

the Henry's Law value associated with wet deposition.

wdep_in_cloud_dep

the in-cloud wet deposition rate in units of L/L.

wdep_below_cloud_dep

the below cloud wet deposition rate in units of 1/s.

rad_decay

the rate of radioactive decay, in units of days.

pollutant_resuspension_factor

the pollutant resuspension factor in units of 1/m.

emissions_name

a case sensitive name that identifies the emissions preset. The use of a name is useful since presets can be referenced by this name when using the 'dispersion_preset_list' function.

emissions_rate

the rate of emissions for the pollutant in mass units per hour.

emissions_duration

the duration of emissions in hours.

emissions_start_time

a string specifying the start of emissions in the format "YY MM DD HH MM".

grid_name

a case sensitive name that identifies the grid preset. The use of a name is useful since presets can be referenced by this name when using the 'dispersion_preset_list' function.

grid_center

the center of the grid, specified in a string containing latitude and longitude in decimal degrees.

grid_spacing

the spacing between adjacent grid points, specified in a string containing decimal degree units of latitude and longitude.

grid_span

the span of the grid, specified in a string containing decimal degree units of latitude and longitude.

grid_folder

the location for which the grid output files will be written.

grid_filename

the name of the output grid file for each dispersion model run. This is normally given a self-describing name, based on parameters for the model run.

grid_number_vertical

the number of vertical levels for the grid.

grid_heights

the heights assigned to each level, for which the total number of levels is given in the 'grid_number_vertical' argument.

grid_start_time

a string specifying the start of sampling emissions by the grid. Should be provided in the format "YY MM DD HH MM".

grid_end_time

a string specifying the end of sampling emissions by the grid. Should be provided in the format "YY MM DD HH MM".

sampling_interval_type_rate

a sting that specifies the type of sampling, and the rate by which sampling occurs ("HH MM").

path_wd

a full path should be provided for the HYSPLIT working directory since presets will reside in this folder.

Examples

Run this code
# NOT RUN {
# Interactively add a preset for a 'emissions' input
dispersion_preset_add("emissions")

# Add a default preset for a 'species' input
dispersion_preset_add("species", interactive = FALSE,
                      species_name = 'default')

# Add a preset for a 'grids' input
dispersion_preset_add("grids", interactive = FALSE,
                      grid_name = "MainGrid",
                      grid_center = "36.5 -122.4",
                      grid_spacing = "0.05 0.05",
                      grid_span = "20 20",
                      grid_number_vertical = 5,
                      grid_heights = "0 200 400 800 1200",
                      grid_start_time = "12 02 01 12 00",
                      grid_end_time = "12 02 08 12 00")
# }

Run the code above in your browser using DataLab