pycopanlpjml.World#

class pycopanlpjml.World(*args, **kwargs)[source]#

Bases: DUMMY

An LPJmL-integrating world entity.

World entity type (mixin) class for copan:LPJmL component. A world instance holds data attributes as pycoupler.LPJmLData or pycoupler.LPJmLDataSet that are received and send via the lpjml instance of the pycoupler.LPJmLCoupler class.

Parameters:
  • input (pycoupler.LPJmLDataSet) – Coupled LPJmL model inputs.

  • output (pycoupler.LPJmLDataSet) – Coupled LPJmL model outputs.

  • grid (pycoupler.LPJmLData) – Grid of the LPJmL model.

  • country (pycoupler.LPJmLData) – Countries of each cell as country code.

  • area (pycoupler.LPJmLData) – Area of each cell in square meters.

  • kwargs (dict, optional) – Additional keyword arguments.

Returns:

An instance of the LPJmL World.

Return type:

World

Examples

In this example, we will demonstate an exammplaric initialization of a pycopanlpjml.Cell instance independent of the pycopanlpjml.Component that automatizes the initializtion of all cells belonging to a world.

A prerequisite is the start of an LPJmL simulation in coupled mode described in … To connect to the LPJmL simulation we use the pycoupler.LPJmLCoupler class.

>>> from pycoupler.coupler import LPJmLCoupler
>>> from pycopanlpjml import World

The configuration file is a json file that holds the configuration for the integrated copan:LPJmL model simulation.

>>> config_file = "path/to/config_file.json"
>>> lpjml = LPJmLCoupler(
...     config_file=config_file,
...     host="localhost",
...     port=2042,
... )

Initialize LPJmL world, all data is read/send from and to the LPJmL model >>> world = World( … input=lpjml.read_input(copy=False), … output=lpjml.read_historic_output(), … grid=lpjml.grid, … country=lpjml.country, … )

NEXTUID = 0#
acquaintance_network = None#
assert_valid()#

Make sure all variable values are valid.

By calling assert_valid for all Variables

atmospheric_carbon = extensive variable 'atmospheric carbon stock' ((mass of C in any chemical compound)), not None, scale=ratio, datatype=<class 'float'>, unit=gigatonnes carbon [GtC], >=0#
complete_values()#

assign default values to all unset Variables

deactivate()#

Deactivate entity.

Remove Entity from its classes entities list and add it to its classes idle_entities list.

delete()#

Delete entity from all lists.

fossil_carbon = extensive variable 'fossil carbon stock' ((mass of C in any chemical compound,                              potentially accessible for human extraction                              and combustion)), not None, scale=ratio, datatype=<class 'float'>, unit=gigatonnes carbon [GtC], >=0#
classmethod get_next_uid()#

Generate UIDs (Unique identifier).

Returns:

current_uid – the current uid

Return type:

int

group_membership_network = None#
idle_entities = None#
instances = None#
model = None#
ocean_carbon = extensive variable 'ocean carbon stock' ((mass of C in any chemical compound)), not None, scale=ratio, datatype=<class 'float'>, unit=gigatonnes carbon [GtC], >=0#
population = extensive variable 'human population', IAMC=Population, CETS=SP.POP, not None, scale=ratio, datatype=<class 'float'>, unit=people [H], >=0#
processes = [aggregate cell carbon stocks]#
reactivate()#

Reactivate entity.

Remove Entity from its classes idle_entities list and add it to its classes entities list.

set_value(var, value)#

Dummy docstring

surface_air_temperature = intensive variable 'surface air temperature' ((in the meaning used in climate policy debates,                  i.e., at 2m above surface, averaged over the day)), AMIP=tas, not None, scale=ratio, datatype=<class 'float'>, unit=kelvins [K], >=0#
terrestrial_carbon = extensive variable 'terrestrial carbon stock' ((mass of C in any chemical compound)), not None, scale=ratio, datatype=<class 'float'>, unit=gigatonnes carbon [GtC], >=0#
variables = OrderedSet()#