Climate Change update

Climate Change update preview image

1 collaborator


(This model has yet to be categorized with any tags)
Visible to everyone | Changeable by everyone
Model was written in NetLogo 5.0.3 • Viewed 1390 times • Downloaded 84 times • Run 0 times
Download the 'Climate Change update' modelDownload this modelEmbed this model

Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)


This is a model of energy flow in the earth, particularly heat energy. It shows the earth as rose colored, and the surface of the planet is represented by a black strip. Above the strip there is a blue atmosphere and black space at the top. Clouds and carbon dioxide (CO2) molecules can be added to the atmosphere. The CO2 molecules represent greenhouse gases that block infrared light that is emitted by the earth. Clouds block incoming or outgoing sun rays, influencing the heating up or cooling down of the planet.


Yellow arrowheads stream downward representing sunlight energy. Some of the sunlight reflects off clouds and more can reflect off the earth's surface.

If sunlight is absorbed by the earth, it turns into a red dot, representing heat energy. Each dot represents the energy of one yellow sunlight arrowhead. The red dots randomly move around the earth, and its temperature is related to the total number of red dots.

Sometimes the red dots transform themselves into infrared (IR) light that heads toward space, carrying off energy. The probability of a red dot becoming IR light depends on the earth's temperature. When the earth is cold, few red dots generate IR light; when it is hot, most do. The IR energy is represented by a magenta arrowhead. Each carries the same energy as a yellow arrowhead and as a red dot. The IR light goes through clouds but can bounce off CO2 molecules.

There is a relation between the number of red dots in the earth and the temperature of the earth. This is because the earth temperature goes up as the total thermal energy is increased. Thermal energy is added by sunlight that reaches the earth as well as from infrared (IR) light reflected down to the earth. Thermal energy is removed by IR emitted by the earth. The balance of these determines the energy in the earth, which is proportional to its temperature.

There are, of course, many simplifications in this model. The earth is not a single temperature, does not have a single albedo, and does not have a single heat capacity. Visible light is somewhat absorbed by CO2 and some IR light does bounce off clouds. No model is completely accurate. What is important is that a model reacts in some ways like the system it is supposed to model. This model does that, showing how the greenhouse effect is caused by CO2 and other gases that absorb IR.


In the updated version there are buttons to add factories and trees. Trees absorb CO2 and factories emmit CO2. Also, it is possible to create up to 4 different types of surfaces and thus creating your own globe. Ice can melt to water when the temperature becomes higher and freeze again when the temperature becomes lower. There is also a possibility to implement a day/night cycle.


The SUN-BRIGHTNESS slider controls how much sun energy enters the earth's atmosphere. A value of 1.0 corresponds to our sun. Higher values allow you to see what would happen if the earth was closer to the sun, or if the sun got brighter.

The ALBEDO slider controls how much of the sun energy hitting the earth is absorbed. If the albedo is 1.0, the earth reflects all sunlight. This could happen if the earth froze, and it is indicated by a white surface. If the albedo is zero, the earth absorbs all sunlight. This is indicated as a black surface. The earth's albedo is about 0.6.

You can add and remove clouds with buttons. Clouds block sunlight but not IR.

You can add and remove greenhouse gases, represented as CO2 molecules. CO2 blocks IR light but not sunlight. The buttons add and subtract molecules in groups of 25 up to 150.

The temperature of the earth is related to the amount of heat in the earth. The more red dots you see, the hotter it is.


Watch a single sunlight arrowhead. This is easier if you slow down the model using the slider at the top of the model. You can also use the WATCH A RAY button.

What happens to the arrowhead when it hits the earth? Describe its later path. Does it escape the earth? What happens then? Do all arrowheads follow similar paths?


  1. Play with the model. Change the albedo and run the model. Add clouds and CO2 to the model and then watch a single sunlight arrowhead. What is the highest earth temperature you can produce?

  2. Run the model with a bright sun but no clouds and no CO2. What happens to the temperature? It should rise quickly and then settle down around 50 degrees. Why does it stop rising? Why does the temperature continue to bounce around? Remember, the temperature reflects the number of red dots in the earth. When the temperature is constant, there are about as many incoming yellow arrowheads as outgoing IR ones. Why?

  3. Explore the effect of albedo holding everything else constant. Does increasing the albedo increase or decrease the earth temperature? When you experiment, be sure to run the model long enough for the temperature to settle down.

  4. Explore the effect of clouds holding everything else constant.

  5. Explore the effect of adding 100 CO2 molecules. What is the cause of the change you observe? Follow one sunlight arrowhead now.


