generated from SEFSC/SEFSC-Template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathred_tide_sim_loop_GAG.R
2181 lines (1979 loc) · 97.8 KB
/
red_tide_sim_loop_GAG.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#NOTES: Things to discuss
# -- Code assumes no seasons so will not work correctly with a seasonal model do
# we need this capacity for any species we may want to include?
# - Gulf assessment models do not yet include seasons
#
# -- No recruitment variability included at the moment. Is this important to add or
# just more noise to confuse the issue. Should we wait for reviewer feedback and
# just add it if they as for it? I don't think it will have any practical impact.
# - Let's stick with simple first, and build in this complexity if/as needed
#
# -- Current approach uses fixed future F values for the simulation with approximates
# a best case scenario where F_target stays the same and the fishery OFL is constantly
# being updated to achieve this (such as through accurate interim assessments). I
# think adding catch based removals will probably just exaggerate the impacts and
# distract from the red tide effect by allowing claims that future assessments
# would correct for the impacts.
#
# -- Which species should we try to implement this for (Red Grouper, Gag, ???)
# - Red and gag grouper only ones where we estimate red tide mortality
#
# -- What outputs do we want to record (Landings, SSB, ???)
# - Added total biomass, red tide kills (biomass), exploitation rate, recruitment, stock status
library(r4ss)
library(RColorBrewer)
#Source setup file that should be named local.setup so that it will be
#ignored by github tracking.
#
DIR<-"C://Users/skyler.sagarese/Desktop/RT/GAG/" #Specify RGR or GAG
local.setup.location <- paste0(DIR,"local.setup.txt")
#local.setup.location <- "C:/Users/skyler.sagarese/Desktop/RT/GAG/local.setup.txt"
source(local.setup.location)
#Source in the SEFSC projections function
source(projection_script)
# #Copy files to the simulation folder
# if(dir.exists(file.path(working_dir))){
# unlink(file.path(working_dir), recursive = TRUE)
# }
# dir.create(file.path(working_dir))
# dir.create(file.path(working_dir,"Base"))
# temp.files <- list.files(path=file.path(assessment_dir))
# file.copy(from = file.path(assessment_dir,temp.files), to = file.path(working_dir,"Base",temp.files))
#Read forecast file to get N_forecast years and base file for overwriting other runs
forecast_base <- r4ss::SS_readforecast(file=file.path(working_dir,"Base","forecast.ss"))
base_output <- r4ss::SS_output(file.path(working_dir,"Base"),covar = FALSE)
#Projection red tide values
rt_proj_ave <- sort(seq(0,0.1,0.01))
#True red tide averages
rt_mean <- sort(c(0.01,0.03,0.06)) #RGR range
#rt_mean <- sort(c(0.01,0.08,0.16)) #GAG range
#How many random red tide replicates to run
n_rand_reps <- 500
#How many years of known catch are entered in the projections
#Red tide mortality will not be added in these years for projections or
#randomization.
#N_fixed_years <- 0 #RGR does not error out, so no reason to subset years
N_fixed_years <- 4 #GAG popn crashes in interim years, need to turn RTM off
#Set seed to allow replication of results
global.seed <- 1234
set.seed(global.seed)
rand_offset <- 0 #offset to avoid using same seed as previous runs
rand_seed <- floor(runif((n_rand_reps+rand_offset),100000,9999999))[(rand_offset+1):(n_rand_reps+rand_offset)]
#Identify the fleet associated with red tide
#rt_fleet <- 5 #Red Grouper
rt_fleet <- 6 #Gag Grouper
#Identify fleets to include in landings calculations
#landings_fleets <- 1:4 #Red Grouper
landings_fleets <- 1:5 #Gag Grouper
fleet_landings_cols <- grep("retain(B)",colnames(base_output$timeseries),fixed=TRUE)[landings_fleets]
fleet_dead_cols <- grep("dead(B)",colnames(base_output$timeseries),fixed=TRUE)[landings_fleets]
#Setup the random red tide mortality vector details
#Set the range for the number of red tide events in the projection period of 100 years
n_rt_events_min <- 5 #The minimum number of red tide events during the projection period
n_rt_events_max <- 20 #The maximum number of red tide events during the projection period
#Set the relative range for red tide in a single year these values will be rescaled
#in each simulation so the total red tide mortality is always sums to the target mean
rt_min <- 0.1 #Relative value of the minimum red tide in a single year
rt_max <- 0.4 #Relative value of the maximum red tide in a single year
#Set up output matrices for storing values of interest
#Data frame to track the iteration settings for each row of the results for indexing
results_setting <- data.frame(rt_projected=c(sort(rep(rt_proj_ave,length(rt_mean)*n_rand_reps))),
rt_mean=c(rep(sort(rep(rt_mean,n_rand_reps)),length(rt_proj_ave))),
replicate=c(rep(1:n_rand_reps,length(rt_mean)*length(rt_proj_ave))))
#Achieved OFL landings
results_landings <- matrix(data=NA,nrow=(length(rt_proj_ave)*length(rt_mean)*n_rand_reps),ncol=(forecast_base$Nforecastyrs+base_output$endyr-base_output$startyr+1))
#Achieved SSB
results_SSB <- matrix(data=NA,nrow=(length(rt_proj_ave)*length(rt_mean)*n_rand_reps),ncol=(forecast_base$Nforecastyrs+base_output$endyr-base_output$startyr+1))
#Target SPR
results_SPR <- matrix(data=NA,nrow=(length(rt_proj_ave)*length(rt_mean)*n_rand_reps),ncol=(forecast_base$Nforecastyrs+base_output$endyr-base_output$startyr+1))
#Target depletion
results_dep <- matrix(data=NA,nrow=(length(rt_proj_ave)*length(rt_mean)*n_rand_reps),ncol=(forecast_base$Nforecastyrs+base_output$endyr-base_output$startyr+1))
#Achieved Recruitment
results_recr <- matrix(data=NA,nrow=(length(rt_proj_ave)*length(rt_mean)*n_rand_reps),ncol=(forecast_base$Nforecastyrs+base_output$endyr-base_output$startyr+1))
#Achieved Total Biomass
results_tbio <- matrix(data=NA,nrow=(length(rt_proj_ave)*length(rt_mean)*n_rand_reps),ncol=(forecast_base$Nforecastyrs+base_output$endyr-base_output$startyr+1))
#Achieved Red Tide Kill (biomass)
results_RTkillbio <- matrix(data=NA,nrow=(length(rt_proj_ave)*length(rt_mean)*n_rand_reps),ncol=(forecast_base$Nforecastyrs+base_output$endyr-base_output$startyr+1))
#Achieved Exploitation Rate
results_Fexp <- matrix(data=NA,nrow=(length(rt_proj_ave)*length(rt_mean)*n_rand_reps),ncol=(forecast_base$Nforecastyrs+base_output$endyr-base_output$startyr+1))
#Index to track row for filling results data
index_row <- 1
# #First loop over the red tide rate included in projections as this will only
# #need the projections to be calculated once.
# for(i in seq_along(rt_proj_ave)){
# #remove exisiting base folders if found
# proj_dir <- file.path(working_dir,paste0("rtproj_",i))
# if(dir.exists(proj_dir)){
# unlink(proj_dir, recursive = TRUE)
# }
# #Create new base folders and copy over the original model files
# dir.create(proj_dir)
# dir.create(file.path(proj_dir,"Base"))
# temp.files <- list.files(path=file.path(working_dir,"Base"))
# file.copy(from = file.path(working_dir,"Base",temp.files), to = file.path(proj_dir,"Base",temp.files))
#
# #Adjust the redtide values for the base projection and rerun the projections
# #to estimate OFL.
# #For now I'm leaving out ABC as I think it distracts from the intent of the
# #simulation because ABC is supposed to account for unknown uncertainty not
# #offset an avoidable bias such as this.
# #This uses the average red tide rate in every projection year
# forecast_base$ForeCatch[forecast_base$ForeCatch$Fleet==rt_fleet & forecast_base$ForeCatch$Year>(base_output$endyr+N_fixed_years),4] <- rep(rt_proj_ave[i],(forecast_base$Nforecastyrs-N_fixed_years))
#
# r4ss::SS_writeforecast(mylist=forecast_base,dir=file.path(proj_dir,"Base"),overwrite=TRUE)
#
# base_proj <- run.projections(file.path(proj_dir,"Base"))
#
# #Loop over all mean red tide level scenarios
# for(j in seq_along(rt_mean)){
# #remove exisiting mean red tide folders if found
# rt_dir <- file.path(proj_dir,paste0("rt_mean_",j))
# if(dir.exists(rt_dir)){
# unlink(rt_dir, recursive = TRUE)
# }
# #Create new folder for each mean red tide level and copy over the original model files
# dir.create(rt_dir)
#
# #Loop over all random red tide sequences
# for(k in 1:n_rand_reps){
# #reset random seed for each random replicate seeds will be replicated across
# #projected red tide levels and mean red tide levels
#
# set.seed(rand_seed[k])
# #Create folders for each random sequence
# dir.create(file.path(rt_dir,k))
# temp.files <- list.files(path=file.path(proj_dir,"Base","OFL_target"))
# file.copy(from = file.path(proj_dir,"Base","OFL_target",temp.files), to = file.path(rt_dir,k,temp.files))
#
# #Calculate a random red tide mortality vector based on specified mean and frequency
# #draw a random number of red tide events from a uniform distribution between min and max number specified
# n_rt_events <- sample(n_rt_events_min:n_rt_events_max,1) #
# #calculate the total red tide mortality expected from the specified mean and number of projection years
# rt_total <- rt_mean[j]*(forecast_base$Nforecastyrs-N_fixed_years)
# #calculate random mortality rates from each event from a uniform distribution between min and max number specified
# rt_mags <- runif(n_rt_events,rt_min,rt_max)
# #rescale the red tide magnitudes so that they sum to the expected total mortality
# rt_mags <- rt_mags*(rt_total/sum(rt_mags))
# #create a zero mortality vector for all years
# rand_red_tide <- rep(0,(forecast_base$Nforecastyrs))
# #randomly select years for the red tide mortality to occur and replace zero's with random mortality rates
# rand_red_tide[sample((N_fixed_years+1):forecast_base$Nforecastyrs,n_rt_events)] <- rt_mags
#
#
# #Modify forecast file to include random red tide mortality sequence
# forecast_rt <- r4ss::SS_readforecast(file=file.path(rt_dir,k,"forecast.ss"))
# forecast_rt$ForeCatch[forecast_rt$ForeCatch$Fleet==rt_fleet & forecast_rt$ForeCatch$Year>(base_output$endyr+N_fixed_years),4] <- rand_red_tide[(N_fixed_years+1):forecast_base$Nforecastyrs]
# #Write out the new forecast file and run model with new random mortality vector
# r4ss::SS_writeforecast(mylist=forecast_rt,dir=file.path(rt_dir,k),overwrite=TRUE)
# shell(paste("cd /d ",file.path(rt_dir,k)," && ss -nohess",sep=""))
#
# #Read in results and save values of interest for analysis
# run_output <- r4ss::SS_output(dir=file.path(rt_dir,k),covar = FALSE)
#
# spr_series <- run_output$sprseries
#
# time_series <- run_output$timeseries
# time_series_virg <- time_series[time_series$Era=="VIRG",]
# time_series <- time_series[time_series$Era!="VIRG" & time_series$Era!="INIT",]
# years <- unique(time_series$Yr)
# for(i in seq_along(years)){
# time_series_sub <- time_series[time_series$Yr==years[i],,drop=FALSE]
# spr_series_sub <- spr_series[spr_series$Yr==years[i],,drop=FALSE]
# results_landings[index_row,i] <- sum(time_series_sub[,fleet_landings_cols])
# results_SSB[index_row,i] <- sum(time_series_sub[,'SpawnBio'])
# results_SPR[index_row,i] <- sum(spr_series_sub[,'SPR'])
# results_dep[index_row,i] <- sum(spr_series_sub[,'Deplete'])
# results_recr[index_row,i] <- sum(time_series_sub[,'Recruit_0'])
# results_tbio[index_row,i] <- sum(spr_series_sub[,'Bio_all.1'])
# # results_RTkillbio[index_row,i] <- sum(time_series_sub[,'dead(B):_5']) #RGR
# results_RTkillbio[index_row,i] <- sum(time_series_sub[,'dead(B):_6']) #GAG
# results_Fisherykillbio[index_row,i] <- sum(time_series_sub[,fleet_dead_cols])
# results_smrybio[index_row,i] <- sum(spr_series_sub[,'Bio_Smry.1'])
# results_Fexp[index_row,i] <- sum(spr_series_sub[,'F_report']) #note: this includes red tide mortality; will subtract it out later
# }
# index_row <- index_row+1
# }
# }
# }
#
# all_results <- list()
# all_results[[1]] <- results_landings
# all_results[[2]] <- results_SSB
# all_results[[3]] <- results_SPR
# all_results[[4]] <- results_dep
# all_results[[5]] <- results_recr
# all_results[[6]] <- results_tbio
# all_results[[7]] <- results_RTkillbio
# all_results[[8]] <- results_Fisherykillbio
# all_results[[9]] <- results_smrybio
# all_results[[10]] <- results_Fexp
#
# #save(all_results,file=save_file)
load("results")
head(all_results)
results_landings<-all_results[[1]]
results_SSB<- all_results[[2]]
results_SPR<- all_results[[3]]
results_dep <- all_results[[4]]
results_recr <- all_results[[5]]
results_tbio <- all_results[[6]]
results_RTkillbio <- all_results[[7]]
results_Fexp <- all_results[[8]]
# Note: exploitation in report file excludes red tide in forecast, but includes in timeseries
# We want to remove red tide from the exploitation time series for consistency
# 2005 (column 43)
RT2005<-base_output$timeseries[base_output$timeseries$Yr==2005,]
RT2005spr<-base_output$sprseries[base_output$sprseries$Yr==2005,]
FishKillBio2005<-sum(RT2005[,fleet_dead_cols])/RT2005spr$Bio_Smry.1
results_Fexp[,43]<-FishKillBio2005
# 2014 (column 52)
RT2014<-base_output$timeseries[base_output$timeseries$Yr==2014,]
RT2014spr<-base_output$sprseries[base_output$sprseries$Yr==2014,]
FishKillBio2014<-sum(RT2014[,fleet_dead_cols])/RT2014spr$Bio_Smry.1
results_Fexp[,52]<-FishKillBio2014
# 2018 (column 56)
RT2018<-base_output$timeseries[base_output$timeseries$Yr==2018,]
RT2018spr<-base_output$sprseries[base_output$sprseries$Yr==2018,]
FishKillBio2018<-sum(RT2018[,fleet_dead_cols])/RT2018spr$Bio_Smry.1
results_Fexp[,56]<-FishKillBio2018
#Summarize results for display
summary_index <- 1
results_summary_setup <- data.frame(rt_projected=c(sort(rep(rt_proj_ave,length(rt_mean)))),
rt_mean=c(rep(sort(rt_mean),length(rt_proj_ave))))
results_landings_summary_mean <- results_landings[1:(length(rt_proj_ave)*length(rt_mean)),]
results_landings_summary_sd <- results_landings[1:(length(rt_proj_ave)*length(rt_mean)),]
results_SSB_summary_mean <- results_SSB[1:(length(rt_proj_ave)*length(rt_mean)),]
results_SSB_summary_sd <- results_SSB[1:(length(rt_proj_ave)*length(rt_mean)),]
results_SPR_summary_mean <- results_SPR[1:(length(rt_proj_ave)*length(rt_mean)),]
results_SPR_summary_sd <- results_SPR[1:(length(rt_proj_ave)*length(rt_mean)),]
results_dep_summary_mean <- results_dep[1:(length(rt_proj_ave)*length(rt_mean)),]
results_dep_summary_sd <- results_dep[1:(length(rt_proj_ave)*length(rt_mean)),]
results_recr_summary_mean <- results_recr[1:(length(rt_proj_ave)*length(rt_mean)),]
results_recr_summary_sd <- results_recr[1:(length(rt_proj_ave)*length(rt_mean)),]
results_tbio_summary_mean <- results_tbio[1:(length(rt_proj_ave)*length(rt_mean)),]
results_tbio_summary_sd <- results_tbio[1:(length(rt_proj_ave)*length(rt_mean)),]
results_RTkillbio_summary_mean <- results_RTkillbio[1:(length(rt_proj_ave)*length(rt_mean)),]
results_RTkillbio_summary_sd <- results_RTkillbio[1:(length(rt_proj_ave)*length(rt_mean)),]
results_Fexp_summary_mean <- results_Fexp[1:(length(rt_proj_ave)*length(rt_mean)),]
results_Fexp_summary_sd <- results_Fexp[1:(length(rt_proj_ave)*length(rt_mean)),]
for(i in seq_along(rt_proj_ave)){
for(j in seq_along(rt_mean)){
rows <- which(results_setting[,"rt_projected"]==rt_proj_ave[i] & results_setting[,"rt_mean"]==rt_mean[j])
results_landings_summary_mean[summary_index,] <- apply(results_landings[rows,],2,mean)
results_landings_summary_sd[summary_index,] <- apply(results_landings[rows,],2,sd)
results_SSB_summary_mean[summary_index,] <- apply(results_SSB[rows,],2,mean)
results_SSB_summary_sd[summary_index,] <- apply(results_SSB[rows,],2,sd)
results_SPR_summary_mean[summary_index,] <- apply(results_SPR[rows,],2,mean)
results_SPR_summary_sd[summary_index,] <- apply(results_SPR[rows,],2,sd)
results_dep_summary_mean[summary_index,] <- apply(results_dep[rows,],2,mean)
results_dep_summary_sd[summary_index,] <- apply(results_dep[rows,],2,sd)
results_recr_summary_mean[summary_index,] <- apply(results_recr[rows,],2,mean)
results_recr_summary_sd[summary_index,] <- apply(results_recr[rows,],2,sd)
results_tbio_summary_mean[summary_index,] <- apply(results_tbio[rows,],2,mean)
results_tbio_summary_sd[summary_index,] <- apply(results_tbio[rows,],2,sd)
results_RTkillbio_summary_mean[summary_index,] <- apply(results_RTkillbio[rows,],2,mean)
results_RTkillbio_summary_sd[summary_index,] <- apply(results_RTkillbio[rows,],2,sd)
results_Fexp_summary_mean[summary_index,] <- apply(results_Fexp[rows,],2,mean)
results_Fexp_summary_sd[summary_index,] <- apply(results_Fexp[rows,],2,sd)
summary_index <- summary_index + 1
}
}
############
# Landings #
############
years<-c(base_output$startyr:(base_output$endyr+100))
cols<-brewer.pal(11, "RdYlBu")
#Want this repeated for baseline simulations across true values
#Reverse colors so blue is good and red is bad ()
cols<-rev(c(rep(cols[1],3),rep(cols[2],3),rep(cols[3],3),rep(cols[4],3),rep(cols[5],3),
rep(cols[6],3),rep(cols[7],3),rep(cols[8],3),rep(cols[9],3),rep(cols[10],3),
rep(cols[11],3)))
jpeg(paste0(DIR,"Landings.jpeg"),res=300,height=2400,width=1600)
par(mfrow=c(3,1),mar=c(0.2,2,0.2,0.9),oma=c(2,2,0.2,0.2))
plot(x=NA,y=NA,xlim=c(min(years),max(years)),ylim=c(min(results_landings)/1000,max(results_landings)/1000),
ylab="",xlab="",las=1,xaxt="n",cex.axis=1.5)
text(2050,max(results_landings)/1000*0.9,"True Future RTM mean=0.01",cex=1.5)
for(i in seq_along(results_landings_summary_mean[,1]))
{
if(results_summary_setup[i,"rt_mean"]==0.01){
lines(x=years,y=results_landings_summary_mean[i,]/1000,col=cols[i])
}
}
plot(x=NA,y=NA,xlim=c(min(years),max(years)),ylim=c(min(results_landings)/1000,max(results_landings)/1000),
xlab="",ylab="",las=1,xaxt="n",cex.axis=1.5)
text(2050,max(results_landings)/1000*0.9,"True Future RTM mean=0.03",cex=1.5)
for(i in seq_along(results_landings_summary_mean[,1]))
{
if(results_summary_setup[i,"rt_mean"]==0.03){
lines(x=years,y=results_landings_summary_mean[i,]/1000,col=cols[i])
}
}
plot(x=NA,y=NA,xlim=c(min(years),max(years)),ylim=c(min(results_landings)/1000,max(results_landings)/1000),
xlab="",ylab="",las=1,cex.axis=1.5)
text(2050,max(results_landings)/1000*0.9,"True Future RTM mean=0.06",cex=1.5)
for(i in seq_along(results_landings_summary_mean[,1]))
{
if(results_summary_setup[i,"rt_mean"]==0.06){
lines(x=years,y=results_landings_summary_mean[i,]/1000,col=cols[i])
}
}
mtext("Landings (1000s metric tons)",side=2,outer=T)
dev.off()
##########################
# Spawning Stock Biomass #
##########################
jpeg(paste0(DIR,"SSB.jpeg"),res=300,height=2400,width=1600)
par(mfrow=c(3,1),mar=c(0.2,2,0.2,0.2),oma=c(2,2,0.2,0.2))
plot(x=NA,y=NA,xlim=c(min(years),max(years)),ylim=c(min(results_SSB)/1000,max(results_SSB)/1000),
ylab="",xlab="",las=1,cex.axis=1.5,xaxt="n")
text(2050,max(results_SSB)/1000*0.9,"True Future RTM mean=0.01",cex=1.5)
for(i in seq_along(results_SSB_summary_mean[,1]))
{
if(results_summary_setup[i,"rt_mean"]==0.01){
lines(x=years,y=results_SSB_summary_mean[i,]/1000,col=cols[i])
}
}
plot(x=NA,y=NA,xlim=c(min(years),max(years)),ylim=c(min(results_SSB)/1000,max(results_SSB)/1000),
xlab="",ylab="",las=1,cex.axis=1.5,xaxt="n")
text(2050,max(results_SSB)/1000*0.9,"True Future RTM mean=0.03",cex=1.5)
for(i in seq_along(results_SSB_summary_mean[,1]))
{
if(results_summary_setup[i,"rt_mean"]==0.03){
lines(x=years,y=results_SSB_summary_mean[i,]/1000,col=cols[i])
}
}
plot(x=NA,y=NA,xlim=c(min(years),max(years)),ylim=c(min(results_SSB)/1000,max(results_SSB)/1000),
xlab="",ylab="",las=1,cex.axis=1.5)
text(2050,max(results_SSB)/1000*0.9,"True Future RTM mean=0.06",cex=1.5)
for(i in seq_along(results_SSB_summary_mean[,1]))
{
if(results_summary_setup[i,"rt_mean"]==0.06){
lines(x=years,y=results_SSB_summary_mean[i,]/1000,col=cols[i])
}
}
mtext("Spawning Stock Biomass (1000s mt)",side=2,outer=T,line=0.7)
dev.off()
#############
# SPR Ratio #
#############
jpeg(paste0(DIR,"SPR Ratio.jpeg"),res=300,height=2400,width=1600)
par(mfrow=c(3,1),mar=c(0.2,2,0.2,0.9),oma=c(2,2,0.2,0.2))
plot(x=NA,y=NA,xlim=c(min(years),max(years)),ylim=c(min(results_SPR),max(results_SPR)),
ylab="SPR Ratio",xlab="",las=1,cex.axis=1.5,xaxt="n")
text(2050,max(results_SPR),"True Future RTM mean=0.01",cex=1.5)
for(i in seq_along(results_SPR_summary_mean[,1]))
{
if(results_summary_setup[i,"rt_mean"]==0.01){
lines(x=years,y=results_SPR_summary_mean[i,],col=cols[i])
}
}
plot(x=NA,y=NA,xlim=c(min(years),max(years)),ylim=c(min(results_SPR),max(results_SPR)),
xlab="",ylab="",las=1,cex.axis=1.5,xaxt="n")
text(2050,max(results_SPR),"True Future RTM mean=0.03",cex=1.5)
for(i in seq_along(results_SPR_summary_mean[,1]))
{
if(results_summary_setup[i,"rt_mean"]==0.03){
lines(x=years,y=results_SPR_summary_mean[i,],col=cols[i])
}
}
plot(x=NA,y=NA,xlim=c(min(years),max(years)),ylim=c(min(results_SPR),max(results_SPR)),
xlab="",ylab="",las=1,cex.axis=1.5)
text(2050,max(results_SPR),"True Future RTM mean=0.06",cex=1.5)
for(i in seq_along(results_SPR_summary_mean[,1]))
{
if(results_summary_setup[i,"rt_mean"]==0.06){
lines(x=years,y=results_SPR_summary_mean[i,],col=cols[i])
}
}
mtext("SPR Ratio",side=2,outer=T,line=0.7)
dev.off()
#############
# SSB Ratio #
#############
jpeg(paste0(DIR,"SSBratio.jpeg"),res=300,height=2400,width=1600)
par(mfrow=c(3,1),mar=c(0.2,2,0.2,0.9),oma=c(2,2,0.2,0.2))
plot(x=NA,y=NA,xlim=c(min(years),max(years)),ylim=c(min(results_dep),max(results_dep)),
ylab="",xlab="",las=1,cex.axis=1.5,xaxt="n")
abline(h=0.4)
text(2050,max(results_dep)*0.95,"True Future RTM mean=0.01",cex=1.5)
for(i in seq_along(results_dep_summary_mean[,1]))
{
if(results_summary_setup[i,"rt_mean"]==0.01){
lines(x=years,y=results_dep_summary_mean[i,],col=cols[i])
}
}
plot(x=NA,y=NA,xlim=c(min(years),max(years)),ylim=c(min(results_dep),max(results_dep)),
xlab="",ylab="",las=1,cex.axis=1.5,xaxt="n")
abline(h=0.4)
text(2050,max(results_dep)*0.9,"True Future RTM mean=0.03",cex=1.5)
for(i in seq_along(results_dep_summary_mean[,1]))
{
if(results_summary_setup[i,"rt_mean"]==0.03){
lines(x=years,y=results_dep_summary_mean[i,],col=cols[i])
}
}
plot(x=NA,y=NA,xlim=c(min(years),max(years)),ylim=c(min(results_dep),max(results_dep)),
xlab="",ylab="",las=1,cex.axis=1.5)
abline(h=0.4)
text(2050,max(results_dep)*0.9,"True Future RTM mean=0.06",cex=1.5)
for(i in seq_along(results_dep_summary_mean[,1]))
{
if(results_summary_setup[i,"rt_mean"]==0.06){
lines(x=years,y=results_dep_summary_mean[i,],col=cols[i])
}
}
mtext("SSB Ratio (SSB/SSBunfished)",side=2,outer=T,line=0.7)
dev.off()
###############
# Recruitment #
###############
jpeg(paste0(DIR,"Recr.jpeg"),res=300,height=2400,width=1600)
par(mfrow=c(3,1),mar=c(0.2,2,0.2,0.9),oma=c(2,2,0.2,0.2))
plot(x=NA,y=NA,xlim=c(min(years),max(years)),ylim=c(min(results_recr)/1000,max(results_recr)/1000),
ylab="",xlab="",cex.axis=1.5,xaxt="n",las=1)
text(2050,max(results_recr)/1000*0.9,"True Future RTM mean=0.01",cex=1.5)
for(i in seq_along(results_recr_summary_mean[,1]))
{
if(results_summary_setup[i,"rt_mean"]==0.01){
lines(x=years,y=results_recr_summary_mean[i,]/1000,col=cols[i])
}
}
plot(x=NA,y=NA,xlim=c(min(years),max(years)),ylim=c(min(results_recr)/1000,max(results_recr)/1000),
xlab="",ylab="",cex.axis=1.5,xaxt="n",las=1)
text(2050,max(results_recr)/1000*0.9,"True Future RTM mean=0.03",cex=1.5)
for(i in seq_along(results_recr_summary_mean[,1]))
{
if(results_summary_setup[i,"rt_mean"]==0.03){
lines(x=years,y=results_recr_summary_mean[i,]/1000,col=cols[i])
}
}
plot(x=NA,y=NA,xlim=c(min(years),max(years)),ylim=c(min(results_recr)/1000,max(results_recr)/1000),
xlab="",ylab="",cex.axis=1.5,las=1)
text(2050,max(results_recr)/1000*0.9,"True Future RTM mean=0.06",cex=1.5)
for(i in seq_along(results_recr_summary_mean[,1]))
{
if(results_summary_setup[i,"rt_mean"]==0.06){
lines(x=years,y=results_recr_summary_mean[i,]/1000,col=cols[i])
}
}
mtext("Recruitment (Millions of Fish)",side=2,outer=T,line=0.7)
dev.off()
#####################
# Exploitation Rate #
#####################
jpeg(paste0(DIR,"F.jpeg"),res=300,height=2400,width=1600)
par(mfrow=c(3,1),mar=c(0.2,2,0.2,0.9),oma=c(2,2,0.2,0.2))
plot(x=NA,y=NA,xlim=c(min(years),max(years)),ylim=c(min(results_Fexp),0.7),
ylab="",xlab="",las=1,cex.axis=1.5,xaxt="n")
text(2050,0.7*0.9,"True Future RTM mean=0.01",cex=1.5)
for(i in seq_along(results_Fexp_summary_mean[,1]))
{
if(results_summary_setup[i,"rt_mean"]==0.01){
lines(x=years,y=results_Fexp_summary_mean[i,],col=cols[i])
}
}
plot(x=NA,y=NA,xlim=c(min(years),max(years)),ylim=c(min(results_Fexp),0.7),
xlab="",ylab="",las=1,cex.axis=1.5,xaxt="n")
text(2050,0.7*0.9,"True Future RTM mean=0.03",cex=1.5)
for(i in seq_along(results_Fexp_summary_mean[,1]))
{
if(results_summary_setup[i,"rt_mean"]==0.03){
lines(x=years,y=results_Fexp_summary_mean[i,],col=cols[i])
}
}
plot(x=NA,y=NA,xlim=c(min(years),max(years)),ylim=c(min(results_Fexp),0.7),
xlab="",ylab="",las=1,cex.axis=1.5)
text(2050,0.7*0.9,"True Future RTM mean=0.06",cex=1.5)
for(i in seq_along(results_Fexp_summary_mean[,1]))
{
if(results_summary_setup[i,"rt_mean"]==0.06){
lines(x=years,y=results_Fexp_summary_mean[i,],col=cols[i])
}
}
mtext("Exploitation Rate (biomass)",side=2,outer=T,line=0.7)
dev.off()
#################
# Total Biomass #
#################
jpeg(paste0(DIR,"tbio.jpeg"),res=300,height=2400,width=1600)
par(mfrow=c(3,1),mar=c(0.2,2,0.2,0.9),oma=c(2,2,0.2,0.2))
plot(x=NA,y=NA,xlim=c(min(years),max(years)),ylim=c(min(results_tbio)/1000,max(results_tbio)/1000),
ylab="",xlab="",las=1,cex.axis=1.5,xaxt="n")
text(2050,max(results_tbio)/1000*0.95,"True Future RTM mean=0.01",cex=1.5)
for(i in seq_along(results_tbio_summary_mean[,1]))
{
if(results_summary_setup[i,"rt_mean"]==0.01){
lines(x=years,y=results_tbio_summary_mean[i,]/1000,col=cols[i])
}
}
plot(x=NA,y=NA,xlim=c(min(years),max(years)),ylim=c(min(results_tbio)/1000,max(results_tbio)/1000),
xlab="",ylab="",las=1,cex.axis=1.5,xaxt="n")
text(2050,max(results_tbio)/1000*0.9,"True Future RTM mean=0.03",cex=1.5)
for(i in seq_along(results_tbio_summary_mean[,1]))
{
if(results_summary_setup[i,"rt_mean"]==0.03){
lines(x=years,y=results_tbio_summary_mean[i,]/1000,col=cols[i])
}
}
plot(x=NA,y=NA,xlim=c(min(years),max(years)),ylim=c(min(results_tbio)/1000,max(results_tbio)/1000),
xlab="",ylab="",las=1,cex.axis=1.5)
text(2050,max(results_tbio)/1000*0.9,"True Future RTM mean=0.06",cex=1.5)
for(i in seq_along(results_tbio_summary_mean[,1]))
{
if(results_summary_setup[i,"rt_mean"]==0.06){
lines(x=years,y=results_tbio_summary_mean[i,]/1000,col=cols[i])
}
}
mtext("Total Biomass (1000s metric tons)",side=2,outer=T,line=0.7)
dev.off()
#########################
# Red Tide Kill Biomass #
#########################
jpeg(paste0(DIR,"RTkillbio.jpeg"),res=300,height=2400,width=1600)
par(mfrow=c(3,1),mar=c(0.2,2,0.2,0.9),oma=c(2,2,0.2,0.2))
plot(x=NA,y=NA,xlim=c(min(years),max(years)),ylim=c(min(results_RTkillbio)/1000,8),
#plot(x=NA,y=NA,xlim=c(min(years),max(years)),ylim=c(min(results_RTkillbio)/1000,max(results_RTkillbio)/1000),
ylab="",xlab="",las=1,cex.axis=1.5,xaxt="n")
text(2050,7,"True Future RTM mean=0.01",cex=1.5)
#text(2050,max(results_RTkillbio)/1000*0.9,"True Future RTM mean=0.01",cex=1.5,col="green")
for(i in seq_along(results_RTkillbio_summary_mean[,1]))
{
if(results_summary_setup[i,"rt_mean"]==0.01){
lines(x=years,y=results_RTkillbio_summary_mean[i,]/1000,col=cols[i])
}
}
#plot(x=NA,y=NA,xlim=c(min(years),max(years)),ylim=c(min(results_RTkillbio)/1000,max(results_RTkillbio)/1000),
plot(x=NA,y=NA,xlim=c(min(years),max(years)),ylim=c(min(results_RTkillbio)/1000,8),
xlab="",ylab="",las=1,cex.axis=1.5,xaxt="n")
text(2050,7,"True Future RTM mean=0.03",cex=1.5)
#text(2050,max(results_RTkillbio)/1000*0.9,"True Future RTM mean=0.03",cex=1.5,col="green")
for(i in seq_along(results_RTkillbio_summary_mean[,1]))
{
if(results_summary_setup[i,"rt_mean"]==0.03){
lines(x=years,y=results_RTkillbio_summary_mean[i,]/1000,col=cols[i])
}
}
#plot(x=NA,y=NA,xlim=c(min(years),max(years)),ylim=c(min(results_RTkillbio)/1000,max(results_RTkillbio)/1000),
plot(x=NA,y=NA,xlim=c(min(years),max(years)),ylim=c(min(results_RTkillbio)/1000,8),
xlab="",ylab="",las=1,cex.axis=1.5)
text(2050,7,"True Future RTM mean=0.06",cex=1.5)
#text(2050,max(results_RTkillbio)/1000*0.9,"True Future RTM mean=0.06",cex=1.5,col="green")
for(i in seq_along(results_RTkillbio_summary_mean[,1]))
{
if(results_summary_setup[i,"rt_mean"]==0.06){
lines(x=years,y=results_RTkillbio_summary_mean[i,]/1000,col=cols[i])
}
}
mtext("Red Tide Kill (1000s metric tons)",side=2,outer=T,line=0.7)
dev.off()
############################
# Results Combined Summary #
############################
jpeg(paste0(DIR,"Summary_Final.jpeg"),res=300,height=2700,width=2400)
par(mfrow=c(4,3),mar=c(2,4,0.5,1),oma=c(0.1,0.1,0.1,0.1))
plot(x=NA,y=NA,xlim=c(min(years),max(years)),ylim=c(min(results_landings)/1000,max(results_landings)/1000),
ylab="Landings (1000s metric tons)",xlab="",las=1,xaxt="n")
text(2047,max(results_landings)/1000*0.9,"True Future RTM mean=0.01",cex=1)
for(i in seq_along(results_landings_summary_mean[,1]))
{
if(results_summary_setup[i,"rt_mean"]==0.01){
lines(x=years,y=results_landings_summary_mean[i,]/1000,col=cols[i])
}
}
plot(x=NA,y=NA,xlim=c(min(years),max(years)),ylim=c(min(results_landings)/1000,max(results_landings)/1000),
xlab="",ylab="",las=1,xaxt="n")
text(2047,max(results_landings)/1000*0.9,"True Future RTM mean=0.03",cex=1)
for(i in seq_along(results_landings_summary_mean[,1]))
{
if(results_summary_setup[i,"rt_mean"]==0.03){
lines(x=years,y=results_landings_summary_mean[i,]/1000,col=cols[i])
}
}
plot(x=NA,y=NA,xlim=c(min(years),max(years)),ylim=c(min(results_landings)/1000,max(results_landings)/1000),
xlab="",ylab="",las=1,xaxt="n")
text(2047,max(results_landings)/1000*0.9,"True Future RTM mean=0.06",cex=1)
for(i in seq_along(results_landings_summary_mean[,1]))
{
if(results_summary_setup[i,"rt_mean"]==0.06){
lines(x=years,y=results_landings_summary_mean[i,]/1000,col=cols[i])
}
}
plot(x=NA,y=NA,xlim=c(min(years),max(years)),ylim=c(min(results_dep),max(results_dep)),
ylab="SSB Ratio (SSB/SSBunfished)",xlab="",las=1,xaxt="n")
abline(h=0.4)
for(i in seq_along(results_dep_summary_mean[,1]))
{
if(results_summary_setup[i,"rt_mean"]==0.01){
lines(x=years,y=results_dep_summary_mean[i,],col=cols[i])
}
}
plot(x=NA,y=NA,xlim=c(min(years),max(years)),ylim=c(min(results_dep),max(results_dep)),
xlab="",ylab="",las=1,xaxt="n")
abline(h=0.4)
for(i in seq_along(results_dep_summary_mean[,1]))
{
if(results_summary_setup[i,"rt_mean"]==0.03){
lines(x=years,y=results_dep_summary_mean[i,],col=cols[i])
}
}
plot(x=NA,y=NA,xlim=c(min(years),max(years)),ylim=c(min(results_dep),max(results_dep)),
xlab="",ylab="",las=1,xaxt="n")
abline(h=0.4)
for(i in seq_along(results_dep_summary_mean[,1]))
{
if(results_summary_setup[i,"rt_mean"]==0.06){
lines(x=years,y=results_dep_summary_mean[i,],col=cols[i])
}
}
text(2000,0.95,"Baseline RTM")
legend(1970,0.925,legend=c("0","0.01","0.02","0.03","0.04","0.05"),lty=1,col=cols[seq(1,31,3)[1:6]],bty="n")
legend(2020,0.925,legend=c("0.06","0.07","0.08","0.09","0.1"),lty=1,col=cols[seq(1,31,3)[7:11]],bty="n")
plot(x=NA,y=NA,xlim=c(min(years),max(years)),ylim=c(min(results_tbio)/1000,max(results_tbio)/1000),
ylab="Total Biomass (1000s metric tons)",xlab="",las=1,xaxt="n")
for(i in seq_along(results_tbio_summary_mean[,1]))
{
if(results_summary_setup[i,"rt_mean"]==0.01){
lines(x=years,y=results_tbio_summary_mean[i,]/1000,col=cols[i])
}
}
plot(x=NA,y=NA,xlim=c(min(years),max(years)),ylim=c(min(results_tbio)/1000,max(results_tbio)/1000),
xlab="",ylab="",las=1,xaxt="n")
for(i in seq_along(results_tbio_summary_mean[,1]))
{
if(results_summary_setup[i,"rt_mean"]==0.03){
lines(x=years,y=results_tbio_summary_mean[i,]/1000,col=cols[i])
}
}
plot(x=NA,y=NA,xlim=c(min(years),max(years)),ylim=c(min(results_tbio)/1000,max(results_tbio)/1000),
xlab="",ylab="",las=1,xaxt="n")
for(i in seq_along(results_tbio_summary_mean[,1]))
{
if(results_summary_setup[i,"rt_mean"]==0.06){
lines(x=years,y=results_tbio_summary_mean[i,]/1000,col=cols[i])
}
}
plot(x=NA,y=NA,xlim=c(min(years),max(years)),ylim=c(min(results_RTkillbio)/1000,7),
ylab="Red Tide Kill (Biomass, 1000s metric tons)",xlab="",las=1)
for(i in seq_along(results_RTkillbio_summary_mean[,1]))
{
if(results_summary_setup[i,"rt_mean"]==0.01){
lines(x=years,y=results_RTkillbio_summary_mean[i,]/1000,col=cols[i])
}
}
plot(x=NA,y=NA,xlim=c(min(years),max(years)),ylim=c(min(results_RTkillbio)/1000,7),
xlab="",ylab="",las=1)
for(i in seq_along(results_RTkillbio_summary_mean[,1]))
{
if(results_summary_setup[i,"rt_mean"]==0.03){
lines(x=years,y=results_RTkillbio_summary_mean[i,]/1000,col=cols[i])
}
}
plot(x=NA,y=NA,xlim=c(min(years),max(years)),ylim=c(min(results_RTkillbio)/1000,7),
xlab="",ylab="",las=1)
for(i in seq_along(results_RTkillbio_summary_mean[,1]))
{
if(results_summary_setup[i,"rt_mean"]==0.06){
lines(x=years,y=results_RTkillbio_summary_mean[i,]/1000,col=cols[i])
}
}
dev.off()
jpeg(paste0(DIR,"Summary.jpeg"),res=300,height=2400,width=2000)
par(mfrow=c(4,3),mar=c(2,4,2,1),oma=c(0.1,0.1,0.1,0.1))
plot(x=NA,y=NA,xlim=c(min(years),max(years)),ylim=c(min(results_landings)/1000,max(results_landings)/1000),
ylab="Landings (1000s metric tons)",xlab="",las=1,xaxt="n")
text(2047,max(results_landings)/1000*0.9,"True Future RTM mean=0.01",cex=1)
for(i in seq_along(results_landings_summary_mean[,1]))
{
if(results_summary_setup[i,"rt_mean"]==0.01){
lines(x=years,y=results_landings_summary_mean[i,]/1000,col=cols[i])
}
}
plot(x=NA,y=NA,xlim=c(min(years),max(years)),ylim=c(min(results_landings)/1000,max(results_landings)/1000),
xlab="",ylab="",las=1,xaxt="n")
text(2047,max(results_landings)/1000*0.9,"True Future RTM mean=0.03",cex=1)
for(i in seq_along(results_landings_summary_mean[,1]))
{
if(results_summary_setup[i,"rt_mean"]==0.03){
lines(x=years,y=results_landings_summary_mean[i,]/1000,col=cols[i])
}
}
plot(x=NA,y=NA,xlim=c(min(years),max(years)),ylim=c(min(results_landings)/1000,max(results_landings)/1000),
xlab="",ylab="",las=1,xaxt="n")
text(2047,max(results_landings)/1000*0.9,"True Future RTM mean=0.06",cex=1)
for(i in seq_along(results_landings_summary_mean[,1]))
{
if(results_summary_setup[i,"rt_mean"]==0.06){
lines(x=years,y=results_landings_summary_mean[i,]/1000,col=cols[i])
}
}
plot(x=NA,y=NA,xlim=c(min(years),max(years)),ylim=c(min(results_SSB)/1000,max(results_SSB)/1000),
ylab="Spawning Stock Biomass (1000s mt)",xlab="",las=1,xaxt="n")
for(i in seq_along(results_SSB_summary_mean[,1]))
{
if(results_summary_setup[i,"rt_mean"]==0.01){
lines(x=years,y=results_SSB_summary_mean[i,]/1000,col=cols[i])
}
}
plot(x=NA,y=NA,xlim=c(min(years),max(years)),ylim=c(min(results_SSB)/1000,max(results_SSB)/1000),
xlab="",ylab="",las=1,xaxt="n")
for(i in seq_along(results_SSB_summary_mean[,1]))
{
if(results_summary_setup[i,"rt_mean"]==0.03){
lines(x=years,y=results_SSB_summary_mean[i,]/1000,col=cols[i])
}
}
plot(x=NA,y=NA,xlim=c(min(years),max(years)),ylim=c(min(results_SSB)/1000,max(results_SSB)/1000),
xlab="",ylab="",las=1,xaxt="n")
for(i in seq_along(results_SSB_summary_mean[,1]))
{
if(results_summary_setup[i,"rt_mean"]==0.06){
lines(x=years,y=results_SSB_summary_mean[i,]/1000,col=cols[i])
}
}
plot(x=NA,y=NA,xlim=c(min(years),max(years)),ylim=c(min(results_SPR),max(results_SPR)),
ylab="SPR Ratio",xlab="",las=1,xaxt="n")
for(i in seq_along(results_SPR_summary_mean[,1]))
{
if(results_summary_setup[i,"rt_mean"]==0.01){
lines(x=years,y=results_SPR_summary_mean[i,],col=cols[i])
}
}
plot(x=NA,y=NA,xlim=c(min(years),max(years)),ylim=c(min(results_SPR),max(results_SPR)),
xlab="",ylab="",las=1,xaxt="n")
for(i in seq_along(results_SPR_summary_mean[,1]))
{
if(results_summary_setup[i,"rt_mean"]==0.03){
lines(x=years,y=results_SPR_summary_mean[i,],col=cols[i])
}
}
plot(x=NA,y=NA,xlim=c(min(years),max(years)),ylim=c(min(results_SPR),max(results_SPR)),
xlab="",ylab="",las=1,xaxt="n")
for(i in seq_along(results_SPR_summary_mean[,1]))
{
if(results_summary_setup[i,"rt_mean"]==0.06){
lines(x=years,y=results_SPR_summary_mean[i,],col=cols[i])
}
}
plot(x=NA,y=NA,xlim=c(min(years),max(years)),ylim=c(min(results_dep),max(results_dep)),
ylab="SSB Ratio (SSB/SSBunfished)",xlab="",las=1)
abline(h=0.4)
for(i in seq_along(results_dep_summary_mean[,1]))
{
if(results_summary_setup[i,"rt_mean"]==0.01){
lines(x=years,y=results_dep_summary_mean[i,],col=cols[i])
}
}
plot(x=NA,y=NA,xlim=c(min(years),max(years)),ylim=c(min(results_dep),max(results_dep)),
xlab="",ylab="",las=1)
abline(h=0.4)
for(i in seq_along(results_dep_summary_mean[,1]))
{
if(results_summary_setup[i,"rt_mean"]==0.03){
lines(x=years,y=results_dep_summary_mean[i,],col=cols[i])
}
}
plot(x=NA,y=NA,xlim=c(min(years),max(years)),ylim=c(min(results_dep),max(results_dep)),
xlab="",ylab="",las=1)
abline(h=0.4)
for(i in seq_along(results_dep_summary_mean[,1]))
{
if(results_summary_setup[i,"rt_mean"]==0.06){
lines(x=years,y=results_dep_summary_mean[i,],col=cols[i])
}
}
dev.off()
jpeg(paste0(DIR,"Summary_2.jpeg"),res=300,height=2400,width=2000)
par(mfrow=c(4,3),mar=c(2,4,2,1),oma=c(0.1,0.1,0.1,0.1))
plot(x=NA,y=NA,xlim=c(min(years),max(years)),ylim=c(min(results_recr)/1000,max(results_recr)/1000),
ylab="Recruitment (Millions of Fish)",xlab="",las=1,xaxt="n")
text(2047,max(results_recr)/1000*0.9,"True Future RTM mean=0.01",cex=1)
for(i in seq_along(results_recr_summary_mean[,1]))
{
if(results_summary_setup[i,"rt_mean"]==0.01){
lines(x=years,y=results_recr_summary_mean[i,]/1000,col=cols[i])
}
}
plot(x=NA,y=NA,xlim=c(min(years),max(years)),ylim=c(min(results_recr)/1000,max(results_recr)/1000),
xlab="",ylab="",las=1,xaxt="n")
text(2047,max(results_recr)/1000*0.9,"True Future RTM mean=0.03",cex=1)
for(i in seq_along(results_recr_summary_mean[,1]))
{
if(results_summary_setup[i,"rt_mean"]==0.03){
lines(x=years,y=results_recr_summary_mean[i,]/1000,col=cols[i])
}
}
plot(x=NA,y=NA,xlim=c(min(years),max(years)),ylim=c(min(results_recr)/1000,max(results_recr)/1000),
xlab="",ylab="",las=1,xaxt="n")
text(2047,max(results_recr)/1000*0.9,"True Future RTM mean=0.06",cex=1)
for(i in seq_along(results_recr_summary_mean[,1]))
{
if(results_summary_setup[i,"rt_mean"]==0.06){
lines(x=years,y=results_recr_summary_mean[i,]/1000,col=cols[i])
}
}
plot(x=NA,y=NA,xlim=c(min(years),max(years)),ylim=c(min(results_tbio)/1000,max(results_tbio)/1000),
ylab="Total Biomass (1000s metric tons)",xlab="",las=1,xaxt="n")
for(i in seq_along(results_tbio_summary_mean[,1]))
{
if(results_summary_setup[i,"rt_mean"]==0.01){
lines(x=years,y=results_tbio_summary_mean[i,]/1000,col=cols[i])
}
}
plot(x=NA,y=NA,xlim=c(min(years),max(years)),ylim=c(min(results_tbio)/1000,max(results_tbio)/1000),
xlab="",ylab="",las=1,xaxt="n")
for(i in seq_along(results_tbio_summary_mean[,1]))
{
if(results_summary_setup[i,"rt_mean"]==0.03){
lines(x=years,y=results_tbio_summary_mean[i,]/1000,col=cols[i])
}
}
plot(x=NA,y=NA,xlim=c(min(years),max(years)),ylim=c(min(results_tbio)/1000,max(results_tbio)/1000),
xlab="",ylab="",las=1,xaxt="n")
for(i in seq_along(results_tbio_summary_mean[,1]))
{
if(results_summary_setup[i,"rt_mean"]==0.06){
lines(x=years,y=results_tbio_summary_mean[i,]/1000,col=cols[i])
}
}
plot(x=NA,y=NA,xlim=c(min(years),max(years)),ylim=c(min(results_RTkillbio)/1000,8),
ylab="Red Tide Kill (Biomass, 1000s metric tons)",xlab="",las=1,xaxt="n")
for(i in seq_along(results_RTkillbio_summary_mean[,1]))
{
if(results_summary_setup[i,"rt_mean"]==0.01){
lines(x=years,y=results_RTkillbio_summary_mean[i,]/1000,col=cols[i])
}
}
plot(x=NA,y=NA,xlim=c(min(years),max(years)),ylim=c(min(results_RTkillbio)/1000,8),
xlab="",ylab="",las=1,xaxt="n")
for(i in seq_along(results_RTkillbio_summary_mean[,1]))
{
if(results_summary_setup[i,"rt_mean"]==0.03){
lines(x=years,y=results_RTkillbio_summary_mean[i,]/1000,col=cols[i])
}
}
plot(x=NA,y=NA,xlim=c(min(years),max(years)),ylim=c(min(results_RTkillbio)/1000,8),
xlab="",ylab="",las=1,xaxt="n")
for(i in seq_along(results_RTkillbio_summary_mean[,1]))
{
if(results_summary_setup[i,"rt_mean"]==0.06){
lines(x=years,y=results_RTkillbio_summary_mean[i,]/1000,col=cols[i])
}
}
plot(x=NA,y=NA,xlim=c(min(years),max(years)),ylim=c(min(results_Fexp),max(results_Fexp)),
ylab="Exploitation Rate (biomass)",xlab="",las=1)
for(i in seq_along(results_Fexp_summary_mean[,1]))
{
if(results_summary_setup[i,"rt_mean"]==0.01){
lines(x=years,y=results_Fexp_summary_mean[i,],col=cols[i])
}
}
plot(x=NA,y=NA,xlim=c(min(years),max(years)),ylim=c(min(results_Fexp),max(results_Fexp)),
xlab="",ylab="",las=1)
for(i in seq_along(results_Fexp_summary_mean[,1]))
{
if(results_summary_setup[i,"rt_mean"]==0.03){
lines(x=years,y=results_Fexp_summary_mean[i,],col=cols[i])
}
}
plot(x=NA,y=NA,xlim=c(min(years),max(years)),ylim=c(min(results_Fexp),max(results_Fexp)),
xlab="",ylab="",las=1)
for(i in seq_along(results_Fexp_summary_mean[,1]))
{
if(results_summary_setup[i,"rt_mean"]==0.06){
lines(x=years,y=results_Fexp_summary_mean[i,],col=cols[i])
}
}
dev.off()
###############################
# Individual Simulation Plots #
###############################