Processing RCP emissions in SMOKE

How do we process RCP emissions (as opposed to the commonly used NEI emissions) in SMOKE?

I am not sure whether you want to simply process the RCP gridded emissions through SMOKE without regridding to a different modeling domain or not. But, as of SMOKE v4.0, we have implemented a few feature to regrid EDGAR global gridded inventories for your modeling domain.

Check out the link for details:

2 Likes

Thanks a lot! I am looking to simulate meteorology (using WRF) and air quality (using CMAQ) for the period 2000-2060 and would thus like to process the RCP8.5 emissions in SMOKE to make them CMAQ-ready. The RCP8.5 emissions data seems to have 0.5 degrees latitude-longitude resolution, decadal timesteps and select chemical species in a netCDF format. These would need to be dealt with in SMOKE before feeding emissions data to CMAQ. The document you shared will perhaps be of good use for that purpose, looking at the first page.

1 Like

Hello:
I tried to do the same as you want and I found that if the netCDF file has the variable ā€œtime stepā€, smkinven module will not recognize the inventory file. EDGAR emission files do not have that variable, because is a unique file containing the total emission (worlwide) in a year. So, EDGAR reveals the sum of the emission in a year, expresed as [kg /m2s ] .
I tried to used Fires gridded emissions from FIRES database, with 0,1 Āŗ of resolution, but at this time, I havenĀ“t solved to get a unique file without ā€œtime stepā€ variable. I donĀ“t know how to erase it from the file.

Maybe someone in this forum could help us to solve it.
Greetings

Ernesto,

Smkinven has a flag called "NETCDF_POL_UNITā€ to specify the unit of the EDGAR pollutants, set to kg m-2 s-1 which is consistent to your setting.

Also, you have an option how to process your inventory as monthly or annual based on your knowledge. You can tell Smkinven how to handle them by how you setup the Smkinven inventory list input file (ARINV). Here is the format shown below. You need to put either specific month (i.e., 1, 2, 3,12) if your inventory file is monthly. If it is annual, then set it to 0.

#SCC, Pollutant, Variable_Name, Month, File_location_name
SOLVENT,VOC,emis_nmvoc,0,/nas/EDGAR/solvent/nmvoc/v42_2010.nc
SOLVENT,CH4,emis_ch4,0,/nas/EDGAR/solvent/ch4/v42_2010.nc
ENERGY,NOX ,emis_nox,0,/nas/EDGAR/energy/nox/v42_2010.nc
ENERGY,PM25,emis_pm25,0,/nas/EDGAR/energy/pm2.5/v42_2010.nc
ENERGY,NOX,emis_nmvoc,0,/nas/EDGAR/energy/nmvoc/v42_2010.nc

Hello Baek:
Yes, I know what you want to tell me. But my question is, What happen if the netcdf file (containing emission inventory) has the variable ā€œtime stepā€ inside.
The information you gave me is considering monthly files (the sum of monthly emission) but not considering the variable ā€œtime stepā€ inside.
I remember, from SMOKE4.5 tutorial, that we have to give to SMKINVEN gridded netCDF files time independent. Am I correct???
Thanks for your time

In my case, I am trying to use an anual inventory file, but with daily emission information inside.

Hi Ernesto,

Unfortunately, current version of SMOKE does not support the time step in netCDF file. We may update the system to support that in the future but unfortunately there is no specific plan for that feature at this moment. Sorry. :frowning:

Not problem. I hope to use any tool to extract the ā€œtime stepā€ variable from netCDF files. Until today, I do not find it.
Thanks for your time

While I was working on another project, Dr. Coats (IOAPI author) and I updated the IOAPI library to read and process raw NetCDF files including RCP and EDGAR pregridded inventory files. Once you install the latest version of IOAPI, you can tap into new module called ā€œMODNCFIOā€. You can read all attributes from the netcdf files quite easily. Here is the detail information about the module in IOAPI. You can develop a tool you need using these functions already available in IOAPI module.

https://www.cmascenter.org/ioapi/documentation/all_versions/html/MODNCFIO.html

1 Like

I saw the POL_HEMI grid parameters in the GRIDDESC file for EDGAR data:

! coords --line: name; type, P-alpha, P-beta, P-gamma, xcent, ycent
ā€™POL_HEMIā€™
6, 1.D0, 45.D0, -98.D0, -98.D0, 90.D0
ā€™ ā€™ ! end coords. grids: name; xorig,yorig,xcell,ycell,ncols,nrows,nthik
ā€™HEMI_108kā€™
ā€™POL_HEMIā€™, -10098D3, -10098D3, 108.D3, 108.D3, 187, 187, 1
ā€™ ā€™ ! end grids.

