Plankton Productivity Simulator-Urban School of SF

Plankton Productivity Simulator-Urban School of SF preview image

1 collaborator

Default-person Cara Gallagher (Author)

Tags

plankton 

Tagged by Cara Gallagher over 1 year ago

Visible to everyone | Changeable by the author
Model was written in NetLogo 6.0.1 • Viewed 273 times • Downloaded 31 times • Run 0 times
Download the 'Plankton Productivity Simulator-Urban School of SF' modelDownload this modelEmbed this model

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


WHAT IS IT?

Simulate plankton growth in Monterey Bay, California under a variety of environmental variables, including wind speed, sunlight intensity, and warm/cool sea surface temperature. Plankton levels and sea surface temperatures can be monitored to establish the productivity levels of different environmental variable combinations.

Property of: Urban School of San Francisco 1563 Page St San Francisco, CA 94117 (415) 626-2919

Developed by: Cara Gallagher caragallagher.ggcr@gmail.com

HOW IT WORKS

Three types of agents control the movement of the sea surface temperature and create the temperature gradient. Parents control the overall movement, orbiters orbit the parents, and shooters are occasionally created to add heterogeneity to the environment.

HOW TO USE IT

Start by selecting the environmental conditions that you would like to test. Environmental choosers are found on the right upper corner of the interface.

-Sea-surface-temp can be "warm" or "cool" and controls the sea surface temp of the  environment.
-Sunlight can be "low" or "high" and controls the sunlight levels.
-Wind-strength can be "strong" or "gentle" and controls the wind strength.

Once your environmentals are selected, you should note the plankton-optimal-temp input below. The plankton-optimal-temp sets the plankton optimal growth temperature. This is set to 13 degrees celsius, but can be modified to test for another optimal temperature (productivity number trends were established for 13 degrees and are unknown for other optimal temperatures).

Below the plankton-optimal-temp input is the productivity-# monitor. This monitor displays the running mean of the productivity number. Use this to establish the differences in production for the different possible environmental combinations. The mean plankton growth plot displays this in a graphical form.

On the left top corner of the interface you will find the view chooser. This allows you to change the map displayed at any time in a trial. The three map options are:

-Satellite-A satellite image of Monterey Bay showing the topobathymetry of the region
-Sea Surface Temp-Displays the SST levels of patches
-Plankton Growth-Displays the Plankton levels of patches

To start your trial, first press the Setup button and let the trial load. Once loading bar is full and checkmark appears you are finished loading. Now press the Start Trial button and watch your experiment run! Once completed (at 600 ticks) record the productivity-# and setup your next experiment!

CREDITS AND REFERENCES

Bathymetric data obtained from Southern California Coastal Ocean Observing System (SCCOOS) Divins, D.L., and D. Metzger, NGDC Coastal Relief Model, Retrieved date goes here, http://www.ngdc.noaa.gov/mgg/coastal/coastal.html. Download provided by the Southern California Coastal Ocean Observing System http://sccoos.org/data/bathy

Topobathy image from Google Earth "Monterey Bay." 3646'13.41"N 12158'28.34"W. Google Earth. November 2, 2016. January 16, 2017. Data from: SIO, U.S. Navy, NGA, GEBCO, MBARI, CSUMB SFML, CA OPC.

Comments and Questions

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

Click to Run Model

extensions [
  gis
  palette
  ]

breed [SSTparents SSTparent]
breed [SSTorbiters SSTorbiter]
breed [SSTshooters SSTshooter]
breed [Loadingbars Loadingbar]
breed [planktons plankton]
breed [checkmarks checkmark]


globals [
  bathymetry
  coastline
  countdown
  trial-plankton-values
  prod-num
  max-prod-num
  min-prod-num
]

turtles-own [
  num
  shooter-countdown
  parent
  symbol
  turtle-density
]

patches-own [
  min-SST
  base-min-SST
  max-SST
  base-max-SST
  depth
  coast
  status
  SST
  patch-state
  check
  plankton-growth-calc
  plankton-growth-rate
  plankton-value
  sun-level
  wind-level
  sst-level-calc
  sst-level
  temp-range
  growth-zone
  ]

