Hi Iago,
The units can definitely be confusing. The values in CATCH_AT_AGE are in 1000s of numbers. Or more specifically, they are in numbers multiplied by the ratio of the input catch from the data file (typically tons) to the units of the weight defined by the biology parameters, which are (typically kilograms).
So to get what you want, it seems you just need to multiply CATCH_AT_AGE by 1000.
Some R code below confirms that multiplying each value from CATCH_AT_AGE by the appropriate weight at age for each morph (different birth season) gets you back to the input catch value for a single year/fleet/season combination.
# read model output (without having downloaded covar or forecast files)
i1 <- SS_output('c:/SS/Iago/Oct3_forums_issue', covar=FALSE, forecast=FALSE)
# subset catch-at-age table for 2014, fleet 1, season 4
catch2014flt1seas4 <- i1$catage[i1$catage$Yr==2014 &
i1$catage$Fleet==1 &
i1$catage$Seas==4,]
# repeat of numbers matrix, with numeric columns replaced by NA
catch2014flt1seas4.bio <- catch2014flt1seas4
catch2014flt1seas4.bio[,names(catch2014flt1seas4.bio) %in% 0:14] <- NA
# table with weight at age values by morph
growth <- i1$endgrowth
# loop over morphs and ages to calculate catch at age in biomass
for(Morph in 1:8){
for(age in 0:14){
# catch in numbers for each Morph/age combination
num <- catch2014flt1seas4[catch2014flt1seas4$Morph==Morph,
names(catch2014flt1seas4) == age]
# retained weight at given age for fleet 1 in season 4
# (weight at age depends on fleet-specific length-based selectivity)
wt <- growth$"RetWt:_1"[growth$Seas==4 &
growth$Morph==Morph &
growth$Age==age]
# catch in biomass (1000s of numbers by weight in kg produces tons)
catch2014flt1seas4.bio[catch2014flt1seas4.bio$Morph==Morph,
names(catch2014flt1seas4.bio) == age] <- num*wt
}
}
# sum the value calculated above across morphs and ages
sum(catch2014flt1seas4.bio[,names(catch2014flt1seas4.bio) %in% 0:14])
# [1] 2808
# catch value from time series for fleet 1, year 2014, season 4
i1$timeseries$"dead(B):_1"[i1$timeseries$Yr==2014 &
i1$timeseries$Seas==4]
# [1] 2808