PyChEmiss
A Python script to create the wrfchemi file from local emissions needed to run WRF-Chem model.
https://github.com/quishqa/PyChEmiss
Category: Emissions
Sub Category: Emission Observation and Modeling
Keywords
emission wrf-chem wrf-domain
Keywords from Contributors
archiving measur transforms optimize observation generic animals compose projection conversion
Last synced: about 24 hours ago
JSON representation
Repository metadata
Create WRF-Chem emission file from your local emissions disaggregated in space and time.
- Host: GitHub
- URL: https://github.com/quishqa/PyChEmiss
- Owner: quishqa
- License: gpl-3.0
- Created: 2020-05-20T20:55:39.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-05T17:51:58.000Z (over 2 years ago)
- Last Synced: 2025-04-22T07:19:48.669Z (5 days ago)
- Topics: emission, wrf-chem, wrf-domain
- Language: Python
- Homepage:
- Size: 133 MB
- Stars: 29
- Watchers: 2
- Forks: 15
- Open Issues: 2
- Releases: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
README.md
PyChEmiss
PyChEmiss
is a Python script to create the wrfchemi
file from surface local emissions needed to run WRF-Chem model. It's based on his older broder AAS4WRF.ncl.
Installation
You need to install the packages that PyChEmiss
needs. We recommend to use
miniconda.
You can download this repo or clone it by:
git clone https://github.com/quishqa/PyChEmiss.git
Then add conda-forge
channel by:
conda config --add channels conda-forge
To avoid conflicts during the installation, we also recommend create a new environment to run PyChEmiss
:
conda create --name PyChEmiss
conda activate PyChEmiss
Option A
Now you can install espmy
, xesmf
and pyyaml
. By doing this, xarray
,
numpy
, and pandas
will be also installed:
conda install esmpy
conda install xesmf
conda install pyyaml
It's important to first install esmpy
to avoid this issue.
Option B
Or, you can install the packages located in requirements.txt
by typing:
conda install --yes --file requirements.txt
If everything goes well, you are ready to go.
The input data
To run this script you need the wrfinput_d0x
and your temporal and spatial disaggregated emissions in mol/km2/hr for gasses and in ug/m2/s for aerossol species. You can see the needed format by exploring emissions_3km.txt
file.
To untar the example files:
tar -zxvf emissions_3km.tar.gz
tar -zxvf wrfinput_d02.tar.gz
pychemiss.yml
Configuration file: This file controls some parameters to run the script. ""
are required only in sep
.
wrfinput_file
: the location of wrfinput_d0x.emission_file
: the location of the local emission file.nx
andny
: the number of longitude and latitude points in which local emission were spatially disaggregated.cell_area
: cell area in km2 of inputemission_file
.start_date
andend_date
:emissions_3km.txt
temporal availability in%Y-%m-%d %H:%M
format.header
: If your local emission file has a header.col_names
: Names of emission file column names. Remember that the three
first columns have to be named "i", "lon", and "lat".sep
: Column delimiter in emission file. Use quotes (""
)method
: we implementnearest_s2d
methods for emissions regridding
(a conservative method is on the way!).
Usage
To run the script, type:
python src/pychemiss.py pychemiss.yml
To check that everything is working properly up to this point, we recommend to visualize the content of the output file, for example, by using ncview
ncview wrfchemi_d02_2018-06-21_00:00:00
WRF-Chem namelist configuration
To use the wrfchemi
file in a standard WRF-Chem simulation, set some control parameters in the namelist.input
file as follows
&time_control
io_form_auxinput5 = 2,
auxinput5_inname = 'wrfchemi_d<domain>',
auxinput5_interval_m = 60,
frames_per_auxinput5 = 240,
/
&chem
io_style_emissions = 2,
/
240 is the number of times (hours) in the wrfchemi
file.
For 24 hours of emissions data, the preprocessor will automatically build two 12-hour emission files: wrfchemi_00z_d02
(00 to 11 UTC) and wrfchemi_12z_d02
(12 to 23 UTC). In this case, set frame_per_auxinput5
to 12 and io_style_emissions
to 1.
Output example
Here there is a comparison between the local emission of CO (with ΔX= 3 Km) and the
output after using pychemiss.py
for a WRF domain of ΔX = 3 km.
Expected Runtime
For a WRF domain with 150 x 100 points and for ten days with hourly emissions (nx =30 and ny=27, like the above figure), in a "normal" laptop, it took 30 seconds to run.
Owner metadata
- Name: Mario Gavidia Calderón
- Login: quishqa
- Email:
- Kind: user
- Description: Postdoctoral researcher at Institute of Astronomy, Geophysics and Atmospheric Sciences, University of Sao Paulo.
- Website: quishqa.github.io
- Location: Sao Paulo, Brazil
- Twitter:
- Company:
- Icon url: https://avatars.githubusercontent.com/u/14168009?u=8056485a72fbbdd88eaee3534cda8ef5e077f8e6&v=4
- Repositories: 35
- Last ynced at: 2024-06-11T15:38:38.036Z
- Profile URL: https://github.com/quishqa
GitHub Events
Total
- Issues event: 1
- Issue comment event: 5
Last Year
- Issues event: 1
- Issue comment event: 5
Committers metadata
Last synced: 5 days ago
Total Commits: 64
Total Committers: 4
Avg Commits per committer: 16.0
Development Distribution Score (DDS): 0.125
Commits in past year: 0
Committers in past year: 0
Avg Commits per committer in past year: 0.0
Development Distribution Score (DDS) in past year: 0.0
Name | Commits | |
---|---|---|
Mario Gavidia-Calderón | m****c@g****m | 56 |
Angel Liduvino Vara Vela | a****a@i****r | 5 |
dependabot[bot] | 4****] | 2 |
Carlos M. Gonzalez Duque | 6****5 | 1 |
Committer domains:
- iag.usp.br: 1
Issue and Pull Request metadata
Last synced: 2 days ago
Total issues: 3
Total pull requests: 6
Average time to close issues: 1 day
Average time to close pull requests: 4 days
Total issue authors: 3
Total pull request authors: 4
Average comments per issue: 3.67
Average comments per pull request: 0.0
Merged pull request: 5
Bot issues: 0
Bot pull requests: 2
Past year issues: 1
Past year pull requests: 0
Past year average time to close issues: N/A
Past year average time to close pull requests: N/A
Past year issue authors: 1
Past year pull request authors: 0
Past year average comments per issue: 4.0
Past year average comments per pull request: 0
Past year merged pull request: 0
Past year bot issues: 0
Past year bot pull requests: 0
Top Issue Authors
- burhangis (1)
- yvsathe14 (1)
- fipoucat (1)
Top Pull Request Authors
- dependabot[bot] (2)
- alvv1986 (2)
- quishqa (1)
- carlosm-5 (1)
Top Issue Labels
Top Pull Request Labels
- dependencies (2)
Dependencies
- esmpy ==8.0.0
- numpy ==1.22.0
- pandas ==1.0.3
- pyyaml ==5.4
- xarray ==0.15.1
- xesmf ==0.3.0
Score: 4.820281565605037