# Using SMOKE to convert netCDF file into CMAQ-ready format

**URL:** <https://forum.cmascenter.org/t/using-smoke-to-convert-netcdf-file-into-cmaq-ready-format/2568>\
**Category:** SMOKE\
**Created:** [August 10, 2021, 8:46pm UTC](https://forum.cmascenter.org/t/using-smoke-to-convert-netcdf-file-into-cmaq-ready-format/2568 "2021-08-10T20:46:25Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![fang63](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.cmascenter.org/fang63/32/42_2.png) [@fang63](https://forum.cmascenter.org/u/fang63)\
**Post date:** [August 10, 2021, 8:46pm UTC](https://forum.cmascenter.org/t/using-smoke-to-convert-netcdf-file-into-cmaq-ready-format/2568/1 "2021-08-10T20:46:25Z")

</div>

Hi CMAS users:

I have an emission input dataset in netCDF format. However, it is not under the same style, which could be used in CMAQ simulation. Does anyone could guide me through, how to use SMOKE to handle this dataset?  
I am attaching the metadata of this dataset, as well as an example of a common emission input dataset in CMAQ simulation (generated from SMOKE) below.

Thank you for your time  
Best,  
Huan

> netcdf \2016\_10\_agriculture\_NOx {  
> dimensions:  
> side = 2 ;  
> xysize = 64000 ;  
> variables:  
> double x\_range(side) ;  
> double y\_range(side) ;  
> double spacing(side) ;  
> int dimension(side) ;  
> float z(xysize) ;  
> z:scale\_factor = 1. ;  
> z:add\_offset = 0. ;  
> z:node\_offset = 1 ;  
> z:nodata\_value = -9999. ;
> 
> // global attributes:  
> :title = “” ;  
> :source = “MEIC Core gridding - GMTEngine” ;  
> data:
> 
> x\_range = 70, 150 ;
> 
> y\_range = 10, 60 ;
> 
> spacing = 0.25, 0.25 ;
> 
> dimension = 320, 200 ;

> netcdf agts\_l.area.20050710.1.us12-nc.nctox {  
> dimensions:  
> TSTEP = UNLIMITED ; // (25 currently)  
> DATE-TIME = 2 ;  
> LAY = 1 ;  
> VAR = 31 ;  
> ROW = 52 ;  
> COL = 66 ;  
> variables:  
> int TFLAG(TSTEP, VAR, DATE-TIME) ;  
> TFLAG:units = “\<YYYYDDD,HHMMSS\>” ;  
> TFLAG:long\_name = "TFLAG " ;  
> TFLAG:var\_desc = "Timestep-valid flags: (1) YYYYDDD or (2) HHMMSS " ;  
> float CO(TSTEP, LAY, ROW, COL) ;  
> CO:long\_name = "CO " ;  
> CO:units = "moles/s " ;  
> CO:var\_desc = "Model species CO " ;  
> float HONO(TSTEP, LAY, ROW, COL) ;  
> HONO:long\_name = "HONO " ;  
> HONO:units = "moles/s " ;  
> HONO:var\_desc = "Model species HONO " ;  
> float NO(TSTEP, LAY, ROW, COL) ;  
> NO:long\_name = "NO " ;  
> NO:units = "moles/s " ;  
> NO:var\_desc = "Model species NO " ;  
> float NO2(TSTEP, LAY, ROW, COL) ;  
> NO2:long\_name = "NO2 " ;  
> NO2:units = "moles/s " ;  
> NO2:var\_desc = "Model species NO2 " ;  
> float ALD2(TSTEP, LAY, ROW, COL) ;  
> ALD2:long\_name = "ALD2 " ;  
> ALD2:units = "moles/s " ;  
> ALD2:var\_desc = "Model species ALD2 " ;  
> float ALDX(TSTEP, LAY, ROW, COL) ;  
> ALDX:long\_name = "ALDX " ;  
> ALDX:units = "moles/s " ;  
> ALDX:var\_desc = "Model species ALDX " ;  
> float BENZENE(TSTEP, LAY, ROW, COL) ;  
> BENZENE:long\_name = "BENZENE " ;  
> BENZENE:units = "moles/s " ;  
> BENZENE:var\_desc = "Model species BENZENE " ;  
> float CH4(TSTEP, LAY, ROW, COL) ;  
> CH4:long\_name = "CH4 " ;  
> CH4:units = "moles/s " ;  
> CH4:var\_desc = "Model species CH4 " ;  
> float ETH(TSTEP, LAY, ROW, COL) ;  
> ETH:long\_name = "ETH " ;  
> ETH:units = "moles/s " ;  
> ETH:var\_desc = "Model species ETH " ;  
> float ETHA(TSTEP, LAY, ROW, COL) ;  
> ETHA:long\_name = "ETHA " ;  
> ETHA:units = "moles/s " ;  
> ETHA:var\_desc = "Model species ETHA " ;  
> float ETOH(TSTEP, LAY, ROW, COL) ;  
> ETOH:long\_name = "ETOH " ;  
> ETOH:units = "moles/s " ;  
> ETOH:var\_desc = "Model species ETOH " ;  
> float FORM(TSTEP, LAY, ROW, COL) ;  
> FORM:long\_name = "FORM " ;  
> FORM:units = "moles/s " ;  
> FORM:var\_desc = "Model species FORM " ;  
> float IOLE(TSTEP, LAY, ROW, COL) ;  
> IOLE:long\_name = "IOLE " ;  
> IOLE:units = "moles/s " ;  
> IOLE:var\_desc = "Model species IOLE " ;  
> float ISOP(TSTEP, LAY, ROW, COL) ;  
> ISOP:long\_name = "ISOP " ;  
> ISOP:units = "moles/s " ;  
> ISOP:var\_desc = "Model species ISOP " ;  
> float MEOH(TSTEP, LAY, ROW, COL) ;  
> MEOH:long\_name = "MEOH " ;  
> MEOH:units = "moles/s " ;  
> MEOH:var\_desc = "Model species MEOH " ;  
> float NVOL(TSTEP, LAY, ROW, COL) ;  
> NVOL:long\_name = "NVOL " ;  
> NVOL:units = "moles/s " ;  
> NVOL:var\_desc = "Model species NVOL " ;  
> float OLE(TSTEP, LAY, ROW, COL) ;  
> OLE:long\_name = "OLE " ;  
> OLE:units = "moles/s " ;  
> OLE:var\_desc = "Model species OLE " ;  
> float PAR(TSTEP, LAY, ROW, COL) ;  
> PAR:long\_name = "PAR " ;  
> PAR:units = "moles/s " ;  
> PAR:var\_desc = "Model species PAR " ;  
> float TERP(TSTEP, LAY, ROW, COL) ;  
> TERP:long\_name = "TERP " ;  
> TERP:units = "moles/s " ;  
> TERP:var\_desc = "Model species TERP " ;  
> float TOL(TSTEP, LAY, ROW, COL) ;  
> TOL:long\_name = "TOL " ;  
> TOL:units = "moles/s " ;  
> TOL:var\_desc = "Model species TOL " ;  
> float UNK(TSTEP, LAY, ROW, COL) ;  
> UNK:long\_name = "UNK " ;  
> UNK:units = "moles/s " ;  
> UNK:var\_desc = "Model species UNK " ;  
> float UNR(TSTEP, LAY, ROW, COL) ;  
> UNR:long\_name = "UNR " ;  
> UNR:units = "moles/s " ;  
> UNR:var\_desc = "Model species UNR " ;  
> float XYL(TSTEP, LAY, ROW, COL) ;  
> XYL:long\_name = "XYL " ;  
> XYL:units = "moles/s " ;  
> XYL:var\_desc = "Model species XYL " ;  
> float NH3(TSTEP, LAY, ROW, COL) ;  
> NH3:long\_name = "NH3 " ;  
> NH3:units = "moles/s " ;  
> NH3:var\_desc = "Model species NH3 " ;  
> float SO2(TSTEP, LAY, ROW, COL) ;  
> SO2:long\_name = "SO2 " ;  
> SO2:units = "moles/s " ;  
> SO2:var\_desc = "Model species SO2 " ;  
> float SULF(TSTEP, LAY, ROW, COL) ;  
> SULF:long\_name = "SULF " ;  
> SULF:units = "moles/s " ;  
> SULF:var\_desc = "Model species SULF " ;  
> float PEC(TSTEP, LAY, ROW, COL) ;  
> PEC:long\_name = "PEC " ;  
> PEC:units = "g/s " ;  
> PEC:var\_desc = "Model species PEC " ;  
> float PMFINE(TSTEP, LAY, ROW, COL) ;  
> PMFINE:long\_name = "PMFINE " ;  
> PMFINE:units = "g/s " ;  
> PMFINE:var\_desc = "Model species PMFINE " ;  
> float PNO3(TSTEP, LAY, ROW, COL) ;  
> PNO3:long\_name = "PNO3 " ;  
> PNO3:units = "g/s " ;  
> PNO3:var\_desc = "Model species PNO3 " ;  
> float POC(TSTEP, LAY, ROW, COL) ;  
> POC:long\_name = "POC " ;  
> POC:units = "g/s " ;  
> POC:var\_desc = "Model species POC " ;  
> float PSO4(TSTEP, LAY, ROW, COL) ;  
> PSO4:long\_name = "PSO4 " ;  
> PSO4:units = "g/s " ;  
> PSO4:var\_desc = "Model species PSO4 " ;
> 
> // global attributes:  
> :IOAPI\_VERSION = "ioapi-3.2: Id: init3.F90 120 2019-06-21 14:18:20Z coats " ;  
> :EXEC\_ID = "??? " ;  
> :FTYPE = 1 ;  
> :CDATE = 2020161 ;  
> :CTIME = 1230 ;  
> :WDATE = 2020161 ;  
> :WTIME = 1230 ;  
> :SDATE = 2005191 ;  
> :STIME = 0 ;  
> :TSTEP = 10000 ;  
> :NTHIK = 1 ;  
> :NCOLS = 66 ;  
> :NROWS = 52 ;  
> :NLAYS = 1 ;  
> :NVARS = 31 ;  
> :GDTYP = 2 ;  
> :P\_ALP = 33. ;  
> :P\_BET = 45. ;  
> :P\_GAM = -97. ;  
> :XCENT = -97. ;  
> :YCENT = 40. ;  
> :XORIG = 1128000. ;  
> :YORIG = -672000. ;  
> :XCELL = 12000. ;  
> :YCELL = 12000. ;  
> :VGTYP = -1 ;  
> :VGTOP = 0.f ;  
> :VGLVLS = 0.f, 0.f ;  
> :GDNAM = "US12NC\_66X52 " ;  
> :UPNAM = "CREATESET " ;  
> :VAR-LIST = "CO HONO NO NO2 ALD2 ALDX BENZENE CH4 ETH ETHA ETOH FORM IOLE ISOP MEOH NVOL OLE PAR TERP TOL UNK UNR XYL NH3 SO2 SULF PEC PMFINE PNO3 POC PSO4 " ;  
> :FILEDESC = "Area source emissions data /FROM/ OPENMRGOUT /VERSION/ SMOKEv4.7\_ /BASE YEAR/ 2002 /NUMBER OF FILES/ 1 /FILE POSITION/ 1 /NUMBER OF VARIABLES/ 31 " ;  
> :HISTORY = “” ;  
> data:
> 
> TFLAG =  
> 2005191, 0,  
> 2005191, 0,  
> 2005191, 0,  
> 2005191, 0,  
> 2005191, 0,  
> 2005191, 0,  
> 2005191, 0,  
> 2005191, 0,  
> 2005191, 0,  
> 2005191, 0,  
> 2005191, 0,  
> 2005191, 0,  
> 2005191, 0,  
> 2005191, 0,  
> 2005191, 0,  
> 2005191, 0,  
> 2005191, 0,  
> 2005191, 0,  
> 2005191, 0,  
> 2005191, 0,  
> 2005191, 0,  
> 2005191, 0,  
> 2005191, 0,  
> 2005191, 0,  
> 2005191, 0,  
> 2005191, 0,  
> 2005191, 0,  
> 2005191, 0,  
> 2005191, 0,  
> 2005191, 0,  
> 2005191, 0,  
> 2005191, 10000,  
> 2005191, 10000,  
> 2005191, 10000,  
> 2005191, 10000,  
> 2005191, 10000,  
> 2005191, 10000,  
> 2005191, 10000,  
> 2005191, 10000,  
> 2005191, 10000,  
> 2005191, 10000,  
> 2005191, 10000,  
> 2005191, 10000,  
> 2005191, 10000,  
> 2005191, 10000,  
> 2005191, 10000,  
> 2005191, 10000,  
> 2005191, 10000,  
> 2005191, 10000,  
> 2005191, 10000,  
> 2005191, 10000,  
> 2005191, 10000,  
> 2005191, 10000,  
> 2005191, 10000,  
> 2005191, 10000,  
> 2005191, 10000,  
> 2005191, 10000,  
> 2005191, 10000,  
> 2005191, 10000,  
> 2005191, 10000,  
> 2005191, 10000,  
> 2005191, 10000,  
> 2005191, 20000,  
> 2005191, 20000,  
> 2005191, 20000,  
> 2005191, 20000,  
> 2005191, 20000,  
> 2005191, 20000,  
> 2005191, 20000,  
> 2005191, 20000,  
> 2005191, 20000,  
> 2005191, 20000,  
> 2005191, 20000,  
> 2005191, 20000,  
> 2005191, 20000,  
> 2005191, 20000,  
> 2005191, 20000,  
> 2005191, 20000,  
> 2005191, 20000,  
> 2005191, 20000,  
> 2005191, 20000,  
> 2005191, 20000,  
> 2005191, 20000,  
> 2005191, 20000,  
> 2005191, 20000,  
> 2005191, 20000,  
> 2005191, 20000,  
> 2005191, 20000,  
> 2005191, 20000,  
> 2005191, 20000,  
> 2005191, 20000,  
> 2005191, 20000,  
> 2005191, 20000,  
> 2005191, 30000,  
> 2005191, 30000,  
> 2005191, 30000,  
> 2005191, 30000,  
> 2005191, 30000,  
> 2005191, 30000,  
> 2005191, 30000,  
> 2005191, 30000,  
> 2005191, 30000,  
> 2005191, 30000,  
> 2005191, 30000,  
> 2005191, 30000,  
> 2005191, 30000,  
> 2005191, 30000,  
> 2005191, 30000,  
> 2005191, 30000,  
> 2005191, 30000,  
> 2005191, 30000,  
> 2005191, 30000,  
> 2005191, 30000,  
> 2005191, 30000,  
> 2005191, 30000,  
> 2005191, 30000,  
> 2005191, 30000,  
> 2005191, 30000,  
> 2005191, 30000,  
> 2005191, 30000,  
> 2005191, 30000,  
> 2005191, 30000,  
> 2005191, 30000,  
> 2005191, 30000,  
> 2005191, 40000,  
> 2005191, 40000,  
> 2005191, 40000,  
> 2005191, 40000,  
> 2005191, 40000,  
> 2005191, 40000,  
> 2005191, 40000,  
> 2005191, 40000,  
> 2005191, 40000,  
> 2005191, 40000,  
> 2005191, 40000,  
> 2005191, 40000,  
> 2005191, 40000,  
> 2005191, 40000,  
> 2005191, 40000,  
> 2005191, 40000,  
> 2005191, 40000,  
> 2005191, 40000,  
> 2005191, 40000,  
> 2005191, 40000,  
> 2005191, 40000,  
> 2005191, 40000,  
> 2005191, 40000,  
> 2005191, 40000,  
> 2005191, 40000,  
> 2005191, 40000,  
> 2005191, 40000,  
> 2005191, 40000,  
> 2005191, 40000,  
> 2005191, 40000,  
> 2005191, 40000,  
> 2005191, 50000,  
> 2005191, 50000,  
> 2005191, 50000,  
> 2005191, 50000,  
> 2005191, 50000,  
> 2005191, 50000,  
> 2005191, 50000,  
> 2005191, 50000,  
> 2005191, 50000,  
> 2005191, 50000,  
> 2005191, 50000,  
> 2005191, 50000,  
> 2005191, 50000,  
> 2005191, 50000,  
> 2005191, 50000,  
> 2005191, 50000,  
> 2005191, 50000,  
> 2005191, 50000,  
> 2005191, 50000,  
> 2005191, 50000,  
> 2005191, 50000,  
> 2005191, 50000,  
> 2005191, 50000,  
> 2005191, 50000,  
> 2005191, 50000,  
> 2005191, 50000,  
> 2005191, 50000,  
> 2005191, 50000,  
> 2005191, 50000,  
> 2005191, 50000,  
> 2005191, 50000,  
> 2005191, 60000,  
> 2005191, 60000,  
> 2005191, 60000,  
> 2005191, 60000,  
> 2005191, 60000,  
> 2005191, 60000,  
> 2005191, 60000,  
> 2005191, 60000,  
> 2005191, 60000,  
> 2005191, 60000,  
> 2005191, 60000,  
> 2005191, 60000,  
> 2005191, 60000,  
> 2005191, 60000,  
> 2005191, 60000,  
> 2005191, 60000,  
> 2005191, 60000,  
> 2005191, 60000,  
> 2005191, 60000,  
> 2005191, 60000,  
> 2005191, 60000,  
> 2005191, 60000,  
> 2005191, 60000,  
> 2005191, 60000,  
> 2005191, 60000,  
> 2005191, 60000,  
> 2005191, 60000,  
> 2005191, 60000,  
> 2005191, 60000,  
> 2005191, 60000,  
> 2005191, 60000,  
> 2005191, 70000,  
> 2005191, 70000,  
> 2005191, 70000,  
> 2005191, 70000,  
> 2005191, 70000,  
> 2005191, 70000,  
> 2005191, 70000,  
> 2005191, 70000,  
> 2005191, 70000,  
> 2005191, 70000,  
> 2005191, 70000,  
> 2005191, 70000,  
> 2005191, 70000,  
> 2005191, 70000,  
> 2005191, 70000,  
> 2005191, 70000,  
> 2005191, 70000,  
> 2005191, 70000,  
> 2005191, 70000,  
> 2005191, 70000,  
> 2005191, 70000,  
> 2005191, 70000,  
> 2005191, 70000,  
> 2005191, 70000,  
> 2005191, 70000,  
> 2005191, 70000,  
> 2005191, 70000,  
> 2005191, 70000,  
> 2005191, 70000,  
> 2005191, 70000,  
> 2005191, 70000,  
> 2005191, 80000,  
> 2005191, 80000,  
> 2005191, 80000,  
> 2005191, 80000,  
> 2005191, 80000,  
> 2005191, 80000,  
> 2005191, 80000,  
> 2005191, 80000,  
> 2005191, 80000,  
> 2005191, 80000,  
> 2005191, 80000,  
> 2005191, 80000,  
> 2005191, 80000,  
> 2005191, 80000,  
> 2005191, 80000,  
> 2005191, 80000,  
> 2005191, 80000,  
> 2005191, 80000,  
> 2005191, 80000,  
> 2005191, 80000,  
> 2005191, 80000,  
> 2005191, 80000,  
> 2005191, 80000,  
> 2005191, 80000,  
> 2005191, 80000,  
> 2005191, 80000,  
> 2005191, 80000,  
> 2005191, 80000,  
> 2005191, 80000,  
> 2005191, 80000,  
> 2005191, 80000,  
> 2005191, 90000,  
> 2005191, 90000,  
> 2005191, 90000,  
> 2005191, 90000,  
> 2005191, 90000,  
> 2005191, 90000,  
> 2005191, 90000,  
> 2005191, 90000,  
> 2005191, 90000,  
> 2005191, 90000,  
> 2005191, 90000,  
> 2005191, 90000,  
> 2005191, 90000,  
> 2005191, 90000,  
> 2005191, 90000,  
> 2005191, 90000,  
> 2005191, 90000,  
> 2005191, 90000,  
> 2005191, 90000,  
> 2005191, 90000,  
> 2005191, 90000,  
> 2005191, 90000,  
> 2005191, 90000,  
> 2005191, 90000,  
> 2005191, 90000,  
> 2005191, 90000,  
> 2005191, 90000,  
> 2005191, 90000,  
> 2005191, 90000,  
> 2005191, 90000,  
> 2005191, 90000,  
> 2005191, 100000,  
> 2005191, 100000,  
> 2005191, 100000,  
> 2005191, 100000,  
> 2005191, 100000,  
> 2005191, 100000,  
> 2005191, 100000,  
> 2005191, 100000,  
> 2005191, 100000,  
> 2005191, 100000,  
> 2005191, 100000,  
> 2005191, 100000,  
> 2005191, 100000,  
> 2005191, 100000,  
> 2005191, 100000,  
> 2005191, 100000,  
> 2005191, 100000,  
> 2005191, 100000,  
> 2005191, 100000,  
> 2005191, 100000,  
> 2005191, 100000,  
> 2005191, 100000,  
> 2005191, 100000,  
> 2005191, 100000,  
> 2005191, 100000,  
> 2005191, 100000,  
> 2005191, 100000,  
> 2005191, 100000,  
> 2005191, 100000,  
> 2005191, 100000,  
> 2005191, 100000,  
> 2005191, 110000,  
> 2005191, 110000,  
> 2005191, 110000,  
> 2005191, 110000,  
> 2005191, 110000,  
> 2005191, 110000,  
> 2005191, 110000,  
> 2005191, 110000,  
> 2005191, 110000,  
> 2005191, 110000,  
> 2005191, 110000,  
> 2005191, 110000,  
> 2005191, 110000,  
> 2005191, 110000,  
> 2005191, 110000,  
> 2005191, 110000,  
> 2005191, 110000,  
> 2005191, 110000,  
> 2005191, 110000,  
> 2005191, 110000,  
> 2005191, 110000,  
> 2005191, 110000,  
> 2005191, 110000,  
> 2005191, 110000,  
> 2005191, 110000,  
> 2005191, 110000,  
> 2005191, 110000,  
> 2005191, 110000,  
> 2005191, 110000,  
> 2005191, 110000,  
> 2005191, 110000,  
> 2005191, 120000,  
> 2005191, 120000,  
> 2005191, 120000,  
> 2005191, 120000,  
> 2005191, 120000,  
> 2005191, 120000,  
> 2005191, 120000,  
> 2005191, 120000,  
> 2005191, 120000,  
> 2005191, 120000,  
> 2005191, 120000,  
> 2005191, 120000,  
> 2005191, 120000,  
> 2005191, 120000,  
> 2005191, 120000,  
> 2005191, 120000,  
> 2005191, 120000,  
> 2005191, 120000,  
> 2005191, 120000,  
> 2005191, 120000,  
> 2005191, 120000,  
> 2005191, 120000,  
> 2005191, 120000,  
> 2005191, 120000,  
> 2005191, 120000,  
> 2005191, 120000,  
> 2005191, 120000,  
> 2005191, 120000,  
> 2005191, 120000,  
> 2005191, 120000,  
> 2005191, 120000,  
> 2005191, 130000,  
> 2005191, 130000,  
> 2005191, 130000,  
> 2005191, 130000,  
> 2005191, 130000,  
> 2005191, 130000,  
> 2005191, 130000,  
> 2005191, 130000,  
> 2005191, 130000,  
> 2005191, 130000,  
> 2005191, 130000,  
> 2005191, 130000,  
> 2005191, 130000,  
> 2005191, 130000,  
> 2005191, 130000,  
> 2005191, 130000,  
> 2005191, 130000,  
> 2005191, 130000,  
> 2005191, 130000,  
> 2005191, 130000,  
> 2005191, 130000,  
> 2005191, 130000,  
> 2005191, 130000,  
> 2005191, 130000,  
> 2005191, 130000,  
> 2005191, 130000,  
> 2005191, 130000,  
> 2005191, 130000,  
> 2005191, 130000,  
> 2005191, 130000,  
> 2005191, 130000,  
> 2005191, 140000,  
> 2005191, 140000,  
> 2005191, 140000,  
> 2005191, 140000,  
> 2005191, 140000,  
> 2005191, 140000,  
> 2005191, 140000,  
> 2005191, 140000,  
> 2005191, 140000,  
> 2005191, 140000,  
> 2005191, 140000,  
> 2005191, 140000,  
> 2005191, 140000,  
> 2005191, 140000,  
> 2005191, 140000,  
> 2005191, 140000,  
> 2005191, 140000,  
> 2005191, 140000,  
> 2005191, 140000,  
> 2005191, 140000,  
> 2005191, 140000,  
> 2005191, 140000,  
> 2005191, 140000,  
> 2005191, 140000,  
> 2005191, 140000,  
> 2005191, 140000,  
> 2005191, 140000,  
> 2005191, 140000,  
> 2005191, 140000,  
> 2005191, 140000,  
> 2005191, 140000,  
> 2005191, 150000,  
> 2005191, 150000,  
> 2005191, 150000,  
> 2005191, 150000,  
> 2005191, 150000,  
> 2005191, 150000,  
> 2005191, 150000,  
> 2005191, 150000,  
> 2005191, 150000,  
> 2005191, 150000,  
> 2005191, 150000,  
> 2005191, 150000,  
> 2005191, 150000,  
> 2005191, 150000,  
> 2005191, 150000,  
> 2005191, 150000,  
> 2005191, 150000,  
> 2005191, 150000,  
> 2005191, 150000,  
> 2005191, 150000,  
> 2005191, 150000,  
> 2005191, 150000,  
> 2005191, 150000,  
> 2005191, 150000,  
> 2005191, 150000,  
> 2005191, 150000,  
> 2005191, 150000,  
> 2005191, 150000,  
> 2005191, 150000,  
> 2005191, 150000,  
> 2005191, 150000,  
> 2005191, 160000,  
> 2005191, 160000,  
> 2005191, 160000,  
> 2005191, 160000,  
> 2005191, 160000,  
> 2005191, 160000,  
> 2005191, 160000,  
> 2005191, 160000,  
> 2005191, 160000,  
> 2005191, 160000,  
> 2005191, 160000,  
> 2005191, 160000,  
> 2005191, 160000,  
> 2005191, 160000,  
> 2005191, 160000,  
> 2005191, 160000,  
> 2005191, 160000,  
> 2005191, 160000,  
> 2005191, 160000,  
> 2005191, 160000,  
> 2005191, 160000,  
> 2005191, 160000,  
> 2005191, 160000,  
> 2005191, 160000,  
> 2005191, 160000,  
> 2005191, 160000,  
> 2005191, 160000,  
> 2005191, 160000,  
> 2005191, 160000,  
> 2005191, 160000,  
> 2005191, 160000,  
> 2005191, 170000,  
> 2005191, 170000,  
> 2005191, 170000,  
> 2005191, 170000,  
> 2005191, 170000,  
> 2005191, 170000,  
> 2005191, 170000,  
> 2005191, 170000,  
> 2005191, 170000,  
> 2005191, 170000,  
> 2005191, 170000,  
> 2005191, 170000,  
> 2005191, 170000,  
> 2005191, 170000,  
> 2005191, 170000,  
> 2005191, 170000,  
> 2005191, 170000,  
> 2005191, 170000,  
> 2005191, 170000,  
> 2005191, 170000,  
> 2005191, 170000,  
> 2005191, 170000,  
> 2005191, 170000,  
> 2005191, 170000,  
> 2005191, 170000,  
> 2005191, 170000,  
> 2005191, 170000,  
> 2005191, 170000,  
> 2005191, 170000,  
> 2005191, 170000,  
> 2005191, 170000,  
> 2005191, 180000,  
> 2005191, 180000,  
> 2005191, 180000,  
> 2005191, 180000,  
> 2005191, 180000,  
> 2005191, 180000,  
> 2005191, 180000,  
> 2005191, 180000,  
> 2005191, 180000,  
> 2005191, 180000,  
> 2005191, 180000,  
> 2005191, 180000,  
> 2005191, 180000,  
> 2005191, 180000,  
> 2005191, 180000,  
> 2005191, 180000,  
> 2005191, 180000,  
> 2005191, 180000,  
> 2005191, 180000,  
> 2005191, 180000,  
> 2005191, 180000,  
> 2005191, 180000,  
> 2005191, 180000,  
> 2005191, 180000,  
> 2005191, 180000,  
> 2005191, 180000,  
> 2005191, 180000,  
> 2005191, 180000,  
> 2005191, 180000,  
> 2005191, 180000,  
> 2005191, 180000,  
> 2005191, 190000,  
> 2005191, 190000,  
> 2005191, 190000,  
> 2005191, 190000,  
> 2005191, 190000,  
> 2005191, 190000,  
> 2005191, 190000,  
> 2005191, 190000,  
> 2005191, 190000,  
> 2005191, 190000,  
> 2005191, 190000,  
> 2005191, 190000,  
> 2005191, 190000,  
> 2005191, 190000,  
> 2005191, 190000,  
> 2005191, 190000,  
> 2005191, 190000,  
> 2005191, 190000,  
> 2005191, 190000,  
> 2005191, 190000,  
> 2005191, 190000,  
> 2005191, 190000,  
> 2005191, 190000,  
> 2005191, 190000,  
> 2005191, 190000,  
> 2005191, 190000,  
> 2005191, 190000,  
> 2005191, 190000,  
> 2005191, 190000,  
> 2005191, 190000,  
> 2005191, 190000,  
> 2005191, 200000,  
> 2005191, 200000,  
> 2005191, 200000,  
> 2005191, 200000,  
> 2005191, 200000,  
> 2005191, 200000,  
> 2005191, 200000,  
> 2005191, 200000,  
> 2005191, 200000,  
> 2005191, 200000,  
> 2005191, 200000,  
> 2005191, 200000,  
> 2005191, 200000,  
> 2005191, 200000,  
> 2005191, 200000,  
> 2005191, 200000,  
> 2005191, 200000,  
> 2005191, 200000,  
> 2005191, 200000,  
> 2005191, 200000,  
> 2005191, 200000,  
> 2005191, 200000,  
> 2005191, 200000,  
> 2005191, 200000,  
> 2005191, 200000,  
> 2005191, 200000,  
> 2005191, 200000,  
> 2005191, 200000,  
> 2005191, 200000,  
> 2005191, 200000,  
> 2005191, 200000,  
> 2005191, 210000,  
> 2005191, 210000,  
> 2005191, 210000,  
> 2005191, 210000,  
> 2005191, 210000,  
> 2005191, 210000,  
> 2005191, 210000,  
> 2005191, 210000,  
> 2005191, 210000,  
> 2005191, 210000,  
> 2005191, 210000,  
> 2005191, 210000,  
> 2005191, 210000,  
> 2005191, 210000,  
> 2005191, 210000,  
> 2005191, 210000,  
> 2005191, 210000,  
> 2005191, 210000,  
> 2005191, 210000,  
> 2005191, 210000,  
> 2005191, 210000,  
> 2005191, 210000,  
> 2005191, 210000,  
> 2005191, 210000,  
> 2005191, 210000,  
> 2005191, 210000,  
> 2005191, 210000,  
> 2005191, 210000,  
> 2005191, 210000,  
> 2005191, 210000,  
> 2005191, 210000,  
> 2005191, 220000,  
> 2005191, 220000,  
> 2005191, 220000,  
> 2005191, 220000,  
> 2005191, 220000,  
> 2005191, 220000,  
> 2005191, 220000,  
> 2005191, 220000,  
> 2005191, 220000,  
> 2005191, 220000,  
> 2005191, 220000,  
> 2005191, 220000,  
> 2005191, 220000,  
> 2005191, 220000,  
> 2005191, 220000,  
> 2005191, 220000,  
> 2005191, 220000,  
> 2005191, 220000,  
> 2005191, 220000,  
> 2005191, 220000,  
> 2005191, 220000,  
> 2005191, 220000,  
> 2005191, 220000,  
> 2005191, 220000,  
> 2005191, 220000,  
> 2005191, 220000,  
> 2005191, 220000,  
> 2005191, 220000,  
> 2005191, 220000,  
> 2005191, 220000,  
> 2005191, 220000,  
> 2005191, 230000,  
> 2005191, 230000,  
> 2005191, 230000,  
> 2005191, 230000,  
> 2005191, 230000,  
> 2005191, 230000,  
> 2005191, 230000,  
> 2005191, 230000,  
> 2005191, 230000,  
> 2005191, 230000,  
> 2005191, 230000,  
> 2005191, 230000,  
> 2005191, 230000,  
> 2005191, 230000,  
> 2005191, 230000,  
> 2005191, 230000,  
> 2005191, 230000,  
> 2005191, 230000,  
> 2005191, 230000,  
> 2005191, 230000,  
> 2005191, 230000,  
> 2005191, 230000,  
> 2005191, 230000,  
> 2005191, 230000,  
> 2005191, 230000,  
> 2005191, 230000,  
> 2005191, 230000,  
> 2005191, 230000,  
> 2005191, 230000,  
> 2005191, 230000,  
> 2005191, 230000,  
> 2005192, 0,  
> 2005192, 0,  
> 2005192, 0,  
> 2005192, 0,  
> 2005192, 0,  
> 2005192, 0,  
> 2005192, 0,  
> 2005192, 0,  
> 2005192, 0,  
> 2005192, 0,  
> 2005192, 0,  
> 2005192, 0,  
> 2005192, 0,  
> 2005192, 0,  
> 2005192, 0,  
> 2005192, 0,  
> 2005192, 0,  
> 2005192, 0,  
> 2005192, 0,  
> 2005192, 0,  
> 2005192, 0,  
> 2005192, 0,  
> 2005192, 0,  
> 2005192, 0,  
> 2005192, 0,  
> 2005192, 0,  
> 2005192, 0,  
> 2005192, 0,  
> 2005192, 0,  
> 2005192, 0,  
> 2005192, 0 ;

---

<div class="post-metadata">

**Author:** ![cjcoats](https://avatars.discourse-cdn.com/v4/letter/c/ac8455/32.png) [@cjcoats](https://forum.cmascenter.org/u/cjcoats)\
**Post date:** [August 10, 2021, 9:25pm UTC](https://forum.cmascenter.org/t/using-smoke-to-convert-netcdf-file-into-cmaq-ready-format/2568/2 "2021-08-10T21:25:28Z")

</div>

We would need a **lot** more information in order to do anything (particularly since this file does not fit any of the recommended netCDF conventions such as CF or M3IOAPI). And this probably needs custom Fortran or C; the functionality needed is not “off the shelf.”

Is the grid embedded in a lat-lon coordinate system, with (in I/O API terms) `NCOLS=320, NROWS=200, XORIG=70.0d0, YORIG=10.0d0, XCELL=YCELL=0.25d0` covering India, China, Mongolia, and part of Siberia?

Note that CMAQ requires a conformal map-projection in Lambert, Equatorial Mercator, or Polar Stereographic, so you would have to re-grid from this grid to your CMAQ grid (I/O API routines `GRID2XY`, `UNGRIDB`, and `BILIN` will be useful for that…)

And what are the emissions variables and their units, and are the units actually what they claim to be? (Note that CMAQ emissions units are not: there is an extra “per grid cell” that is not stated but needs to be accounted for)?  
Do you need to re-speciate? …and with what factors?

FWIW.

---

<div class="post-metadata">

**Author:** ![fang63](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.cmascenter.org/fang63/32/42_2.png) [@fang63](https://forum.cmascenter.org/u/fang63)\
**Post date:** [August 11, 2021, 1:25am UTC](https://forum.cmascenter.org/t/using-smoke-to-convert-netcdf-file-into-cmaq-ready-format/2568/3 "2021-08-11T01:25:29Z")

</div>

Hi Carlie,

Thank you for looking into my issue. I am answering your questions below. Hope it could be easier to solve my issue.

Best,  
Huan

> Is the grid embedded in a lat-lon coordinate system, with (in I/O API terms) `NCOLS=320, NROWS=200, XORIG=70.0d0, YORIG=10.0d0, XCELL=YCELL=0.25d0` covering India, China, Mongolia, and part of Siberia?

Yes

> Note that CMAQ requires a conformal map-projection in Lambert, Equatorial Mercator, or Polar Stereographic, so you would have to re-grid from this grid to your CMAQ grid (I/O API routines `GRID2XY` , `UNGRIDB` , and `BILIN` will be useful for that…)

I would like to convert to lambert conformal conic, could you guide me through how to use the I/O API tools to approach this?

> And what are the emissions variables and their units, and are the units actually what they claim to be?

The emissions were divided into multiple netCDF files based on the variables. There, the one I provided only include one emission variable, and I need to combined them into one netCDF at the end. The unit is 10^3 kg per grid cell, it is the monthly emission amount. I know using SMOKE, it would be converted into hourly emission rate.

> Do you need to re-speciate? …and with what factors?

No

---

<div class="post-metadata">

**Author:** ![cjcoats](https://avatars.discourse-cdn.com/v4/letter/c/ac8455/32.png) [@cjcoats](https://forum.cmascenter.org/u/cjcoats)\
**Post date:** [August 11, 2021, 3:30pm UTC](https://forum.cmascenter.org/t/using-smoke-to-convert-netcdf-file-into-cmaq-ready-format/2568/4 "2021-08-11T15:30:32Z")

</div>

> I would like to convert to lambert conformal conic, could you guide me through how to use the I/O API tools to approach this?

This is a three-step process:

- First, `MODULE MODGCTP` routine `GRID2XY()` can be used to find the Lambert coordinates for the cell cernters – see [https://cjcoats.github.io/ioapi/MODGCTP.html](https://cjcoats.github.io/ioapi/MODGCTP.html)
- Then routine `UNGRIDB()` can be used to find a bilinear-interpolation matrix from the input grid to the output CMAQ grid: see [https://cjcoats.github.io/ioapi/UNGRIDB.html](https://cjcoats.github.io/ioapi/UNGRIDB.html)
- Then routine `BILIN()` can be used to interpolate input-grid emissions variables to the output CMAQ grid, using the interpolation matrix from the step above.

> …multiple netCDF files based on the variables. There, the one I provided only include one emission variable, and I need to combined them into one netCDF at the end.

Let us assume (below) that there are `NEMIS` such files, one per variable. Input dimensions are 320 by 200 and cell-size is `DLAT` by `DLON`. Output dimensions are `NCOLS` by `NROWS` and cell size is `XCELL` by `YCELL`.

Routine `READNCVAR()` from `MODULE MODNCFIO` will give you a high-level (single-call) way of reading the emissions data.

> The unit is 10^3 kg per grid cell, it is the monthly emission amount.

So you will need to multiply by (a) the ratio of the cell sizes; and (b) the (species specific) units conversion factor to convert to moles/sec/  
For (a), let `DLAT` and `DLON` give the input lat-lon cell size, `LAT(:,:)` and `LON(:.:)` be the input-grid lat and lon value arrays, and `R` be the radius of the Earth in meters. Then (gridded) input cell-aree is approximately `(PI/180)*DLAT*DLON*COS(LAT(:,:)` and the output area is `XCELL*YCELL`. Then standard chemistry gives the per-species conversion from _10^3 KG_ to _moles_, and assuming uniform per-day/per-hour distribution of the emissions, the per-month to per-second conversion factor is approximately 12/(365.24_24_3600). The most obvious correction to this is to find the diurnal distribution of the emissions, and compute an array of hourly-profile factors FH(24) that adds up to 1.

The most computationally-efficient program-outline looks something like the following:

- Allocate and compute the bilinear-interpolation matrix `C(4,NCOLS,NROWS)`.

- Allocate an input-array `A(320,200)` and output-array `E(NCOLS,NROWS,NEMIS)`.

- For each emissions species S=1…NEMIS:

- 
  - Read input `A(320,200)` from its emissions-file.

- 
  - Multiply by the bilinear interpolation matrix to get `E(:.:,S)`

- 
  - Multiply `E(:,:,S)` by the (gridded) cell-area ratios and by the _10^3 KG_ to \*moles conversion factor.

- Create the output-file.

- For each output time step (at hour `H`)

- 
  - For each species `S`

- 
  - 
    - Write` FH(H)*E(:,:,S)` to the output file

- Done … close program using `M3EXIT()`

---

<div class="post-metadata">

**Author:** ![hlbutterfly](https://avatars.discourse-cdn.com/v4/letter/h/57b2e6/32.png) [@hlbutterfly](https://forum.cmascenter.org/u/hlbutterfly)\
**Post date:** [June 5, 2022, 3:33pm UTC](https://forum.cmascenter.org/t/using-smoke-to-convert-netcdf-file-into-cmaq-ready-format/2568/5 "2022-06-05T15:33:08Z")

</div>

Hi Carlie,

Thanks for a very detailed layout of the processing steps. However, I am puzzled by this following step:

- Multiply `E(:,:,S)` by the (gridded) cell-area ratios and by the _10^3 KG_ to \*moles conversion factor.

What do you mean by “cell-area ratios”? E(:,:,S) is with a dimension of the output grid cell (NCOLSxNROWS) and the cell size is XCELL\*YCELL. So where does this ratio come from?

Thanks  
Ling

---

<div class="post-metadata">

**Author:** ![cjcoats](https://avatars.discourse-cdn.com/v4/letter/c/ac8455/32.png) [@cjcoats](https://forum.cmascenter.org/u/cjcoats)\
**Post date:** [June 5, 2022, 5:50pm UTC](https://forum.cmascenter.org/t/using-smoke-to-convert-netcdf-file-into-cmaq-ready-format/2568/6 "2022-06-05T17:50:36Z")

</div>

> [@cjcoats](#):
>
> Then (gridded) input cell-aree is approximately `(PI/180)*DLAT*DLON*COS((PI/180)*LAT(:,:)` and the output area is `XCELL*YCELL`

so the ratio of output-cell-area to input-cell-area is  
`XCELL*YCELL/ ((PI/180)*DLAT*DLON*COS((PI/180)*LAT(:,:) )`

---

<div class="post-metadata">

**Author:** ![hlbutterfly](https://avatars.discourse-cdn.com/v4/letter/h/57b2e6/32.png) [@hlbutterfly](https://forum.cmascenter.org/u/hlbutterfly)\
**Post date:** [June 6, 2022, 3:03am UTC](https://forum.cmascenter.org/t/using-smoke-to-convert-netcdf-file-into-cmaq-ready-format/2568/7 "2022-06-06T03:03:14Z")

</div>

Hi Carlie,

Thanks for the reply!

However, LAT(:,🙂 has the input dimension of 320x200 while the intermediate variable E(:,:,S) has the dimension of XCELL\*YCELL, which seems to be inconsistent with the input dimension (320x200). So E(:,:,S) cannot be multiplied with the cell-area ratios. Am I understanding correct?

Thanks  
Ling

---

<div class="post-metadata">

**Author:** ![cjcoats](https://avatars.discourse-cdn.com/v4/letter/c/ac8455/32.png) [@cjcoats](https://forum.cmascenter.org/u/cjcoats)\
**Post date:** [June 6, 2022, 10:32am UTC](https://forum.cmascenter.org/t/using-smoke-to-convert-netcdf-file-into-cmaq-ready-format/2568/8 "2022-06-06T10:32:10Z")

</div>

No. `XCELL` and `YCELL` are **lengths** of cell-edges, measured in (MKS units) Meters. 320x200 is the **numbers** of these cells in the column and row directions.

---

<div class="post-metadata">

**Author:** ![hlbutterfly](https://avatars.discourse-cdn.com/v4/letter/h/57b2e6/32.png) [@hlbutterfly](https://forum.cmascenter.org/u/hlbutterfly)\
**Post date:** [June 6, 2022, 12:46pm UTC](https://forum.cmascenter.org/t/using-smoke-to-convert-netcdf-file-into-cmaq-ready-format/2568/9 "2022-06-06T12:46:50Z")

</div>

Oops. My fault. Yes. XCELL and YCELL are just numbers. However, this LAT(:,🙂 has the dimension of the input grid (for example, 320x200) and E(:,:,S) has the dimension of output grid cell (NCOLS x NROWS), which is still inconsistent with the input dimension.

---

<div class="post-metadata">

**Author:** ![cjcoats](https://avatars.discourse-cdn.com/v4/letter/c/ac8455/32.png) [@cjcoats](https://forum.cmascenter.org/u/cjcoats)\
**Post date:** [June 6, 2022, 1:13pm UTC](https://forum.cmascenter.org/t/using-smoke-to-convert-netcdf-file-into-cmaq-ready-format/2568/10 "2022-06-06T13:13:06Z")

</div>

You should be able to get LAT and LON on whatever grid you’re interested in – use [M3Tools program _latlon_](https://cjcoats.github.io/ioapi/LATLON.html) if necessary.

---

<div class="post-metadata">

**Author:** ![hlbutterfly](https://avatars.discourse-cdn.com/v4/letter/h/57b2e6/32.png) [@hlbutterfly](https://forum.cmascenter.org/u/hlbutterfly)\
**Post date:** [June 6, 2022, 3:30pm UTC](https://forum.cmascenter.org/t/using-smoke-to-convert-netcdf-file-into-cmaq-ready-format/2568/11 "2022-06-06T15:30:46Z")

</div>

OK. So this “LAT” has the dimension of the output grid definition. Got it! Thanks!
