If you have a PC, you don't need to compile any code
first. Instead, you can download the existing executables.
Use Windows Explorer to create a new directory C:\AERMOD .
See "Model Code" to get the appropriate executable from https://www.epa.gov/scram/air-quality-dispersion-modeling-preferred-and-recommended-models#aermod . Unzip it and copy the executable aermod.exe into your AERMOD subdirectory.
Also see the "Installation Guide" info at https://www.epa.gov/scram/air-quality-dispersion-modeling-preferred-and-recommended-models#aermod
If
you have a Mac, and if you are lucky, you can download executables for AERMOD, AERMET,
and AERMAP that I compiled in July 2018 on my iMac. You can find
them in the zip file here . Put the zip file on your Desktop, and unzip it. To see if
it works, skip step 3 below and go to the major section below that says
"Check that AERMOD runs OK on your Computer."
However, AERMOD is often updated, and Apple produces new operating
systems. So it is very likely that many of you with different
Macs and different OSX versions will be unlucky. (Sorry, please
don't contact me because I will NOT provide support for these
programs.) In that case, see item 3 next.
If
you have a Mac, and you are NOT lucky, then you need to (a) download the iTerm2 terminal
program, (b) download Xcode, (c) run Xcode and allow it to install the
additional components when prompted, (d) install MacPorts, (e) download
the fortran
compiler to your Mac; (f) download the AERMOD source code and
associated files; and (g) compile the code on your Mac. Seems
complicated, but I will guide you through it.
If you
don't already have iTerm2 on your Mac, use your browser to search on
"iTerm2". Then download this free terminal program and install it.
Check to see if you already have a fortran95 compiler on your Mac. In your iTerm2, type which gfortran . If one already exists on your computer then the path to it will be displayed. Or, you might already have it, but it might be an old version. On your terminal, type gfortran --version . I used GNU Fortran (GCC) 6.3.0 for all the work described below. If you already have it, or if you have an older or newer version that works OK when you try to use it, then skip step c below.
To install gfortran, follow the instructions in Tips to Install gfortran on your Mac , but ...
• Update to step 1 in that installation guide: use https:// instead of http://
• Update to step 13 in that installation guide: use https:// instead of http://
• Update to step 15: if your Mac is worried about the unidentified
developer, another trick to open it is to option-click on the
package. This step might not be neeeded if you Mac happily opened
the file.
Using your web browser,
download to your Mac Desktop the AERMOD source code as a zip file from https://www.epa.gov/scram/air-quality-dispersion-modeling-preferred-and-recommended-models#aermod
where it says "Model Code" / "Source Code". Move the downloaded zip file to your Desktop if it is not already there.
Then unzip the downloaded file. You should now have a folder on your Desktop called aermod_source .
Use iTerm2, and type the cd command to move into the "aermod_source" directory. For example,
if you had downloaded the airmod.zip file to your Desktop and unzipped
it there, then the following command should put you in the correct
directory.
Next, copy and paste the following command in your iTerm, and
hit the enter key to compile the aermod model. This command
should be as one very long line (it will automatically word wrap in
iTerm).
It might take a long time to compile (a minute or so depending on the
speed of your Mac) during which time nothing seems to happen in
iTerm. Please be patient and drink your coffee.
gfortran
-o aermod.x -fbounds-check -fcheck=all -Wall -frecursive -O3 modules.f
aermod.f setup.f coset.f soset.f reset.f meset.f ouset.f inpsum.f
metext.f iblval.f siggrid.f tempgrid.f windgrid.f calc1.f calc2.f
prise.f prime.f sigmas.f pitarea.f output.f evset.f evcalc.f evoutput.f
uninam.f -w
use Windows Explorer to create a subdirectory: C:\AERMOD\sample
use Windows Explorer to create a new subdirectory (i.e., a new empty folder):
C:\AERMOD\trymeOpen the Command Prompt window (i.e., the old DOS command-line window) on your PC. (Hint: Start|All Programs|Accessories|Command Prompt ). This will probably display a prompt on your screen of C:\Docuents and Settings\YOURNAME>_ .
At this command prompt, type DIR and the enter key. It should display the names and other info
about the 5 files in that tryme directory. Namely, it should show
the 5 files that were discussed in item (e) above. You are doing
this just to confirm that you have all the files you need for this run.
Then, run AERMOD by typing aermod.exe and the enter key into your Command Prompt window. Hopefully it runs, and produces new output file(s) in your tryme directory, which you can see by typing DIR enter . Hopefully one of the new files produce is aermod.out . (If your executable didn't run, then try typing only aermod or only AERMOD to get it to run.)
The most important output is in your aermod.out file. Normal text edit programs will word-wrap the output making it difficult to read. However, you can read aermod.out into a Microsoft Word document, and then reformat it to be Landscape orientation, font size 8 points, and reduce all the margins by about half their initial values. This also takes advantage of the page-breaks that are already in the aermod.out file. The result is many pages (about 33 when I did it), but is very readable. You can save it as a Word.doc , or print it into a pdf file.
Some hints are in the Sample Run Instructions.pdf that you
downloaded, but they have set up their directories slightly different
than I suggested here. Also, note that you need to enter DOS
commands into the Command Prompt window to run aermod. You can't
just double click on the aermod.exe file.
If you have a Mac, .
Use your Mac desktop to create a new folder called tryme . Drag and drop (while holding down the option key) aermod.x from the aermod_source directory to your new tryme directory. This puts a copy of the executable in tryme.
From https://www.epa.gov/scram/air-quality-dispersion-modeling-preferred-and-recommended-models#aermod download the "Sample Run (ZIP)" file to your desktop, and un-zip it.
From
this new Sample Run directory on your Desktop, use option-drag-drop to
put a copy of each of the following 4 input files into your tryme folder:
aermod.inp
aermet2.sfc
aermet2.pfl
aertest_evt.inp .
At this point, only aermod.x and those 4 input files should be in your tryme folder. Nothing else please.
Using iTerm2, use cd to navigate into your tryme directory. For example: cd ~/Desktop/tryme
Then, run AERMOD by typing ./aermod.x into your iTerm2 window.
The most important output is in your aermod.out file. Normal text edit programs will word-wrap the output making it difficult to read. However, you can read aermod.out into a Microsoft Word document, and then reformat it to be Landscape orientation, font size 8 points, and reduce all the margins by about half their initial values. This also takes advantage of the page-breaks that are already in the aermod.out file. The result is many pages (about 33 when I did it), but is very readable. You can save it as a Word.doc , or print it into a pdf file.
.
If you have a PC: you don't need to compile any code
first. Instead, you can download the existing executables.
Use Windows Explorer to create a new directory C:\AERMET .
From https://www.epa.gov/scram/meteorological-processors-and-accessory-programs#aermet, see
"Model Code" to get the appropriate executable. Unzip it
and copy the executable aermet.exe into your AERMET subdirectory.
If you have a Mac: and if you downloaded a working executable from zip file here , then skip to step 3.
Otherwise, you
will need to (a) download the AERMET fortran source code and
associated files; and (b) compile the code on your Mac.
Hopefully, you have already installed gfortran on your Mac. If
not, please see AERMOD Mac steps 2a-d in the previous section to
install and test gfortran.
Using your web browser, go to https://www.epa.gov/scram/meteorological-processors-and-accessory-programs#aermet . Then ...
...where it says "Model Code" / "Source Code", download to
your Mac Desktop the AERMET source code as a zip file. (As of Jul 2018,
that zip file is at https://www3.epa.gov/ttn/scram/7thconf/aermod/aermet_source.zip .)
Move the downloaded zip file to your Desktop if it is not already there.
Then unzip the downloaded file. You should now have a folder on your Desktop called aermet_source . It has about 200 fortran subroutine files that need to be compiled and linked into a single executable. Luckily, we will automate this for you.
Use your normal Finder to open the aermet_source folder, and change the name of one of the fortran files. Change from mod_AsosCommDates.for to mod_AsosCommDates.FOR . (You are changing the lower-case .for to upper-case .FOR).
Use your web browser to download a copy of the makefile provided here to your computer. Make sure the name of this file is makefile (with NO .txt suffix or any other suffix). This is the script that tells the fortran compiler to compile all those subroutines and link them into a single executable program. You can view this makefile in any text editor, but please don't change it and don't cause any .txt suffix to be added to it.
Copy the makefile into your aermet_source folder .
Use iTerm2, and...
type the cd command to move into the "aermet_source" directory if you are not already there. For example,
if you had downloaded the airmet.zip file to your Desktop and unzipped
it there, then the following command should put you in the correct
directory.
In iTerm2, type make and hit the enter key. This will automatically use the makefile to tell the fortran compiler what to do. If it was successful, you will see a new an object (.o) file for every one of the 200 original fortran (.FOR) files. More importantly, one of your new files is called aermet.x . This is the executable file that you wanted.
.
Both PC and Mac.
Run a sample to test if aermet is working. In the following
description, I will use the generic word "gui" for graphic user
interface, which for PC users is Windows Explorer and for Mac users is
their desktop Finder. Also, when I use the generic word
"terminal", then PC people should use Command Prompt, and Mac people
should use iTerm2. (See the examples above for AERMOD if you are
unfamiliar with usage of these software systems.)
.
If you have a PC: you don't need to compile any code
first. Instead, you can download the existing executables.
Use Windows Explorer to create a new directory C:\AERMAP .
From https://www.epa.gov/scram/air-quality-dispersion-modeling-related-model-support-programs#aermap , see
"Model Code" to download the appropriate executable to your PC. Unzip it
and copy the executable aermap.exe into your AERMAP subdirectory. Also copy all the associated .las and .los files into that same subdirectory.
If you have a Mac and if you downloaded a working executable from zip file here , then skip to step 3.
Otherwise, you
will need to (a) download the AERMAP fortran source code and
associated files; and (b) compile the code on your Mac.
Hopefully, you have already installed gfortran on your Mac. If
not, please see AERMOD Mac steps 2a-d in a previous section to
install and test gfortran.
Using your web browser, go to https://www.epa.gov/scram/air-quality-dispersion-modeling-related-model-support-programs#aermap . Then ...
...where it says "Model Code" / "Source Code", download to
your Mac Desktop the AERMAP source code as a zip file. (As of Jul 2018,
that zip file is at https://www3.epa.gov/ttn/scram/models/aermod/aermap/aermap_source.zip .)
Move the downloaded zip file to your Desktop if it is not already there.
Then unzip the downloaded file. You should now have a folder on your Desktop called aermap_source . It has about 20 fortran subroutine files that need to be compiled and linked into a single executable. Luckily, we will automate this for you.
Use your web browser to download a copy of the makefile provided here to your computer. Make sure the name of this file is makefile (with NO .txt suffix or any other suffix). This is the script that tells the fortran compiler to compile all those subroutines and link them into a single executable program. You can view this makefile in any text editor, but please don't change it and don't cause any .txt suffix to be added to it.
Copy the makefile into your aermap_source folder .
Use iTerm2, and...
type the cd command to move into the "aermap_source" directory if you are not already there. For example,
if you had downloaded the airmap.zip file to your Desktop and unzipped
it there, then the following command should put you in the correct
directory.
In iTerm2, type make and hit the enter key. This will automatically use the makefile to tell the fortran compiler what to do. If it was successful, you will see a new an object (.o) file for every one of the 20 or so original fortran (.f) files. More importantly, one of your new files is called aermap.x . This is the executable file that you wanted.
To get some of the additional supporting files, use your web-browser from your Finder to go back to https://www.epa.gov/scram/air-quality-dispersion-modeling-related-model-support-programs#aermap and then download the Windows executable zip file to your Mac desktop. Unzip it on your desktop, which creates a folder called aermap_exe . Use your finder to open that folder, and delete the windows executable file called aermap.exe . But keep the README and all associated .las and .los files. Change the name of this subdirectory to gridshift_files , which are needed input files for the test cases that you can run .
.
Both PC and Mac.
Run a sample to test if aermap is working. In the following
description, I will use the generic word "gui" for graphic user
interface, which for PC users is Windows Explorer and for Mac users is
their desktop Finder. Also, when I use the generic word
"terminal", then PC people should use Command Prompt, and Mac people
should use iTerm2. (See the examples above for AERMOD if you are
unfamiliar with usage of these software systems.)
.
.
http://www.eos.ubc.ca/courses/atsc507/ADM/
Copyright © 2016, 2018, 2021 by Roland Stull.