However, I am not sure I can accurately give the values of all the parameters like P-alpha, P-beta, etc to describe the grid+projection for RCP data that I downloaded. How should I proceed here?

You need to find out the detail spatial domain information for your gridded inventory files before you move forward. If your modeling domain is different than what I provided you, then you need to generate your own GRIDMASK input file for a proper spatial and temporal allocations processing through SMOKE.

Running MCIP also gives a GRIDDESC file for the WRF meteorological input, I assume.

What are possible ways of converting CSV files to IO/API format in (1) linux, and (2) windows environments? It looks like I will have to do the conversion during RCP emissions preprocessing for SMOKE.

Hi,

The specifics of what needs to be done depend upon what is in the CSV file. The easiest way starts with a pre-existing IO/API file, but that isnā€™t strictly necessary. The code below is just something a colleague threw together very quickly ā€“ it is probably not complete but it should be close:

ā€“ START PYTHON CODE

import pandas as pd

import PseudoNetCDF as pnc

pathtoexistingemisfile = ā€˜/path/to/ioapi.ncā€™

outpath = ā€˜test.ncā€™

pathtocsv = ā€˜/path/to/RCP.csvā€™

read and copy an existing file

iofile = pnc.pncopen(pathtoexistingemisfile).copy()

zero out

for k, v in iofile.variables.items():

if k != ā€˜TFLAGā€™:

v[:] = 0.

Assuming a specific structure of columns and spatial/temporal consistency

Datetime_UTC in the form YYYY-MM-DD HH:MM:SS+0000

Latitude in the form of decimal degrees north

Longitude in the form of decimal degrees east

Species in the form of the name expected by CMAQ

Value in the unit expected by CMAQ

csvdata = pd.read_csv(pathtocsv, parse_dates=[ā€˜Datetime_UTCā€™])

Convert lon/lat to i/j

i, j = iofile.ll2ij(csvdata[ā€˜Longitudeā€™], csvdata[ā€˜Latitudeā€™])

csvdata[ā€˜Iā€™] = csvdata[ā€˜Longitudeā€™].astype(ā€˜iā€™) * 0 + i

csvdata[ā€˜Jā€™] = csvdata[ā€˜Iā€™] * 0 + j

Group on date/i/j/spc and sum masses

grouped = csvdata.groupby([ā€˜Speciesā€™, ā€˜Datetime_UTCā€™, ā€˜Iā€™, ā€˜Jā€™]).sum()

times = iofile.getTimes()

for ridx, row in grouped.iterrows():

spck, date, i, j = ridx

h = ((date - times[0]).total_seconds() // 3600).astype(ā€˜iā€™)

iofile.variables[spck][h, 0, j, i] = row[ā€˜Valueā€™]

iofile.save(outpath, format=ā€˜NETCCDF_CLASSICā€™)

ā€“ END PYTHON CODE

Hello Dr Baek.
Here I am again. I have been bussy trying to change netCDF format to use in SMOKE, similar to EDGAR files.
Now, I have a way to proceess that kind of file, and it worth perfect. Now, I am wondering if I can extract daily inventory files (netCDF files) instead monthly inventory as you told me before.
I am trying to obtain fire emissions from global inventory data. So, the most correctly way is to process it as daily emissions.
It is possible to put in arinv file daily emissions from netCDF file?
Thanks

I am not sure what is the best option for this but current version can not process daily netcdf gridded inventory files. Not sure it will work or not but you can run daily netCDF inventory file as ARINV everyday. It means you need to switch the daily netcdf file everyday. With this option, you need to be careful about the time zone shift of your daily fire emissions. If they are in GMT, you need to update COSTCY file for all country to be in GMT to avoid any time zone shift during the run.

Thanks Mr Baek.
In fact, thatĀ“s the problem I have right now.
I simulated daily inventory netCDF files, putting a factor of 1 for monthly and weekly profiles. I obtained results, but there are some weird, because it suposes to be biomass burning emissions, and I can see emissions from Ocean. So, the grid cells with emissions are not well located geograpically. That problem i did not observed using edgar inventory.
I attached the image I obtained in Verdi, and you can see my problem.

I also attached you the global maps for biomass burning I used to (the same as Edgar in resolution 3600 x 1800)

Do you know what could be the cause of it?

Thanks for your time

Hello,
I have been making some calculations with the new EDGAR database for several domains in Europe with annual inventories and it works properfly. However, I found that ā€œtemporalā€ gives me an error: ā€œProblem with input dataā€ when modifying the month in the ARINV list input file. Do I have to modify any format of the inventory netcdf input files? or should I modify any additional environment variables?

Thank you for your help.

Hi Eduardo,
Are you still having a problem on processing Temporal? What kind of error message from Temporal?