Earth system modelling with complex dynamic human societies: the copan:CORE World-Earth modeling framework

. Possible future trajectories of the Earth system in the Anthropocene are determined by the increasing entanglement of processes operating in the physical, chemical and biological systems of the planet, as well as in human societies, their cultures and economies. Here, we introduce the copan:CORE open source software library that provides a framework for developing, composing and running World-Earth models, i


Introduction
In the Anthropocene, the future trajectory of the Earth system is equally governed by two kinds of internal processes (Crutzen, 2002;Steffen et al., 2007;Lewis and Maslin, 2015;Waters et al., 2016;Steffen et al., in press): those operating in the physical, chemical, and biological systems of the planet and those occurring in its human societies, their cultures and economies (Schellnhuber, 1998(Schellnhuber, , 1999)).The history of global change is the history of the increasing planetary-scale entanglement of these two domains (Lenton and Watson, 2011;Lenton et al., 2016;Gaffney and Steffen, 2017).
Computer simulation models are pivotal tools for gaining scientific understanding and providing policy advice for addressing global change challenges such as anthropogenic climate change or rapid degradation of biosphere integrity (Rockström et al., 2009;Steffen et al., 2015).At present, two large modelling enterprises considering the larger Earth system are mature (van Vuuren et al., 2016): (i) Biophysical "Earth system models" derived from and built around a core of atmosphere-ocean general circulation models that are evaluated using storyline-based socioeconomic scenarios (e.g., representative concentration pathways, RCPs) (Stocker et al., 2013).(ii) Socio-economic Integrated Assessment Models built for the evaluation of policy pathways and options that are operated using storyline-based environmental scenarios (e.g., shared socio-economic pathways, SSPs, Edenhofer et al. (2014)).There is a growing number of intersections, couplings and exchanges between the biophysical and socio-economic components of these two model classes for more comprehensive consistency (van Vuuren et al., 2012;Foley et al., 2016).
However, such existing scientific assessment models of global change do to a large degree not include dynamic representations of the socio-cultural dimensions of human societies (Donges et al., in prep.) and the diverse actors, their agencies and complex dynamics networks connecting them that together constitute social structure (Verburg et al., 2016;Donges et al., 2017a, b).Such dimensions are at most partly represented by different socio-economic scenarios (e.g., SSPs) that act as external forcing, constraints and boundary conditions to the modelled Earth system dynamics.There are, however, large differences in beliefs, norms, and political preferences of various social groups, as well as in their metabolic profiles which are related to their access and use of energy and resources (Fischer-Kowalski, 1997;Otto et al., in prep.).Historical examples show that economic interests, beliefs and political preferences of various social groups might be contradictory and sometimes lead to rapid social changes, revolutions and sometimes also devastating conflicts and wars.In other cases, the inability to establish effective social institutions controlling resource access might lead to unsustainable resource use and resource degradation, a process described as the tragedy of the commons (Ostrom, 1990).Climate change is the paradigmatic example of a global commons which needs global institutional arrangements for the usage of the atmosphere as a deposit for greenhouse gas emissions if devastating environmental and social damages are to be avoided in the future (Schellnhuber et al., 2016b;Otto et al., 2017).
In order to explore the risks, dangers and opportunities for sustainable development within this planetary social-ecological system in the Anthropocene, it is important to understand how biophysical, socio-metabolic and socio-cultural processes in-fluence each other (Donges et al., in prep.), how institutional and other social processes function, and which tipping elements can emerge out of the interrelations of the subsystems (Lenton et al., 2008;Kriegler et al., 2009;Cai et al., 2016;Kopp et al., 2016).The objective is to explore from a dynamical systems perspective under what preconditions the maintenance of planetary boundaries (Rockström et al., 2009;Steffen et al., 2015), i.e., a Holocene-like state of the Anthropocene, can be reconciled with human material objectives (i.e., development) to produce a tolerable (i.e., ethically defensible) trajectory of the whole Earth system (i.e., sustainable development) (Raworth, 2012;Steffen et al., in press).
To this end, substantial efforts are required to advance whole Earth system models, referred to as World-Earth models (WEMs) in this article, that capture the coevolving dynamics of the social (the World of human societies) and natural (the biogeophysical Earth) spheres of the Earth system on planetary scales (Verburg et al., 2016;Donges et al., 2017a, b;Müller-Hansen et al., 2017).The need for developing such next generation social-ecological models has been recognized in several subdisciplines of global change science dealing with socio-hydrology (Di Baldassarre et al., 2017;Keys and Wang-Erlandsson, 2017), land-use dynamics (Arneth et al., 2014;Robinson et al., 2017), and the globalised food-water-climate nexus (Dermody et al., 2017).While there has been some progress in developing stylized (also referred to as conceptual) models of this type in recent years (Kellie-Smith and Cox, 2011;Motesharrei et al., 2014;Garrett, 2015;Wiedermann et al., 2015;Heck et al., 2016;Barfuss et al., 2017;Nitzbon et al., 2017), advanced and process-detailed WEMs are not yet available for studying the deeper past and the longer-term Anthropocene future of this coupled system.
A number of new developments make it attractive to re-visit the challenge of building such WEMs now.Due to the huge progress in computing, comprehensive Earth system modelling is advancing fast.And with the ubiquity of computers and digital communication for simulation and data acquisition in daily life (Otto et al., 2015), efforts to model social systems are increased and become more concrete.Recent advances for example in complex systems theory, computational social sciences, social simulation and social-ecological systems modelling (Farmer and Foley, 2009;Farmer et al., 2015;Helbing et al., 2012;Müller-Hansen et al., 2017) make it feasible to include some important macroscopic dynamics of human societies regarding among others the formation of institutions, values, and preferences, and various processes of decision-making into a model of the whole Earth system, i.e., the physical Earth including its socially organised and mentally reflexive humans.Furthermore, new methodological approaches are developing fast that allow representing crucial aspects of social systems, such as adaptive complex networks (Gross and Blasius, 2008;Snijders et al., 2010).Finally, initiatives such as Future Earth (Future Earth, 2014) and the Earth League (Rockström et al. (2014), www.the-earth-league.org)provide a framework for inter-and transdisciplinary research that could support such an ambitious modeling program.This would allow qualitative and quantitative numerical exploration of the universe of possible trajectories in the Anthropocene, their accessibility and their preconditions.
While there is a wealth of software frameworks for modelling social dynamics using agent-based approaches (Kravari and Bassiliades, 2015), for example Netlogo (Wilensky and Rand, 2015), Repast (North et al., 2013) or Cormas (Bousquet et al., 1998), these tend to focus on applications to rather local systems and none of them is specialized for an Earth system analysis context.Accordingly, we have designed the copan:CORE World-Earth modeling framework presented in this paper to allow for a high degree of modularity and flexibility and coupling capabilities to preexisting biophysical Earth system and economic integrated assessment models.
Following the introduction, this article is structured as follows.Sect. 2 outlines general design principles for and required properties of WEMs.Sect. 3 presents the conceptual and object-oriented software design of the copan:CORE World-Earth modeling framework and its reference implementation in the programming language Python.Furthermore, an exemplary WEM is introduced and the resulting World-Earth dynamics are briefly discussed (Sect.4).Sect. 5 concludes.

