# CGRID output writing error caused by detecting negative emission rates in the new emission inventory

**URL:** <https://forum.cmascenter.org/t/cgrid-output-writing-error-caused-by-detecting-negative-emission-rates-in-the-new-emission-inventory/797>\
**Category:** Emissions Inventory\
**Created:** [July 7, 2019, 5:11pm UTC](https://forum.cmascenter.org/t/cgrid-output-writing-error-caused-by-detecting-negative-emission-rates-in-the-new-emission-inventory/797 "2019-07-07T17:11:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![zyj.jess](https://avatars.discourse-cdn.com/v4/letter/z/8dc957/32.png) [@zyj.jess](https://forum.cmascenter.org/u/zyj.jess)\
**Post date:** [July 7, 2019, 5:11pm UTC](https://forum.cmascenter.org/t/cgrid-output-writing-error-caused-by-detecting-negative-emission-rates-in-the-new-emission-inventory/797/1 "2019-07-07T17:11:48Z")

</div>

Dear all;

I have created a new NH3 emission inventory for North Carolina specifically. This emission inventory was processed using SMOKE and then combined into a CMAQ-ready emission input.

I keep experiencing an error shown below. After checking emission inventory, I did not find any negative values. But the NH3 emission is the lowest at this time step but it is not negative though.

```
 Processing Day/Time [YYYYDDD:HHMMSS]: 2014001:045200
   Which is Equivalent to (UTC): 4:52:00 Wednesday, Jan. 1, 2014
   Time-Step Length (HHMMSS): 000400

 ERROR: Invalid Negative emission rates have been detected from 
 GRIDDED_EMIS for CMAQ species NH3.
 Please inspect the Emission Control Namelist File.

```

As shown in this error message, it detected a negative emission rate instead of the actual emission. It makes me suspect the emission rates used in SMOKE when it is being processed.

Is there a way to find out which part is wrong and generates negative emission rates? Could you share me some idea or recommendation? I appreciate it a lot!

Yijia

---

<div class="post-metadata">

**Author:** ![zyj.jess](https://avatars.discourse-cdn.com/v4/letter/z/8dc957/32.png) [@zyj.jess](https://forum.cmascenter.org/u/zyj.jess)\
**Post date:** [July 7, 2019, 5:34pm UTC](https://forum.cmascenter.org/t/cgrid-output-writing-error-caused-by-detecting-negative-emission-rates-in-the-new-emission-inventory/797/2 "2019-07-07T17:34:32Z")

</div>

I re-ran the CMAQ with new NH3 emission inventory and came into the same issue again.

```
 Processing Day/Time [YYYYDDD:HHMMSS]: 2014001:045200
   Which is Equivalent to (UTC): 4:52:00 Wednesday, Jan. 1, 2014
   Time-Step Length (HHMMSS): 000400

 ERROR: Invalid Negative emission rates have been detected from 
 GRIDDED_EMIS for CMAQ species NH3.
 Please inspect the Emission Control Namelist File.

```

I have some ideas about this issue. After using merge program in SMOKE to process the new ammonia emission, I used the program called “ **combine-terra.exe** ” to produce gridded CMAQ input. Before running the combine-terra.exe, I need to set up two files which are “settings.txt” and “species\_nei.txt”.

The settings.txt looks like this.  
setenv SPECIES\_DEF species\_nei.txt  
setenv OUTFILE emis\_mole\_new\_all\_20140103\_12US1\_cmaq\_cb6cmaq\_2014fa\_nata\_cb6cmaq\_14j.ncf  
setenv INFILE1  
emis\_mole\_all\_20140103\_12US1\_cmaq\_cb6\_2014fb\_cdc\_cb6cmaq\_14j.ncf  
setenv INFILE2 emis\_mole\_ag\_onlyNC\_20140103\_12US1\_cmaq\_cb6cmaq\_2014fa\_nata\_cb6cmaq\_14j.ncf  
setenv INFILE3 emis\_mole\_ptaglivestock\_20140103\_12US1\_cmaq\_cb6cmaq\_2014fa\_nata\_cb6cmaq\_14j.ncf

The species\_nei.txt looks like this.  
/orig species ,units ,expression  
ACET ,moles/s ,ACET[1]  
ACROLEIN ,moles/s ,ACROLEIN[1]  
ALD2 ,moles/s ,ALD2[1]  
ALD2\_PRIMARY ,moles/s ,ALD2\_PRIMARY[1]  
ALDX ,moles/s ,ALDX[1]  
BENZ ,moles/s ,BENZ[1]  
BUTADIENE13 ,moles/s ,BUTADIENE13[1]  
CH4 ,moles/s ,CH4[1]  
CH4\_INV ,g/s ,CH4\_INV[1]  
CL2 ,moles/s ,CL2[1]  
CO ,moles/s ,CO[1]  
CO2\_INV ,g/s ,CO2\_INV[1]  
ETH ,moles/s ,ETH[1]  
ETHA ,moles/s ,ETHA[1]  
ETHY ,moles/s ,ETHY[1]  
ETOH ,moles/s ,ETOH[1]  
FORM ,moles/s ,FORM[1]  
FORM\_PRIMARY ,moles/s ,FORM\_PRIMARY[1]  
HCL ,moles/s ,HCL[1]  
HONO ,moles/s ,HONO[1]  
IOLE ,moles/s ,IOLE[1]  
ISOP ,moles/s ,ISOP[1]  
KET ,moles/s ,KET[1]  
MEOH ,moles/s ,MEOH[1]  
N2O\_INV ,g/s ,N2O\_INV[1]  
NAPH ,moles/s ,NAPH[1]  
**NH3 ,moles/s ,NH3[1]-NH3[2]+NH3[3]**  
NH3\_FERT ,moles/s ,NH3\_FERT[1]  
NO ,moles/s ,NO[1]  
NO2 ,moles/s ,NO2[1]  
NVOL ,moles/s ,NVOL[1]  
OLE ,moles/s ,OLE[1]  
PAL ,g/s ,PAL[1]  
PAR ,moles/s ,PAR[1]  
PCA ,g/s ,PCA[1]  
PCL ,g/s ,PCL[1]  
PEC ,g/s ,PEC[1]  
PFE ,g/s ,PFE[1]  
PH2O ,g/s ,PH2O[1]  
PK ,g/s ,PK[1]  
PMC ,g/s ,PMC[1]  
PMG ,g/s ,PMG[1]  
PMN ,g/s ,PMN[1]  
PMOTHR ,g/s ,PMOTHR[1]  
PNA ,g/s ,PNA[1]  
PNCOM ,g/s ,PNCOM[1]  
PNH4 ,g/s ,PNH4[1]  
PNO3 ,g/s ,PNO3[1]  
POC ,g/s ,POC[1]  
PRPA ,moles/s ,PRPA[1]  
PSI ,g/s ,PSI[1]  
PSO4 ,g/s ,PSO4[1]  
PTI ,g/s ,PTI[1]  
SO2 ,moles/s ,SO2[1]  
SOAALK ,moles/s ,SOAALK[1]  
SULF ,moles/s ,SULF[1]  
TERP ,moles/s ,TERP[1]  
TOL ,moles/s ,TOL[1]  
UNK ,moles/s ,UNK[1]  
UNR ,moles/s ,UNR[1]  
VOC\_INV ,g/s ,VOC\_INV[1]  
XYLMN ,moles/s ,XYLMN[1]

As you can see, I kept all other variables unchanged. The only change I made is doing replacement with the NH3. The new NH3 will be “NH3[1]-NH3[2]+NH3[3]”. To make it clear, I subtract the NC NH3 emission from the original NEI gridded emission file and then add my new NH3 emission for NC. To me, it seems that the operation or formula is only applied for geographical substitution instead of the actual values. But I am not sure what combine-terra.exe does inside it. I think it is this step using combine program that induces some negative emission rates. I will go ahead to check the new output from combine and I will probably see some negative values across NC.

Based on my description, could you detect any part in the processing step that could induce the error of negative values? Could you share me some thoughts about it?

Thanks a lot!  
Yijia

---

<div class="post-metadata">

**Author:** ![eyth.alison](https://avatars.discourse-cdn.com/v4/letter/e/7ab992/32.png) [@eyth.alison](https://forum.cmascenter.org/u/eyth.alison)\
**Post date:** [July 8, 2019, 12:55pm UTC](https://forum.cmascenter.org/t/cgrid-output-writing-error-caused-by-detecting-negative-emission-rates-in-the-new-emission-inventory/797/3 "2019-07-08T12:55:22Z")

</div>

Yijia,

It is possible that your math on NH3 is causing emissions to be negative in some cases. I’m not sure if you have a way to prevent that.

I think combine just does some simple math on the variables…

Alison
