Skip to content

aerscreen

aerscreen

AERSCREEN configuration: the prompt answers and the restart file.

EPA's AERSCREEN is the single-source screening front-end to AERMOD. It generates screening meteorology with MAKEMET, runs AERMOD over it (and BPIP-PRIME and AERMAP when asked to), and reports worst-case 1-hour impacts with the scaled 3-, 8-, 24-hour and annual values -- the first step of a permit analysis, deciding whether refined modelling is needed.

AERSCREEN has no keyword input deck. It is interactive: it asks an ordered sequence of questions on stdin (title, units, source type, the source parameters, downwash, terrain, meteorology, fumigation, debug, output file name, then a validation page whose <Enter> starts the run). It can also restart from a previous run: if aerscreen.inp exists in the working directory, it parses the **-prefixed header that its own runs leave at the top of that file (the rest of the file is the AERMOD runstream of the last refinement stage), shows the title, and asks whether to continue with it. Both were read off AERSCREEN.FOR (subroutines initprompts, stacks, downwash, getDEMs, metdata, fuminp, setdebug, getoutfil, validate for the prompts; readinp and makeinput for the header) and checked against every deck in EPA's aerscreen_test_cases.zip.

This module is the parameter container for one run and produces both forms:

  • :meth:AERSCREENConfig.to_stdin_answers -- the answers, one per prompt, in the order AERSCREEN asks them (metric units throughout).
  • :meth:AERSCREENConfig.to_aerscreen_input -- the restart file: the ** header in AERSCREEN's own column layout, byte for byte, plus the CO pathway it also reads (title, BPIP file, NO2 chemistry).
  • :meth:AERSCREENConfig.from_aerscreen_input -- the parser for that header, so an EPA-published or previously generated deck round-trips.

Binary dispatch lives in :mod:pyaermod.aerscreen_runner, which feeds either form to a locally built AERSCREEN (scripts/build_aerscreen.sh) and stages the programs it spawns.

Typical usage::

from pyaermod import AERSCREENConfig, AERSCREENSourceType

cfg = AERSCREENConfig(
    title="SO2 stack screening",
    source_type=AERSCREENSourceType.POINT,
    emission_rate=10.0,           # g/s
    stack_height=30.0,            # m
    stack_diameter=2.0,           # m
    stack_temp=425.0,             # K (None for ambient)
    exit_velocity=15.0,           # m/s
    albedo=0.16, bowen_ratio=0.8, roughness_length=0.1,
)
answers = cfg.to_stdin_answers()      # what the runner types
deck = cfg.to_aerscreen_input()       # or the restart file

The earlier release of this module wrote a KEY: value deck that AERSCREEN never reads; the fields that described things AERSCREEN has no notion of were renamed or dropped, and passing an old name raises a :class:TypeError naming its replacement.

AERSCREENSourceType

Bases: StrEnum

The seven source types AERSCREEN's opening prompt offers.

CAPPED and HORIZONTAL are aliases kept from the previous release; their values are AERSCREEN's own keywords.

prompt_letter property

prompt_letter: str

The letter the source-type prompt takes (P, V, A, C, F, S, H).

header_keyword property

header_keyword: str

The ** ... DATA keyword of the restart-file source block.

is_stack property

is_stack: bool

POINT, POINTCAP or POINTHOR: a stack with diameter and velocity.

is_elevated_release property

is_elevated_release: bool

Stack-like sources: the ones downwash and fumigation apply to.

AERSCREENConfig dataclass

Everything AERSCREEN asks for one run, in metric units.

Parameters:

Name Type Description Default
title str

Run title (AERSCREEN keeps 60 characters).

required
source_type AERSCREENSourceType

One of :class:AERSCREENSourceType; a string is coerced.

required
emission_rate float

Emission rate in g/s.

required
stack_height Optional[float]

Release height in metres: the stack height of POINT / POINTCAP / POINTHOR, the flare stack height of FLARE, the centre height of VOLUME, the release height of AREA / AREACIRC. Required.

None
stack_diameter Optional[float]

Stack inner diameter (m) and exit velocity (m/s). Required for the three stack types.

None
exit_velocity Optional[float]

Stack inner diameter (m) and exit velocity (m/s). Required for the three stack types.

None
stack_temp Optional[float]

Stack exit temperature in K. None or 0 means ambient; a negative value is a temperature difference above ambient.

None
flare_heat_release Optional[float]