to setup
  ca
  reset-ticks
  set countdown 50 + random 10 - random 10   ;countdown for SSTshooter agents
  check-SST-toggle
  setup-map
  setup-symbols
  setup-base-sst
  setup-turtles
  set-max-min-prod-num
  display-depth-in-patches
  ask patches with [status = "water"] [
    setup-sun
    setup-wind
    set-temp-range
    set plankton-value 1
    check-patch-state
    setup-starting-sst
  ]
  repeat 5 [diffuse SST 1]   ;diffuse SST to surrounding patches
  ask SSTorbiters [ht]   ;hide SST agents
  ask SSTparents [ht]
  ask SSTshooters [ht]
  set trial-plankton-values (list (total-plankton ) (total-plankton))  ;start list for productivity number calculation
  ask patches [set pcolor black] ;set loading screen background black
  create-loading-agents
  repeat 100[        ;run setup 100x
    run-procedure
    loading-bar-check
    plankton-wiggle]
  if ticks = 100 [create-checkmarks 1 [ ;create checkmark to signify the end of setup
        setxy 0 -65
        set shape "checkmark"
        set size 45
    ]]
end 

to setup-map   ;loads coastline and bathymetry values for patches
   set bathymetry gis:load-dataset "montereyclip4.asc"
   set coastline gis:load-dataset "coastline.asc"
   gis:set-world-envelope-ds (gis:envelope-union-of (gis:envelope-of bathymetry)
    (gis:envelope-of coastline))
    view-coastline
end 

to view-coastline ;creates land and water patches and sets background to bay satellite image
  gis:apply-raster coastline coast
  ask patches [
    ifelse (coast >= 0)
    [set status "land"]
    [set status "water"]
  ]
  import-pcolors-rgb "MBaySat.png"
end 

to display-depth-in-patches ;uses gis:apply-raster to apply depth values to patches
  gis:apply-raster bathymetry depth
  let min-depth gis:minimum-of bathymetry
  let max-depth 0
end 

to setup-base-sst ;establishes total max and min SST
   ask patches with [status = "water"][
    set base-max-SST 18.5
    set base-min-SST 11.5
    set patch-state "inactive"
    set check "no"
  ]
end 

to setup-turtles ;create turtles to drive SST movement ;more turtles are needed for warm SST than cool SST
     if sea-surface-temp = "cool" [
    ask n-of 2 patches with [status = "water"] [sprout-SSTparents 1]
  ask SSTparents [
    hatch-SSTorbiters 3 [set parent myself]
    set color red
    set num (20 + random 5 - random 5)
  ]
  ask SSTorbiters [  ;SSTorbiters orbit SSTparents
    hatch-SSTorbiters 2 [set parent myself]]
  ask SSTorbiters [
    set heading random 360
    set color yellow
    set num (8 + random 3 - random 3)
    repeat 40 [orbit]
  ]]
  if sea-surface-temp = "warm" [
    ask n-of 3 patches with [status = "water"] [sprout-SSTparents 1]
  ask SSTparents [
    hatch-SSTorbiters 4 [set parent myself]
    set color red
    set num (30 + random 5 - random 5)
  ]
  ask SSTorbiters [
    hatch-SSTorbiters 2 [set parent myself]]
  ask SSTorbiters [
    set heading random 360
    set color yellow
    set num (15 + random 3 - random 3)
    repeat 40 [orbit] ;creates distance from SSTparents
  ]]
end 

to setup-sun ;selects sunlight growth value
  set sun-level .2 + random-float .15 - random-float .15
end 

to create-loading-agents  ;creates loading screen turtles
   create-loadingbars 1 [
    set shape "loading-bar-0"
    set heading 0
    set size 90
    setxy 0 -25]
    create-planktons 3 [set size 40 ]
    ask n-of 1 planktons [
      set shape "plankton-1"
      setxy -50 20]
    ask n-of 1 planktons with [shape = "default"] [
      set shape "plankton-2"
      setxy 0 25]
    ask n-of 1 planktons with [shape = "default"] [
      set shape "plankton-3"
      setxy 50 20]
end 

