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.fandsetup.fdefine them, MAXIFILE, several urban areas andAERMODProject.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 throughscripts/keyword_oracle.py, and thirty probe decks underscripts/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 deltawhere AERMOD readsnum init delta);MODELOPT ... ELEVATED,NO2STACKunder ARM2, a single name-firstURBANOPT,MAXIFILE filename, theMETHODdeposition line, four-fieldEVENTPER, the AREAPOLY centroid LOCATION and the group-lessBLPINPUTwere 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.
AERSURFACEConfigproduces the pathway deck AERSURFACE parses and reproduces EPA's RDU reference;AERSCREENConfiganswers AERSCREEN's interactive prompts or writes its restart header, withscripts/build_aerscreen.shand 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'skmultipliers, a lognormal fit, or any cumulative distribution become AERMOD's diameter, mass-fraction and density categories. The bins report the mass left outside them, andbins_from_cut_points(tail=...)asks what lies above the largest cut point rather than modelling no coarse mass.to_deposition_paramsconverts aerodynamic to Stokes diameters when given a density. - Designed run sets (
pyaermod.ensemble, docs/ensemble.md).run_designruns 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, andcollect_plotfilesgathers the results into one table. - Study decks need no text patching.
CO DEBUGOPT, the MODELOPT depletion switches, AREA Szinit,HOUREMISfiles 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¶
AERSURFACEConfig— the fields describe AERSURFACE's real control file (land_cover_file,zo_radius_km,seasons,moisture,sectorsas(start, end, "AP"|"NONAP")triples,sfcchar_file). An old field name raises aTypeErrornaming the replacement.AERSCREENConfig— the fields are AERSCREEN's prompts (vertical_dimension,lateral_dimension,land_usewithclimate,dem_files);distancesandextra_linesare removed. An old field name raises aTypeErrornaming the replacement.EventPeriod— AERMOD's fiveEVENTPERfields (event_name, averaging_period, date, source_group, original_conc) plus a requiredlocation=EventLocation(...);write(event_filename=)writes a complete event deck.OutputPathway.max_fileis removed; usemaxi_files=[MaxiFile(...)].GasDepositionParamshas AERMOD's field names (diffusivity,diffusivity_water,cuticular_resistance,henry_constant).deposition_methodis kept but writes nothing; Method 2 deposition ismethod_2.- The AERMET pipeline runs in two stages. AERMET 11 and later merge
inside METPREP, so
run_aermet_pipelineignoresstage2(passNone) and returns the Stage 1 and METPREP results.AERMETStage2is deprecated. Decks that AERMET would stop on now raiseValueErrorinstead. Examples are an upper-air station without an elevation and a non-numeric SURFACE station ID. pyaermod.gui_v2.state.AppStateis removed; usepyaermod.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.