Does anybody here have any experience with editing wrfchemi outputs from the prep_chem utility so that I overwrite the file with my own emissions?

I am knowledgeable in python, but I am not that well oriented with the manipulation of NetCDF files.

What I want to do, basically, is to use my own emissions inside the WRF/Chem model

  1. I have a shapefile of emissions (gridded) with each grid having a value for the emissions.
  2. I want to convert this to a readable format for the WRF/Chem; however, I think editing the wrfchemi files by prep_chem would be easier? (Tell me if not)

I have read the emissions guide of the WRF/Chem, but it does not really expound on details about this especially about the following

  • How to deal with the speciation (my shapefile has only PM10 and PM2.5). where exactly do I place this in the new emissions file (the edited wrfchemi)I want. There are many pm species there (like pm2.5 nucleation mode, pm, etc). I am not sure what weights to put on these.
  • My emissions are not time dependent, and what do I do when I edit the wrfchemi file for this. (the wrfchemi files I have now are also not time dependent)

Hoping someone could help out with this.


  • $\begingroup$ If I understand your question correctly: Do you just want to replace values of some variables in your NetCDF file? Are your emission (the ones in the shape file) already on the same grid as present in the WRF/Chem emission file? The python netCDF4 interface is described here: unidata.github.io/netcdf4-python/netCDF4/index.html . Also a tutorial is present there. In order to get familiar with your NetCDF file you might have a look into it with ncdump (command line tool). ncdump -h FILENAME prints the header of the file containing all variables, dimensions etc. $\endgroup$ – daniel.neumann Sep 25 at 19:59
  • $\begingroup$ If your original gridded emission data are not on the same grid as your WRF/Chem setup you could convert the Shape file into NetCDF with NCL and then interpolate it onto your appropriate grid via cdo. Here you find a hint on how to do it: code.mpimet.mpg.de/boards/2/topics/6693 $\endgroup$ – daniel.neumann Sep 25 at 20:00

As far as working with netCDF files is concerned, you can use this example. What I've done in the past is loop through the dimensions, variables, and file attributes, with if statements to make changes to the parts of the file that I want to edit.

In your case, you can do what you think is best. Perhaps you can just take an average of the emissions to smooth over the subgrid variability between the wrfchemi grid and the shapefile. Just make sure that the units are consistent. Concerning temporal variability, you can do what you think is appropriate, just specify what you do when communicating your methods. So if it is easier for you to just input constant hourly emissions from a daily average emissions, then do that. If you think it is easier to keep the hour-by-hour pattern, then you can do that.

As far as the speciation is concerned (see pages 14-15), you can put PM10 in the e_pm10 variable. The PM2.5 emissions is up to you, though keep in mind what the difference between these two are (see this and this).


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.