to setup-wind ;selects wind growth value under all conditions
  if wind-strength = "gentle" [
    ifelse sunlight = "low" [
      ifelse sea-surface-temp = "cool"
      [set wind-level 0.45 + random-float 0.05 - random-float 0.05] ;Cool SST, Low Sun, Gentle Wind
      [set wind-level 0.7 + random-float 0.05 - random-float 0.05]] ;Warm SST, Low Sun, Gentle Wind
    [
      ifelse sea-surface-temp = "cool"
      [set wind-level 0.5 + random-float 0.05 - random-float 0.05] ;Cool SST, High Sun, Gentle Wind
      [set wind-level 1.85 + random-float 0.05 - random-float 0.05]]  ;Warm SST, High Sun, Gentle Wind
  ]

  if wind-strength = "strong" [
    ifelse sunlight = "low" [
      ifelse sea-surface-temp = "cool"
      [set wind-level 1.85 + random-float 0.05 - random-float 0.05] ;Cool SST, Low Sun, Strong Wind
      [set wind-level 0.5 + random-float 0.05 - random-float 0.05]] ;Warm SST, Low Sun, Strong Wind
    [
      ifelse sea-surface-temp = "cool"
      [set wind-level 0.5 + random-float 0.05 - random-float 0.05] ;Cool SST, High Sun, Strong Wind
      [set wind-level 0.9 + random-float 0.05 - random-float 0.05]]  ;Warm SST, High Sun, Strong Wind
  ]
end 

to set-temp-range ;selects temperature range for growth zones under all environmentals
 if wind-strength = "gentle" [
    ifelse sunlight = "low" [
      ifelse sea-surface-temp = "cool"
      [set temp-range 0.56]       ;Cool SST, Low Sun, Gentle Wind
      [set temp-range 0.75]]       ;Warm SST, Low Sun, Gentle Wind
    [
      ifelse sea-surface-temp = "cool"
      [set temp-range 0.7] ;Cool SST, High Sun, Gentle Wind
      [set temp-range 0.6]] ;Warm SST, High Sun, Gentle Wind
  ]

  if wind-strength = "strong" [
    ifelse sunlight = "low" [
      ifelse sea-surface-temp = "cool"
      [set temp-range 0.1]      ;Cool SST, Low Sun, Strong Wind
      [set temp-range 0.59]]   ;Warm SST, Low Sun, Strong Wind
    [
      ifelse sea-surface-temp = "cool"
      [set temp-range 0.65] ;Cool SST, High Sun, Strong Wind
      [set temp-range 0.9]] ;Warm SST, High Sun, Strong Wind
  ]
end 

to set-max-min-prod-num  ;defines max and min productivity numbers for all environmentals
 if wind-strength = "gentle" [
    ifelse sunlight = "low" [
      ifelse sea-surface-temp = "cool"
      [ set max-prod-num 29
        set min-prod-num 21]   ;Cool SST, Low Sun, Gentle Wind

      [ set max-prod-num 19
        set min-prod-num 11]]  ;Warm SST, Low Sun, Gentle Wind
    [
      ifelse sea-surface-temp = "cool"
      [ set max-prod-num 75
        set min-prod-num 61] ;Cool SST, High Sun, Gentle Wind

      [ set max-prod-num 19
        set min-prod-num 11]] ;Warm SST, High Sun, Gentle Wind
  ]

  if wind-strength = "strong" [
    ifelse sunlight = "low" [
      ifelse sea-surface-temp = "cool"
      [ set max-prod-num 19
        set min-prod-num 11]   ;Cool SST, Low Sun, Strong Wind

      [ set max-prod-num 30
        set min-prod-num 23]]  ;Warm SST, Low Sun, Strong Wind
    [
      ifelse sea-surface-temp = "cool"
      [ set max-prod-num 59
        set min-prod-num 51] ;Cool SST, High Sun, Strong Wind

      [ set max-prod-num 45
        set min-prod-num 35]] ;Warm SST, High Sun, Strong Wind
  ]
end 