Towards blueprinting World-Earth models
In this section, we outline guidelines for the construction of the novel class of WEMs and also discuss their required properties for addressing leading research questions of the following type: (1) In which respects is the Anthropocene different from previous paleoclimatic states of the Earth, and how might it alter the future evolution of the Earth system and its main components (Steffen et al., in press)?( 2) What are the social, economic and environmental conditions for sustainable development within a "safe and just" operating space for humankind, i.e., for a trajectory of the Earth system that neither violates precautionary planetary boundaries nor acceptable social foundations (Rockström et al., 2009;Steffen et al., 2015;Raworth, 2012)?
(3) Are there possibly disastrous cascading interactions between potential climatic (e.g., continental ice sheets or major biomes such as the Amazon rain forest) and social tipping elements (e.g., public opinion formation and eco-migration) and how can they be avoided (Schellnhuber et al., 2016a)?(4) How does climate change feed back on complex social structures and their dynamics?(5) How do societal transformations affect the natural Earth system?
We think that such a research program, which aims at investigating the dynamics and resilience of the planetary socialecological system in the Anthropocene, should be built upon recent advances in the theory and modelling of complex adaptive systems.It needs to take into account the agency of social actors and global-scale adaptive networks carrying and connecting social, economic and ecological processes that shape social-ecological coevolution (Verburg et al., 2016;Donges et al., 2017a, b).Modeling approaches for investigating social-ecological system dynamics have already been developed.However, they usually focus on local or small-scale human-nature interactions (Schlüter et al., 2012).Therefore, we need to scale up such approaches to the planetary scale and incorporate insights from macro-level and global modeling exercises.Accordingly, we propose that the development of WEMs of the type discussed in this paper should be guided by aiming for the following properties: 1. Environmental and societal processes should be described on similar levels of complexity (e.g., in terms of the number of state variables representing the two spheres) to do justice to the dominant role of human societies in Anthropocene Earth system dynamics.One implication of this guideline is that WEMs should have the ability to reflect a similar number of planetary boundaries and social foundations, respectively.The modelled subsystems and processes can be further structured into biophysical, socio-metabolic and socio-cultural taxa (Donges et al., in prep.)(see Sect. 3 definitions).
2. WEMs should allow for representations of the dynamics of the diverse agents and the complex social structure connecting them that constitute human societies, using the tools of agent-based and adaptive network modelling (Müller-Hansen et al., 2017).Accordingly, such models should describe decision processes of representative samples of individual hu- mans, social groups or classes, and collective agents such as firms, households or governments.This includes the representation of diverse objectives, constraints, and decision rules, differentiating for example by the agent's social class and function and taking the actual and perceived decision options of different agent types into account.They should reflect the observation that the social sphere is networked on multiple layers and regarding multiple phenomena (knowledge, trade, institutions, preferences etc.).3. WEMs should incorporate as dynamic processes the feedbacks of collective social processes on biogeophysical Earth system components and vice versa.This feature enables them to produce paths in coevolution space (Schellnhuber, 1998(Schellnhuber, , 1999) ) through time-forward integration of all entities and networks allowing for deterministic and stochastic dynamics.
4. WEMs should be able to capture nonlinear dynamics.This feature is a prerequisite for modeling climatic (Lenton et al., 2008) and social tipping elements (Kopp et al., 2016).storylines nor optimisations but focus on the exploration of the space of dynamic possibilities.This feature allows for WEM dynamics to be investigated with state-of-the-art methods from complex systems theory, e.g., for measuring different flavors of resilience (Menck et al., 2013;van Kan et al., 2016;Donges and Barfuss, 2017) and for establishing hierarchies of planetary boundaries and safe operating spaces in models (Heitzig et al., 2016;Kittel et al., 2017).
It is instructive to compare WEMs to the two existing classes of global change models in terms of to what degree they represent biophysical, socio-metabolic/economic and socio-cultural subsystems and processes in the planetary social-ecological system (Fig. 1).Earth System Models (ESMs) focus on the process-detailed description of biogeophysical dynamics (e.g., atmosphere-ocean fluid dynamics or biogeochemistry), while socio-metabolic processes (e.g., economic growth, greenhouse gas emissions and land use) are incorporated via external forcing and socio-cultural processes (e.g., public opinion formation, political and institutional dynamics) are only considered through different scenarios regarding the development of exogenous socio-metabolic drivers.Integrated Assessment Models (IAMs) contain a stylized description of biophysical dynamics, are process-detailed in the socio-metabolic/economic domains and are driven by narratives in the socio-cultural domain.In turn, WEMs should include all three domains equally.However, the focus of current and near-future developments in World-Earth modeling should lie on the development of a detailed description of socio-cultural processes because they are the ones where the least work has been done so far in formal modeling.
3 The copan:CORE World-Earth modelling framework In this section, we present the World-Earth modelling framework copan:CORE that was designed following the blueprinting guidelines outlined above (Sect.2).We describe our framework on three levels, starting with the abstract level independent of any software (Sects.3.1, 3.2, and 3.3), then describing the software design independent of any programming language (Sect.3.4), and finally presenting details of our reference implementation in the Python language (Sect.3.5).
In summary, copan:CORE enables a flexible model design around standard components and model setups that allows investigation of a broad set of case studies and research questions (Fig. 2).This flexibility and role-based modularization via multiple-inheritance is achieved through object-oriented programming.For example, these features allow for interoperability and dynamic coupling with existing models (e.g., the terrestrial vegetation model LPJmL working on the cell level (Bondeau et al., 2007), other Earth system models or integrated assessment models such as IMAGE ( van Vuuren et al.)) as well as for flexible scripting by end users.On the level of model infrastructure, a careful documentation, an automated test framework and git versioning allow for collaborative and structured development in large teams using copan:CORE.face, the European Union [EU], yourself) that are involved in a number of sufficiently well-distinguishable processes ("things that happen", e.g., vegetation growth, economic production, opinion formation) which affect one or more attributes ("how things are", e.g., the spot's harvestable biomass, the EU's gross product, your opinion on fossil fuels, the atmosphere-ocean diffusion coefficient).During a model run, entities may come into existence (individuals may be born, social systems may merge into larger ones or fractionate), cease to exist (individuals may die, social systems may collapse), or may even be "reactivated" (e.g., an occupied country may regain independence).
3.1.2Entity-types, process taxa, process-types copan:CORE classifies entities by entity-types ("kinds of things that are", e.g., spatial grid cell, social system, individual), and allows to group (some or all) processes into process taxa (e.g., natural, socio-metabolic, cultural).Each process and each attribute belongs to either a certain entity-type or a certain process taxon.We deliberately do not specify sharp criteria for subject-verb-object sentence structure even when the subject is not a conscious being and the described action is not deliberate (e.g., "the oceans take up carbon from the atmosphere").copan:CORE therefore allows modelers to treat some processes as if they were "done by" a certain entity (the "subject" of the process) "to" itself and/or certain other entities (the "objects" of the process).Other processes for which there appears to be no natural candidate entity to serve as the "subject" can be treated as if they are happening "inside" or "on" some larger entity that contains or otherwise supports all actually involved entities.In both cases, the process is treated as belonging to some entity-type.Still other processes such as multilateral trade may best be treated as not belonging to a single entity and can thus be modeled as belonging to some process taxon.
Similarly, attributes may be modeled as belonging to some entity-type (e.g., 'total population' might be modeled as an attribute of the 'social system' entity-type) or to some process taxon (e.g., 'atmosphere-ocean diffusion coefficient' might be modeled as an attribute of the 'environment' process taxon).We suggest to model most quantities as entity-type attributes and model only those quantities as process taxon attributes which represent global constants.
Independently of where processes belong to, they are also distinguished by their formal process-type, corresponding to different mathematical modeling and simulation/solving techniques: continuous dynamics given by ordinary differential equations, -(quasi-)instantaneous reactions given by algebraic equations (e.g., for describing economic equilibria), steps in discrete time (e.g., for processes aggregated at annual level or for coupling with external, time-step-based models or model components), or events happening at irregular or random time points (e.g., for agent-based and adaptive network components or externally generated extreme events).
the latter two potentially have probabilistic effects (later versions will also include support for stochastic differential equations or other forms of time-continuous noise, currently noise can only be modeled via time-discretized steps).Similarly, attributes have data-types (mostly physical or socio-economic simple quantities of various dimensions and units, but also more complex data-types such as references or networks).
Fig. 2 summarizes our basic process taxa and entity-types, their typical connections, and the corresponding typical modeling approaches (which in turn are related to certain formal process types).Sects.3.2 and 3.3 will describe them in detail.

