Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cmaq2hemco/mechrc/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
__all__ = ['cb6r5_ae7_aq']
__all__ = ['cb6r5_ae7_aq', 'geoschem_14_6_2']

from . import cb6r5_ae7_aq
from . import cb6r5_ae7_aq, geoschem_14_6_2
2 changes: 1 addition & 1 deletion cmaq2hemco/mechrc/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def writeconfig(outpath, year, sector, filepatt, cq2gc):
if os.path.exists(hcpath):
break
else:
raise IOError('file not found')
raise IOError(f'File not found: {hcpath}')

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great descriptive addition.


with open(outpath, 'w') as hcf:
print(sector, hcpatt, end='', flush=True)
Expand Down
82 changes: 82 additions & 0 deletions cmaq2hemco/mechrc/geoschem_14_6_2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
__all__ = ['writeconfig']


cq2gc = {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably be named gc2gc. I see that BC is spit into BCPI and BCPO (and similar for OC). If I understand it correctly, everything else just a pass thru.

'ACET': [['ACET', '']],
'ACR': [['ACR', '']],
'ACTA': [['ACTA', '']],
'ALD2': [['ALD2', '']],
'ALK4': [['ALK4', '']],
'ALK6': [['ALK6', '']],
'BALD': [['BALD', '']],
'BC': [['BCPI', '70'], ['BCPO', '71']],
'BENZ': [['BENZ', '']],
'C2H2': [['C2H2', '']],
'C2H4': [['C2H4', '']],
'C2H6': [['C2H6', '']],
'C3H8': [['C3H8', '']],
'C4H6': [['C4H6', '']],
'CCl4': [['CCl4', '']],
'CH2Br2': [['CH2Br2', '']],
'CH2Cl2': [['CH2Cl2', '']],
'CH2O': [['CH2O', '']],
'CH3Br': [['CH3Br', '']],
'CH3Cl': [['CH3Cl', '']],
'CH3I': [['CH3I', '']],
'CH4': [['CH4', '']],
'CHCl3': [['CHCl3', '']],
'CL2': [['CL2', '']],
'CO': [['CO', '']],
'CSL': [['CSL', '']],
'EBZ': [['EBZ', '']],
'EOH': [['EOH', '']],
'FURA': [['FURA', '']],
'GLYX': [['GLYX', '']],
'HACTA': [['HACTA', '']],
'HCL': [['HCL', '']],
'HCOOH': [['HCOOH', '']],
'HONO': [['HONO', '']],
'ISOP': [['ISOP', '']],
'IVOC': [['IVOC', '']],
'LIMO': [['LIMO', '']],
'MACR': [['MACR', '']],
'MEK': [['MEK', '']],
'MGLY': [['MGLY', '']],
'MOH': [['MOH', '']],
'MTPA': [['MTPA', '']],
'MTPO': [['MTPO', '']],
'MVK': [['MVK', '']],
'NAP': [['NAP', '']],
'NH3': [['NH3', '']],
'NH4': [['NH4', '']],
'NIT': [['NIT', '']],
'NO': [['NO', '115']],
'NO2': [['NO2', '']],
'OC': [['OCPI', '72'], ['OCPO', '73']],
'OCS': [['OCS', '']],
'pFe': [['pFe', '']],
'PHEN': [['PHEN', '']],
'PNA': [['PNA', '']],
'PRPE': [['PRPE', '']],
'RCHO': [['RCHO', '']],
'RCOOH': [['RCOOH', '']],
'ROH': [['ROH', '']],
'SO2': [['SO2', '']],
'SO4': [['SO4', '']],
'STYR': [['STYR', '']],
'SULF': [['SULF', '']],
'TMB': [['TMB', '']],
'TOLU': [['TOLU', '']],
'XYLE': [['XYLE', '']],
}
# ignore special species, inventory meta variables, HAP tracers, UNK/UNR
for key in ['NH3_FERT','HFLUX', 'VOC_INV','NMOG','CH4_INV','ACROLEIN','BUTADIENE13','ETHYLBENZ','UNK','UNR']:

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For flake8 compatibility, we're going to need spaces after commas.

cq2gc[key] = []

# Ignore unused particulate species
for key in ['PAL', 'PCA', 'PCL', 'PH2O', 'PK', 'PSI', 'PTI','PMC', 'PMG', 'PMN', 'PMOTHR', 'PNCOM']:
cq2gc[key] = []

def writeconfig(outpath, year, sector, filepatt):
from .core import writeconfig as genwriteconfig
return genwriteconfig(outpath, year, sector, filepatt, cq2gc)
Loading