to setup-symbols ;maintains correct symbols for the environmentals being tested
  create-turtles 1 [
    set symbol "Sun"
      setxy 60 90
      set size 20
      set heading 0
      if sunlight = "low" [set shape "low-sunlight"]
      if sunlight = "high" [set shape "high-sunlight"]
  ]
  create-turtles 1 [
    set symbol "Wind"
      setxy 80 90
      set size 20
      set heading 0
      if wind-strength = "gentle" [set shape "gentle-wind"]
      if wind-strength = "strong" [set shape "strong-wind"]
  ]
  create-turtles 1 [
    set symbol "SST"
      setxy 95 90
      set size 20
      set heading 0
      if sea-surface-temp = "warm" [set shape "high-sst"]
      if sea-surface-temp = "cool" [set shape "low-sst"]
  ]
end 

to view-maps  ;selects which map is displayed in interface
 if View = "Satellite" [import-pcolors-rgb "MBaySat.png"]
 if View = "Sea Surface Temp" [view-SST]
 if View = "Plankton Growth" [view-plankton]
end 

to loading-bar-check ;progresses loading bar with tick number
  ask loadingbars [
    if (ticks >= 6) and (ticks < 18) [set shape "loading-bar-1"]
    if (ticks >= 18) and (ticks < 31) [set shape "loading-bar-2"]
    if (ticks >= 31) and (ticks < 43) [set shape "loading-bar-3"]
    if (ticks >= 43) and (ticks < 56) [set shape "loading-bar-4"]
    if (ticks >= 56) and (ticks < 68) [set shape "loading-bar-5"]
    if (ticks >= 68) and (ticks < 81) [set shape "loading-bar-6"]
    if (ticks >= 81) and (ticks < 93) [set shape "loading-bar-7"]
    if (ticks >= 93) [set shape "loading-bar-8"]
  ]
end 

to plankton-wiggle ;loading bar plankton wiggle dance
  ask planktons [set heading (heading + random 180 - random 180)]
end 

to run-procedure ;run procedures for each tick
  ;;;;;;;;;;;;;;;;turtle commands;;;;;;;;;;;;;;;;;;
  ask SSTparents[
    move
    set num num + random 1 - random 1]
  ask SSTorbiters [
    orbit
    set num num + random 1 - random 1]
  ifelse countdown > 0
  [set countdown countdown - 1]
  [
    set countdown 50 + random 10 - random 10
    ask one-of turtles [hatch-SSTshooters 1 [
        set heading random 360
        set size 0
        set shooter-countdown (50 + random 15)]]]
  ask SSTshooters [
    shoot
    ifelse shooter-countdown > 0 [set shooter-countdown shooter-countdown - 1]
    [die]]
  check-symbols

  ;;;;;;;;;;;;;;patch commands;;;;;;;;;;;;;;;;;;;;
  ask patches with [status = "water"][check-patch-state]
    set prod-num ((mean (trial-plankton-values) / total-poss-plankton) * 100)
    set-patch-state
  ask patches with [status = "water"] [
    set-patch-SST
    setup-growth-zones
    calculate-plankton-growth]
  repeat 5 [
    diffuse SST 1
    diffuse plankton-value 1
     ]
  set trial-plankton-values (lput total-plankton trial-plankton-values)
  tick
end 

to check-SST-toggle ;maintains max and min SST values for cool and warm SST conditions
  ask patches [
    if sea-surface-temp = "cool"
  [set max-SST 15
    set min-SST 11.5]
  if sea-surface-temp = "warm"
  [set max-SST 18.5
    set min-SST 13.5
  ]]
end 

to view-SST ;displays SST in interface
  ask patches with [status = "water"]
    [set pcolor palette:scale-gradient
        palette:scheme-colors "Divergent" "Spectral" 11 SST 20 (base-min-SST)]
end 

