climate change

Upload: azz

Post on 14-Jan-2016

218 views

Category:

Documents


0 download

DESCRIPTION

nlogo

TRANSCRIPT

  • 7/18/2019 Climate Change

    1/16

    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 sunlightbreed [IRs IR] ;; packets of infrared radiationbreed [heats heat] ;; packets of heat energybreed [CO2s CO2] ;; packets of carbon dioxide

    breed [clouds cloud]clouds-own [cloud-speed cloud-id]

    ;;;; Setup Procedures;;

    to setup clear-all 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" setup-world set temperature 12 reset-ticksend

    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 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 [ update-albedo ] ]end

    ;;;; 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 ask patches with [pycor = earth-top] [ update-albedo ] run-heat ;; step heat run-IR ;; step IR

  • 7/18/2019 Climate Change

    2/16

    run-CO2 ;; moves CO2 molecules tickend

    to update-albedo ;; patch procedure set pcolor scale-color green albedo 0 1end

    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 + 2.5 + random-float 2 - random-float 2 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 ]end

    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 ] ]end

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

  • 7/18/2019 Climate Change

    3/16

    to create-sunshine ;; don't necessarily create a ray each tick ;; as brightness gets higher make more if 10 * sun-brightness > random 50 [ create-rays 1 [ set heading 160 set color yellow ;; rays only come from a small area ;; near the top of the world setxy (random 10) + min-pxcor max-pycor ] ]end

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

    to encounter-earth ask rays with [ycor 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 ] ]end

    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 * (12 + 0.1 * count heats) 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 temperature > 20 + random 40 ;; 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 and xcor > 0 and xcor < max-pxcor - 8 [ set breed IRs ;; let some escape as IR set heading 20

    set color magenta ] [ set heading 100 + random 160 ] ;; return them to earth ] ]end

    to run-IR ask IRs [ if not can-move? 0.3 [ die ] fd 0.3

  • 7/18/2019 Climate Change

    4/16

    if ycor

  • 7/18/2019 Climate Change

    5/16

    01-2424-822111ticks30.0

    BUTTON61210145setupSetupNIL1TOBSERVERNIL

    NILNILNIL1

    BUTTON1031219845gogoT

    1TOBSERVERNILNILNILNIL0

    SLIDER1847191

    80sun-brightnesssun-brightness0510.21NILHORIZONTAL

  • 7/18/2019 Climate Change

    6/16

    SLIDER1882191115albedoalbedo010.60.051NILHORIZONTAL

    PLOT9212278423Global TemperatureNILNIL

    0.010.010.020.0truefalse"" ""PENS"default" 1.0 0 -2674135 true "" "plot temperature"

    BUTTON7152

    102185add CO2add-CO2NIL1TOBSERVERNILNILNILNIL0

    BUTTON104152199185remove CO2remove-CO2NIL1

  • 7/18/2019 Climate Change

    7/16

    TOBSERVERNILNILNILNIL0

    MONITOR21087303132NILtemperature1111

    BUTTON7118102151

    add cloudadd-cloudNIL1TOBSERVERNILNILNILNIL0

    BUTTON

    104118199151remove cloudremove-cloudNIL1TOBSERVERNILNILNIL

    NIL0

    MONITOR210133303178CO2 amountcount CO2s

  • 7/18/2019 Climate Change

    8/16

    2111

    BUTTON2084130975watch a raywatch one-of rays\nask subject [ pd ]NIL1TOBSERVERNILNILNILNIL0

    @#$#@#$#@## WHAT IS IT?

    This is a model of energy flow in the earth, particularly heat energy. It showsthe 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.

    ## HOW IT WORKS

    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 heatenergy. 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 headstoward 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 magentaarrowhead. 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 temperat

    ure 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 theenergy 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 heatcapacity. 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

  • 7/18/2019 Climate Change

    9/16

    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.

    ## HOW TO USE IT

    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 whatwould 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 theearth froze, and it is indicated by a white surface. If the albedo is zero, theearth 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 of25 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.

    ## THINGS TO NOTICE

    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?

    ## THINGS TO TRY

    1. Play with the model. Change the albedo and run the model. Add clouds and CO2to 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 thetemperature? It should rise quickly and then settle down around 50 degrees. Whydoes 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.

    ## EXTENDING THE MODEL

    Try to add some other factors influencing the earth's temperature. For example,

  • 7/18/2019 Climate Change

    10/16

    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 withhigh albedo, and seas with low albedo, and then evaluate what happens when theglaciers melt into the seas.

    ## NETLOGO FEATURES

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

    ## RELATED MODELS

    Daisyworld

    ## CREDITS AND REFERENCES

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

    ## HOW TO CITE

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

    * Tinker, R. and Wilensky, U. (2007). NetLogo Climate Change model. http://ccl.northwestern.edu/netlogo/models/ClimateChange. Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL.* Wilensky, U. (1999). NetLogo. http://ccl.northwestern.edu/netlogo/. Center forConnected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL.

    ## COPYRIGHT AND LICENSE

    Copyright 2007 Uri Wilensky.

    ![CC BY-NC-SA 3.0](http://i.creativecommons.org/l/by-nc-sa/3.0/88x31.png)

    This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/ 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 [email protected].

    @#$#@#$#@defaulttrue0

    Polygon -7500403 true true 150 5 40 250 150 205 260 250

    airplanetrue0Polygon -7500403 true true 150 0 135 15 120 60 120 105 15 165 15 195 120 180 135240 105 270 120 285 150 270 180 285 210 270 165 240 180 180 285 195 285 165 180105 180 60 165 15

    arrow

  • 7/18/2019 Climate Change

    11/16

    true0Polygon -7500403 true true 150 0 0 150 105 150 105 293 195 293 195 150 300 150

    boxfalse0Polygon -7500403 true true 150 285 285 225 285 75 150 135Polygon -7500403 true true 150 135 15 75 150 15 285 75Polygon -7500403 true true 15 75 15 225 150 285 150 135Line -16777216 false 150 285 150 135Line -16777216 false 150 135 15 75Line -16777216 false 150 135 285 75

    bugtrue0Circle -7500403 true true 96 182 108Circle -7500403 true true 110 127 80Circle -7500403 true true 110 75 80Line -7500403 true 150 100 80 30Line -7500403 true 150 100 220 30

    butterfly

    true0Polygon -7500403 true true 150 165 209 199 225 225 225 255 195 270 165 255 150 240Polygon -7500403 true true 150 165 89 198 75 225 75 255 105 270 135 255 150 240Polygon -7500403 true true 139 148 100 105 55 90 25 90 10 105 10 135 25 180 40 195 85 194 139 163Polygon -7500403 true true 162 150 200 105 245 90 275 90 290 105 290 135 275 180260 195 215 195 162 165Polygon -16777216 true false 150 255 135 225 120 150 135 120 150 105 165 120 180150 165 225Circle -16777216 true false 135 90 30Line -16777216 false 150 105 195 60

    Line -16777216 false 150 105 105 60

    carfalse0Polygon -7500403 true true 300 180 279 164 261 144 240 135 226 132 213 106 203 84 185 63 159 50 135 50 75 60 0 150 0 165 0 225 300 225 300 180Circle -16777216 true false 180 180 90Circle -16777216 true false 30 180 90Polygon -16777216 true false 162 80 132 78 134 135 209 135 194 105 189 96 180 89Circle -7500403 true true 47 195 58Circle -7500403 true true 195 195 58

    circlefalse0Circle -7500403 true true 0 0 300

    circle 2false0Circle -7500403 true true 0 0 300Circle -16777216 true false 30 30 240

  • 7/18/2019 Climate Change

    12/16

    cloudfalse0Circle -7500403 true true 13 118 94Circle -7500403 true true 86 101 127Circle -7500403 true true 51 51 108Circle -7500403 true true 118 43 95Circle -7500403 true true 158 68 134

    co2-moleculetrue0Circle -1 true false 183 63 84Circle -16777216 false false 183 63 84Circle -7500403 true true 75 75 150Circle -16777216 false false 75 75 150Circle -1 true false 33 63 84Circle -16777216 false false 33 63 84

    cowfalse0Polygon -7500403 true true 200 193 197 249 179 249 177 196 166 187 140 189 93 19

    1 78 179 72 211 49 209 48 181 37 149 25 120 25 89 45 72 103 84 179 75 198 76 25264 272 81 293 103 285 121 255 121 242 118 224 167Polygon -7500403 true true 73 210 86 251 62 249 48 208Polygon -7500403 true true 25 114 16 195 9 204 23 213 25 200 39 123

    cylinderfalse0Circle -7500403 true true 0 0 300

    dotfalse0

    Circle -7500403 true true 90 90 120

    face happyfalse0Circle -7500403 true true 8 8 285Circle -16777216 true false 60 75 60Circle -16777216 true false 180 75 60Polygon -16777216 true false 150 255 90 239 62 213 47 191 67 179 90 203 109 218150 225 192 218 210 203 227 181 251 194 236 217 212 240

    face neutralfalse

    0Circle -7500403 true true 8 7 285Circle -16777216 true false 60 75 60Circle -16777216 true false 180 75 60Rectangle -16777216 true false 60 195 240 225

    face sadfalse0Circle -7500403 true true 8 8 285

  • 7/18/2019 Climate Change

    13/16

    Circle -16777216 true false 60 75 60Circle -16777216 true false 180 75 60Polygon -16777216 true false 150 168 90 184 62 210 47 232 67 244 90 220 109 205150 198 192 205 210 220 227 242 251 229 236 206 212 183

    fishfalse0Polygon -1 true false 44 131 21 87 15 86 0 120 15 150 0 180 13 214 20 212 45 166Polygon -1 true false 135 195 119 235 95 218 76 210 46 204 60 165Polygon -1 true false 75 45 83 77 71 103 86 114 166 78 135 60Polygon -7500403 true true 30 136 151 77 226 81 280 119 292 146 292 160 287 170270 195 195 210 151 212 30 166Circle -16777216 true false 215 106 30

    flagfalse0Rectangle -7500403 true true 60 15 75 300Polygon -7500403 true true 90 150 270 90 90 30Line -7500403 true 75 135 90 135Line -7500403 true 75 45 90 45

    flower

    false0Polygon -10899396 true false 135 120 165 165 180 210 180 240 150 300 165 300 195240 195 195 165 135Circle -7500403 true true 85 132 38Circle -7500403 true true 130 147 38Circle -7500403 true true 192 85 38Circle -7500403 true true 85 40 38Circle -7500403 true true 177 40 38Circle -7500403 true true 177 132 38Circle -7500403 true true 70 85 38Circle -7500403 true true 130 25 38Circle -7500403 true true 96 51 108

    Circle -16777216 true false 113 68 74Polygon -10899396 true false 189 233 219 188 249 173 279 188 234 218Polygon -10899396 true false 180 255 150 210 105 210 75 240 135 240

    housefalse0Rectangle -7500403 true true 45 120 255 285Rectangle -16777216 true false 120 210 180 285Polygon -7500403 true true 15 120 150 15 285 120Line -16777216 false 30 120 270 120

    leaf

    false0Polygon -7500403 true true 150 210 135 195 120 210 60 210 30 195 60 180 60 165 15 135 30 120 15 105 40 104 45 90 60 90 90 105 105 120 120 120 105 60 120 60 13530 150 15 165 30 180 60 195 60 180 120 195 120 210 105 240 90 255 90 263 104 285105 270 120 285 135 240 165 240 180 270 195 240 210 180 210 165 195Polygon -7500403 true true 135 195 135 240 120 255 105 255 105 285 135 285 165 240 165 195

    line

  • 7/18/2019 Climate Change

    14/16

    true0Line -7500403 true 150 0 150 300

    line halftrue0Line -7500403 true 150 0 150 150

    molecule watertrue0Circle -1 true false 183 63 84Circle -16777216 false false 183 63 84Circle -7500403 true true 75 75 150Circle -16777216 false false 75 75 150Circle -1 true false 33 63 84Circle -16777216 false false 33 63 84

    pentagonfalse0Polygon -7500403 true true 150 15 15 120 60 285 240 285 285 120

    personfalse0Circle -7500403 true true 110 5 80Polygon -7500403 true true 105 90 120 195 90 285 105 300 135 300 150 225 165 300195 300 210 285 180 195 195 90Rectangle -7500403 true true 127 79 172 94Polygon -7500403 true true 195 90 240 150 225 180 165 105Polygon -7500403 true true 105 90 60 150 75 180 135 105

    plantfalse0

    Rectangle -7500403 true true 135 90 165 300Polygon -7500403 true true 135 255 90 210 45 195 75 255 135 285Polygon -7500403 true true 165 255 210 210 255 195 225 255 165 285Polygon -7500403 true true 135 180 90 135 45 120 75 180 135 210Polygon -7500403 true true 165 180 165 210 225 180 255 120 210 135Polygon -7500403 true true 135 105 90 60 45 45 75 105 135 135Polygon -7500403 true true 165 105 165 135 225 105 255 45 210 60Polygon -7500403 true true 135 90 120 45 150 15 180 45 165 90

    raytrue0Line -7500403 true 150 0 150 315

    Line -7500403 true 120 255 150 225Line -7500403 true 150 225 180 255Line -7500403 true 120 165 150 135Line -7500403 true 120 75 150 45Line -7500403 true 150 135 180 165Line -7500403 true 150 45 180 75

    squarefalse0

  • 7/18/2019 Climate Change

    15/16

    Rectangle -7500403 true true 30 30 270 270

    square 2false0Rectangle -7500403 true true 30 30 270 270Rectangle -16777216 true false 60 60 240 240

    starfalse0Polygon -7500403 true true 151 1 185 108 298 108 207 175 242 282 151 216 59 28294 175 3 108 116 108

    targetfalse0Circle -7500403 true true 0 0 300Circle -16777216 true false 30 30 240Circle -7500403 true true 60 60 180Circle -16777216 true false 90 90 120Circle -7500403 true true 120 120 60

    tree

    false0Circle -7500403 true true 118 3 94Rectangle -6459832 true false 120 195 180 300Circle -7500403 true true 65 21 108Circle -7500403 true true 116 41 127Circle -7500403 true true 45 90 120Circle -7500403 true true 104 74 152

    trianglefalse0Polygon -7500403 true true 150 30 15 255 285 255

    triangle 2false0Polygon -7500403 true true 150 30 15 255 285 255Polygon -16777216 true false 151 99 225 223 75 224

    truckfalse0Rectangle -7500403 true true 4 45 195 187Polygon -7500403 true true 296 193 296 150 259 134 244 104 208 104 207 194Rectangle -1 true false 195 60 195 105

    Polygon -16777216 true false 238 112 252 141 219 141 218 112Circle -16777216 true false 234 174 42Rectangle -7500403 true true 181 185 214 194Circle -16777216 true false 144 174 42Circle -16777216 true false 24 174 42Circle -7500403 false true 24 174 42Circle -7500403 false true 144 174 42Circle -7500403 false true 234 174 42

    turtle

  • 7/18/2019 Climate Change

    16/16

    true0Polygon -10899396 true false 215 204 240 233 246 254 228 266 215 252 193 210Polygon -10899396 true false 195 90 225 75 245 75 260 89 269 108 261 124 240 105225 105 210 105Polygon -10899396 true false 105 90 75 75 55 75 40 89 31 108 39 124 60 105 75 105 90 105Polygon -10899396 true false 132 85 134 64 107 51 108 17 150 2 192 18 192 52 16965 172 87Polygon -10899396 true false 85 204 60 233 54 254 72 266 85 252 107 210Polygon -7500403 true true 119 75 179 75 209 101 224 135 220 225 175 261 128 26181 224 74 135 88 99

    wheelfalse0Circle -7500403 true true 3 3 294Circle -16777216 true false 30 30 240Line -7500403 true 150 285 150 15Line -7500403 true 15 150 285 150Circle -7500403 true true 120 120 60Line -7500403 true 216 40 79 269Line -7500403 true 40 84 269 221Line -7500403 true 40 216 269 79

    Line -7500403 true 84 40 221 269

    xfalse0Polygon -7500403 true true 270 75 225 30 30 225 75 270Polygon -7500403 true true 30 75 75 30 270 225 225 270

    @#$#@#$#@NetLogo 5.0.5@#$#@#$#@setup add-cloud add-cloud add-cloud repeat 800 [ go ]@#$#@#$#@

    @#$#@#$#@@#$#@#$#@@#$#@#$#@default0.0-0.2 0 0.0 1.00.0 1 1.0 0.00.2 0 0.0 1.0link directiontrue0Line -7500403 true 150 150 90 180Line -7500403 true 150 150 210 180

    @#$#@#$#@0@#$#@#$#@