Operational emissions refer to the carbon generated by a component while it is in use. It is the product of the energy used by the component in kWh and the grid intensity in gCO2e/kWh. The operational emissions are added to the embodied emissions (calculated using sci-m
) to provide an overall SCI score for the component.
Not Needed
energy
: energy value in kWhgrid/carbon-intensity
: intensity value gCO2e/kWh
carbon-operational
: the carbon emitted during a applications operation, in gCO2eq
To calculate the operational emissions o
for a software application, use the following:
O = E * I
where O
= operational emissions, E
= energy in kWh, and I
= grid carbon intensity.
In the IF implementation the calculation is expressed using the following terms:
o = (energy * grid/carbon-intensity)
Read more on operational emissions.
IF implements the plugin based on the simple multiplication of the energy and intensity values as inputs. The sci-o
plugin expects energy
and grid/carbon-intensity
to be provided as inputs
.
Note that the
energy
field is added to themanifest
by thesci-e
plugin only. This meanssci-o
must always be preceded bysci-e
in a plugin pipeline. This is always true, even if there is only a single component ofenergy
such ascpu/energy
fromteads-curve
.sci-e
sums all the available components and adds the sum to themanifest
asenergy
.
To run the plugin, you must first create an instance of SciO
using SciO()
. Then, you can call execute()
to return carbon-operational
.
The following snippet demonstrates how to call the sci-o
plugin from Typescript.
import {SciO} from '@grnsft/if-plugins';
const sciO = SciO();
const results = await sciO.execute([
{
energy: 0.5, // energy value in kWh
'grid/carbon-intensity': 0.5, // intensity value gCO2e/kWh
},
]);
IF users will typically call the plugin as part of a pipeline defined in a manifest
file. In this case, instantiating the plugin is handled by ie
and does not have to be done explicitly by the user. The following is an example manifest
that calls sci-o
:
name: sci-o
description:
tags:
initialize:
plugins:
sci-o:
method: SciO
path: '@grnsft/if-plugins'
tree:
children:
child:
pipeline:
- sci-o
config:
sci-o:
inputs:
- timestamp: 2023-08-06T00:00
duration: 3600
energy: 0.001
grid/carbon-intensity: 800
You can run this example manifest
by saving it as ./examples/manifests/test/sci-o.yml
and executing the following command from the project root:
npm i -g @grnsft/if
npm i -g @grnsft/if-plugins
ie --manifest ./examples/manifests/test/sci-o.yml --output ./examples/outputs/sci-o.yml
The results will be saved to a new yaml
file in ./examples/outputs
.