to set-patch-SST ;assigns patch SST based on patch state
 if patch-state = "super-active" [set SST (max-SST + random-float 2 - random-float 3)]
 if patch-state = "active" [
   ifelse SST > (max-SST - 2)
   [set SST SST - random-float .02]
   [ifelse SST < (min-SST + 2)
     [set SST SST + random-float .5]
     [set SST SST + random-float 2 - random-float 2]
     ]]
 if patch-state = "now-active" [set SST (((max-SST + min-SST) / 2) + random-float 1.5 - random-float 1.5)] ;set maximum sst to 21 degrees C
 if patch-state = "now-inactive" [deactivate]
 if patch-state = "inactive" [
   ifelse SST > min-SST
   [ifelse SST > (min-SST + 1)
       [set SST SST - random-float .5 + random-float .25]
       [set SST SST - random-float .25 + random-float .25]]
   [set SST SST + random-float .5 - random-float .25]
     ]
end 

to deactivate ;decreases SST in patches with no turtles around
  ifelse SST > min-SST [set SST SST - random-float .1] [
    set SST min-SST
    set patch-state "inactive"]
end 

to move ;movement commands for SST parent turtles
  let land patches in-cone 3 90 with [status = "land"]
  ifelse any? land [
    set heading heading + 30 + random 300
    fd 0.5]
  [set heading heading + random 5 - random 5
    fd 0.5]
end 

to orbit ;movement commands for SST orbiter turtles
  let land patches in-cone 3 90 with [status = "land"]
  ifelse any? land [
    face parent
    set heading heading + random 30 - random 30
    fd 1
  ]
    [ifelse distance parent > 60 [
    face parent
    set heading heading + random 30 - random 30
    fd 1
  ]
  [set heading heading + random 10 - random 10
    fd 1
    ]]
end 

to shoot ;movement commands for SST shooter turtles
  let land patches in-cone 3 90 with [status = "land"]
  ifelse any? land [
    set heading heading + 30 + random 300
    fd 1]
  [set heading heading + random 5 - random 5
    fd 1]
end 

to check-patch-state ;creates a boolian check to establish patches as now-inactive
 if check = "yes" [
        set check "no"
        set patch-state "now-inactive"
        ]
end 

to set-patch-state ;sets patch state based on turtle presence
  ask SSTshooters [ask patches in-radius 10 with [status = "water"] [
       set check "yes"
       set patch-state "active"]]
  ask SSTparents [
    ask patches in-radius (num + 10) with [status = "water"] [
      ifelse check = "no"
      [set patch-state "now-active"
        set check "yes"]
      [set patch-state "active"]]
    ask patches in-radius (num - (num / 5)) with [status = "water"] [set patch-state "super-active"]
  ]
  ask SSTorbiters [
    ask patches in-radius (num + 10) with [status = "water"] [
      ifelse check = "no" [
        set patch-state "now-active"
        set check "yes"]
      [set patch-state "active"]]
    ask patches in-radius num with [status = "water"] [set patch-state "super-active"]
    ]
end 

to setup-starting-sst ;sets up starting SST values for patches basesd on patch state
  if patch-state = "super-active" [set SST (max-SST + random-float 4 - random-float 5)]
  if patch-state = "active" [set SST (max-SST - 2 + random-float 2)]
  if patch-state = "now-active" [set SST ((max-SST + min-SST) / 2) + random-float 1 - random-float 1]
  if patch-state = "now-inactive" [set SST ((max-SST + min-SST) / 2) + random-float 1 - random-float 1]
  if patch-state = "inactive" [
    ifelse sea-surface-temp = "warm"
   [set SST min-SST + random-float 3 - random-float 3]
   [set SST min-SST + random-float 2 - random-float 2]]
end 

to check-symbols ;maintains symbols with mid-run environmental changes
  ask turtles with [symbol = "Sun"] [
    if shape = "low-sunlight" [if sunlight = "high" [set shape "high-sunlight"]]
    if shape = "high-sunlight" [if sunlight = "low" [set shape "low-sunlight"]]]
  ask turtles with [symbol = "Wind"] [
    if shape = "gentle-wind" [if wind-strength = "strong" [set shape "strong-wind"]]
    if shape = "strong-wind" [if wind-strength = "gentle" [set shape "gentle-wind"]]]
  ask turtles with [symbol = "SST"] [
    if shape = "low-sst" [if sea-surface-temp = "warm" [set shape "high-sst"]]
    if shape = "high-sst" [if sea-surface-temp = "cool" [set shape "low-sst"]]]
