This functions reads the gmacsall.out file as a named list within R.
readGMACSallOUT(
FileName = NULL,
verbose = TRUE,
DatFile = NULL,
CtlFile = NULL,
GmacsFile = NULL,
nyrRetro = NULL
)(character string)- path and name (by default, gmacsAll.out) of the file to read.
(logical)- (TRUE/FALSE); flag to print processing information
(list)- Object containing the .dat file - This is the output
of the readGMACSdat() function.
(list)- Object containing the .ctl file - This is the output
of the readGMACSctl() function.
(list)- Object containing the gmacs.dat file - This is the output
of the readGMACS.dat() function.
(integer)- Number of year for the retrospective analysis
the gmacsall.out file as a named list.
sourcefile - The file source.
Comments - Specifications about the GMACS version used and the stock
assessed.
Stock_info - A named list with information relative to the stock assessed.
Objects are the following:
Stock - The name of the stock assessed.
Year_range - The start and end year of the assessment.
Number_of_seasons - The number of season.
Number_of_fleets - The number of fleet.
Fleets - The names of the fleets (fishing and surveys).
Number_of_sexes - The number of sex.
Number_of_shell_conditions - The number of shell conditions.
Number_of_maturity_states - The number of maturity states.
Weight_unit_is - The unit for weight.
Numbers_unit_is - The unit for numbers.
Lik_type - The likelihood for each data component (raw and weighted).
Penalties - The total penalties.
Priors - The likelihood for priors.
Initial_size_structure - The likelihood for the initial size
composition.
Total - The total likelihood.
Lik_type_fleet - The likelihood (raw, emphasis, net) for each data source
including recruitment (deviations and sex-ratio).
Penalties_type - The Penalties and emphasis for each "priors".
Maximum_gradient - The maximum gradient.
Param - A named list with the estimated parameters. Objects are the following:
theta - The key parameter controls (core parameters - theta parameters).
Grwth - The growth parameters.
Vul - The vulnerability (selectivity and retention) parameters.
Envpar_Slx - The environmental-linked selectivity parameters.
Slx_Devs - The selectivity deviations.
Fbar - The mean fishing mortality parameters.
Fdev - The fishing fleet-specific weights for male.
Foff - The female fishing mortality offset to male F.
Fdov - The fishing fleet-specific weights for female.
rec_ini - The initial recruitment by size-class.
rec_dev_est - The year-specific recruitment deviations.
logit_rec_prop_est - The year-specific sex-ratio recruitment.
Mdev - The natural mortality deviation.
EffSamp_size - The effective sample size.
survey_Q - The survey-specific catchability.
log_add_cvt - The survey-specific additional CV.
Management_Quantities - The estimated management quantities
(SPR; MSY, OFL, ...) and recruitment.
Overall_Summ - Overall summary per year (SSB, SSA, Dynamic B0,
Recruitment, mortality, ...).
mean_weight - The sex-specific mean weight per size-class for
each year and the mid-point used in the model.
maturity - The sex-specific proportion of mature per size-class.
dCatchData - The catch data with predicted values.
log_q_catch - The estimated catchability (log space).
dSurveyData - The survey data with predicted values.
sdnr_MAR_cpue - The survey-specific standard devaiation and median.
Size_fit_summary - The summary of size-specific fit for each fleet.
sdnr_MAR_lf - The standard deviation and median for each size composition data.
Francis_weights - The francis weights.
Selectivity - The size-specific selectivity for the capture, retained and discards.
Select_control - The selectivity controls.
m_prop - The proportion of natural mortality per season and year.
M_size_class - The sex- and mature-state specific natural mortality
per size-class for each year.
Fully_selected_fishing_F_Fl_Yr_Sex - The sex-specific fully-selected
fishing mortality for each season and each year.
Fully_F - The fully-selected fishing mortality for each fleet.
F_SizeC_Continuous - The fully-selected fishing mortality by
size class (continuous).
F_SizeC_Discrete - The fully-selected fishing mortality by
size class (discrete).
TotMorta_SizeC_Continuous - The total mortality by size class
(continuous).
TotMorta_SizeC_Discrete - The total mortality by size class (discrete).
N_at_size - The matrix of number-at-size.
molt_probability - The sex-specific probability of molting
for each year by size class.
Growth_transition_Matrix - The sex-specific growth transition matrix.
Size_transition_Matrix - The sex-specific size transition matrix.
fhitfut - A season-specific matrix for F by fleet.
spr_syr - The first year for computing Rbar.
spr_nyr - The last year for computing Rbar.
spr_rbar - The mean recruitment for SPR calculation.
proj_rbar - The mean recruitment for the projections.
spr_sexr - The sex-ratio for SPR calculation.
SR_alpha_prj - The alpha parameter of the stock recruitment
relationship used in the projections.
SR_beta_prj - The beta parameter of the stock recruitment
relationship used in the projections.
spr_fofl - The fishing mortality relative to MSY for the OFL.
spr_cofl_ret - The retained portion of the OFL.
nloglike - A list containing the negative log-likelihood for all
data sources (catch, survey, size composition, growth data (tagging data),
and recruitment)
nlogPenalty - The log penalties.
priorDensity - The values of the prior densities.
if (FALSE) {
# Stock ----
stock <- "SNOW_crab"
# GMACS input files ----
datfileName <- "snow_21_M09.dat"
ctlfileName <- "snow_21_M09.ctl"
# read gmacs.dat ----
fileName <- "gmacs.dat"
fileName <- file.path(dir_Base, stock, fileName, fsep = fsep)
GMACSdat <- readGMACS.dat(path = fileName, verbose = TRUE)
# Read the data file ----
datFile <- file.path(dir_Base, stock, datfileName, fsep = fsep)
datFile <- readGMACSdat(FileName = datFile, verbose = T)
# Read the control file ----
ctlFile <- file.path(dir_Base, stock, ctlfileName, fsep = fsep)
ctlFile <- readGMACSctl(
FileName = ctlFile,
verbose = T,
DatFile = datFile,
nyrRetro = GMACSdat$N_Year_Retro
)
# Read the Gmacsall.out file ----
GMACSalloutfile <-
readGMACSallOUT(
FileName = file.path(Dir_Dvpt_Vers, "build", stock, "Gmacsall.out", fsep = fsep),
verbose = TRUE,
DatFile = datFile,
CtlFile = ctlFile,
GmacsFile = GMACSdat,
nyrRetro = GMACSdat$N_Year_Retro
)
}