; Model version: SUB2_1 updatedparamentrs ; ; Manuscript authors: Viola Pavlova, Jacob Nabe-Nielsen, Rune Dietz, Jens-Christian Svenning, Katrin Vorkamp, Frank Farso Riget, Volker Grimm, Sonne Christian, Letcher Robert ; ; created 1.10.2012 in NetLogo 4.1 ; updated 10.3.2013 : Volker in Net Logo 5.0.3 ; updated 20.03.2013 and 01.05.2013: Viola ; updated 18.1.2014: Viola in NetLogo 4.1.3 ; updated 9.6. 2014: Viola in NetLogo 4.1.3 to run in kilojoules ;[[references to ODD, Supporting Information S4]] ; POLAR BEAR VARIABLES ;extensions [profiler] turtles-own [ age weight ;[[= W in the ODD]] status ; female: 0 no cubs, 1 with cubs, 2 with yearlings, 5 males energy; [[= EA for males & single females, EFC for females with cubs, EFY for females with yearlings]] BB ; PCB body burden sex; females 1, males 0 SA;random number for age SS;random number for seal sex SARN;random number for seal age class ofno;offspring number BBc ;cont.body burde in cub; BBy;cont. body burden in yearling Ey; energy demand of a yearling fat; blubber percentage Ic; [[ = Ic, updated in a loop] RN;random number p; pregnant? 0 = not, 1=yes days1; number of days of cub 1 survival days2; number of days of cub 2 survival epsilon ; ] ; GLOBAL PARAMETERS globals [ lambda year T_bl;total blubber C_Seal;seal contamination G;energy gain from one seal Sweight; weight of each hunted seal seal1986; seal contamination for 1986 seal1987 seal1988 seal1989 seal1990 seal1991 seal1992 seal1993 seal1994 seal1995 seal1996 seal1997 seal1998 seal1999 seal2000 seal2001 seal2002 seal2003 seal2004 seal2005 seal2006 seal2007 seal2008 seal2009 seal2010 death ; mortality NUMBERS f_A; field metabolic factor of older bears value 1-10 f_Y;field metabolic factor of yearlings value 1-13 initialpopulation sigmay; yearling survival sigmac; cub survival beta0; breeding probability, 0.437 beta12; breeding probability, 0.104 mcc; cub milk consumption 469; g/day Emc; energy in milk for cubs 16.9;kJ/g Emy; energy in milk for yearlings 12; kJ/g mcy; yearling milk consumption 131; g/day Wy; 95;yearling weight kg Wsm; 54.5 ; male seal growth equation parameter asm; 0.04247 ; male seal growth equation parameter bsm; 0.16599 ; male seal growth equation parameter Wsf; 48.1 ; female seal growth equation parameter asf; 0.1114 ; female seal growth equation parameter bsf; 0.2583 ; female seal growth equation parameter a_Tbl; 0.365; seal blubber estimation parameter b_Tbl ;1.564; seal blubber estimation parameter Es; 37.8 kJ/g, (9 kcal/g) calories obtained from a gram of seal kappa; recalculate kcal to kilojoules hsa ; hunting prefernce to adult seal hsp ; hunting prefernce to seal pup FmilkC; 0.275 FmilkY; 0.206 rho; 0.67; ratio contaminant in milk and female Ac; 0.23, assimilation cub Ay; 0.23 assimilation yearling AA; 10 assimilation adult mu_sm ; 0.13; mortality subadult male mu_m; 0.067; mortality adult male mu_sf; 0.084; mortality subadult female mu_f; 0.053; mortality adult female pi_1cub; 0.276; probability of single cub in litter (as opposed to two) Ff; 0.28, fat female Fpf; 0.4; pregnant female Ffcub; 0.23;female with cubs Ffyrl; 0.28; female with yrl Fm; 0.28; fat male Wpf; 371; weight pregnant female Wfc; 161; weight female with cubs Wbm; 389; mael bear growth equation parameter kbm; 0.303; male bear growth equation parameter Abm; -1.245 ; male bear growth equation parameter Wbf; 185; female bear growth equation parameter kbf; 0.58;female bear growth equation parameter Abf; -0.578;female bear growth equation parameter Fc; 0.11; fat cub Fy; 0.28; fat yearling Wc; 45; weight cub ;outfile ;output-name numberruns; number of runs ] ;-------------------------------------------SETUP------------------------------------------------------------ to setup ;; (for this model to work with NetLogo's new plotting features, ;; __clear-all-and-reset-ticks should be replaced with clear-all at ;; the beginning of your setup procedure and reset-ticks at the end ;; of the procedure.) clear-all reset-ticks set seal1986 [ 298.6622122 258.4424255 329.9668719 295.5449218 288.8138783 301.8631965 310.4877937 400.8369598 423.8512401 481.5520232 661.9916265 614.7106154] set seal1987 [ 288.691589 249.814511 318.9511651 285.6783671 279.1720346 291.7857107 300.122382 387.4553062 409.7012712 465.4757551 639.891512 594.1889435] set seal1988 [ 279.0538279 241.4746332 308.3032098 276.1412002 269.852077 282.0446546 290.103012 374.5203893 396.0236889 449.9361817 618.529194 574.3523729] set seal1989[ 269.7378165 233.4131762 298.0107288 266.9224248 260.8432594 272.6287966 280.4181316 362.0172954 382.8027228 434.9153858 597.8800416 555.1780319] set seal1990[ 260.7328134 225.6208451 288.0618549 258.0114116 252.1351948 263.5272802 271.0565739 349.9316083 370.0231291 420.3960484 577.9202463 536.6438125] set seal1991[ 252.0284359 218.0886554 278.445117 249.3978861 243.7178426 254.7296115 262.007545 338.2493932 357.670173 406.3614286 558.6267944 518.7283446] set seal1992[ 243.6146478 210.8079225 269.149427 241.071917 235.5814977 246.2256465 253.2606115 326.9571804 345.7296114 392.7953445 539.9774405 501.4109718] set seal1993[ 235.481748 203.7702516 260.1640669 233.0239044 227.7167787 238.0055804 244.8056881 316.04195 334.187677 379.6821543 521.9506819 484.6717271] set seal1994[ 227.6203591 196.9675282 251.4786766 225.2445689 220.1146178 230.0599352 236.6330263 305.4911168 323.0310616 367.0067386 504.5257337 468.4913099] set seal1995[ 220.0214171 190.3919089 243.0832418 217.7249409 212.7662496 222.3795497 228.7332028 295.2925155 312.2469019 354.7544825 487.6825049 452.8510644] set seal1996[ 212.6761603 184.0358119 234.9680826 210.4563503 205.6632013 214.9555683 221.0971093 285.4343872 301.8227636 342.9112592 471.4015751 437.7329572] set seal1997[ 205.5761196 177.8919087 227.1238421 203.4304164 198.7972832 207.7794312 213.7159413 275.9053654 291.7466277 331.4634134 455.6641725 423.1195572] set seal1998[ 198.7131087 171.9531152 219.5414759 196.6390382 192.1605789 200.8428643 206.5811883 266.6944632 282.0068763 320.3977457 440.4521517 408.994015] set seal1999[ 192.0792144 166.2125841 212.2122416 190.0743853 185.7454361 194.1378697 199.6846238 257.7910603 272.5922795 309.7014973 425.7479733 395.3400439] set seal2000[ 185.6667879 160.6636965 205.1276885 183.7288886 179.5444583 187.6567165 193.0182962 249.1848911 263.4919822 299.3623355 411.5346833 382.1419008] set seal2001[ 179.4684357 155.3000545 198.2796481 177.5952318 173.5504956 181.391932 186.5745192 240.8660327 254.6954919 289.3683392 397.7958938 369.3843682] set seal2002[ 173.477011 150.1154739 191.6602246 171.6663427 167.7566371 175.3362927 180.345863 232.8248934 246.192666 279.7079852 384.5157639 357.0527367] set seal2003[ 167.6856058 145.1039767 185.2617858 165.9353853 162.1562024 169.4828167 174.3251461 225.0522017 237.9737009 270.3701353 371.6789816 345.1327878] set seal2004[ 162.0875424 140.2597848 179.0769543 160.3957517 156.7427342 163.8247547 168.5054264 217.5389958 230.02912 261.3440227 359.2707461 333.6107778] set seal2005[ 156.6763663 135.5773127 173.098599 155.0410549 151.5099907 158.3555831 162.8799939 210.2766128 222.3497632 252.6192404 347.2767506 322.4734219] set seal2006[ 151.4458385 131.0511616 167.3198267 149.8651208 146.4519386 153.0689958 157.4423624 203.2566793 214.9267762 244.1857287 335.6831659 311.7078786] set seal2007[ 146.3899281 126.6761128 161.7339746 144.8619815 141.5627459 147.9588974 152.1862624 196.4711012 207.7516003 236.0337637 324.4766248 301.3017352] set seal2008[ 141.5028056 122.4471219 156.3346021 140.0258684 136.8367755 143.019396 147.1056334 189.9120547 200.8159625 228.1539462 313.644206 291.2429934] set seal2009[ 136.7788362 118.3593127 151.1154839 135.3512054 132.2685781 138.2447963 142.1946176 183.5719773 194.111866 220.5371908 303.1734197 281.5200555] set seal2010[ 132.2125731 114.4079722 146.0706021 130.8326028 127.8528867 133.6295932 137.4475525 177.4435589 187.6315809 213.1747153 293.0521931 272.1217108] set year 1950 set initialpopulation 2000 set numberruns 60 ;file-setup ;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::set parameter values::::::::::::::::::::::::::::::::::::::: ; OffspringSurvival set sigmay 0.916 set sigmac 0.57 set beta0 0.437 set beta12 0.104 ; SetEnergyRequirement set f_A 6 set f_Y 11 set mcc 469; g/day consumtion set Emc 16.9;kJ/g energy in milk set Emy 12; kJ/g energy in milk set mcy 131; g/day consumtion set Wy 90;105; kg 90 ;Feed set hsa 18 set hsp 56 set Wsm 54.5 set asm 0.04247 set bsm 0.16599 set Wsf 48.1 set asf 0.1114 set bsf 0.2583 set a_Tbl 0.365 set b_Tbl 1.564 set Es 37.8;kJ/g = 9 kcal/g calories obtained from gram of seal ;LactationTransfer set FmilkC 0.275 set FmilkY 0.206 set rho 0.67 set Ac 0.23 set Ay 0.3 set AA 0.1 ;DieAndBreed set mu_sm 0.13; mortality subadult male set mu_m 0.067; mortality adult male set mu_sf 0.084; mortality subadult female set mu_f 0.053; mortality adult female set pi_1cub 0.276; probability of single cub in litter (as opposed to two) ;UpdateBlubber ; proportion of fat on a polar bear set Ff 0.28 set Fpf 0.4; pregnant female set Ffcub 0.23;female with cubs set Ffyrl 0.28; female with yrl set Fm 0.28 ; UpdateWeight set Wpf 371 set Wfc 161 set Wbm 389 set kbm 0.303 set Abm -1.245 set Wbf 185 set kbf 0.58 set Abf -0.578 ;updateBB set Fc 0.11 set Fy 0.28 set Wc 43.5; changed from 43.5 crt initialpopulation [ fd random 9 rt random 30 ] ;INITIALILZATION of Turtles ask turtles [ set age 2 + random 19 set Ic 0 set sex random 2; 0male 1 female ;ASSIGN INITIAL STATUS: ifelse sex = 1 [ set status random 3 if status = 0 [ set p random 2] if status = 1 [ set ofno 1 + random 2] if status = 2 [ set ofno 1 + random 2] ] [ set status 5 ]; males don't breed status = 5 ;ASSIGN INITIAL WEIGHT: ifelse sex = 0;male [ set weight Wbm * ( 1 - exp(- kbm * ( age - Abm))) ^ 3 ];von bertallanfy growth for males, [ set weight Wbf * ( 1 - exp(- kbf * ( age - Abf))) ^ 3 ]; von bertalanffy growth for females for UpdateBlubber ] reset-ticks end ; setup ;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++; ;+++++++++++++++++++++++++++==GO==+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++; ;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++; to go tick ask turtles [set Ic 0] ;--------------------------------------------SUBMODULES---------------------------------------------- ask turtles with [sex = 1] [OffspringSurvival];which females will be pregnant this year and whose cubs will die and when UpdateBlubber UpdateWeight ask turtles[SetEnergyRequirement]; calculate energy requirments for every bear according to the weight ask turtles [Feed]; calculate hunting of seals ask turtles [LactationTransfer]; for lactating females ask turtles [PopulationDynamics]; natural mortality and natality ask turtles[UpdateAge] ; get older UpdateBlubber UpdateWeight ;FILE OUTPUT: ; if year > 1985 ; [ ; ask turtles ; [ ; set RN random 10 ; if RN = 1 ; [ ; file-write-line ; ] ; ] ; ] ;a sample of 1/5 of population writes file set year year + 1 ;yearcounter set NUMBERS count turtles set lambda (count turtles / initialpopulation) ^ ( 1 / ticks) if ticks = numberruns [stop] end ; go ;/////////////////////////////////////////////////SUBMODULES-DETAILS///////////////////////////////////////////// ;-------------------------------------------OffspringSurvival-------------------------------------- to OffspringSurvival ; turtle procedure if age < 5 [ set status 0 set p 0 ] set RN random-float 1 if status = 2 and ofno = 1 [ set p 0 ifelse RN < sigmay [ set days1 365 set days2 0 ] [ set ofno 0 set days1 random 366 + 1 set days2 0 ] ] if status = 2 and ofno = 2 [ set p 0 if RN < (1 - sigmay) ^ 2 [ set ofno 0 set days1 random 366 + 1 set days2 random 366 + 1 ] if ( 1 - sigmay) ^ 2 < RN and RN < 1 - (sigmay ^ 2) [ set ofno 1 set days1 random 366 + 1 set days2 365 ] if RN > (1 - (sigmay ^ 2) ) [ set ofno 2 set days1 365 set days2 365 ] ] if status = 1 and ofno = 1 [ set p 0 ifelse RN < sigmac [ set days1 365 set days2 0 ] [ set ofno 0 set days1 random 366 + 1 set days2 0 ] ] if status = 1 and ofno = 2 [ set p 0 if RN < (1 - sigmac) ^ 2 [ set ofno 0 set days1 random 366 + 1 set days2 random 366 + 1 ] if ( 1 - sigmac ) ^ 2 < RN and RN < 1 - (sigmac ^ 2) [ set ofno 1 set days1 random 366 + 1 set days2 365 ] if RN > ( 1 - (sigmac ^ 2)) [ set ofno 2 set days1 365 set days2 365 ] ] ; who will get pregnant this year? if age > 5 and status = 0 and p = 0 [ ifelse RN < beta0 [ set p 1 set BBc 0 set BBy 0 ] [ set p 0 set BBc 0 set BBy 0 ] ] set RN random-float 1 if status = 1 and ofno = 0 [ set BBc 0 set BBy 0 if RN < beta12 [ set p 1 ] ] if status = 2 and ofno = 0 [ set BBc 0 set BBy 0 if RN < beta12 [ set p 1 ] ] end ;----------------------------------SET ENERGY------------------------------------------------------------ to SetEnergyRequirement ; turtle procedure ;calculate weight dependent energy requirment of a polar bear set energy 365 * kappa * f_A * 70 * (weight) ^ 0.75; [[eq.(S4)]] ; adjust for females if sex = 1 and status = 1 [ set energy energy + Emc * mcc * (days1 + days2) ;[[eq.(S5)]] ]; adjusted for cub milk consumption [kJ] if sex = 1 and status = 2 [ set energy energy + Emy * mcy * (days1 + days2) ;[[eq.(S6)]] set Ey 365 * kappa * f_Y * 70 * ( Wy ) ^ 0.75 - Emy * mcy * 365 ;[[eq.(S7)]] set epsilon Ey / energy ;[[eq.(S8)]] ] end ;---------------------------------------------TO FEED---------------------------------------------------- to Feed ; turtle procedure if energy > 90000 [ loop ; eat seals until energy demands of the bear are met [ set SARN random 100 ; determine age class of seals to eat and select seal age SA randomly within ; this class: if SARN <= hsa [ set SA (3 + random 17) if SA >= 11 [ set SA 11 ] ];18% if hsa < SARN and SARN <= (100 - hsp) [ set SA (1 + random 2) ];26% if SARN > (100 - hsp) [ set SA 0 ] ; select age of seal 56% set SS random 2 ;select seal sex sex = 1 female;sex = 0 male ifelse SS = 0 ;calculate weight of seal [ set Sweight Wsm * ((1 - exp(- asm * (SA + 0.61))) ^ bsm);[[eq.(S1)]] ]; Von Bertalanffy [ set Sweight Wsf * ((1 - exp(- asf * (SA + 0.61))) ^ bsf);[[eq.(S1)]] ] set T_bl a_Tbl * Sweight + b_Tbl ; [[eq. (S3)]] ;-------------------------------find seal contamination in appropriate list------------ if year < 1986 [ set C_Seal item SA seal1986 ] if year = 1986 [ set C_Seal item SA seal1986 ] if year = 1987 [ set C_Seal item SA seal1987 ] if year = 1988 [ set C_Seal item SA seal1988 ] if year = 1989 [ set C_Seal item SA seal1989 ] if year = 1990 [ set C_Seal item SA seal1990 ] if year = 1991 [ set C_Seal item SA seal1991 ] if year = 1992 [ set C_Seal item SA seal1992 ] if year = 1993 [ set C_Seal item SA seal1993 ] if year = 1994 [ set C_Seal item SA seal1994 ] if year = 1995 [ set C_Seal item SA seal1995 ] if year = 1996 [ set C_Seal item SA seal1996 ] if year = 1997 [ set C_Seal item SA seal1997 ] if year = 1998 [ set C_Seal item SA seal1998 ] if year = 1999 [ set C_Seal item SA seal1999 ] if year = 2000 [ set C_Seal item SA seal2000 ] if year = 2001 [ set C_Seal item SA seal2001 ] if year = 2002 [ set C_Seal item SA seal2002 ] if year = 2003 [ set C_Seal item SA seal2003 ] if year = 2004 [ set C_Seal item SA seal2004 ] if year = 2005 [ set C_Seal item SA seal2005 ] if year = 2006 [ set C_Seal item SA seal2006 ] if year = 2007 [ set C_Seal item SA seal2007 ] if year = 2008 [ set C_Seal item SA seal2008 ] if year = 2009 [ set C_Seal item SA seal2009 ] ;------------------------------contamination in all body of the seal----------- set Ic Ic + T_bl * C_Seal * 1000 ; calc. contamination in this seal [ng]; [[eq.(S9)]] set G T_bl * Es * 1000 ;calc. energy gained of this seal when Es = 37,8 kJ/g ; [[eq. (S10)]] set energy energy - G ; reduce energy minus energy gained from seal if energy < ( kappa * 90000 ) [ set BB BB + (Ic * AA ) stop ] ] ; loop ] ; if energy demand "energy" < kappa * 90000 ;this condition set as one half of energetic contribution of one 45 kg seal prevents bears from overeating in case last of the cought seals is much larger than what is left of their energy needs to cover ; Stirling and mcEwan 1975 end ;---------------------------------LactationTransfer------------------------------------- to LactationTransfer if sex = 1 [ if status = 1 [ let C BB / ((weight + Wpf)/ 2 * (fat + Fpf)/ 2 * 1000) ; [[eq.(S11)]] set BB BB - (days1 + days2) * mcc * FmilkC * rho * C ; [[eq. (S14)]] if ofno != 0 [ set BBc 365 * mcc * FmilkC * rho * Ac * C ;[[eq.(S15)]] ] ] ; 0.496 - daily milk consumption, 0.275..fat percent, 0.67...ratio of contaminants in milk/mother, if status = 2 [ let C BB / (weight * fat * 1000) ; [[eq. (S13)]] set BB BB - (days1 + days2) * mcy * FmilkY * rho * C ;[[eq.(S12)]] if ofno != 0 [ set BBy BBy + (epsilon * Ic * Ay + 365 * mcy * FmilkY * rho * Ay * C ) ; [[eq.(S16)]] ] ; ]] end ;-----------------------------------------DIE AND BREED------------------------------------------------ to PopulationDynamics if age > 30 [die] set RN random-float 1 ;WHO DIES THIS YEAR if sex = 0 [ ifelse age < 5 [ set death mu_sm ] [ set death mu_m ] if RN < death [die] ] if sex = 1 [ ifelse age < 5 [ set death mu_sf ] [ set death mu_f ] if RN < death [die] ] ; BREED NEW INDIVIDUALS if sex = 1 and status = 2 and ofno > 0 [ set status 0 set p 0 hatch ofno [ set age 1 set BB BBy set BBc 0 set BBy 0 set sex random 2 set color green fd random 10 rt random 50 set p 0 set ofno 0 set days1 0 set days2 0 ifelse sex = 0 [ set status 5 ] [ set status 0 ] ] ] ; UPDATE STATUS VALID FOR NEXT YEAR ifelse sex = 0 [ set status 5 ] [ if status = 0 and p = 0 [ set ofno 0 set BBc 0 set BBy 0 ] if status = 2 and p = 1 [ set status 1 set RN random-float 1 ifelse RN < pi_1cub [ set ofno 1 ] [ set ofno 2 ] ] if status = 2 and ofno = 0 and p = 0 [ set status 0 ] if status = 1 and ofno = 0 and p = 0 [ set status 0 ] if status = 1 and ofno != 0 [ set status 2 set BBy BBc set BBc 0 ] if status = 1 and p = 1 [ set status 1 set p 0 set RN random-float 1 ifelse RN < pi_1cub [ set ofno 1 ] [ set ofno 2 ] ] if status = 0 and p = 1 [ set status 1 set p 0 set RN random-float 1 ifelse RN < pi_1cub [ set ofno 1 ] [ set ofno 2 ] ] ] end ;----------------------------------------------------UPDATE AGE------------------------------------ to UpdateAge ;UPDATE AGE set age age + 1 set color scale-color red age 0 30 if age = 2 [ set color green ] ; UPDATE COUNTERS set energy 0; set Ic 0 set days1 0 set days2 0 set Ey 0 set epsilon 0 end ;-----------------------------------------------UPDATE BLUBBER------------------------------- to UpdateBlubber ; proportion of fat on a polar bear ask turtles with [status = 0] [set fat Ff] ;females without offspring ask turtles with [p = 1 ] [set fat Fpf] ;pregnant females ask turtles with [status = 1] [set fat Ffcub];females with cubs ask turtles with [status = 2] [set fat Ffyrl] ;females with yearlings ask turtles with [sex = 0] [set fat Fm] ;males end ;------------------------------------------------------UPDATE WEIGHT-------------------------------- to UpdateWeight ask turtles [ ifelse sex = 0;male=0 [ set weight Wbm * ( 1 - exp(- kbm * ( age - Abm ))) ^ 3;[[(eq.S17)]] ] [ set weight Wbf * ( 1 - exp(- kbf * ( age - Abf))) ^ 3 ;[[(eq.S17)]] ] if sex = 1 and p = 1 [ set weight Wpf ] if sex = 1 and status = 1 [ set weight Wfc ] ] end ;;---------------------------------------------------------FILE SETUP--------------------------------------- ;to file-setup ; ; set outfile (word year ".txt") ; file-open outfile ; file-print ("year age sex C BB lambda") ; header line (space-separated). ;end ; ; ;;--------------------------------------------------------FILE WRITE LINE----------------------------- ;to file-write-line ; file-open outfile ; ; ; ; file-write year ; ; file-write age ; file-write sex ; let C BB / (weight * fat * 1000) file-write C ; ; file-write BB ; file-write lambda ; file-print "" ; ; file-close ;end