Introduction

This page has visualizations for the CCA model example, Atlantis Summit Common Scenario 1. For full explanation of methods, see the file linked at the beginning of each section.

Simulate a survey part 3: sample for length and age composition

Full methods are explained here.

The following settings should achieve a survey that samples all Atlantis model output timesteps, all fish and shark species, and all model polygons, with perfect efficiency and full selectivity for all ages:

# should return a perfectly scaled survey 
effic1 <- data.frame(species=funct.group.names,
                     efficiency=rep(1.0,length(funct.group.names)))

# should return all lengths fully sampled (Atlantis output is 10 age groups per spp)
# BUT CHECK if newer Atlantis models can do age-specific outputs
selex1 <- data.frame(species=rep(funct.group.names, each=10),
                     agecl=rep(c(1:10),length(funct.group.names)),
                     selex=rep(1.0,length(funct.group.names)*10))

# should return all model areas
boxpars <- load_box(d.name, box.file)
boxall <- c(0:(boxpars$nbox - 1))

# these are model specific, generalized above
# if(initCCA) boxall <- c(0:88) 
# if(initNEUS) boxall <- c(0:29)
# if(initNOBA) boxall <- c(0:59) 

# should return all model output timesteps; need to generalize
# if(initCCA) timeall <- c(0:100) 
# if(initNEUS) timeall <- c(0:251)
# if(initNOBA) timeall <- c(0:560) 

# generalized
runpar <- load_runprm(d.name, run.prm.file)
noutsteps <- runpar$tstop/runpar$outputstep
stepperyr <- if(runpar$outputstepunit=="days") 365/runpar$toutinc

timeall <- c(0:noutsteps)
  
# define set of species we expect surveys to sample (e.g. fish only? vertebrates?)
# for ecosystem indicator work test all species, e.g.
survspp <- funct.group.names 

# to keep plots simpler, currently hardcoded for vertebrate/fished invert groups
# if(initCCA) survspp <- funct.group.names[c(1:44, 59:61, 65:68)] 
# if(initNEUS) survspp <- funct.group.names[1:21]
# if(initNOBA) survspp <- funct.group.names[1:36]

# for length and age groups lets just do fish and sharks
# NOBA model has InvertType, changed to GroupType in file, but check Atlantis default
if(initNOBA) funct.groups <- rename(funct.groups, GroupType = InvertType)

survspp <- funct.groups$Name[funct.groups$IsTurnedOn==1 &
                           funct.groups$GroupType %in% c("FISH", "SHARK")]

#if(initCCA) survspp <- survspp[!survspp %in% "Pisciv_T_Fish"]

Here we use create_survey on the numbers output of run_truth to create the survey census of age and length composition.

Next, get true annual (cohort) age comp from this census survey based on run truth. (is there a standard Atlantis output I can compare this to as we did for biomass?)

Then we use the sample_fish function and compare to true annual age comp calculated above as a test. These should match. We show compositions sampled for the initial time step, a time step in the middle of the run, and the last timestep.

Most match, with some exceptions to be discussed with the regional model developers. Mismatches seem to happen later in this CCA run?