inmap

package module
v1.9.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 20, 2022 License: GPL-3.0 Imports: 35 Imported by: 2

README

(In)tervention (M)odel for (A)ir (P)ollution

Code check Coverage Status Go Reference Go Report Card

Note: This is the documentation for InMAP v1.9.0. Documentation for other versions is available here.

Visit the InMAP website at https://inmap.run!

About InMAP

InMAP is a multi-scale emissions-to-health impact model for fine particulate matter (PM2.5) that mechanistically evaluates air quality and health benefits of perturbations to baseline emissions. A main simplification of InMAP compared to a comprehensive chemical transport model is that it does so on an annual-average basis rather than the highly time-resolved performance of a full CTM. The model incorporates annual-average parameters (e.g. transport, deposition, and reaction rates) from the a chemical transport model. Grid-cell size varies as shown in Figure 1, ranging from smaller grid cells in urban areas to larger grid cells in rural areas. This variable resolution grid is used to simulate population exposures to PM2.5 with high spatial resolution while minimizing computational expense.

alt tag Figure 1: InMAP spatial discretization of the model domain into variable resolution grid cells. Left panel: full domain; right panel: a small section of the domain centered on the city of Los Angeles.

Getting InMAP

Go to releases to download the most recent release for your type of computer. For Mac systems, download the file with "darwin" in the name. You will need both the executable program and the input data ("evaldata_vX.X.X.zip"). All of the versions of the program are labeled "amd64" to denote that they are for 64-bit processors (i.e., all relatively recent notebook and desktop computers). It doesn't matter whether your computer processor is made by AMD or another brand, it should work either way.

Compiling from source

You can also compile InMAP from its source code. The instructions here are specific to Linux or Mac computers; other systems should work with minor changes to the commands below. Refer here for a list of theoretically supported systems.

  1. Install the Go compiler, version 1.11 or higher. Make sure you install the correct version (64 bit) for your system. It may be useful to go through one of the tutorials to make sure the compiler is correctly installed.

  2. Install the git version control program, if it is are not already installed.

  3. Download and install the main program:

    git clone https://github.com/spatialmodel/inmap.git # Download the code.
    cd inmap # Move into the InMAP directory
    GO111MODULE=on go build ./cmd/inmap # Compile the InMAP executable.
    

    There should now be a file named inmap or inmap.exe in the current dirctory. This is the inmap executable file. It can be copied or moved to any directory of your choosing and run as described below in "Running InMAP".

  4. Optional: run the tests:

    cd /path/to/inmap # Move to the directory where InMAP is downloaded,
    # if you are not already there.
    GO111MODULE=on go test ./... -short
    

Running InMAP

  1. Make sure that you have downloaded the InMAP input data files: evaldata_vX.X.X.zip from the InMAP release page, where X.X.X corresponds to a version number. The data files may need to be downloaded from a separate link included in the release information rather than directly from the release page.

  2. Create an emissions scenario or use one of the evaluation emissions datasets available in the evaldata_vX.X.X.zip files on the InMAP release page. Emissions files should be in shapefile format where the attribute columns correspond to the names of emitted pollutants. The acceptable pollutant names are VOC, NOx, NH3, SOx, and PM2_5. Emissions units can be specified in the configuration file (discussed below) and can be short tons per year, kilograms per year, or micrograms per second. The model can handle multiple input emissions files, and emissions can be either elevated or ground level. Files with elevated emissions need to have attribute columns labeled "height", "diam", "temp", and "velocity" containing stack information in units of m, m, K, and m/s, respectively. Emissions will be allocated from the geometries in the shape file to the InMAP computational grid.

  3. Make a copy of the configuration file template and edit it if desired, keeping in mind that you will either need to set the evaldata environment variable to the directory you downloaded the evaluation data to, or replace all instances of ${evaldata} in the configuration file with the path to that directory. You must also ensure that the directory OutputFile is to go in exists. Refer to the documentation here for information about other configuration options. The configuration file is a text file in TOML format, and any changes made to the file will need to conform to that format or the model will not run correctly and will produce an error.

  4. Run the program:

     inmapXXX run steady --config=/path/to/configfile.toml
    

    where inmapXXX is replaced with the executable file that you downloaded. For some systems you may need to type ./inmapXXX instead. If you compiled the program from source, the command will just be inmap for Linux or Mac systems and inmap.exe for Windows systems.

    The above command runs the model in the most typical mode. For alternative run modes and other command options refer here.

  5. View the program output. The output files are in shapefile format which can be viewed in most GIS programs. One free GIS program is QGIS. By default, the InMAP only outputs ground-level, but this can be changed using the configuration file.

    Output variables are specified as OutputVariables in the configuration file. Each output variable is defined in the configuration file by its name and an expression that can be used to calculate it (in the form VariableName = "Expression"). Output variable names can be chosen by the user, but their corresponding expressions must consist of variables that are understood by InMAP. Note that output variable names should have a length of 10 characters or less because there is a limit on the allowed length of shapefile field names.

    In the case of a variable that is built into the model, e.g. WindSpeed, an acceptable entry in the configuration file would be WindSpeed = "WindSpeed". If double WindSpeed is desired as an output variable, an acceptable entry in the configuration file would be DoubleWind = "WindSpeed*2". A user-defined variable such as DoubleWind can then appear in an separate expression, e.g. ExpTwoWind = "exp(DoubleWind)" where the DoubleWind is exponentiated. Note that expressions can include functions such as exp(). For more information on the available functions refer to the source code documentation (here).

    Output variable expressions are, by default, evaluated within each grid cell. By surrounding an expression with braces ({...}), InMAP can instead perform summary calculations (evaluating the expression across all grid cells). InMAP has a built-in function sum() that can be used for such grid level calculations. For example, an expression for a variable NPctWNoLat, representing the percentage of the total US population that is Non-Latino White, would be NPctWNoLat = "{sum(WhiteNoLat) / sum(TotalPop)}". Only the part of the expression inside of the braces is evaluated at the grid level. NPctWNoLat could then be used as a variable in expressions evaluated at the grid cell level, e.g, WhNoLatDiff = "PctWhNoLat - NPctWNoLat", representing the difference between the percentage of the population of each grid cell that is white and the percentage of the total US population that is white.

    There is a complete list of built-in variables here. Some examples include:

    • Pollutant concentrations in units of μg m-3:
      • VOC (VOC)
        • NOx (NOx)
        • NH3 (NH3)
        • SOx (SOx)
        • Total PM2.5 (TotalPM25; The sum of all PM2.5 components)
        • Primary PM2.5 (PrimaryPM25)
        • Particulate sulfate (pSO4)
        • Particulate nitrate (pNO3)
        • Particulate ammonium (pNH4)
        • Secondary organic aerosol (SOA)
    • Populations of different demographic subgroups are in units of people per grid cell. The included populations may vary depending on input data, but in the default dataset as of this writing the groups included are:
      • total population (TotalPop)
      • people identifying as Asian (Asian), Black (Black), Latino (Latino), Native American or American Indian (Native), and Non-Latino White (WhiteNoLat).
    • Mortality rates for the total population and/or different demographic subgroups, which can be used to perform health impact calculations, are in units of deaths per year per 100,000 people. Each mortality rate is mapped to a unique corresponding population group in the configuration file, e.g. AllCause = "TotalPop" or AsianMort = "Asian". Each mortality rate will be weighted by its corresponding population group when mortality rates are allocated to the grid cell level. The included mortality rates may vary depending on input data, but in the default dataset as of this writing baseline mortality rates are included for the following groups:
      • total poplation (AllCause)
      • people identifying as asian (AsianMort), black (BlackMort), latino (LatinoMort), native american or american indian (NativeMort), and non-latino white (WhNoLMort).
    • Numbers of deaths attributable to PM2.5 in each of the populations are obtained by defining an expression in the configuration file based on the variables TotalPM25, the population variable of interest, and the overall or population-specific mortality rate. For example, deaths among the total population could be calculated with the following entry in the configuration file: TotalPopD = "(exp(log(1.078)/10 * TotalPM25) - 1) * TotalPop * AllCause / 100000". Numbers of deaths are measured in units of deaths/year.
