Skip to content

v2.2.0 — Validated against EPA's own programs; the archival release

The release the PyAERMOD manuscript (Journal of the Air & Waste Management Association, in preparation) cites. It carries everything since v2.0.0 (v2.1.0 was never tagged): the validation of the regulatory math and file formats against EPA's programs, a runstream reader that handles every AERMOD v26135 keyword, the round-trip guarantee over EPA's whole test-deck archive, and an AERSCREEN wrapper that drives the real binary. It also adds particle size distributions for Method 1 deposition, designed run sets, a seven-step GUI, and ten end-to-end example jobs run against AERMOD 26135, along with the defects those jobs found. Three dataclasses changed their fields incompatibly and the AERMET pipeline now runs in two stages; read the upgrade notes before pinning.

Validation evidence

Check Result
EPA test-suite parity, AERMOD v26135, set aermet26135_aermod26135 142 / 142 POSTFILE comparisons within EPA's ±0.001 slope margin (docs/validation.md)
AERTEST regression against EPA's plotfile all 144 receptors bit for bit
Round trip of the 53 decks in EPA's v26135 archive 53 / 53 parse → write → re-parse, every pathway equal field for field, every line modelled or kept verbatim
The rewritten decks through AERMOD's setup pass 49 / 53 accepted clean; the four chained MULTYEAR years report the same E500 as EPA's originals without the previous year's save file
Rewritten decks against EPA's POSTFILEs 14 decks with pyaermod's SO pathway and 10 fully rewritten decks, all at slope 1.000000
Keyword coverage, AERMOD v26135 115 / 115 dispatched keywords handled and tested (104 with a field, 11 stored verbatim by documented decision), from 59 at v2.0.0 (docs/keyword-audit-v26135.md)
AERSCREEN against EPA's 22 test cases all 22 restart decks byte for byte; 21 of 22 cases reproduce EPA's .OUT line for line (the 22nd ships in EPA's archive with the wrong deck)
BPIP-PRIME exact over 6,480 direction comparisons against EPA's binary
AERSURFACE EPA's RDU reference reproduced byte for byte; about 30 configurations through the binary's setup pass
NAAQS design values exact against 40 CFR 50 appendices N, S and T and EPA's ranked plotfiles
Runner overhead and batch throughput see docs/benchmarks.md

Highlights

  • Every AERMOD v26135 keyword is read into a field or kept verbatim by a documented decision. The reader went from 59 to 115 handled keywords over four tranches: the restart, NOx-background and design-value keywords (#10); AREAPOLY, BUOYLINE and RLINEXT construction with the group, unit and barrier keywords (#13); receptor networks and the runstream layout as reset.f and setup.f define them, MAXIFILE, several urban areas and AERMODProject.unparsed_lines (#14); the EV pathway, the last ME and OU keywords, METHOD_2, PLATFORM and the POINTCAP, POINTHOR and SWPOINT sources (#15). Field layouts come from EPA's Fortran through scripts/keyword_oracle.py, and thirty probe decks under scripts/oracle_decks/ record what AERMOD said about each form, including the guesses it rejected.
  • The writer forms that were fatal in every AERMOD release are gone. Every polar grid pyaermod wrote had zero receptors (GDIR init num delta where AERMOD reads num init delta); MODELOPT ... ELEVATED, NO2STACK under ARM2, a single name-first URBANOPT, MAXIFILE filename, the METHOD deposition line, four-field EVENTPER, the AREAPOLY centroid LOCATION and the group-less BLPINPUT were all rejected by the binary. Each is now written as the Fortran reads it and checked by AERMOD's own setup pass in the test suite.
  • The regulatory math was wrong and is now exact. NAAQS design values interpolated quantiles instead of reading the rank tables in 40 CFR 50 (understating the NO2 design value at 72 of 72 receptors on EPA's data); PM2.5 and PM10 scored each day by its peak hour; BPIP had no structure influence zone, backwards rotation and centroid XBADJ and YBADJ. All are pinned against EPA's own outputs.
  • AERSURFACE and AERSCREEN drive the real binaries. Both wrote decks their programs never read. AERSURFACEConfig produces the pathway deck AERSURFACE parses and reproduces EPA's RDU reference; AERSCREENConfig answers AERSCREEN's interactive prompts or writes its restart header, with scripts/build_aerscreen.sh and a checked-in patch that makes EPA's source build under gfortran.
  • Provenance and reproducibility. The parity report stamps the AERMOD version, compiler, reference set, pyaermod version and commit; the EPA parity, real-binary and AERSCREEN workflows run weekly; the report, the audit and the benchmarks regenerate from the tag with the commands in docs/validation.md.
  • Citable. CITATION.cff (CFF 1.2.0) ships with the release; the Zenodo DOI minted for this tag is recorded there and in the README once the release is published.
  • Particle size distributions for Method 1 deposition (pyaermod.psd, docs/psd.md). Cut-point data such as AP-42's k multipliers, a lognormal fit, or any cumulative distribution become AERMOD's diameter, mass-fraction and density categories. The bins report the mass left outside them, and bins_from_cut_points(tail=...) asks what lies above the largest cut point rather than modelling no coarse mass. to_deposition_params converts aerodynamic to Stokes diameters when given a density.
  • Designed run sets (pyaermod.ensemble, docs/ensemble.md). run_design runs one AERMOD case per design row in parallel, each in its own directory, keyed by a hash of its factors, binary and input files. Its manifest makes an interrupted design resume where it stopped, and collect_plotfiles gathers the results into one table.
  • Study decks need no text patching. CO DEBUGOPT, the MODELOPT depletion switches, AREA Szinit, HOUREMIS files and receptor elevations under elevated terrain (Cartesian and polar) are written from the project model. Source groups are written after the sources, where AERMOD reads them.
  • AERMET and AERMAP decks those programs accept. Both writers produced decks that AERMET 24142/26135 and AERMAP rejected. They now write the syntax each binary reads, and a run counts as successful only when the program says it finished.
  • Runs are reported as AERMOD reported them. Aborted runs are failures, killed runs name their signal, batch results come back in input order, a resumed batch counts a deck as done only when AERMOD finished it, and the output readers keep values below 1e-99 and values flagged for calm or missing hours.
  • The GUI is seven steps: Project, Sources, Receptors, Meteorology, Output, Review & Run, Results. It also imports decks. Every user journey is driven in a real browser against recorded and real AERMOD runs.
  • Ten common AERMOD jobs (docs/use-cases.md). These are end-to-end scripts, from a single stack to NO2 chemistry, the 1-hour SO2 design value, AERMAP terrain, deposition and air-toxics screening. Each was run on AERMOD 26135 and is shown with the figure it drew. Writing them found and fixed library defects: NAAQS units, contours drawn from summary rows, PLOTFILE ranks, DEM tiles, and raster and KMZ geometry.

Breaking changes

  1. AERSURFACEConfig — the fields describe AERSURFACE's real control file (land_cover_file, zo_radius_km, seasons, moisture, sectors as (start, end, "AP"|"NONAP") triples, sfcchar_file). An old field name raises a TypeError naming the replacement.
  2. AERSCREENConfig — the fields are AERSCREEN's prompts (vertical_dimension, lateral_dimension, land_use with climate, dem_files); distances and extra_lines are removed. An old field name raises a TypeError naming the replacement.
  3. EventPeriod — AERMOD's five EVENTPER fields (event_name, averaging_period, date, source_group, original_conc) plus a required location=EventLocation(...); write(event_filename=) writes a complete event deck.
  4. OutputPathway.max_file is removed; use maxi_files=[MaxiFile(...)]. GasDepositionParams has AERMOD's field names (diffusivity, diffusivity_water, cuticular_resistance, henry_constant). deposition_method is kept but writes nothing; Method 2 deposition is method_2.
  5. The AERMET pipeline runs in two stages. AERMET 11 and later merge inside METPREP, so run_aermet_pipeline ignores stage2 (pass None) and returns the Stage 1 and METPREP results. AERMETStage2 is deprecated. Decks that AERMET would stop on now raise ValueError instead. Examples are an upper-air station without an elevation and a non-numeric SURFACE station ID.
  6. pyaermod.gui_v2.state.AppState is removed; use pyaermod.gui_v2.session.Session (reset() → new(), last_run_dir → last_run.work_dir).

bins_from_cut_points without tail=, when the bin edges reach beyond the largest cut point, now raises a FutureWarning; the next release will raise ValueError there.

The full mapping and before/after examples are in the upgrade notes of CHANGELOG-archive.md.

Install

pip install pyaermod==2.2.0
pip install "pyaermod[gui]"          # NiceGUI browser app
pip install "pyaermod[all]"          # everything

See CHANGELOG-archive.md for the complete list of changes.