Tuesday, August 9, 2011

Getting PM2.5 from CMAQ

PM2.5 is a big deal. But it is quite a beast to model, and CMAQ does so in a speciated way. This means that CMAQ keeps track of all the different types of PM (from nitrate, sulfate, whatever) and keeps them separate.

That sounds cool, because I mean that would let you look at a specific one if all you actually care about is sulfate for example. Makes sense.

But! It is way less cool for you if you really only care about PM2.5 as a total count, or if you want to use the total count as a frame of reference to a specific kind. The EPA NAAQS regulate PM2.5 as a total, so you really should care about PM2.5 as a whole too.

The reason it is less cool for you is because there is no "total PM2.5" output from CMAQ at all. You have to make it yourself. This sounds easy but can be VERY misleading, so I want to try and help you do this the right way. I did it the wrong way and it caused me more work so let's avoid that. If this confuses you even more I apologize...

There are conflicting options for calculating PM2.5. The way I did it was according to a presentation given by CMAS in 2010. That powerpoint is here: http://arset.gsfc.nasa.gov/umbc/files/Session1Day3/CMAQ-Introduction-for-ARSET.ppt

On slide 10, it says that PM2.5 is equal to the sum of a bunch of different species. So that's what I did. Is that right?

I once thought it was. Then things changed.

Instead, you can follow the approach in this document here:
www.epa.gov/CAIR/pdfs/CMAQ_Evaluation.pdf

This says on page 3 that you did the right thing when you picked your species to count in the mix, but you really should be scaling two of them by 1.167. Is that right?

Possibly? Maybe?

Next we check "Evaluation of the community multiscale air quality (CMAQ) model version 4.5: Sensitivities impacting model performance; Part II—particulate matter" by K. Wyat Appel. Note that this is for version 4.5 and you shouldn't be using that version, but in any case it says not only should you be doing that scaling bit, but also you should be looking at sodium and chlorine species too.

This is also in "A multi–pollutant,risk–based approach to air quality management:Case study for Detroit" by Karen Wesson. Is that right?

Could be?

Sometimes in life and in modeling, you have to make your own answers.

Monday, August 8, 2011

Mercury Paper Figure Documentation

I am attaching my word document describing the figures in the mercury paper that Tracey and Caitlin wrote. Each page is describing a new figure and what data was used to create it. Most of the figures were made using excel, but some where created with NCL.

http://www.scribd.com/full/61868877?access_key=key-1zae00432g0xpzpcp93a

If figures were made in excel the pathway is bolded in purple.
If figures were made with NCL the pathway to the script is bolded in black. The data for the NCL plots are bolded in blue.

I will posting more documentation on other figures I have made for my thesis work.

Jami

Thursday, July 28, 2011

CMAQ Output: ACONC vs. CONC

At last week's group meeting, I discussed the difference between 2 of CMAQ's output files: ACONC and CONC.

CONC = instantaneous pollutant concentration at each output timestep (each hour)

ACONC = average pollutant concentration for each model hour (average throughout hour)

The CONC file automatically includes all pollutants at all vertical model layers, whereas the pollutants and vertical layers in the ACONC are set by the user in the CCTM run script. In general, use ACONC for comparison with ground-based measurements and CONC for comparison with satellite data.

Overall, I found that ACONC and CONC concentrations compare very well over both the CONUS and GL domains for secondary (formed in atmosphere) pollutants. A much bigger difference is seen between ACONC and CONC for primary (directly emitted) pollutants. This difference is expected - subhourly variations in wind speed and other meteorological factors will affect the local concentrations of primary pollutants emitted from point sources (e.g. SO2, CO) much more that the concentrations of the more well-mixed secondary pollutants (e.g. O3, ASO4).

Nothing earth-shattering, but might be helpful to someone running CMAQ for the first time.

Steve

Tuesday, May 24, 2011

Requested Projections for Satellite Regridding

So, as most of you know, I'm currently working on some scripts that will regrid and reproject satellite data into a usable form. I'm doing this by writing a python framework, and I'm building it with the intention that it should be easy enough to add functionality for a given projection/regridding algorithm once I'm done.