Running the preprocessor

InMAP includes a preprocessor to convert chemical transport model (CTM) output into InMAP meteorology and baseline chemistry input data. Unlike the main InMAP model, the preprocessor only needs to be run once for each spatiotemporal domain. Users that would like to use a different spatial or temporal domain than what is included with the InMAP download can obtain CTM output for that domain and run the preprocessor themselves. The WRF-Chem and GEOS-Chem CTMs are currently supported. Information on how to run the preprocessor is here, and information regarding preprocessor configuration is here.

API

The InMAP package is split into an executable program and an application programming interface (API). The documentation here shows the functions available in the API and how they work.

Documentation

Overview

Package inmap is an air quality model for predicting health impacts of air pollutant emissions.

Index

Constants

View Source
const (
	// Version gives the version number.
	Version = "1.9.0"

	// VarGridDataVersion gives the version of the variable grid data reuquired by
	// this version of the software.
	VarGridDataVersion = "1.6.1"

	// InMAPDataVersion is the version of the InMAP data required by this version
	// of the software.
	InMAPDataVersion = "1.2.0"
)
View Source
const (
	MWa = 28.97 // g/mol, molar mass of air

	// Chemical mass conversions [ratios]
	NOxToN = mwN / mwNOx
	NtoNO3 = mwNO3 / mwN
	SOxToS = mwS / mwSO2
	StoSO4 = mwSO4 / mwS
	NH3ToN = mwN / mwNH3
	NtoNH4 = mwNH4 / mwN
)

physical constants

View Source
const (
	// TestGridSR is a spatial reference for testing.
	TestGridSR = `` /* 432-byte string literal not displayed */
	// TestPopulationShapefile is a population shapefile for testing.
	TestPopulationShapefile = "tempPopulation.shp"
	// TestMortalityShapefile is mortality rate shapefile for testing.
	TestMortalityShapefile = "tempMortality.shp"
	// TestCTMDataFile is a CTMData file for testing.
	TestCTMDataFile = "tempCTMData.ncf"
)

Variables

View Source
var PolNames = []string{"gOrg", "pOrg",
	"PM2_5",
	"gNH", "pNH",
	"gS", "pS",
	"gNO", "pNO",
}

PolNames are the names of pollutants within the model

USGSseinfeld lookup table to go from USGS land classes to land classes for particle dry deposition.

USGSwesely lookup table to go from USGS land classes to land classes for gas dry deposition.

View Source
var USGSz0 = []float64{.50, .1, .06, .1, 0.095, .20, .11,
	.03, .035, .15, .50, .50, .50, .50, .35, 0.0001, .20, .40,
	.01, .10, .30, .15, .075, 0.001, .01, .15, .01}

USGSz0 holds Roughness lengths for USGS land classes ([m]), from WRF file VEGPARM.TBL.

View Source
var WriteTestPopShapefile = func() {
	// holder for test population data.
	type pop struct {
		geom.Polygon
		TotalPop, WhiteNoLat, Black, Native, Asian, Latino float64
	}

	popData := []pop{
		{
			Polygon: []geom.Path{{
				geom.Point{X: -3999, Y: -3999},
				geom.Point{X: -3899, Y: -3999},
				geom.Point{X: -3899, Y: -3899},
				geom.Point{X: -3999, Y: -3899},
				geom.Point{X: -3999, Y: -3999},
			}},
			TotalPop:   100000.,
			WhiteNoLat: 50000.,
			Black:      20000.,
			Asian:      8000.,
			Native:     2000.,
			Latino:     20000.,
		},
		{
			Polygon: []geom.Path{{
				geom.Point{X: -3499, Y: -3001},
				geom.Point{X: -3501, Y: -3001},
				geom.Point{X: -3501, Y: -2999},
				geom.Point{X: -3499, Y: -2999},
				geom.Point{X: -3499, Y: -3001},
			}},
			TotalPop:   0.,
			WhiteNoLat: 0.,
			Black:      0.,
			Asian:      0.,
			Native:     0.,
			Latino:     10000.,
		},
	}
	e, err := shp.NewEncoder(TestPopulationShapefile, pop{})
	if err != nil {
		panic(err)
	}
	for _, p := range popData {
		if err = e.Encode(p); err != nil {
			panic(err)
		}
	}
	e.Close()
	f, err := os.Create(strings.TrimRight(TestPopulationShapefile, ".shp") + ".prj")
	if err != nil {
		panic(err)
	}
	if _, err = f.Write([]byte(TestGridSR)); err != nil {
		panic(err)
	}
	f.Close()
}

WriteTestPopShapefile writes out a population shapefile for testing.

Functions

func CreateTestCTMData added in v1.4.1

func CreateTestCTMData() (VarGridConfig, *CTMData)

CreateTestCTMData creates example CTMData for testing.

func DeleteShapefile added in v1.4.1

func DeleteShapefile(fname string) error

DeleteShapefile deletes the named shapefile.

func Regrid added in v1.2.0

func Regrid(oldGeom, newGeom []geom.Polygonal, oldData []float64) (newData []float64, err error)

Regrid regrids concentration data from one spatial grid to a different one.

func VarGridTestData added in v1.4.1

VarGridTestData returns some test data for variable grid generation.

func WriteTestMortalityShapefile added in v1.4.1

func WriteTestMortalityShapefile()

WriteTestMortalityShapefile writes out a mortality rate shapefile for testing.

Types

type CTMData added in v1.2.0

type CTMData struct {

	// Data is a map of information about processed CTM variables,
	// with the keys being the variable names.
	Data map[string]struct {
		Dims        []string           // netcdf dimensions for this variable
		Description string             // variable description
		Units       string             // variable units
		Data        *sparse.DenseArray // variable data
	}
	// contains filtered or unexported fields
}

CTMData holds processed data from a chemical transport model

func CombineCTMData added in v1.7.0

func CombineCTMData(nests ...*CTMData) (*CTMData, error)

CombineCTMData returns the combination of the input data nests. The output will have the extent of the first nest and the horizontal resolution of the highest resolution nest. It is assumed that the nests fit neatly inside each other; no interpolation will be performed. The input nests will be overlayed onto the output in the provided order, so each sequential nest will write over any previous nest(s) that it overlaps with. Vertical layers are assumed to be the same among all nests; no vertical layer interpolation is performed. If the nests do not all have the same number of layers, an error will be returned.

func Preprocess added in v1.4.1

func Preprocess(p Preprocessor, xo, yo, dx, dy float64) (*CTMData, error)

Preprocess returns preprocessed InMAP input data based on the information available from the given preprocessor. x0 and y0 are the left and y coordinates of the lower-left corner of the domain, and dx and dy are the x and y edge lengths of the grid cells, respectively.

func (*CTMData) AddVariable added in v1.2.0

func (d *CTMData) AddVariable(name string, dims []string, description, units string, data *sparse.DenseArray)

AddVariable adds data for a new variable to d.

func (*CTMData) Write added in v1.2.0

func (d *CTMData) Write(w *os.File) error

Write writes d to netcdf file w.

type Cell