Try to add some other factors influencing the earth's temperature. For example, you could add patches of vegetation and then see what happens as they are consumed for human occupation. Also, you could try to add variable albedo to the model, instead of having one value for the whole planet. You could have glaciers with high albedo, and seas with low albedo, and then evaluate what happens when the glaciers melt into the seas.


Note that clouds are actually made up of lots of small circular turtles.




This model is based on an earlier version created in 2005 by Robert Tinker for the TELS project.


If you mention this model in a publication, we ask that you include these citations for the model itself and for the NetLogo software:


Copyright 2007 Uri Wilensky.


This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License. To view a copy of this license, visit or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.

Commercial licenses are also available. To inquire about commercial licenses, please contact Uri Wilensky at

Updated by Sander van Egmond

Comments and Questions

Please start the discussion about this model! (You'll first need to log in.)

Click to Run Model

globals [
  sky-top      ;; y coordinate of top row of sky
  earth-top    ;; y coordinate of top row of earth
  temperature  ;; overall temperature

breed [rays ray]     ;; packets of sunlight
breed [IRs IR]       ;; packets of infrared radiation
breed [heats heat]   ;; packets of heat energy
breed [CO2s CO2]     ;; packets of carbon dioxide
breed [factories factory]
breed [suns sun]
breed [clouds cloud]
breed [trees tree]
clouds-own [cloud-speed cloud-id]
suns-own [sun-speed]

;; Setup Procedures

to setup
  set-default-shape rays "ray"
  set-default-shape IRs "ray"
  set-default-shape clouds "cloud"
  set-default-shape heats "dot"
  set-default-shape CO2s "CO2-molecule"
  set-default-shape factories "factory"
  set-default-shape trees "tree"
  set-default-shape suns "sun"
  set temperature -20
  plot temperature

to setup-world
  set sky-top max-pycor - 5
  set earth-top 0
  ask patches [  ;; set colors for the different sections of the world
    if pycor > sky-top [  ;; space
      set pcolor scale-color white pycor 22 15
    if pycor <= sky-top and pycor > earth-top [ ;; sky
      set pcolor scale-color blue pycor -20 20
    if pycor < earth-top
      [ set pcolor red + 3 ] ;; earth
    if pycor = earth-top ;; earth surface
      [ albedo-surface ]
  create-suns 1
    set color yellow
    set size 4
    setxy (min-pxcor + 0.3) 20.5
    set heading 90
    set sun-speed 0.045

;; Runtime Procedures

to go
  ask clouds [ fd cloud-speed ]  ; move clouds along
  run-sunshine   ;; step sunshine
  ;; if the albedo slider has moved update the color of the "earth surface" patches
  run-heat  ;; step heat
  run-IR    ;; step IR
  run-CO2   ;; moves CO2 molecules
  ask patches [  if pycor = earth-top ;; earth surface
      [ albedo-surface  ]
  plot temperature
  ask trees [
  ask factories [
  ask suns [ 

to albedo-surface     ;; determine the albedo of the surface and the landtype of the surface

  let size1-min (min-pxcor * 0.01 * size-landtype1) ;; determine the size of all landtypes
  let size1-max (max-pxcor * 0.01 * size-landtype1)
  let size2-min (size1-min + (min-pxcor - size1-min) * size-landtype2 * 0.01) 
  let size2-max (size1-max + (max-pxcor - size1-max) * size-landtype2 * 0.01) 
  let size3-min (size2-min + (min-pxcor - size2-min) * size-landtype3 * 0.01) 
  let size3-max (size2-max + (max-pxcor - size2-max) * size-landtype3 * 0.01)
    if landtype4 = "ice/water" [   ;; Landtype 4 (outer landtype)
      ifelse ice-melt? [
        set pcolor scale-color blue temperature 30 0 ]
        [set pcolor scale-color blue landtype4-albedo 0 1 ]
    if landtype4 = "forest" [
      set pcolor scale-color green landtype4-albedo 0 1 ]
    if landtype4 = "desert" [
      set pcolor scale-color yellow landtype4-albedo 0 1 ]
    if landtype4 = "rocky" [
      set pcolor scale-color gray landtype4-albedo 0 1 ] 
  if pxcor >= size3-min and pxcor <= size3-max [ ;; Landtype 3
    if landtype3 = "ice/water" [
      ifelse ice-melt? [
        set pcolor scale-color blue temperature 30 0 ]
        [set pcolor scale-color blue landtype3-albedo 0 1 ]
    if landtype3 = "forest" [
      set pcolor scale-color green landtype3-albedo 0 1 ]
    if landtype3 = "desert" [
      set pcolor scale-color yellow landtype3-albedo 0 1 ]
    if landtype3 = "rocky" [
      set pcolor scale-color gray landtype3-albedo 0 1 ]  
  if pxcor >= size2-min and pxcor <= size2-max [ ;; Landtype 2 
    if landtype2 = "ice/water" [
      ifelse ice-melt? [
        set pcolor scale-color blue temperature 30 0 ]
        [set pcolor scale-color blue landtype2-albedo 0 1 ]
    if landtype2 = "forest" [
      set pcolor scale-color green landtype2-albedo 0 1 ]
    if landtype2 = "desert" [
      set pcolor scale-color yellow landtype2-albedo 0 1 ]
    if landtype2 = "rocky" [
      set pcolor scale-color gray landtype2-albedo 0 1 ]   

  if pxcor >= size1-min and pxcor <= size1-max [ ;; Landtype 1 (inner landtype)     
    if landtype1 = "ice/water" [
      ifelse ice-melt? [
        set pcolor scale-color blue temperature 30 0 ]
        [set pcolor scale-color blue landtype1-albedo 0 1 ]
    if landtype1 = "forest" [
      set pcolor scale-color green landtype1-albedo 0 1 ]
    if landtype1 = "desert" [
      set pcolor scale-color yellow landtype1-albedo 0 1 ]
    if landtype1 = "rocky" [
      set pcolor scale-color gray landtype1-albedo 0 1 ]    

to add-cloud            ;; erase clouds and then create new ones, plus one
  let sky-height sky-top - earth-top
  ;; find a random altitude for the clouds but
  ;; make sure to keep it in the sky area
  let y earth-top + (random-float (sky-height - 4)) + 2
  ;; no clouds should have speed 0
  let speed (random-float 0.1) + 0.01
  let x random-xcor
  let id 0
  ;; we don't care what the cloud-id is as long as
  ;; all the turtles in this cluster have the same
  ;; id and it is unique among cloud clusters
  if any? clouds
  [ set id max [cloud-id] of clouds + 1 ]

  create-clouds 3 + random 20
    set cloud-speed speed
    set cloud-id id
    ;; all the cloud turtles in each larger cloud should
    ;; be nearby but not directly on top of the others so
    ;; add a little wiggle room in the x and ycors
    setxy x + random 9 - 4
          ;; the clouds should generally be clustered around the
          ;; center with occasional larger variations
          y + random-normal 2.5 1
    set color white
    ;; varying size is also purely for visualization
    ;; since we're only doing patch-based collisions
    set size 2 + random 2
    set heading 90

to remove-cloud       ;; erase clouds and then create new ones, minus one
  if any? clouds [
    let doomed-id one-of remove-duplicates [cloud-id] of clouds
    ask clouds with [cloud-id = doomed-id]
      [ die ]

to run-sun
      fd sun-speed * 49 / 48
      ifelse day-night? [
        ifelse (round ((ticks - max-pxcor / sun-speed) / (2 * max-pxcor / sun-speed)) mod 2) = 0 [

to radiate
   if 10 * sun-brightness > random 50 [
     hatch-rays 1 [
     set color yellow
     ifelse beam? [ set heading 180 ]
       [set heading 150 + random 60]
     set size 1] 

to run-sunshine
  ask rays [
    if not can-move? 0.3 [ die ]  ;; kill them off at the edge
    fd 0.3                        ;; otherwise keep moving
  reflect-rays-from-clouds  ;; check for reflection off clouds
  encounter-earth   ;; check for reflection off earth and absorption

to reflect-rays-from-clouds
 ask rays with [any? clouds-here] [   ;; if ray shares patch with a cloud
   set heading 180 - heading   ;; turn the ray around

to encounter-earth
  ask rays with [ycor <= earth-top] [
    ;; depending on the albedo either
    ;; the earth absorbs the heat or reflects it
    ifelse (100 * ((pcolor / 10) mod 1)) > random 100
      [ set heading 180 - heading  ] ;; reflect
      [ rt random 45 - random 45 ;; absorb into the earth
        set color red - 2 + random 4
        set breed heats ]

to run-heat    ;; advances the heat energy turtles
  ;; the temperature is related to the number of heat turtles
  set temperature 0.99 * temperature + 0.01 * ( 0.1 * count heats - 20)
  ask heats
    let dist 0.5 * random-float 1
    ifelse can-move? dist
      [ fd dist ]
      [ set heading 180 - heading ] ;; if we're hitting the edge of the world, turn around
    if ycor >= earth-top [  ;; if heading back into sky
      ifelse  random 100 > 85
              ;; heats only seep out of the earth from a small area
              ;; this makes the model look nice but it also contributes
              ;; to the rate at which heat can be lost
        [ set breed IRs                    ;; let some escape as IR
          set heading (random 60 - 30)
          set color magenta ]
        [ set heading 100 + random 160 ] ;; return them to earth

to run-IR
  ask IRs [
    if not can-move? 0.3 [ die ]
    fd 0.3
    if ycor <= earth-top [   ;; convert to heat if we hit the earth's surface again
      set breed heats
      rt random 45
      lt random 45
      set color red - 2 + random 4
    if any? CO2s-here    ;; check for collision with CO2
      [ set heading 180 - heading ]

to add-CO2  ;; randomly adds 25 CO2 molecules to atmosphere
  let sky-height sky-top - earth-top
  create-CO2s 25 [
    set color green
    ;; pick a random position in the sky area
    setxy random-xcor
          earth-top + random-float sky-height

to add-factory
    create-factories 1 [
    set color red
    set size 1.5
       setxy random-xcor 1     

to add-tree
    create-trees 1 [
    set color green
    set size 2
       setxy random-xcor 1.4     

to remove-factory ;; randomly remove 25 CO2 molecules
  repeat 1 [
    if any? factories [
      ask one-of factories [ die ]

to remove-tree ;; randomly remove 25 CO2 molecules
  repeat 1 [
    if any? trees [
      ask one-of trees [ die ]

to remove-CO2 ;; randomly remove 25 CO2 molecules
  repeat 25 [
    if any? CO2s [
      ask one-of CO2s [ die ]

to run-CO2
  ask CO2s [
    rt random 51 - 25 ;; turn a bit
    let dist 0.05 + random-float 0.1
    ;; keep the CO2 in the sky area
    if [pycor <= 0.5] of patch-ahead dist
      [ set heading 180 - heading ]
    fd dist ;; move forward a bit
    setxy xcor 0.996 * ycor 

to catch-CO2s  
  let prey one-of CO2s-here                    
  if prey != nobody                             
    [ ask prey [ die ]

to emmit-CO2s
  if random 100 > 95 [
  hatch-CO2s 1 [
    set size 1
    set color green

; Copyright 2007 Uri Wilensky.
; See Info tab for full copyright and license.

There is only one version of this model, created about 9 years ago by Sander van Egmond.

Attached files

File Type Description Last updated
Climate Change update.png preview Preview for 'Climate Change update' about 9 years ago, by Sander van Egmond Download

This model does not have any ancestors.

This model does not have any descendants.