This repository holds python code to help facilitate running and processing CMAQ simulations.
Instructions for running two scenarios (a base case and a with renewables scenario) for the DEC's 12OTC2 domain (12 km spatial resolution) and 4OTC2 domain (4 km spatial resolution) are included in this README. NOTE: I'm not sure if this package allows you to run multiple instances of CMAQModel simultaneously.
If you want to run a new simulation, start by preparing your data/dirpaths_{self.appl}.yml
with directory and file paths. Then, edit the examples/ex_run_onetime.py
script. To make it easy on yourself, I suggest opening your NEI_HOME
directory in a separate VSCode window, so you can quickly navigate around the intermed
, reports
, and smoke_out
directories.
- Prepare the
{ertac_case}__fs_ff10_future.csv
and the{ertac_case}_fs_ff10_hourly_future.csv
. Note that you might have to delete comments associated with Tri-Center Naniwa Energy. - Change
appl
. The available options are commented out in the example script. - Change
ertac_case
. The only options that I have developed thus far areCONUS2016_Base
(the base case) andCONUS2016_S0
(the with renewables case). - Run
ex_ptertac_onetime.py
. This step should take about 3 hours to run and creates the grid-specificstack_groups_ptertac
file.
Then, edit the examples/ex_ptertac_daily.py
script
- Change
start_datetime
. - Change
end_datetime
. - Change
appl
- Change
ertac_case
- Run
ex_ptertac_daily.py
. This step should take about 45 minutes to run and creates a grid-specificinln_mole_ptertac
for each day in the month. NEI designed it's scripts to easily process the full year, so it's easiest to process data in monthly incriments. - If this is not the base case, I manually rename the
smoke_out
directory to append the scenario (e.g.,ptertac_s0
). Yes, I know, there must be a better way of doing this...
To visualize the point source emissions, you must transfer these files to the CMAQ grid by running runsmoke.run_inlineto2d
. Note that you must run this fucntion separately for each day that you would like processed.
Finally, edit examples/ex_run_cctm.py
- If not rerunning MCIP, specify the location of your MCIP files using the
LOC_MCIP
variable indata/dirpaths_{self.appl}.yml
- If not rerunning MCIP, set
new_mcip=False
in yourCMAQModel
instance - Specify the location of your initial and boundary conditions using the
LOC_IC
andLOC_BC
variables indata/dirpaths_{self.appl}.yml
- Specify the location of your ptertac in-line emissiions files using the
LOC_ERTAC
variable indata/dirpaths_{self.appl}.yml
- Change
start_datetime
. - Change
end_datetime
. - Change
appl
. - Run
examples/ex_run_cctm.py
inside a tmux window. This domain takes about 1h 45m per day to run on the 48 proc node on Magma.
In order to visualize the data CCTM data properly, you need to postprocess the data using the CMAQ combine
utility program, which you can run by editing examples/ex_run_scombine.py
.
- Change
start_datetime
. - Change
end_datetime
. - Change
appl
. - Run
examples/ex_run_combine.py
. No need for a tmux window, and this should take several minutes per day of simulaiton time with the default calcualtions.
If you want to run the 4-km domain after running a simulation on the 12-km domain, many of the steps remain the same. Start by preparing your data/dirpaths_{self.appl}.yml
with directory and file paths. Then, edit the examples/ex_ptertac_onetime.py
script.
- Change
appl
. The available options are commented out in the example script. - Change
ertac_case
. The only options that I have developed thus far areCONUS2016_Base
(the base case) andCONUS2016_S0
(the with renewables case). - Run
ex_ptertac_onetime.py
. This step should take about 2 hours to run, and creates the grid-specificstack_groups_ptertac*
file. No need for a tmux window.
Next, edit the examples/ex_run_daily.py
script.
- Change
appl
. The available options are commented out in the example script. - Change
ertac_case
- Run
ex_run_daily.py
. This step should take about an hour to run and creates a grid-specificinln_mole_ptertac
for each day in the month. No need for a tmux window. - If this is not the base case, I manually rename the
smoke_out
directory to append the scenario (e.g.,ptertac_s0
).
If you need to run MCIP, edit the examples/ex_run_mcip.py
script
- Change
start_datetime
. - Change
end_datetime
. - Change
appl
. The available options are commented out in the example script. - Make sure that the start and end dates are correct.
- Run
examples/ex_run_mcip.py
. Each day takes just over a minute to run on Magma.
If you need to run ICON, which you probably don't, edit the examples/ex_run_icon.py
script.
- Change
start_datetime
. - Change
end_datetime
. - Change
appl
. The available options are commented out in the example script. - Make sure that the start and end dates are correct.
- Check the
coarse_grid_appl
. - Run
examples/ex_run_icon.py
.
NOTE: I'm just using the simulations transferred to us from NYDEC as boundary conditions (CGRID files), so I just simply change the LOC_IC
variable in data/dirpaths_{self.appl}.yml
rather than running ICON.
If you need to run BCON, which you probably do, edit the examples/ex_run_bcon.py
script
- Change
start_datetime
. - Change
end_datetime
. - Change
appl
. The available options are commented out in the example script. - Make sure that the start and end dates are correct.
- Check the
coarse_grid_appl
. - Run
examples/ex_run_bcon.py
inside a tmux window. BCON takes about a minute per day to run on Magma.
Finally, edit examples/ex_run_cctm.py
- If not running MCIP, specify the location of your MCIP files using the
LOC_MCIP
variable indata/dirpaths_{self.appl}.yml
and setnew_mcip=False
in yourCMAQModel
instance. - If not running BCON, specify the location of you BCON files using the
LOC_BC
variable indata/dirpaths_{self.appl}.yml
and setnew_bcon=False
in yourCMAQModel
instance. - Specify the name of your ptertac in-line emissiions files in the
LOC_ERTAC
variable indata/dirpaths_{self.appl}.yml
. - Change
start_datetime
. - Change
end_datetime
. - Change
appl
. The available options are commented out in the example script. - Run
examples/ex_run_cctm.py
inside a tmux window. This domain takes about 55 min per day to run on the 48 proc node on Magma.
In order to visualize the data CCTM data properly, you need to postprocess the data using the CMAQ combine
utility program, which you can run by editing examples/ex_run_scombine.py
.
- Change
start_datetime
. - Change
end_datetime
. - Change
appl
. - Run
examples/ex_run_combine.py
. No need for a tmux window, and this should take several minutes per day of simulaiton time with the default calcualtions.