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 theCOpathway 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.
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: |
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
|
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
|
False
|
population
|
bool
|
Urban dispersion and the urban population (> 100), required when
|
False
|
ambient_distance
|
Optional[float]
|
Minimum distance to ambient air (m). |
None
|
no2_method
|
Optional[str]
|
NO2 chemistry: |
None
|
no2_stack_ratio
|
Optional[str]
|
NO2 chemistry: |
None
|
ozone_concentration
|
Optional[str]
|
NO2 chemistry: |
None
|
ozone_units
|
Optional[str]
|
NO2 chemistry: |
None
|
downwash
|
bool
|
Building downwash (stack types and FLARE only). Either name a
pre-existing BPIP-PRIME input file in |
False
|
terrain
|
bool
|
Include terrain heights (AERMAP is run). Needs the source
location -- |
False
|
probe_distance
|
Optional[float]
|
Maximum distance to probe (m); |
None
|
discrete_receptors
|
Sequence[float]
|
Up to ten discrete receptor distances (m), or a file already in
AERSCREEN's format ( |
()
|
discrete_receptor_file
|
Sequence[float]
|
Up to ten discrete receptor distances (m), or a file already in
AERSCREEN's format ( |
()
|
flagpole_height
|
Optional[float]
|
Flagpole receptor height (m); |
None
|
source_elevation
|
Optional[float]
|
Source base elevation (m). |
None
|
aermap_elevation
|
Optional[float]
|
Source base elevation (m). |
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: |
None
|
climate
|
Optional[int]
|
AERMET seasonal tables instead: :data: |
None
|
surface_file
|
Optional[str]
|
An AERSURFACE output file ( |
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; |
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; |
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; |
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; |
False
|
run_aermod
|
bool
|
|
True
|
debug
|
bool
|
Write the per-receptor concentration debug file. |
False
|
output_file
|
str
|
Output file name; must end in |
'AERSCREEN.OUT'
|
effective_release_height
property
¶
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
¶
Whether AERSCREEN would offer the fumigation prompts at all.
surface_code
property
¶
AERSCREEN's isurf: 0 user values, 1-8 AERMET land use, 9 file.
discrete_receptor_filename
property
¶
Basename of the discrete-receptor file the header names.
staged_input_files
property
¶
Files the run needs beside it: the runner copies these in.
to_stdin_answers ¶
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 ¶
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
¶
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
|
|
title |
str
|
The run title. |
maximum |
AERSCREENImpact
|
The overall maximum impact ( |
ambient_boundary |
Optional[AERSCREENImpact]
|
The impact at the ambient boundary, if AERSCREEN reported it. |
distances, concentrations |
The |
parse_aerscreen_output ¶
Parse an AERSCREEN .OUT file (a path or its text).