Running integrated assessment models in cloud sandboxes

November 22, 2026. Published on jamesmurdza.com

Recently, I've been learning a lot about integrated assessment models (IAMs), including attending a conference on the topic. Integrated assessment models are computer models that link the economy, energy, land use and climate to explore how different choices lead to different outcomes — typically run on clusters by researchers, and used everywhere from local policymaking to the Paris Agreement.

I've previously run the Dynamic Integrated Climate-Economy model (DICE) in a Jupyter notebook. It's a low-resolution model with a simple climate component, so it can't capture much detail.

The next challenge was to run the Global Change Analysis Model (GCAM). GCAM is a widely used, open-source model written in C++ that links energy, agriculture and land use over decades.

Temperature anomaly graph with results from seven climate models

Setting up each model

Before running GCAM, I started by running several easier-to-set-up models as well as DICE. The climate models are emulators—that means they are based mostly on statistical fits rather than simulations of physical processes.

I ran each in a Daytona sandbox, which required:

  1. Determining the hardware requirements of each model
  2. Creating a Dockerfile with the steps to reproducibly set up each model
  3. Adding a run.py in the Dockerfile to standardize the input parameters of each model. (I process the raw output outside the sandbox.)

The Dockerfiles are also on Docker Hub, so they can be used independently of my web app. I also created a Daytona snapshot from each Dockerfile, so I can quickly initialize sandboxes for each model.

Hardware requirements

My main finding was that the simple models run quickly with a small amount of CPU and memory. Adding more than 2 vCPU and 1 GiB of memory did not make them run significantly faster.

In the future, I want to try using burstable pricing on Daytona to see if I can run models with even less than 1 vCPU.

To run OSCAR and GCAM, I needed more memory. When trying to run OSCAR with 1GiB of RAM, it ran out of memory. Using a sandbox with more memory fixed this.

Model name Description Runtime stats
Two Layer Simple climate model with a surface layer and a deep-ocean layer <1s with 1 vCPU and 1 GiB memory
HECTOR Simple climate model that converts CO₂ emissions into temperature rise ~1.7s with 2 vCPU and 1 GiB memory
MAGICC Simple climate model that converts emissions data into temperature rise ~10s with 2 vCPU and 1 GiB memory
FaIR Ensemble climate model that runs 66 sets of assumptions to give a spread of warming outcomes ~15s with 2 vCPU and 1 GiB memory
DICE Climate and economy model that weighs the costs and benefits of emissions reductions ~30s with 2 vCPU and 1 GiB memory
OSCAR Earth system model with linked carbon cycle, ocean, ice, and vegetation components ~10 minutes with 4 vCPU and 8 GiB memory
GCAM Climate and economy model that links energy, agriculture, and land use over decades ~30 minutes with 4 vCPU and 8 GiB memory

Running GCAM

Getting GCAM working was a little less straightforward than the other models. However, GCAM uses the climate model Hector, so we already had one component working.

Preparing the GCAM XML files

To run GCAM (the C++ program), one must first prepare a "database" of about 5.7 GB XML files. This data comes from 380MB of raw CSV files which are included with GCAM. The easy way to do this is to download the full release from GitHub.

The hard way to do this is to build the XML files with gcamdata (an R package) that uses drake. The GCAM documentation says "at least 5 GB available RAM" is needed to run gcamdata. However, what I learned is that using the minimal energy settings (jobs=1, memory_strategy="autoclean") was still not sufficient with 8 GiB of RAM, and that running gcamdata took me 13.5GB of memory at its peak. It took about 75 minutes to complete.

During testing, I also discovered some memory and data processing bugs in gcamdata, which I hope to return to later to create fixes for.

Running GCAM in a cloud sandbox

When running GCAM, I again encountered issues with memory. GCAM 9.1's official documentation says:

Warning: GCAM requires significant computational resources. A GCAM model simulation will utilize over 8 GB of system RAM and storing the full results of the simulation will take around 3 GB of disk space per scenario.

The warning says that simulations use over 8 GB of RAM. That still doesn't tell us how much memory we need to run GCAM simulations.

As it turned out, I was able to run GCAM with just under 8GB of RAM, but I had to adjust the default settings. GCAM defaulted to using the maximum number of cores (4) but ran out of memory.

A GCAM configuration file with max-parallelism set

I then tried with max-parallelism=1, which worked, with 7.3 GiB of RAM at its peak, and with max-parallelism=2, which also worked with 7.9 GiB of RAM. While the latter is precariously close to our limit, I continued to use this setting on several more runs without problems.

Launching a sandbox from a snapshot takes less than a second, but updating a snapshot can take 10+ minutes. Therefore, I tried to set up the sandbox images such that they are as flexible as possible. The run.py script for GCAM takes scenario and config_overrides parameters, which can contain any GCAM config parameter.

User interface

I made a NextJS web app, which is mainly useful to manage parallel and batch runs. In this app, I can select multiple models and scenarios to run simultaneously.

Selecting multiple models and scenarios to run in the web app

Each run shows a progress indicator and how long it has been running, and when it is finished the output can be viewed:

Viewing the output of a finished run in the web app

While the web app is open, updates are streamed from the sandbox to the dashboard. A webhook is triggered from the sandbox to the backend after each run completes. That way, the results are always saved in the database and the sandbox is deleted. The sandbox is also deleted automatically after a set period of time in case the model hangs, to prevent unexpected costs.

Using AI for IAM development

I mainly used Claude Code to set up, debug and automate the models I discussed here. Doing this without AI would not have been feasible for me.

However, when using AI to set up a model, we should watch out for a few things:

  • The AI will set up configuration files and input files
  • The AI might fix bugs in or modify the actual model

If we don't audit and document each step that the AI takes, that is a problem for reproducibility because I could receive different results than others using the same model.

In the near future, entire IAMs will be refactored and written by AI. Eventually, AI will introduce bugs and inconsistencies into IAMs. To ensure our models are still accurate, we need to verify changes against past versions.

To verify changes, we need to carefully choose a sensible selection of scenarios and inputs to test. Fortunately, with cloud sandboxes, this verification can be done more quickly. With Daytona, it's feasible to run over 100 instances of GCAM in parallel.

The benefit of using sandboxes is that it makes the entire development process faster.

Source code

All of the code, Dockerfiles and documentation are open-source and licensed under the Apache 2.0 license:

http://github.com/jamesmurdza/possibleplanets/

Read the original on blog.jamesmurdza.com →