That said, if down the line someone needs a projection I didn't initially program in, they'll have to either A) wait for me to code it in for them or B) figure out enough of how the program works to code in a projection themselves. Neither of those options would take too terribly long, but I figured I'd put as many useful projections in the program as I can now, so that later no one has to wait at all.

The only problem is, I don't really know what projections people want! For now, all I've programmed is the lambert conic conformal, so any and all suggestions are welcome! They don't take long to program, and it's actually kind of fun, so don't be shy. Just drop me a comment below with any projection you'd like to see and I'll put it in there for you.

Saturday, May 21, 2011

Scripts and File Description document

I have finally documented all the NCL scripts and data files I have created/compiled over the last few years. The Word document is currently stored on 'sox' at /Users/plachinski/Data_Management_SDP.docx and will probably updated a few more times. All of the NCL scripts described in this document are in my personal directory on 'rainforest', and all of my externals are also currently hooked up to 'rainforest'.

Feel free to utilize anything I have created. Hopefully this will save everyone some time with data analysis.

Steve

Tuesday, April 19, 2011

Nested Runs in CMAQ

So the default CMAQ CCTM scripts have a section that says:

#> remove existing output files?
set DISP = delete
#set DISP = update
# set DISP = keep

If you choose "delete" there, it clears out your $OUTDIR before running. This can be cool if you are fixing something that you did wrong the first time (which applies to 99% of the time for me), but can cause problems if you want to do a run that is more than 1 day (which should be 100% of the time). What will happen if you try to run with an initial condition of the output from last run is that the output will be deleted before it's accessed as an initial condition. This is really annoying and embarrassing. It also means that...

you pretty much don't want to use the default CMAQ CCTM scripts basically ever.

Instead you want to use a custom-made one that has some if-statements and for-loops. This allows you to have a spin-up period, redirect the output from the day before as the initial condition for the previous day, and so on.

If you're like me, you're like "that sounds easy enough but really tedious." In which case your first plan of attack is to:

don't waste your time and just copy off someone else's

I put a copy on mercury in /Users/Luedke/cmaq/cctm/copy.this.cctm.runscript
I did my best to comment in what you need to change and stuff so it finally makes sense.
Have fun.

Monday, April 11, 2011

Remote disk image installation

With most of the software we work with, the only way to install it is by building it from source code. As everyone has at some point experienced, building from source can be difficult and frustrating.

Fortunately, some software comes as "Disk images" (you'll know because the files end in .dmg). These "disk images" are the classic, point and click kind of installers that do all the work for you. The only problem is it takes a few obscure commands to get them to work over command line, and it's not always possible/convenient to go sit down at the machine itself and install it from the GUI. Here's a step-by-step on how to install disk images over the command line.

NOTE: curly braces denote that you should input whatever is appropriate for you and should not actually be input. IE if I read
ls {myHomeDirectory}
I would actually type
ls /Users/oberman

1) Download the file and put it in your home directory (don't worry, we won't be installing it here.)

2) Mount the disk image. The command for this is:
hdiutil attach {filename.dmg}

3) cd to the /Volumes directory. You should see your disk image as one of the volumes (don't worry if it doesn't have the exact same name as the filename)

4) cd into your disk image's volume. Note that if the name contains spaces, using tab completion avoids having to monkey around with escape sequences.

5) You should see at least one file that ends with .pkg, .mpkg, or some variant. This is the file we actually want to install. To do so, we use the following command:
sudo installer -verbose -pkg {packageFile.pkg} -target {/install/location/} >& {/log/filename}
If you're unsure what to put for /install/location, a good bet is almost always /usr/local/. Note that most programs build into subdirectories of the target directory (IE /target/location/bin, /target/location/lib, etc...).

6) Check the logfile (whatever you set /log/filename to be) for any error messages.

7) If you don't find any error messages, cd back to /Volumes

8) Dismount the installation volume. The command for this is:
hdiutil detach {/VolumeName}


And you've successfully installed your program! You can now dispose of the original file you downloaded if you wish, but I find I like having them filed away in case I need to reinstall. Hopefully this saves some searching next time you need to install software!