FLARE total heat release (cal/s) and radiative heat-loss fraction (AERSCREEN's default 0.55).

None
flare_heat_loss Optional[float]

FLARE total heat release (cal/s) and radiative heat-loss fraction (AERSCREEN's default 0.55).

None
lateral_dimension Optional[float]

VOLUME initial lateral and vertical dimensions (m). The vertical dimension is also asked of AREA and AREACIRC.

None
vertical_dimension Optional[float]

VOLUME initial lateral and vertical dimensions (m). The vertical dimension is also asked of AREA and AREACIRC.

None
area_length Optional[float]

AREA long and short sides (m). AERSCREEN swaps them if given the other way round.

None
area_width Optional[float]

AREA long and short sides (m). AERSCREEN swaps them if given the other way round.

None
radius Optional[float]

AREACIRC radius (m).

None
urban bool

Urban dispersion and the urban population (> 100), required when urban=True.

False
population bool

Urban dispersion and the urban population (> 100), required when urban=True.

False
ambient_distance Optional[float]

Minimum distance to ambient air (m). None takes AERSCREEN's default: 1 m, or 2.15 * lateral_dimension + 1 for VOLUME.

None
no2_method Optional[str]

NO2 chemistry: None (none), "OLM" or "PVMRM", with the in-stack NO2/NOx ratio (0-1) and the background ozone in "UG/M3", "PPM" or "PPB".

None
no2_stack_ratio Optional[str]

NO2 chemistry: None (none), "OLM" or "PVMRM", with the in-stack NO2/NOx ratio (0-1) and the background ozone in "UG/M3", "PPM" or "PPB".

None
ozone_concentration Optional[str]

NO2 chemistry: None (none), "OLM" or "PVMRM", with the in-stack NO2/NOx ratio (0-1) and the background ozone in "UG/M3", "PPM" or "PPB".

None
ozone_units Optional[str]

NO2 chemistry: None (none), "OLM" or "PVMRM", with the in-stack NO2/NOx ratio (0-1) and the background ozone in "UG/M3", "PPM" or "PPB".

None
downwash bool

Building downwash (stack types and FLARE only). Either name a pre-existing BPIP-PRIME input file in bpip_file or give the single building: building_height, building_length (max horizontal dimension), building_width (min), building_angle (orientation of the long side from north, 0-179), stack_direction (direction of the stack from the building centre, 0-360) and stack_distance (m).

False
terrain bool

Include terrain heights (AERMAP is run). Needs the source location -- lat/lon or utm_easting/utm_northing with utm_zone -- datum ("NAD83" or "NAD27"), dem_files of type dem_type ("NED" or "DEM") and the NADCON grid files in nad_grid_dir. Not for AREA.

False
probe_distance Optional[float]

Maximum distance to probe (m); None takes AERSCREEN's default of 5000 m, or 10000 m with terrain. AERSCREEN rounds it up to a multiple of 25 m.

None
discrete_receptors Sequence[float]

Up to ten discrete receptor distances (m), or a file already in AERSCREEN's format (units: meters then one distance per line).

()
discrete_receptor_file Sequence[float]

Up to ten discrete receptor distances (m), or a file already in AERSCREEN's format (units: meters then one distance per line).

()
flagpole_height Optional[float]

Flagpole receptor height (m); None for none.

None
source_elevation Optional[float]

Source base elevation (m). None means 0 m, or the AERMAP-derived elevation when terrain=True; aermap_elevation says so explicitly (AERSCREEN keeps the elevation AERMAP found in the restart file next to that flag).

None
aermap_elevation Optional[float]

Source base elevation (m). None means 0 m, or the AERMAP-derived elevation when terrain=True; aermap_elevation says so explicitly (AERSCREEN keeps the elevation AERMAP found in the restart file next to that flag).

None
temp_min_k float

MAKEMET meteorology: ambient temperature range (K), minimum wind speed (m/s) and anemometer height (m). AERSCREEN's defaults.

250.0
temp_max_k float

MAKEMET meteorology: ambient temperature range (K), minimum wind speed (m/s) and anemometer height (m). AERSCREEN's defaults.

250.0
min_wind_speed float

MAKEMET meteorology: ambient temperature range (K), minimum wind speed (m/s) and anemometer height (m). AERSCREEN's defaults.

250.0
anemometer_height float

MAKEMET meteorology: ambient temperature range (K), minimum wind speed (m/s) and anemometer height (m). AERSCREEN's defaults.

250.0
albedo Optional[float]

Single user-specified surface characteristics.

None
bowen_ratio Optional[float]

Single user-specified surface characteristics.

None
roughness_length Optional[float]

Single user-specified surface characteristics.

None
land_use Optional[int]

AERMET seasonal tables instead: :data:AERMET_LAND_USE code and :data:AERMET_CLIMATE code.

None
climate Optional[int]

AERMET seasonal tables instead: :data:AERMET_LAND_USE code and :data:AERMET_CLIMATE code.

None
surface_file Optional[str]

An AERSURFACE output file (FREQ_SECT / SECTOR / SITE_CHAR lines) instead. Exactly one of the three surface options must be given.

None
use_adju bool

Apply the ADJ_U* low-wind adjustment in MAKEMET.

False
fumigation bool

Inversion break-up and shoreline fumigation (stack types and FLARE with a release height of at least 10 m). Shoreline needs the minimum distance to the shoreline (m, at most 3000) and an optional direction (degrees; None for none).

False
shoreline_fumigation bool

Inversion break-up and shoreline fumigation (stack types and FLARE with a release height of at least 10 m). Shoreline needs the minimum distance to the shoreline (m, at most 3000) and an optional direction (degrees; None for none).

False
shoreline_distance bool

Inversion break-up and shoreline fumigation (stack types and FLARE with a release height of at least 10 m). Shoreline needs the minimum distance to the shoreline (m, at most 3000) and an optional direction (degrees; None for none).

False
shoreline_direction bool

Inversion break-up and shoreline fumigation (stack types and FLARE with a release height of at least 10 m). Shoreline needs the minimum distance to the shoreline (m, at most 3000) and an optional direction (degrees; None for none).

False
run_aermod bool

False skips the AERMOD screening and keeps only the fumigation calculations (AERSCREEN's "Run AERSCREEN: N").

True
debug bool

Write the per-receptor concentration debug file.

False
output_file str

Output file name; must end in .out / .OUT. AERSCREEN derives the log, restart and maximum-concentration file names from it.

'AERSCREEN.OUT'

effective_release_height property

effective_release_height: float

The height AERSCREEN's fumigation eligibility test looks at.

For FLARE that is the effective stack height it computes from the heat release (stacks, label 201), not the flare tip.

fumigation_allowed property

fumigation_allowed: bool

Whether AERSCREEN would offer the fumigation prompts at all.

surface_code property

surface_code: int

AERSCREEN's isurf: 0 user values, 1-8 AERMET land use, 9 file.

discrete_receptor_filename property

discrete_receptor_filename: Optional[str]

Basename of the discrete-receptor file the header names.

staged_input_files property

staged_input_files: List[str]

Files the run needs beside it: the runner copies these in.

to_stdin_answers

to_stdin_answers() -> List[str]

The answers, one per prompt, in the order AERSCREEN asks.

This is the data-entry pass of AERSCREEN.FOR with no aerscreen.inp present: initprompts, stacks(0), downwash(0), getDEMs(0), metdata(0), fuminp(0), setdebug(0), getoutfil, then validate. An empty string is a bare <Enter>, which takes AERSCREEN's default where one is offered.

to_aerscreen_input

to_aerscreen_input() -> str

The restart file AERSCREEN reads from aerscreen.inp.

The ** header uses the exact column layout of AERSCREEN's makeinput FORMATs, followed by the CO pathway keywords readinp also reads. Values AERSCREEN fills in from a run (stack flow rate, the surface characteristics of the dominant sector) are computed or carried through so a parsed EPA deck writes back identically.

One quirk of the reader on the other side: it keeps the title only up to its first comma, upper-cased (the whole line is upper-cased before the keyword is matched). A run restarted from this file reports that shortened title; the answers of :meth:to_stdin_answers keep it whole.

from_aerscreen_input classmethod

from_aerscreen_input(text: str) -> AERSCREENConfig

Parse a restart file (an aerscreen.inp header) back.

Reads what readinp reads: the ** data blocks with list-directed parsing (whitespace-separated, quoted file names), plus TITLEONE, TITLETWO, MODELOPT, POLLUTID, NO2STACK and OZONEVAL from the CO pathway.

AERSCREENImpact dataclass

One row of the AERSCREEN MAXIMUM IMPACT SUMMARY table.

conc_annual is None where AERSCREEN prints N/A (area sources, whose scaled values all equal the 1-hour value).

AERSCREENSummary dataclass

What an AERSCREEN .OUT file concludes.

Attributes:

Name Type Description
version str

"AERSCREEN 21112 / AERMOD 26135" as the banner states it.

title str

The run title.

maximum AERSCREENImpact

The overall maximum impact (FLAT TERRAIN or TERRAIN row).

ambient_boundary Optional[AERSCREENImpact]

The impact at the ambient boundary, if AERSCREEN reported it.

distances, concentrations

The OVERALL MAXIMUM CONCENTRATIONS BY DISTANCE table, in metres and ug/m3, in the order printed.

parse_aerscreen_output

parse_aerscreen_output(source: Union[str, Path]) -> AERSCREENSummary

Parse an AERSCREEN .OUT file (a path or its text).