Modularization, model components, user roles
copan:CORE aims at supporting a plug-and-play approach to modelling and a corresponding division of labour between several user groups (or roles) by dividing the overall model-based research workflow into several tasks: -If there is already a model that fits your research question, use that one in your study (role: model end user).
- As a consequence, we formally distinguish between model components and (composed) models.
A model component specifies (i) a meaningful collection of processes that belong so closely together that it would not make much sense to include some of them without the others into a model (e.g., plants' photosynthesis and respiration), (ii) the entity attributes that those processes deal with, referring to attributes listed in the master data model whenever possible, (iii) which existing (or, if really necessary, additional) entity-types and process taxa these processes and attributes belong to.A model specifies (i) which model components to use, (ii) if necessary, which components are allowed to overrule parts of which other components (iii) if necessary, any attribute identities, i.e., whether some generally distinct attributes should be considered to be the same thing in this model (e.g., in a complex model, the attribute 'harvestable biomass' used by an 'energy sector' component as input may need to be distinguished from the attribute 'total vegetation' governed by a 'vegetation dynamics' component, but a simple model that has no 'land use' component that governs their relationship may want to identify the two).

Master data model and master component repository
The master data model defines entity types, process taxa, attributes, and physical dimensions and units which the modeling board members deem (i) likely to occur in many different models or model components and (ii) sufficiently well-defined and well-named (in particular, specific enough to avoid most ambiguities but avoiding a too discipline-specific language).The master component repository contains model components which the modeling board members deem likely to be useful for many different models, sufficiently mature and well-tested, and indecomposable into more suitable smaller components.

All attributes are treated as variables
Although many models make an explicit distinction between "endogenous" and "exogenous" variables and "parameters", our modular approach requires us to treat all relevant entity-type or process taxon attributes a priori in the same way, calling them variables whether or not they turn out to be constant during a model run or are used for a bifurcation analysis in a study.This is because a quantity that one model component uses as an exogenous parameter that will not be changed by this component will often be an endogenous variable of another component, and it is not known to a model component developer which of the quantities she deals with will turn out to be endogenous variables or exogenous parameters of a model or study that uses this component.
A variable's specification contains metadata such as a common language label and description, a mathematical symbol, its level of measurement or scale of measure (ratio, interval, ordinal, or nominal), its physical or socio-economic dimension and default unit (if possible following some established standard), its default (constant or initial) value and range of possible values.

Basic entity-types
We try to keep the number of explicitly considered entity-types manageably small and thus choose to model some relevant things that occur in the real world not as separate entities but rather as attributes of other entities.As a rule of thumb (with the exception of the entity-type 'world'), only things that can occur in potentially large, a priori unknown, and maybe changing numbers and display a relevant degree of heterogeneity for which a purely statistical description seems inadequate will be modeled as entities.In contrast, things that typically occur only once for each entity of some type (e.g., an individual's bank account) or which are numerous but can sufficiently well described statistically are modeled as attributes of the latter entitytype.
Although further entity-types (e.g., 'household', 'firm', 'social group', 'policy', or 'river catchment', the latter being central in socio-hydrology (Di Baldassarre et al., 2017) and important for the water planetary boundary (Steffen et al., 2015)) will eventually be included into the master data model, at this point the copan:CORE base model component only provides the following entity-types that all models must contain, in addition to an overall entity-type 'world' that may serve as an anchor point for relations between entities (see also Fig. 3).

Cells
An entity of type 'cell' represents a small spatial region used for discretising the spatial aspect of processes and attributes which are actually continuously distributed in space.They may be of a more or less regular shape and arrangement, e.g., represent a latitude-longitude-regular or an icosahedral grid or an irregular triangulation adapted to topography.Since they have no realworld meaning beyond their use for discretization, cells are not meant to be used as agents in agent-based model components.
Geographical regions with real-world meaning should instead be modeled via the type 'social system'.

Social systems
An entity of type 'social system' is meant to represent what is sometimes simply called a 'society', e.g., Wikipedia defines 'society' as "an economic, social, industrial or cultural infrastructure" (Wikipedia, 2017).We understand a social system as a humanly-designed and humanly-reproduced structure including the flows of energy, material, financial and other resources that are used to satisfy human needs and desires, influenced by the accessibility and usage of technology and infrastructure (Otto et al., in prep.).Equally importantly, social systems include social institutions such as informal systems of norms and values and beliefs, and formally codified written laws and regulations, governance and organizational structures (Williamson, 1998).
In our framework, norms, values and beliefs may be described in macroscopic terms on the social system level but may also be described microscopically on the level of individuals (Sect.3.2.3).
Social systems in this sense typically have a considerable size (e.g., a sovereign nation state such as the United States of America, a federal state or country such as Scotland, an urban area such as the Greater Tokyo Area, or an economically very closely integrated world region such as the EU), controlling a well-defined territory (represented by a set of cells) and encompassing all the socio-metabolic and cultural processes occurring within that territory.Social systems are not meant to represent a single social group, class, or stratum, for which different entity-types should be used (e.g., a generic entity-type 'social group').
To allow for a consistent aggregation of socio-metabolic quantities and modeling of hierarchical political decision-making, the social systems in a model are either all disjoint (e.g., representing twelve world regions as in some integrated assessment models, or all sovereign countries), or form a nested hierarchy with no nontrivial overlaps (e.g., representing a three-level hierarchy of world regions, countries, and urban areas).As the attributes of social systems will often correspond to data assembled by official statistics, we encourage to use a set of social systems that is compatible to the standard classification ISO 3166-1/2 when representing real-world social systems.
Social systems may act as agents in agent-based model components but an alternative choice would be to use 'individuals' like their 'head of government' or 'social groups' like a 'ruling elite' as agents.

Individuals
Entities of type 'individual' represent individual human beings.These entities will typically act as agents in agent-based model components, although also entities of other types (e.g., the potential types 'household', 'firm', or 'social group') may do so.
In contrast to certain economic modeling approaches that use "representative" consumers, an entity of type 'individual' in copan:CORE is not usually meant to represent a whole class of similar individuals (e.g., all the actual individuals of a certain profession) but just one specific individual.Still, the set of all 'individuals' contained in a model will typically be interpreted as being a representative sample of all real-world people, and consequently each individual carries a quantity 'represented population' as an attribute to be used in statistical aggregations, e.g., within a social system.

Basic process taxa
Based on Donges et al. (in prep.), we classify processes into three major taxa.We give only a rough definition and abstain from defining a finer, hierarchical taxonomy, being aware that gaining consensus among different disciplines on such a taxonomy would be unlikely, and thus leaving the assignment of individual processes and attributes to either taxon to the respective model component developers:

Environment
The 'environment' process taxon is meant to contain biophysical or "natural" processes from material subsystems of the Earth system that are not or only insignificantly shaped or designed by human societies (e.g., atmosphere-ocean diffusion, growth of unmanaged vegetation, and maybe the decay of former waste dumps).We expect these processes to deal primarily with the entity-types 'cell' (for local processes such as terrestrial vegetation dynamics described with spatial resolution) and 'world' (for global processes described without spatial resolution, e.g., the greenhouse effect) and sometimes 'social system' (for mesoscopic processes described at the level of a social system's territory, e.g., the environment diffusion and decomposition of industrial wastes).

Metabolism
The 'metabolism' process taxon is meant to contain socio-metabolic and economic processes from material subsystems that are designed or significantly shaped by human societies (e.g., harvesting, afforestation, greenhouse gas emissions, waste dumping, land-use change, infrastructure building).Social metabolism refers to the material flows in human societies and the way societies organize their exchanges of energy and materials with nature (Fischer-Kowalski, 1997;Martinez-Alier, 2009).We expect these processes to deal primarily with the entity-types 'social system' (e.g., for processes described at national or urban level), 'cell' (for local socio-metabolic processes described with additional spatial resolution for easier coupling to natural processes) and 'world' (for global socio-metabolic processes such as international trade), and only rarely with the entity-type 'individual' (e.g., for micro-economic model components such as consumption, investment or the job market).

Culture
The 'culture' process taxon is meant to contain socio-cultural processes from immaterial subsystems (e.g., opinion adoption, social learning, voting, policy-making) that are described in models in a way abstracted from their material basis.Culture in its broadest definition refers to everything what people do, think and posses as members of society (Bierstedt, 1963, p. 129).We expect these processes to deal primarily with the entity-types 'individual' (for "micro"-level descriptions) and 'social system' (for "macro"-level descriptions), and rarely 'world' (for international processes such as diplomacy or treaties).

Software design
This section describes the programming language-independent parts of how the above abstract structure is realized as computer software.As they correspond closely with the role-based and entity-centric view of the abstract framework, modularization and object-orientation are our main design principles.All parts of the software are organized in packages, subpackages, modules, and classes.The only exception are those parts of the software that are written by model end-users to perform actual studies, which will typically be in the form of scripts following a mainly imperative programming style that uses the classes provided by the framework.Fig. 4 summarizes the main aspects of this design which are described in detail in the following.

Object-oriented representation
Entity-types and process taxa are represented by classes ('Cell', 'SocialSystem', 'Culture', . . .), individual entities by instances (objects) of the respective entity-type class, and process taxon classes have exactly one instance.While entity-type and process taxon classes hold processes' and variables' metadata as class attributes, entity instances hold variable values and, where needed, their time derivatives as instance attributes.Processes' logics can be specified via symbolic expressions in the process metadata (e.g., for simple algebraic or differential equations) or as imperative code in instance methods (e.g., for regular 'steps' and random 'events' in an agent-based modeling style).

Interface and implementation classes
All of this is true not only on the level of (composed) models but already on the level of model components, though restricted to the entity-types, processes and variables used in the respective component.To avoid name clashes but still be able to use the same simple naming convention throughout in all model components, each model component is represented by a subpackage of the main copan:CORE software package, containing class definitions for all used entity-types and process taxa as follows.Each entity-type and process taxon used in the model component is represented by two classes, (i) an interface class that has a class attribute of type 'Variable' (often imported from the master data model subpackage or another model component's interface classes) for each variable of this entity-type or process taxon this model component uses as input or output, containing that variable's metadata (see Fig. 8 for an example), and (ii) an implementation class inherited from the interface class, containing a class attribute 'processes' and potentially some instance methods with process logics.
The attribute 'processes' is a list of objects of type 'Process', each of which specifies the metadata of one process that this model component contributes to this entity-type or process taxon (see Figs. 9,10 for examples).These metadata either contain the process logics as a symbolic expression or as a reference to some instance method(s).Instance methods do not return variable values but manipulate variable values or time derivatives directly via the respective instance attributes.As many variables are influenced by more than one process, some process implementation methods (e.g., those for differential equations or noise) only add some amount to an attribute value, while others (e.g., those for major events) may also overwrite an attribute

Dimensional quantities, symbolic expressions, networks
To be able to specify values of dimensional quantities, mathematical equations, and networks of relationships between entities in a convenient and transparent way, we provide classes representing these types of objects, e.g., 'Dimension', 'Unit', 'Dimen-sionalQuantity', 'Expr' (for symbolic expressions), 'Graph' (for networks), 'ReferenceVariable'/'SetVariable' (for references to single/sets of other entities).

Reference implementation in Python
For the reference implementation of copan:CORE we chose the Python programming language to enable a fast development cycle and provide a low threshold for end users.It is available as an open-source Python package pycopancore (http://github.com/pikcopan/pycopancore)including the master data model and a small number of pre-defined model components and models as subpackages and modules.Symbolic expressions are implemented via the sympy package (Meurer et al., 2017) which was extended to support aggregation (as in Fig. 10, top, line 5) and cross-referencing between entities (as in Fig. 10, bottom, line 14).
ODE integration is currently implemented via the scipy package (Jones et al., 2001).While the reference implementation is suitable for moderately sized projects, very detailed models or large-scale Monte-Carlo simulations may require an implementation in a faster language such as C++, which we aim at realizing via a community-driven open-source software development project.
Model component developers add their model component as a package to their local workspace folder, including the interface module and one module for each provided implementation class as in Figs.8-10.In order to paralellize complex computations or couple to other model software, an implementation class may implement certain processes using an instance method that calls or communicates with other processes or external programs which provide a communication method supported by Python, e.g., MPI or JSON.
Model composers provide a module that mainly composes the final entity type and process taxon classes via multiple inheritance from model components' implementation classes, e.g., specifying code like modeling board members.Arrows indicate the relations "is using" (dashed) and "inherits from" (solid).
Model end users use a Python script that imports these model modules, instantiates a 'model' object, all needed process taxon objects and an initial set of entities, then initializes those variables that shall start with non-default values, uses a 'runner' object to run the model for a specified time and finally analyses the resulting trajectory.runner returns the time evolution of requested variables as a nested Python dictionary the first-and second-level keys of which are a 'variable' object and an entity or process taxon and whose values are lists of values ordered by time, which can then conveniently be analysed or plotted (e.g., Fig. 5, line 30).
4 Examplary World-Earth model implemented using copan:CORE In this section, we shortly present an example of a model realized with the pycopancore reference implementation of the copan:CORE modeling framework.The example model was designed to showcase the concepts and capabilities of copan:CORE in a rather simple WEM, and its components were chosen so that all entity types and process taxa and most features of copan:CORE are covered.Although most model components are somewhat plausible versions of model components that can be found in the various literatures, the example model is not intended to be a serious representation of the real world that could be used directly for studying research questions.Likewise, although we show example trajectories that are based on parameters 10 and initial conditions that roughly reproduce current values of real-world global aggregates in order to make the example as accessible as possible, the shown time evolutions may not be interpreted as any kind of meaningful quantitative prediction or projection.
In spite of this modest goal here, it will become obvious from the two presented scenarios that including socio-cultural dynamics such as migration, environmental awareness, social learning, and policy making into more serious models of the Earth Syst.Dynam.Discuss., https://doi.org/10.global co-evolution of human societies and the environment will likely make a considerable qualitative difference for their results and thus have significant policy implications.2013)) and with international technology spillovers and human capital depreciation; international migration driven by differences in well-being (see, e.g., Lilleoer and van den Broeck ( 2011)); and a domestic voting on subsidizing renewables, taxing greenhouse gas emissions, and banning fossil fuels that is driven by individual environmental friendliness.The latter results from getting aware of environmental problems by observing the local biomass density and diffuses through a social acquaintance network via a standard model of social learning (see e.g., Holley and Liggett (1975)).These processes cover all possible process taxon interactions as shown in Table 1 and are distributed over eight model components in the code as shown in Fig. 6.
In order to show in particular what effect the inclusion of the socio-cultural processes into WEMs can have on their results, we compare two representative hundred-year runs from this example model, one without the social processes migration, environmental awareness, social learning, and voting, and another with these processes included.Both runs start from the same initial conditions and use the same parameters which were chosen to roughly reflect real-world global aggregates of the year 2000 but were otherwise randomly distributed on an Earth-like planet with five fictitious social systems, 100 grid cells and 1000 representative individuals.See the Supplementary Information for model and parameter details.
As can be seen in Fig. 7 (left), without the social processes, our fictitious societies go on burning the fossil carbon stock, driving atmospheric and ultimately ocean carbon stocks further up considerably despite a temporary reduction in the latter two stocks (Fig. 7 bottom panels show these variables corresponding to the environmental process taxon).Although terrestrial carbon grows initially, it also eventually gets exploited severely once fossil stocks are down and the share of biomass in the energy sector grows (middle panels show these energy sector shares in all five social systems).Although one social system has a renewable energy policy in place throughout and renewable energy knowledge spills over to other social systems, the renewable sectors only become really competitive and get significant shares towards the end of the century when unprotected biomass becomes scarce.Things are very different when the social processes are included, Fig. 7 (right).As can be seen in the upper panel with variables corresponding to the socio-cultural process taxon, the share of environmentally friendly individuals grows rapidly due to the combined effects of environmental awareness and social learning.Since this implies that a proportionally growing percentage of the terrestrial carbon gets protected, the growing environmental friendliness at first implies a declining share of the biomass sector and hence an even growing share of the fossil sector.But after about two decades, this evolution gets 5 reversed fast due to energy policy: growing environmental friendliness also causes all social systems to implement a renewable subsidy at different time points but within only several years, then an emissions tax and ultimately banning fossils completely shortly after.After that, despite the renewable subsidy and vast protection of terrestrial carbon, the energy system is dominated by biomass for about another three decades before renewables take over.Still, in contrast to the first scenario, atmospheric carbon declines and terrestrial carbon remains high.dynamics from different schools of thought (Schlüter et al., 2017) on the coevolutionary trajectory of the system.The model components describe fine-grained yet meaningfully defined subsystems of the social and environmental domains of the Earth system and thus enable the combination of modeling approaches from the natural and social sciences.In the framework, different entities such as geographic cells, individual humans, and social systems are represented and their attributes are shaped by environmental, socio-metabolic, and socio-cultural processes.The mathematical types of processes that can be implemented 5 in the framework range from ordinary differential and algebraic equations to deterministic and stochastic events.Due to its flexibility, the model framework can be used to analyse interactions at and between various scales -from local to regional and global.The current version of the copan:CORE framework also comes with some tentative model components implementing, e.g., basic economic, climatic, biological, demographic and social network dynamics.However, to use the framework for rigorous scientific analyses, these components have to be refined, their details have to be spelled out, and new components have to be developed that capture processes with crucial influence on World-Earth coevolutionary dynamics.For this purpose, various modeling approaches from the social sciences are available to be applied to develop comprehensive representations of such socio-metabolic and cultural processes (Müller-Hansen et al. (2017) and references therein).For example, hierarchical adaptive network approaches could be used to model the development of social groups, institutions and organizations spanning local to global scales or the interaction of economic sectors via resource, energy and information flows.
Making such an endeavor prosper requires the collection and synthesis of knowledge from various disciplines.The modular approach of the copan:CORE framework supports well-founded development of single model components, helps to integrate various processes and allows to analyse their interplay.We therefore call upon the interdisciplinary social-ecological modelling community to participate in further model and application development to facilitate "whole" Earth system analysis.(bottom, l.23-26), symbolic expressions (bottom, l.7-8) and equations (top, l.9-10), aggregation (top, l.6), and cross-referencing between entities (bottom, l.16-18).

Figure 1 .
Figure 1.World-Earth models (WEMs) in the space of model classes used for scientific analysis of global change.It is shown to what degree current Earth system models, integrated assessment models and WEMs cover biophysical, socio-metabolic/economic, and sociocultural processes, respectively. 5

10 5 .
WEMs should allow for a comprehensive evaluation of state and parameter spaces to explore the universe of accessible system trajectories and to enable rigorous analyses of uncertainties and model robustness.Hence, they emphasize neither Earth Syst.Dynam.Discuss., https://doi.org/10.5194/esd-2017-126Manuscript under review for journal Earth Syst.Dynam.Discussion started: 15 January 2018 c Author(s) 2018.CC BY 4.0 License.

3. 1 Figure 2 .
Figure 2. Overview of copan:CORE modelling framework.The entities in copan:CORE models are classified by entity-types (e.g., grid cell, social system, individual).Processes are grouped into process taxa (cultural, metabolic, environmental).Each process belongs to either a certain entity-type or a certain process taxon.Processes are further distinguished by their formal process-type, which allows various different modeling approaches.Entity types, process taxa and process types can be freely combined with each other.Thick black lines indicate which combinations are most common.

10
deciding where processes belong since this is in part a question of style and academic discipline and there will inevitably be examples where this choice appears to be quite arbitrary and will affect only the model's description, implementation, and maybe its running time, but not its results.When talking about processes, people from very different backgrounds widely use a 7 Earth Syst.Dynam.Discuss., https://doi.org/10.5194/esd-2017-126Manuscript under review for journal Earth Syst.Dynam.Discussion started: 15 January 2018 c Author(s) 2018.CC BY 4.0 License.
If not, decide what model components the question at hand needs.-If all components exist, compose a new model from them (role: model composer).Earth Syst.Dynam.Discuss., https://doi.org/10.5194/esd-2017-126Manuscript under review for journal Earth Syst.Dynam.Discussion started: 15 January 2018 c Author(s) 2018.CC BY 4.0 License.-If not, design and implement missing model components (role: model component developer).If some required entity attributes are not yet in the master data model (Sect.3.1.4),add them to your component.Suggest welltested entity attributes, entity-types, or model components to be included in the copan:CORE community's master data model or master component repository (modeling board members will then review them).

Figure 3 .
Figure 3. Basic relationships between entities in the copan:CORE framework.This entity-relationship diagram shows the most important entity types and relationships, and a selection of entities' attributes, as implemented in the 'base' model component of the pycopancore reference implementation.
Dynam.Discuss., https://doi.org/10.5194/esd-2017-126Manuscript under review for journal Earth Syst.Dynam.Discussion started: 15 January 2018 c Author(s) 2018.CC BY 4.0 License.3.4.3 Model composition via multiple inheritanceFinally, a model's composition from model components is represented via multiple inheritance from the model component's implementation classes (which are thus also called 'mixin' classes) as follows.Each model is defined in a separate module (typically a single code file).For each entity-type and process taxon that is defined in at least one of the used model component packages, the model module defines a composite class that inherits from all the mixin classes of that entity-type contained in the used model component packages.
Figure 4. Stylized software diagram of a model in pycopancore displaying the inheritance structure, showing only the 'base' and one other model component and just one entity-type and process taxon.Large boxes are subpackages, colors indicate code sections which are provided or used by different user roles.Red: model end users, orange: model developers, blue: model component developers, green:

Figure 5 .
Figure 5. Sketch of a model end user's Python script running a model and plotting some results, featuring dimensional quantities and a network.Variable values can be set either at instantiation (line 9), via the entity object attribute (line 20) or the Variable object (line 24).
The example model includes a spatially resolved version of the simple carbon cycle used inNitzbon et al. (2017) (based on Anderies et al. (2013)); regionalised versions of the well-being-driven population dynamics and simple economy used inNitzbon et al. (2017), adding to its fossil and biomass energy sectors a renewable energy sector with technological progress based on learning by doing(Nagy et al. (

Figure 7 .
Figure 7. Two runs from an example model, one without (left) and one with (right) the social processes of migration, environmental awareness, social learning, and voting included, showing very different transient (and asymptotic, though not shown here) behaviour.

Figure 8 .]Figure 10 .
Figure 8. Sketch of a model component's interface, implemented as a Python module that lists the variables.The component contributes to the various entity types and process taxa, either referenced from the master data model (line 13) or defined newly (line 15).