Closed cddesja closed 8 years ago
My plots are fine given the output. However, will convert biomass in tons to number of YOY recruits. Using:
yoy_mg_N = (yoy_biom * 50000000.0 / X_CN)
you_nums = you_mg / (KWRR + KWSR)
@erlasturl - Is this something you want? Otherwise, I'm going to close this. It would be easy enough to implement.
These numbers look very strange (extremely small) when I use this calculation. I have code in create_vadt.R to do this but it's presently commented out. If this is something someone is interested in then I'll reopen it.
I would like to have the numbers of YOY but I think the calculations should be different.
The YOY output is in tonnes wet weight (I think) so we need to convert the KWRR and KWSR to tonnes wet weight.
Rec_w = (KWRR +KWSR )_5.7_20/1000000000
Rec_N = YOY tonnes/Rec_w
Connected to this I think it would be ok to take out the last plot in age disaggregated, the one that says recruits because it really is just ageclass 1
OK. Is Rec_N recruitment numbers or nitrogen?
I agree about the last plot.
Rec_N is recruitment numbers
^^^ For FCD. Based on
# fixed: yoy as number of individuals
colnames(yoy)[2:length(names(yoy))] <- str_split_fixed(names(yoy)[2:length(names(yoy))], pattern = '.0', n = 2)[,1]
kwrr <- grep("KWRR", biolprm, value = T)
kwrr_split <- unlist(str_split_fixed(kwrr, pattern = ' ', n = 2))
kwrr_split <- apply(kwrr_split,2, str_trim, side = "both")
kwrr_group <- str_split_fixed(kwrr_split[,1], pattern = '_', n = 2)[,2]
kwrr_param <- str_split_fixed(kwrr_split[,2], pattern = ' ', n = 2)[,1]
kwsr <- grep("KWSR", biolprm, value = T)
kwsr_split <- unlist(str_split_fixed(kwsr, pattern = ' ', n = 2))
kwsr_split <- apply(kwsr_split,2, str_trim, side = "both")
kwsr_group <- str_split_fixed(kwsr_split[,1], pattern = '_', n = 2)[,2]
kwsr_param <- str_split_fixed(kwsr_split[,2], pattern = ' ', n = 2)[,1]
kwrr <- data.frame(group = kwrr_group, kwrr_param)
kwsr <- data.frame(group = kwsr_group, kwsr_param)
kwrr_kwsr_params <- merge(kwrr, kwsr)
kwrr_kwsr_params$total <- as.double(as.character(kwrr_kwsr_params$kwrr_param)) + as.double(as.character(kwrr_kwsr_params$kwsr_param))
## Erla Calculations
kwrr_kwsr_params$total <- kwrr_kwsr_params$total * 5.720 / 1000000000
for(i in 2:ncol(yoy)){
findColumn <- kwrr_kwsr_params$group == names(yoy)[i]
yoy[, i] <- yoy[,i] / kwrr_kwsr_params$total[findColumn]
}
This look OK? Note, I'm using a very old Iceland model.
I am going to assume this fixes things @erlasturl. If not, let me know.
The YOY biomass plot looks very strange. Either it's something wrong with Atlantis code or my code.