# WRF/Chem: Editing NetCDF (wrfchemi files) for own emissions

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)

• 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.

Thanks!

• 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. – daniel.neumann Sep 25 at 19:59
• 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 – daniel.neumann Sep 25 at 20:00