Model Independent Emissions Module. MIEM can be used to configure and apply atmospheric emissions in host models.
Copyright (C) 2026 University Corporation for Atmospheric Research
To build and install MIEM locally, you must have CMake installed on your machine.
Open a terminal window, navigate to a folder where you would like the MIEM files to exist, and run the following commands:
git clone https://github.com/NCAR/miem.git
cd miem
mkdir build
cd build
cmake ..
sudo make installTo run the tests:
make testIf you would later like to uninstall MIEM, you can run sudo make uninstall from the build/ directory.
You must have Docker Desktop installed and running. With Docker Desktop running, open a terminal window and run:
git clone https://github.com/NCAR/miem.git
cd miem
docker build -t miem -f docker/Dockerfile .
docker run -it miem bashInside the container, you can run the MIEM tests from the /build/ folder:
cd /build/
make testThe following example configures a single anthropogenic emissions source and runs one model timestep.
Species mapping and inventory translation are handled upstream by MechanismConfiguration and musica::Translate(). By the time MIEMConfig is constructed here, species are already resolved.
To run this example save the following code in a file named miem_example.cpp:
#include <miem/config.hpp>
#include <miem/emissions.hpp>
#include <miem/emissions_state.hpp>
#include <iostream>
using namespace miem;
int main()
{
SourceConfig cams_anthro{
.name_ = "CAMS anthropogenic",
.mode_ = SourceMode::Offline,
.type_ = SourceType::Anthropogenic,
.file_pattern_ = "/path/to/CAMS-GLOB-ANT_{YYYY}-{MM}.nc",
.temporal_interpolation_ = TemporalInterpolation::Linear,
.vertical_injection_ = VerticalInjection::Surface,
.category_ = 0,
.hierarchy_ = 1,
.scaling_factor_ = 1.0,
.sector_ = "anthropogenic",
};
MIEMConfig cfg{
.sources_ = { cams_anthro },
};
Emissions emissions(cfg, /*n_cells=*/163842, /*n_vert_levels=*/60);
EmissionsState state = emissions.Run(
86400.0 * 180.0, // sim_time_sec: day 180
600.0 // dt_sec: 10 minutes
);
std::cout << "NO surface flux at cell 0: "
<< state.surface_flux_(0, "NO")
<< " kg m-2 s-1" << std::endl;
return 0;
}To build and run the example (assuming the default install location):
g++ -o miem_example miem_example.cpp -I./include -std=c++20
./miem_exampleOutput:
NO surface flux at cell 0: 0 kg m-2 s-1
We welcome contributions and feedback from anyone, everything from updating the content or appearance of the documentation to new and cutting-edge science.
- Collaboration
- Anyone interested in scientific collaboration which would add new software functionality should read the MUSICA software development plan.
Please see the MIEM documentation for detailed installation and usage instructions.