type Cell struct {
	geom.Polygonal                // Cell geometry
	WebMapGeom     geom.Polygonal // Cell geometry in web map (mercator) coordinate system

	UAvg       float64 `desc:"Average East-West wind speed" units:"m/s"`
	VAvg       float64 `desc:"Average North-South wind speed" units:"m/s"`
	WAvg       float64 `desc:"Average up-down wind speed" units:"m/s"`
	UDeviation float64 `desc:"Average deviation from East-West velocity" units:"m/s"`
	VDeviation float64 `desc:"Average deviation from North-South velocity" units:"m/s"`

	AOrgPartitioning float64 `desc:"Organic particle partitioning" units:"fraction particles"`
	BOrgPartitioning float64 // particle fraction
	SPartitioning    float64 `desc:"Sulfur particle partitioning" units:"fraction particles"`
	NOPartitioning   float64 `desc:"Nitrate particle partitioning" units:"fraction particles"`
	NHPartitioning   float64 `desc:"Ammonium particle partitioning" units:"fraction particles"`
	SO2oxidation     float64 `desc:"SO2 oxidation to SO4 by HO and H2O2" units:"1/s"`

	ParticleWetDep float64 `desc:"Particle wet deposition" units:"1/s"`
	SO2WetDep      float64 `desc:"SO2 wet deposition" units:"1/s"`
	OtherGasWetDep float64 `desc:"Wet deposition: other gases" units:"1/s"`
	ParticleDryDep float64 `desc:"Particle dry deposition" units:"m/s"`

	NH3DryDep float64 `desc:"Ammonia dry deposition" units:"m/s"`
	SO2DryDep float64 `desc:"SO2 dry deposition" units:"m/s"`
	VOCDryDep float64 `desc:"VOC dry deposition" units:"m/s"`
	NOxDryDep float64 `desc:"NOx dry deposition" units:"m/s"`

	Kzz   float64 `desc:"Grid center vertical diffusivity after applying convective fraction" units:"m²/s"`
	Kxxyy float64 `desc:"Grid center horizontal diffusivity" units:"m²/s"`

	M2u float64 `desc:"ACM2 upward mixing (Pleim 2007)" units:"1/s"`
	M2d float64 `desc:"ACM2 downward mixing (Pleim 2007)" units:"1/s"`

	PopData  []float64 // Population for multiple demographics [people/grid cell]
	MortData []float64 // Baseline mortality rates for multiple demographics [Deaths per 100,000 people per year/grid cell]

	Dx     float64 `desc:"Cell x length" units:"m"`
	Dy     float64 `desc:"Cell y length" units:"m"`
	Dz     float64 `desc:"Cell z length" units:"m"`
	Volume float64 `desc:"Cell volume" units:"m³"`

	Ci        []float64 // concentrations at beginning of time step [μg/m³]
	Cf        []float64 // concentrations at end of time step [μg/m³]
	EmisFlux  []float64 // emissions [μg/m³/s]
	CBaseline []float64 // Total baseline PM2.5 concentration.

	Layer       int     `desc:"Vertical layer index" units:"-"`
	LayerHeight float64 `desc:"Height at layer bottom" units:"m"`

	Temperature                float64 `desc:"Average temperature" units:"K"`
	WindSpeed                  float64 `desc:"RMS wind speed" units:"m/s"`
	WindSpeedInverse           float64 `desc:"RMS wind speed inverse" units:"(m/s)^(-1)"`
	WindSpeedMinusThird        float64 `desc:"RMS wind speed^(-1/3)" units:"(m/s)^(-1/3)"`
	WindSpeedMinusOnePointFour float64 `desc:"RMS wind speed^(-1.4)" units:"(m/s)^(-1.4)"`
	S1                         float64 `desc:"Stability parameter" units:"?"`
	SClass                     float64 `desc:"Stability class" units:"0=Unstable; 1=Stable"`

	Index                 [][2]int // Index gives this cell's place in the nest structure.
	AboveDensityThreshold bool
	// contains filtered or unexported fields
}

Cell holds the state of a single grid cell.

func (*Cell) IsPlumeIn added in v1.2.0

func (c *Cell) IsPlumeIn(stackHeight, stackDiam, stackTemp, stackVel float64) (bool, float64, error)

IsPlumeIn calculates whether the plume rise from an emission is at the height of c when given stack information (see github.com/ctessum/atmos/plumerise for required units). The return values are whether the plume rise ends within the current cell, the height of the plume rise in meters, and whether there was an error.

func (*Cell) SetEmissionsFlux added in v1.7.0

func (c *Cell) SetEmissionsFlux(e *Emissions, m Mechanism) error

SetEmissionsFlux sets the emissions flux for the receiver based on the emissions in e.

func (*Cell) String added in v1.2.0

func (c *Cell) String() string

type CellManipulator added in v1.2.0

type CellManipulator func(c *Cell, Dt float64)

CellManipulator is a class of functions that operate on a single grid cell, using the given timestep Dt [seconds].

func AddEmissionsFlux added in v1.2.0

func AddEmissionsFlux() CellManipulator

AddEmissionsFlux adds emissions to c.Cf and sets c.Ci equal to c.Cf. It should be run once for each timestep, and it should not be run in parallel with other CellManipulators.

func MeanderMixing added in v1.2.0

func MeanderMixing() CellManipulator

MeanderMixing returns a function that calculates changes in concentrations caused by meanders: adevection that is resolved by the underlying comprehensive chemical transport model but is not resolved by InMAP.

func Mixing added in v1.2.0

func Mixing() CellManipulator

Mixing returns a function that calculates vertical mixing based on Pleim (2007), which is combined local-nonlocal closure scheme, for boundary layer and based on Wilson (2004) for above the boundary layer. Also calculate horizontal mixing.

func UpwindAdvection added in v1.2.0

func UpwindAdvection() CellManipulator

UpwindAdvection returns a function that calculates advection in the cell based on the upwind differences scheme.

type ConvergenceStatus added in v1.2.0

type ConvergenceStatus struct {
	// contains filtered or unexported fields
}

ConvergenceStatus holds the percent difference for each pollutant between the last convergence check and this one.

func (ConvergenceStatus) String added in v1.2.0

func (c ConvergenceStatus) String() string

type DomainManipulator added in v1.2.0

type DomainManipulator func(d *InMAP) error

DomainManipulator is a class of functions that operate on the entire InMAP domain.

func Calculations added in v1.2.0

func Calculations(calculators ...CellManipulator) DomainManipulator

Calculations returns a function that concurrently runs a series of calculations on all of the model grid cells.

func Load added in v1.2.0

func Load(r io.Reader, config *VarGridConfig, emis *Emissions, m Mechanism) DomainManipulator

Load returns a function that loads the data from a previously Saved file into an InMAP object.

func Log added in v1.2.0

Log sends simulation status messages to c.

func ResetCells added in v1.2.0

func ResetCells() DomainManipulator

ResetCells clears concentration and emissions information from all of the grid cells and boundary cells.

func RunPeriodically added in v1.2.0

func RunPeriodically(period float64, f DomainManipulator) DomainManipulator

RunPeriodically runs f periodically during the simulation, with the time in seconds between runs specified by period.

func Save added in v1.2.0

func Save(w io.Writer) DomainManipulator