end 

to setup-growth-zones ;establishes patches as a growth zone or not based on temp-range
  ifelse (SST < (plankton-optimal-temp + (temp-range + temp-mod)))
  [ifelse (SST > (plankton-optimal-temp - (temp-range + temp-mod)))
      [set growth-zone "true"]
      [set growth-zone "false"] ]
  [set growth-zone "false"]
end 

to-report productivity-num ;calculates running mean production number
  set prod-num ((mean (trial-plankton-values) / total-poss-plankton) * 100)
  report prod-num
end 

to calculate-plankton-growth ;determines plankton growth rates based on environmentals
  setup-sst-level
  ifelse growth-zone = "true" ;growth only occurs in growth zones
  [set plankton-growth-rate ((sst-level + wind-level + sun-level) / 3) ;calculates total plankton growth rate
    if plankton-value < 15 [ ;establishes a max patch plankton value of 15
      if plankton-value < .05 [set plankton-value .06] ;maintains plankton value > 0
       ifelse prod-num < (min-prod-num + 3)
        [set plankton-value (plankton-value + (plankton-value * plankton-growth-rate))]
        [set plankton-value (plankton-value + (plankton-value * plankton-growth-rate * plankton-mod))] ;plankton mod decreases plankton growth when above max
    ]]
  [if (plankton-value > 0) [
      set plankton-value plankton-value - random-float 1
  ]]
end 

to view-plankton ;displays plankton values in the interface
  ask patches with [status = "water"]
      [set pcolor palette:scale-gradient [[74 95 145] [129 199 132]] plankton-value 0 15]
end 

to setup-sst-level ;calculates SST level for plankton growth rate
    ifelse growth-zone = "true" [
      let sst-level-report (1 - (abs((SST - plankton-optimal-temp) / temp-range)))
      ifelse sst-level-report > 0
      [set sst-level (sst-level-report / 2)]
      [set sst-level 0]
    ]
   [set sst-level 0]
end 

to-report total-plankton ;calculates total plankton level present
  report sum [plankton-value] of patches with [plankton-value > 0]
end 

to-report total-poss-plankton ;calculates total possible plankton level
  let total-patches (count patches with [status = "water"])
  report total-patches * 12
end 

to-report temp-mod ;temperature range adujuster for instances where production number falls under min-production number
  let t (temp-range)
  let i v
  report i * t
end 

to-report v  ;multiplier for the temperature range modifier for instances where production number falls under min-production number
  let r ((max-prod-num - min-prod-num) / 3)
  let tv (abs((prod-num - min-prod-num) - r)/(2 * r))
  if tv > 2 [set tv 2]
  report tv
end 

to-report plankton-mod  ;multiplier for the plankton growth adjuster for instances where production number rises above max-production number
  let r (max-prod-num - (min-prod-num + 3))
  let k (min-prod-num + 3)
  let tp (abs((prod-num - k) - r) / r)
  if prod-num > max-prod-num [set tp -0.05]
  report tp
end 

to start_trial ;trial run procedures
  ask loadingbars [die] ;kills loading screen turtles
  ask planktons [die]
  ask checkmarks [die]
  view-coastline
  view-maps
  repeat 500 [
    run-procedure
    view-maps
    plot productivity-num ;plots productivity number on interface plot
    ]
end 

There are 3 versions of this model.

Uploaded by When Description Download
Cara Gallagher over 1 year ago *removed "range" Download this version
Cara Gallagher over 1 year ago Compatible with file uploads Download this version
Cara Gallagher over 1 year ago Initial upload Download this version

Attached files

File Type Description Last updated
coastline.asc data Monterey Coastline File over 1 year ago, by Cara Gallagher Download
MBaySat.png png Monterey Bay Satellite Image over 1 year ago, by Cara Gallagher Download
montereyclip4.asc data Monterey Bathymetry File over 1 year ago, by Cara Gallagher Download
Plankton Productivity Simulator-Urban School of SF.png preview Preview for 'Plankton Productivity Simulator-Urban School of SF' over 1 year ago, by Cara Gallagher Download

This model does not have any ancestors.

This model does not have any descendants.