Save returns a function that saves the data in d to a gob file (format description at https://golang.org/pkg/encoding/gob/).

func SetTimestepCFL added in v1.2.0

func SetTimestepCFL() DomainManipulator

SetTimestepCFL returns a function that sets the time step using the Courant–Friedrichs–Lewy (CFL) condition for advection or Von Neumann stability analysis (http://en.wikipedia.org/wiki/Von_Neumann_stability_analysis) for diffusion, whichever one yields a smaller time step.

func SteadyStateConvergenceCheck added in v1.2.0

func SteadyStateConvergenceCheck(numIterations int, popGridColumn string, m Mechanism, c chan ConvergenceStatus) DomainManipulator

SteadyStateConvergenceCheck checks whether a steady-state simulation is finished and sets the Done flag if it is. If numIterations > 0, the simulation is finished after that number of iterations have completed. Otherwise, the simulation has finished if the change in mass and population-weighted concentration of each pollutant in the domain since the last check are both less than 0.1%. Checks occur every 3 hours of simulation time. popGridColumn is the name of the population type used to determine grid cell sizes as in VarGridConfig.PopGridColumn. c is a channel over which the percent change between checks is sent. If c is nil, no status updates will be sent.

type EmisRecord added in v1.2.0

type EmisRecord struct {
	geom.Geom
	VOC, NOx, NH3, SOx float64 // emissions [μg/s]
	PM25               float64 `shp:"PM2_5"` // emissions [μg/s]
	Height             float64 // stack height [m]
	Diam               float64 // stack diameter [m]
	Temp               float64 // stack temperature [K]
	Velocity           float64 // stack velocity [m/s]
}

EmisRecord is a holder for an emissions record.

func FromAEP added in v1.4.1

func FromAEP(r []aep.RecordGridded, grids []*aep.GridDef, gi int, VOC, NOx, NH3, SOx, PM25 []aep.Pollutant) ([]*EmisRecord, error)

FromAEP converts the given AEP (github.com/spatialmodel/inmap/emissions/aep) records to EmisRecords using the given grid definitions and grid index gi. VOC, NOx, NH3, SOx, and PM25 are lists of AEP Polluants that should be mapped to those InMAP species. The returned EmisRecords will be grouped as much as possible to minimize the number of records.

type Emissions added in v1.2.0

type Emissions struct {

	// Mask specifies the region that emissions should be clipped
	// to. It is assumed to use the same spatial reference as the
	// InMAP computational grid. It is ignored if nil.
	Mask geom.Polygon
	// contains filtered or unexported fields
}

Emissions is a holder for input emissions data.

func NewEmissions added in v1.2.0

func NewEmissions() *Emissions

NewEmissions Initializes a new emissions holder.

func ReadEmissionShapefiles added in v1.2.0

func ReadEmissionShapefiles(gridSR *proj.SR, units string, c chan string, mask geom.Polygon, shapefiles ...string) (*Emissions, error)

ReadEmissionShapefiles returns the emissions data in the specified shapefiles, and converts them to the spatial reference gridSR. Input units are specified by units; options are tons/year, kg/year, ug/s, and μg/s. Output units = μg/s. c is a channel over which status updates will be sent. If c is nil, no updates will be sent. mask specifies the region that emissions should be clipped to, assumed to use the same spatial reference as the InMAP grid. If mask is nil it will be ignored.

func (*Emissions) Add added in v1.2.0

func (e *Emissions) Add(er *EmisRecord)

Add adds an emissions record to the receiver, clipping it to the Mask if necessary.

func (*Emissions) EmisRecords added in v1.4.1

func (e *Emissions) EmisRecords() []*EmisRecord

EmisRecords returns all EmisRecords stored in the receiver.

type GEOSChem added in v1.4.1

type GEOSChem struct {
	// contains filtered or unexported fields
}

GEOSChem is an InMAP preprocessor for GEOS-Chem output. Information regarding GEOS-Chem output variables is available from http://wiki.seas.harvard.edu/geos-chem/index.php/List_of_GEOS-FP_met_fields and http://wiki.seas.harvard.edu/geos-chem/index.php/Species_in_GEOS-Chem.

func NewGEOSChem added in v1.4.1

func NewGEOSChem(GEOSA1, GEOSA3Cld, GEOSA3Dyn, GEOSI3, GEOSA3MstE, GEOSApBp, GEOSChemOut, OlsonLandMap, startDate, endDate string, dash bool, chemRecordStr, chemFileStr string, noChemHour bool, msgChan chan string) (*GEOSChem, error)

NewGEOSChem initializes a GEOS-Chem preprocessor from the given configuration information.

GEOSA1 is the location of the GEOS 1-hour time average files. [DATE] should be used as a wild card for the simulation date.

GEOSA3Cld is the location of the GEOS 3-hour average cloud parameter files. [DATE] should be used as a wild card for the simulation date.

GEOSA3Cld is the location of the GEOS 3-hour average dynamical parameter files. [DATE] should be used as a wild card for the simulation date.

GEOSI3 is the location of the GEOS 3-hour instantaneous parameter files. [DATE] should be used as a wild card for the simulation date.

GEOSA3MstE is the location of the GEOS 3-hour average moist parameters on level edges files. [DATE] should be used as a wild card for the simulation date.

geosApBp is the location of the pressure level variable file. It is optional; if it is not specified the Ap and Bp information will be extracted from the geosChem file.

GEOSChemOut is the location of GEOS-Chem output files. [DATE] should be used as a wild card for the simulation date.

OlsonLandMap is the location of the GEOS-Chem Olson land use map file, which is described here: http://wiki.seas.harvard.edu/geos-chem/index.php/Olson_land_map

startDate and endDate are the dates of the beginning and end of the simulation, respectively, in the format "YYYYMMDD".

If dash is true, GEOS-Chem chemical variable names are assumed to be in the form 'IJ-AVG-S__xxx'. If dash is false, they are assumed to be in the form 'IJ_AVG_S_xxx'.

If msgChan is not nil, status messages will be sent to it.

chemRecordInterval is the time interval between different records in the GEOS-Chem output. It is specified by the user as a string (chemRecordStr), e.g. "3h" for 3 hours.

chemFileInterval is the time interval of each file. It is specified as a string (chemFileStr), e.g. "3h" for 3 hours.

If noChemHour is true, then the GEOS-Chem output files will be assumed to not contain a time dimension.

func (*GEOSChem) ALT added in v1.4.1

func (gc *GEOSChem) ALT() NextData

ALT helps fulfill the Preprocessor interface, returning inverse air density m3/kg.

func (*GEOSChem) ASOA added in v1.4.1

func (gc *GEOSChem) ASOA() NextData

ASOA helps fulfill the Preprocessor interface.

func (*GEOSChem) AVOC added in v1.4.1

func (gc *GEOSChem) AVOC() NextData

AVOC helps fulfill the Preprocessor interface.

func (*GEOSChem) BSOA added in v1.4.1

func (gc *GEOSChem) BSOA() NextData

BSOA helps fulfill the Preprocessor interface.

func (*GEOSChem) BVOC added in v1.4.1

func (gc *GEOSChem) BVOC() NextData

BVOC helps fulfill the Preprocessor interface.

func (*GEOSChem) CloudFrac added in v1.4.1

func (gc *GEOSChem) CloudFrac() NextData

CloudFrac helps fulfill the Preprocessor interface by returning the cloud volume fraction.

func (*GEOSChem) DX added in v1.6.1

func (gc *GEOSChem) DX() (float64, error)

DX returns the longitude grid spacing.

func (*GEOSChem) DY added in v1.6.1

func (gc *GEOSChem) DY() (float64, error)

DY returns the latitude grid spacing.

func (*GEOSChem) H2O2 added in v1.4.1

func (gc *GEOSChem) H2O2() NextData

H2O2 helps fulfill the Preprocessor interface by returning hydrogen peroxide concentration [ppmv].

func (*GEOSChem) HO added in v1.4.1

func (gc *GEOSChem) HO() NextData

HO helps fulfill the Preprocessor interface by returning hydroxyl radical concentration [ppmv].

func (*GEOSChem) Height added in v1.4.1

func (gc *GEOSChem) Height() NextData

Height returns a functions that calculates layer heights at each time step using the hyposometric equation.

func (*GEOSChem) NH3 added in v1.4.1

func (gc *GEOSChem) NH3() NextData

NH3 helps fulfill the Preprocessor interface.

func (*GEOSChem) NOx added in v1.4.1

func (gc *GEOSChem) NOx() NextData

NOx helps fulfill the Preprocessor interface.

func (*GEOSChem) Nx added in v1.4.1

func (gc *GEOSChem) Nx() (int, error)

Nx helps fulfill the Preprocessor interface by returning the number of grid cells in the West-East direction.

func (*GEOSChem) Ny added in v1.4.1

func (gc *GEOSChem) Ny() (int, error)

Ny helps fulfill the Preprocessor interface by returning the number of grid cells in the South-North direction.

func (*GEOSChem) Nz added in v1.4.1

func (gc *GEOSChem) Nz() (int, error)

Nz helps fulfill the Preprocessor interface by returning the number of grid cells in the below-above direction.

func (*GEOSChem) P added in v1.4.1

func (gc *GEOSChem) P() NextData

P helps fulfill the Preprocessor interface by returning pressure [Pa].

func (*GEOSChem) PBLH added in v1.4.1

func (gc *GEOSChem) PBLH() NextData

PBLH helps fulfill the Preprocessor interface.

func (*GEOSChem) PNH added in v1.4.1

func (gc *GEOSChem) PNH() NextData

PNH helps fulfill the Preprocessor interface.

func (*GEOSChem) PNO added in v1.4.1

func (gc *GEOSChem) PNO() NextData

PNO helps fulfill the Preprocessor interface.

func (*GEOSChem) PS added in v1.4.1

func (gc *GEOSChem) PS() NextData

PS helps fulfill the Preprocessor interface.

func (*GEOSChem) QCloud added in v1.4.1

func (gc *GEOSChem) QCloud() NextData

QCloud helps fulfill the Preprocessor interface by returning the cloud mass fraction.

func (*GEOSChem) QRain added in v1.4.1

func (gc *GEOSChem) QRain() NextData

QRain helps fulfill the Preprocessor interface by returning rain mass fraction based on the GEOS precipitation rate [kg m-2 s-1] and the assumption (from the EMEP model wet deposition algorithm) that raindrops are falling at 5 m/s.

func (*GEOSChem) RadiationDown added in v1.4.1

func (gc *GEOSChem) RadiationDown() NextData

RadiationDown helps fulfill the Preprocessor interface by returning downwelling radiation [W m-2].

func (*GEOSChem) SOx added in v1.4.1

func (gc *GEOSChem) SOx() NextData

SOx helps fulfill the Preprocessor interface.

func (*GEOSChem) SeinfeldLandUse added in v1.4.1

func (gc *GEOSChem) SeinfeldLandUse() NextData

SeinfeldLandUse helps fulfill the Preprocessor interface by returning land use categories as specified in github.com/ctessum/atmos/seinfeld.

func (*GEOSChem) SurfaceHeatFlux added in v1.4.1

func (gc *GEOSChem) SurfaceHeatFlux() NextData

SurfaceHeatFlux helps fulfill the Preprocessor interface by returning sensible heat flux from turbulence W/m2.

func (*GEOSChem) T added in v1.4.1

func (gc *GEOSChem) T() NextData

T helps fulfill the Preprocessor interface by returning temperature [K].

func (*GEOSChem) TotalPM25 added in v1.4.1

func (gc *GEOSChem) TotalPM25() NextData

TotalPM25 helps fulfill the Preprocessor interface.

func (*GEOSChem) U added in v1.4.1

func (gc *GEOSChem) U() NextData

U helps fulfill the Preprocessor interface.

func (*GEOSChem) UStar added in v1.4.1

func (gc *GEOSChem) UStar() NextData

UStar helps fulfill the Preprocessor interface by returning friction velocity m/s.

func (*GEOSChem) V added in v1.4.1

func (gc *GEOSChem) V() NextData

V helps fulfill the Preprocessor interface.

func (*GEOSChem) W added in v1.4.1

func (gc *GEOSChem) W() NextData

W helps fulfill the Preprocessor interface.

func (*GEOSChem) WeselyLandUse added in v1.4.1

func (gc *GEOSChem) WeselyLandUse() NextData

WeselyLandUse helps fulfill the Preprocessor interface by returning land use categories as specified in github.com/ctessum/atmos/wesely1989.

func (*GEOSChem) XCenters added in v1.6.1

func (gc *GEOSChem) XCenters() ([]float64, error)

XCenters returns the x-coordinates of the grid points.

func (*GEOSChem) YCenters added in v1.6.1

func (gc *GEOSChem) YCenters() ([]float64, error)

YCenters returns the y-coordinates of the grid points.

func (*GEOSChem) Z0 added in v1.4.1

func (gc *GEOSChem) Z0() NextData

Z0 helps fulfill the Preprocessor interface by returning momentum roughness length [m].

type GridMutator added in v1.2.0

type GridMutator func(cell *Cell, totalMass, totalPopulation float64) bool

A GridMutator is a function whether a Cell should be mutated (i.e., either divided or combined with other cells), where totalMass is absolute value of the total mass of pollution in the system and totalPopulation is the total population in the system.

func PopulationMutator added in v1.2.0

func PopulationMutator(config *VarGridConfig, popIndices PopIndices) (GridMutator, error)

PopulationMutator returns a function that determines whether a grid cell should be split by determining whether either the cell population or maximum poulation density are above the thresholds specified in config.

type InMAP added in v1.2.0

type InMAP struct {

	// InitFuncs are functions to be called in the given order
	//  at the beginning of the simulation.
	InitFuncs []DomainManipulator

	// RunFuncs are functions to be called in the given order repeatedly
	// until "Done" is true. Therefore, the simulation will not end until
	// one of RunFuncs sets "Done" to true.
	RunFuncs []DomainManipulator

	// CleanupFuncs are functions to be run in the given order after the
	// simulation has completed.
	CleanupFuncs []DomainManipulator

	Dt float64 // seconds

	// Done specifies whether the simulation is finished.
	Done bool

	// VariableDescriptions gives descriptions of the model variables.
	VariableDescriptions map[string]string
	// VariableUnits gives the units of the model variables.
	VariableUnits map[string]string

	// PopIndices gives the array index of each population type in the PopData
	// field in each Cell.
	PopIndices map[string]int
	// contains filtered or unexported fields
}

InMAP holds the current state of the model.

func (*InMAP) CellIntersections added in v1.2.0

func (d *InMAP) CellIntersections(g geom.Geom) (cells []*Cell, fractions []float64)

CellIntersections returns an array of all of the grid cells (on all vertical levels) that intersect g, and an array of the fraction of g that intersects with each cell.

func (*InMAP) Cells added in v1.2.0

func (d *InMAP) Cells() []*Cell

Cells returns the InMAP grid cells as an array.

func (*InMAP) Cleanup added in v1.2.0

func (d *InMAP) Cleanup() error

Cleanup finishes the simulation by running d.CleanupFuncs.

func (*InMAP) GetGeometry added in v1.2.0

func (d *InMAP) GetGeometry(layer int, webMap bool) []geom.Polygonal

GetGeometry returns the cell geometry for the given layer. if WebMap is true, it returns the geometry in web mercator projection, otherwise it returns the native grid projection.

func (*InMAP) Init added in v1.2.0

func (d *InMAP) Init() error

Init initializes the simulation by running d.InitFuncs.

func (*InMAP) InsertCell added in v1.2.0

func (d *InMAP) InsertCell(c *Cell, m Mechanism)

InsertCell adds a new cell to the grid. The function will take the necessary steps to fit the new cell in with existing cells, but it is the caller's reponsibility that the new cell doesn't overlap any existing cells.

func (*InMAP) OutputOptions added in v1.2.0

func (d *InMAP) OutputOptions(m Mechanism) (names []string, descriptions []string, units []string)

OutputOptions returns the options for output variable names and their descriptions.

func (*InMAP) Results added in v1.2.0

func (d *InMAP) Results(o *Outputter) (map[string][]float64, error)

Results returns the simulation results. Output is in the form of map[variable][row]concentration.

func (*InMAP) Run added in v1.2.0

func (d *InMAP) Run() error

Run carries out the simulation by running d.RunFuncs until d.Done is true.

func (*InMAP) SetEmissionsFlux added in v1.7.0

func (d *InMAP) SetEmissionsFlux(emis *Emissions, m Mechanism) error

SetEmissionsFlux sets the emissions flux for the cells in the receiver based on the emissions in e.

func (*InMAP) VerticalProfile added in v1.2.0

func (d *InMAP) VerticalProfile(variable string, p geom.Point, m Mechanism) (height, vals []float64, err error)

VerticalProfile retrieves the vertical profile for a given variable at the given location p in the native grid projection.

type Mechanism added in v1.4.1

type Mechanism interface {
	// AddEmisFlux adds emissions flux to Cell c based on the given
	// pollutant name and amount in units of μg/s. The units of
	// the resulting flux may vary for different chemical mechanisms.
	AddEmisFlux(c *Cell, name string, val float64) error

	// DryDep returns a dry deposition function of the type indicated by
	// name that is compatible with this chemical mechanism.
	// Valid options may vary for different chemical mechanisms.
	DryDep(name string) (CellManipulator, error)

	// WetDep returns a dry deposition function of the type indicated by
	// name that is compatible with this chemical mechanism.
	// Valid options may vary for different chemical mechanisms.
	WetDep(name string) (CellManipulator, error)

	// Species returns the names of the emission and concentration pollutant
	// species that are used by this chemical mechanism.
	Species() []string

	// Value returns the concentration or emissions value of
	// the given variable in the given Cell. It returns an
	// error if given an invalid variable name.
	Value(c *Cell, variable string) (float64, error)

	// Units returns the units of the given variable, or an
	// error if the variable name is invalid.
	Units(variable string) (string, error)

	// Chemistry returns a function that simulates chemical reactions.
	Chemistry() CellManipulator

	// Len returns the number of pollutants in the chemical mechanism.
	Len() int
}

Mechanism is an interface for atmospheric chemical mechanisms.

type MortIndices added in v1.4.1

type MortIndices map[string]int

MortIndices gives the array indices of each mortality rate.

type MortalityRates added in v1.2.0

type MortalityRates struct {
	// contains filtered or unexported fields
}

MortalityRates is a holder for information about the average human mortality rate (in units of deaths per 100,000 people per year) in the model domain.

type NextData added in v1.4.1

type NextData func() (*sparse.DenseArray, error)

NextData is a type of function that returns data for the next time step. If there are no more time steps, it should return the io.EOF error.

type Outputter added in v1.4.1

type Outputter struct {
	// contains filtered or unexported fields
}

Outputter is a holder for output parameters.

fileName contains the path where the output will be saved.

If allLayers is true, output will contain data for all of the vertical layers, otherwise only the ground-level layer is returned.

outputVariables maps the names of the variables for which data should be returned to expressions that define how the requested data should be calculated. These expressions can utilize variables built into the model, user-defined variables, and functions.

modelVariables is automatically generated based on the model variables that are required to calculate the requested output variables.

Functions are defined in the outputFunctions variable.

func NewOutputter added in v1.4.1

func NewOutputter(fileName string, allLayers bool, outputVariables map[string]string, outputFunctions map[string]govaluate.ExpressionFunction, m Mechanism) (*Outputter, error)

NewOutputter initializes a new Outputter holder and adds a set of default output functions. Default functions include:

'exp(x)' which applies the exponental function e^x.

'log(x)' which applies the natural logarithm function log(e).

'log10(x)' which applies the base-10 logarithm function log10(e).

'sum(x)' which sums a variable across all grid cells.

func (*Outputter) CheckOutputVars added in v1.4.1

func (o *Outputter) CheckOutputVars(m Mechanism) DomainManipulator

CheckOutputVars ensures that the requested output variables are all valid.

func (*Outputter) Output added in v1.4.1

func (o *Outputter) Output(sr *proj.SR) DomainManipulator

Output writes the simulation results to a shapefile. SR is the spatial reference of the model grid.

type PopConcMutator added in v1.2.0

type PopConcMutator struct {
	// contains filtered or unexported fields
}

PopConcMutator is a holds an algorithm for dividing grid cells based on gradients in population density and concentration. Refer to the methods for additional documentation.

func NewPopConcMutator added in v1.2.0

func NewPopConcMutator(config *VarGridConfig, popIndices PopIndices) *PopConcMutator

NewPopConcMutator initializes a new PopConcMutator object.

func (*PopConcMutator) Mutate added in v1.2.0

func (p *PopConcMutator) Mutate() GridMutator

Mutate returns a function that takes a grid cell and returns whether Σ(|ΔConcentration|)*combinedVolume*|ΔPopulation| / {Σ(|totalMass|)*totalPopulation} > a threshold between the grid cell in question and any of its horizontal neighbors, where Σ(|totalMass|) is the sum of the absolute values of the mass of all pollutants in all grid cells in the system, Σ(|ΔConcentration|) is the sum of the absolute value of the difference between pollution concentations in the cell in question and the neighbor in question, |ΔPopulation| is the absolute value of the difference in population between the two grid cells, totalPopulation is the total population in the domain, and combinedVolume is the combined volume of the cell in question and the neighbor in question.

type PopIndices added in v1.2.0

type PopIndices map[string]int

PopIndices gives the array indices of each population type.

type Population added in v1.2.0

type Population struct {
	// contains filtered or unexported fields
}

Population is a holder for information about the human population in the model domain.

type Preprocessor added in v1.4.1

type Preprocessor interface {
	// Nx is the number of grid cells in the West-East direction.
	Nx() (int, error)
	// Ny is the number of grid cells in the South-North direction.
	Ny() (int, error)
	// Nz is the number of grid cells in the below-above direction.
	Nz() (int, error)

	// PBLH is planetary boundary layer height [m].
	PBLH() NextData
	// Height is vertical layer height above ground [m].
	Height() NextData
	// ALT is inverse air density [m3/kg].
	ALT() NextData
	// T temperature [K].
	T() NextData
	// P is pressure [Pa].
	P() NextData

	// UStar is friction velocity [m/s].
	UStar() NextData
	// SeinfeldLandUse is land use categories as
	// specified in github.com/ctessum/atmos/seinfeld.
	SeinfeldLandUse() NextData
	// WeselyLandUse is land use categories as
	// specified in github.com/ctessum/atmos/wesely1989.
	WeselyLandUse() NextData
	// Z0 is surface roughness length [m].
	Z0() NextData

	// QRain is the mass fraction of rain [mass/mass].
	QRain() NextData
	// QCloud is the mass fraction of cloud water in each grid cell [mass/mass].
	QCloud() NextData
	// CloudFrac is the fraction of each grid cell filled with clouds [volume/volume].
	CloudFrac() NextData

	// SurfaceHeatFlux is heat flux at the surface [W/m2].
	SurfaceHeatFlux() NextData
	// RadiationDown is total downwelling radiation [W m-2].
	RadiationDown() NextData

	// U is West-East wind speed [m/s].
	U() NextData
	// V is South-North wind speed [m/s].
	V() NextData
	// W is below-above wind speed [m/s].
	W() NextData

	// AVOC is total concentration of anthropogenic
	// secondary organic aerosol precursors (VOCs) [μg/m3].
	AVOC() NextData
	// AVOC is total concentration of biogenic
	// secondary organic aerosol precursors (VOCs) [μg/m3].
	BVOC() NextData
	// ASOA is total concentration of anthropogenic
	// secondary organic aerosol [μg/m3].
	ASOA() NextData
	// BSOA is total concentration of biogenic
	// secondary organic aerosol [μg/m3].
	BSOA() NextData
	// NOx is concentration of oxides of Nitrogen [μg/m3].
	NOx() NextData
	// PNO is concentration of particulate nitrate [μg/m3].
	PNO() NextData
	// SOx is concentration of Sulfur oxides [μg/m3].
	SOx() NextData
	// PS is concentration of particulate sulfate [μg/m3].
	PS() NextData
	// NH3 is concentration of ammonia [μg/m3].
	NH3() NextData
	// PNH is concentration of particulate ammonium [μg/m3].
	PNH() NextData
	// TotalPM25 is total concentration of fine particulate matter (PM2.5) [μg/m3].
	TotalPM25() NextData
	// HO is hydroxyl radical concentration [ppmv].
	HO() NextData
	// H2O2 is hydrogen peroxide concentration [ppmv].
	H2O2() NextData
}

Preprocessor specifies the methods that are necessary for a variable to act as a preprocessor for InMAP inputs.

type SimulationStatus added in v1.2.0

type SimulationStatus struct {
	// SimulationDays is the number of days in simulation time since the
	// start of the simulation.
	SimulationDays float64

	// Iteration is the current iteration number.
	Iteration int

	// Walltime is the total wall time since the beginning of the simulation.
	Walltime time.Duration

	// StepWalltime is the wall time that elapsed during the most recent time step.
	StepWalltime time.Duration

	// Dt is the timestep in seconds.
	Dt float64
}

SimulationStatus holds information about the progress of a simulation.

func (SimulationStatus) String added in v1.2.0

func (s SimulationStatus) String() string

type VarGridConfig added in v1.2.0

type VarGridConfig struct {
	VariableGridXo float64 // lower left of output grid, x
	VariableGridYo float64 // lower left of output grid, y
	VariableGridDx float64 // m
	VariableGridDy float64 // m
	Xnests         []int   // Nesting multiples in the X direction
	Ynests         []int   // Nesting multiples in the Y direction
	HiResLayers    int     // number of layers to do in high resolution (layers above this will be lowest resolution.

	PopDensityThreshold float64 // limit for people per unit area in the grid cell
	PopThreshold        float64 // limit for total number of people in the grid cell

	// PopConcThreshold is the limit for
	// Σ(|ΔConcentration|)*combinedVolume*|ΔPopulation| / {Σ(|totalMass|)*totalPopulation}.
	// See the documentation for PopConcMutator for more information.
	PopConcThreshold float64

	CensusFile        string   // Path to census shapefile or COARDS-compliant NetCDF file
	CensusPopColumns  []string // Shapefile fields containing populations for multiple demographics
	PopGridColumn     string   // Name of field in shapefile to be used for determining variable grid resolution
	MortalityRateFile string   // Path to the mortality rate shapefile

	// MortalityRateColumns give the columns in the mortality rate
	// shapefile containing mortality rates, and the population groups that
	// should be used for population-weighting each mortality rate.
	MortalityRateColumns map[string]string

	GridProj string // projection info for CTM grid; Proj4 format
}

VarGridConfig is a holder for the configuration information for creating a variable-resolution grid.

func (*VarGridConfig) LoadCTMData added in v1.2.0

func (config *VarGridConfig) LoadCTMData(rw cdf.ReaderWriterAt) (*CTMData, error)

LoadCTMData loads CTM data from a netcdf file.

func (*VarGridConfig) LoadPopMort added in v1.2.0

func (config *VarGridConfig) LoadPopMort() (*Population, PopIndices, *MortalityRates, MortIndices, error)

LoadPopMort loads the population and mortality rate data from the shapefiles specified in config.

func (*VarGridConfig) MutateGrid added in v1.2.0

func (config *VarGridConfig) MutateGrid(divideRule GridMutator, data *CTMData, pop *Population, mortRates *MortalityRates, emis *Emissions, m Mechanism, logChan chan string) DomainManipulator

MutateGrid returns a function that creates a static variable resolution grid (i.e., one that does not change during the simulation) by dividing cells as determined by divideRule. Cells where divideRule is true are divided to the next nest level (up to the maximum nest level), and cells where divideRule is false are combined (down to the baseline nest level). Log messages are written to logChan if it is not nil.

func (*VarGridConfig) RegularGrid added in v1.2.0

func (config *VarGridConfig) RegularGrid(data *CTMData, pop *Population, popIndex PopIndices, mortRates *MortalityRates, mortIndex MortIndices, emis *Emissions, m Mechanism) DomainManipulator

RegularGrid returns a function that creates a new regular (i.e., not variable resolution) grid as specified by the information in c.

type WRFChem added in v1.4.1

type WRFChem struct {
	// contains filtered or unexported fields
}

WRFChem is an InMAP preprocessor for WRF-Chem output.

func NewWRFChem added in v1.4.1

func NewWRFChem(WRFOut, startDate, endDate string, msgChan chan string) (*WRFChem, error)

NewWRFChem initializes a WRF-Chem preprocessor from the given configuration information. WRFOut is the location of WRF-Chem output files. [DATE] should be used as a wild card for the simulation date. startDate and endDate are the dates of the beginning and end of the simulation, respectively, in the format "YYYYMMDD". If msgChan is not nil, status messages will be sent to it.

func (*WRFChem) ALT added in v1.4.1

func (w *WRFChem) ALT() NextData

ALT helps fulfill the Preprocessor interface by returning inverse air density m3/kg.

func (*WRFChem) ASOA added in v1.4.1

func (w *WRFChem) ASOA() NextData

ASOA helps fulfill the Preprocessor interface.

func (*WRFChem) AVOC added in v1.4.1

func (w *WRFChem) AVOC() NextData

AVOC helps fulfill the Preprocessor interface.

func (*WRFChem) BSOA added in v1.4.1

func (w *WRFChem) BSOA() NextData

BSOA helps fulfill the Preprocessor interface.

func (*WRFChem) BVOC added in v1.4.1

func (w *WRFChem) BVOC() NextData

BVOC helps fulfill the Preprocessor interface.

func (*WRFChem) CloudFrac added in v1.4.1

func (w *WRFChem) CloudFrac() NextData

CloudFrac helps fulfill the Preprocessor interface by returning the fraction of each grid cell filled with clouds volume/volume.

func (*WRFChem) GLW added in v1.4.1

func (w *WRFChem) GLW() NextData

GLW helps fulfill the Preprocessor interface by returning downwelling long wave radiation at ground level W/m2.

func (*WRFChem) H2O2 added in v1.4.1

func (w *WRFChem) H2O2() NextData

H2O2 helps fulfill the Preprocessor interface by returning hydrogen peroxide concentration [ppmv].

func (*WRFChem) HO added in v1.4.1

func (w *WRFChem) HO() NextData

HO helps fulfill the Preprocessor interface by returning hydroxyl radical concentration [ppmv].

func (*WRFChem) Height added in v1.4.1

func (w *WRFChem) Height() NextData

Height helps fulfill the Preprocessor interface by returning layer heights above ground level calculated based on geopotential height. For more information, refer to http://www.openwfm.org/wiki/How_to_interpret_WRF_variables.

func (*WRFChem) NH3 added in v1.4.1

func (w *WRFChem) NH3() NextData

NH3 helps fulfill the Preprocessor interface.

func (*WRFChem) NOx added in v1.4.1

func (w *WRFChem) NOx() NextData

NOx helps fulfill the Preprocessor interface.

func (*WRFChem) Nx added in v1.4.1

func (w *WRFChem) Nx() (int, error)

Nx helps fulfill the Preprocessor interface by returning the number of grid cells in the West-East direction.

func (*WRFChem) Ny added in v1.4.1

func (w *WRFChem) Ny() (int, error)

Ny helps fulfill the Preprocessor interface by returning the number of grid cells in the South-North direction.

func (*WRFChem) Nz added in v1.4.1

func (w *WRFChem) Nz() (int, error)

Nz helps fulfill the Preprocessor interface by returning the number of grid cells in the below-above direction.

func (*WRFChem) P added in v1.4.1

func (w *WRFChem) P() NextData

P helps fulfill the Preprocessor interface by returning pressure [Pa].

func (*WRFChem) PBLH added in v1.4.1

func (w *WRFChem) PBLH() NextData

PBLH helps fulfill the Preprocessor interface by returning planetary boundary layer height [m].

func (*WRFChem) PNH added in v1.4.1

func (w *WRFChem) PNH() NextData

PNH helps fulfill the Preprocessor interface.

func (*WRFChem) PNO added in v1.4.1

func (w *WRFChem) PNO() NextData

PNO helps fulfill the Preprocessor interface.

func (*WRFChem) PS added in v1.4.1

func (w *WRFChem) PS() NextData

PS helps fulfill the Preprocessor interface.

func (*WRFChem) QCloud added in v1.4.1

func (w *WRFChem) QCloud() NextData

QCloud helps fulfill the Preprocessor interface by returning the mass fraction of cloud water in each grid cell mass/mass.

func (*WRFChem) QRain added in v1.4.1

func (w *WRFChem) QRain() NextData

QRain helps fulfill the Preprocessor interface by returning rain mass fraction.

func (*WRFChem) RadiationDown added in v1.4.1

func (w *WRFChem) RadiationDown() NextData

RadiationDown helps fulfill the Preprocessor interface by returning total downwelling radiation at ground level W/m2.

func (*WRFChem) SOx added in v1.4.1

func (w *WRFChem) SOx() NextData

SOx helps fulfill the Preprocessor interface.

func (*WRFChem) SWDown added in v1.4.1

func (w *WRFChem) SWDown() NextData

SWDown helps fulfill the Preprocessor interface by returning downwelling short wave radiation at ground level W/m2.

func (*WRFChem) SeinfeldLandUse added in v1.4.1

func (w *WRFChem) SeinfeldLandUse() NextData

SeinfeldLandUse helps fulfill the Preprocessor interface by returning land use categories as specified in github.com/ctessum/atmos/seinfeld.

func (*WRFChem) SurfaceHeatFlux added in v1.4.1

func (w *WRFChem) SurfaceHeatFlux() NextData

SurfaceHeatFlux helps fulfill the Preprocessor interface by returning heat flux at the surface W/m2.

func (*WRFChem) T added in v1.4.1

func (w *WRFChem) T() NextData

T helps fulfill the Preprocessor interface by returning temperature [K].

func (*WRFChem) TotalPM25 added in v1.4.1

func (w *WRFChem) TotalPM25() NextData

TotalPM25 helps fulfill the Preprocessor interface.

func (*WRFChem) U added in v1.4.1

func (w *WRFChem) U() NextData

U helps fulfill the Preprocessor interface by returning West-East wind speed m/s.

func (*WRFChem) UStar added in v1.4.1

func (w *WRFChem) UStar() NextData

UStar helps fulfill the Preprocessor interface by returning friction velocity m/s.

func (*WRFChem) V added in v1.4.1

func (w *WRFChem) V() NextData

V helps fulfill the Preprocessor interface by returning South-North wind speed m/s.

func (*WRFChem) W added in v1.4.1

func (w *WRFChem) W() NextData

W helps fulfill the Preprocessor interface by returning below-above wind speed m/s.

func (*WRFChem) WeselyLandUse added in v1.4.1

func (w *WRFChem) WeselyLandUse() NextData

WeselyLandUse helps fulfill the Preprocessor interface by returning land use categories as specified in github.com/ctessum/atmos/wesely1989.

func (*WRFChem) Z0 added in v1.4.1

func (w *WRFChem) Z0() NextData

Z0 helps fulfill the Preprocessor interface by returning roughness length.

Directories

Path Synopsis
Package cloud contains utilities for distributed InMAP simulations.
Package cloud contains utilities for distributed InMAP simulations.
cloudrpc/cloudrpcgojs
Package cloudrpc is a generated protocol buffer package.
Package cloudrpc is a generated protocol buffer package.
cmd
inmap
Command inmap is a command-line interface for the InMAP air pollution model.
Command inmap is a command-line interface for the InMAP air pollution model.
inmapweb
command inmapweb is a web interface for the InMAP model and related tools.
command inmapweb is a web interface for the InMAP model and related tools.
emissions
aep
aep/aeputil
Package aeputil provides commonly used configuration and functions for the AEP library.
Package aeputil provides commonly used configuration and functions for the AEP library.
slca/eieio
Package eieio implements an Extended InMAP Economic Input-Output (EIEIO) life cycle assessment model based on the US Bureau of Economic Analysis (BEA) Annual Input-Output Accounts Data from https://www.gov/industry/io_annual.htm.
Package eieio implements an Extended InMAP Economic Input-Output (EIEIO) life cycle assessment model based on the US Bureau of Economic Analysis (BEA) Annual Input-Output Accounts Data from https://www.gov/industry/io_annual.htm.
slca/eieio/ces
Package ces translates Consumer Expenditure Survey (CES) demographic data to EIO categories.
Package ces translates Consumer Expenditure Survey (CES) demographic data to EIO categories.
slca/eieio/eieiorpc/eieiorpcjs
Package eieiorpc is a generated protocol buffer package.
Package eieiorpc is a generated protocol buffer package.
Package epi holds a collection of functions for calculating the health impacts of air pollution.
Package epi holds a collection of functions for calculating the health impacts of air pollution.
Package inmaputil contains configuration and utility functions for commonly-used operations with the InMAP model.
Package inmaputil contains configuration and utility functions for commonly-used operations with the InMAP model.
science
chem/simplechem
Package simplechem contains a simplified atmospheric chemistry mechanism.
Package simplechem contains a simplified atmospheric chemistry mechanism.
drydep/simpledrydep
Package simpledrydep provides a atmospheric dry deposition algorithm for a small number of chemical species.
Package simpledrydep provides a atmospheric dry deposition algorithm for a small number of chemical species.
wetdep/emepwetdep
Package emepwetdep provides a atmospheric wet deposition algorithm from the EMEP model.
Package emepwetdep provides a atmospheric wet deposition algorithm from the EMEP model.
Package sr contains functions for creating a source-receptor (SR) matrix from the InMAP air pollution model and interacting with it.
Package sr contains functions for creating a source-receptor (SR) matrix from the InMAP air pollution model and interacting with it.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL