Read the GMACS control file.
readGMACSctl(FileName = NULL, verbose = TRUE, DatFile = NULL, nyrRetro = NULL)(character string)- path (and name (e.g. snow.ctl)) of the control file
(logical)- (TRUE/FALSE); flag to print processing information
(list)- Object containing the .dat file - This is the output
of the readGMACSdat() function.
(integer)- Number of year for the retrospective analysis
A list with the content of the model.ctl file.
sourcefile - The file source.
Comments - Specifications about the GMACS version used and the stock
assessed.
ntheta - The number of key parameters control.
theta_control - The matrix pf teh key parameters control.
lw_type - The type of length-weight (LW) relationship.
lw_alfa - The alpha parameter of the LW relationship (if lw_type = 1).
lw_beta - The beta parameter of the LW relationship (if lw_type = 1).
mean_wt_in - The vector/matrix of mean weight-at-size (if lw_type = 2,3).
maturity - The proportion of mature at size by sex.
legal_maturity - The legal definition of the proportion of mature at size by sex.
Func_maturity_TermMolting - Use functional maturity for terminally molting animals?
bUseCustomGrowthMatrix - The selected option for the growth matrix.
bUseGrowthIncrementModel - The selected option for the growth increment model.
bUseCustomMoltProbability - The selected molt probability function.
bUseCustomMatureProbability - The selected option for the maturity probability
(only applicable if nmature = 2)
nSizeClassRec - The maximum size-class for recruitment
nSizeIncVaries - The number of size increment periods
iYrsSizeIncChanges - The year(s) for which the size increment change.
nMoltVaries - The number of molt periods.
iYrsMoltChanges - The year(s) for which molt change.
BetaParRelative - Are the beta parameters relative?
nMatureVaries - The number of maturity probability periods
iYrsMatureChanges - The year(s) for which maturity probability change.
nGrwth - The total number of growth parameters
(depends upon nSizeIncVaries).
nSizeIncPar - The number of size increment parameters.
Grwth_control - The matrix of growth controls.
MoltProb_control - The matrix of molting probability controls.
MatureProb_control - The matrix of mature probability controls.
CustomGrowthMatrix - The custom growth-increment matrix or size-transition
matrix.
CustomMoltProbabilityMatrix - The custom molt probability matrix.
slx_nsel_period_in - The number of selectivity time period per fleet.
slx_bsex_in - The number of sex specific selectivity.
slx_type_in - The sex-specific selectivity type.
slx_include_in - Is there any insertion of a fleet selectivity in another?
slx_extra_in - Extra parameter for each selectivity pattern.
ret_nret_period_in - The number of retention time period per fleet.
ret_bsex_in - The number of sex specific retention.
ret_type_in - The sex-specific retention type.
ret_extra_in - Extra parameter for each retention pattern.
slx_nret - Boolean for retention/discard.
slx_max_at_1_in - Is the selectivity for the maximum size class
forced to be 1?
slx_cols - The number of parameter required for each vulnerability pattern.
slx_npar - The number of parameter for each pattern of selectivity.
nslx_pars - The total number of vulnerability parameters.
Selex_control - the matrix of selectivity control.
Ret_control - The matrix of retention control.
NumAsympRet - The number of asymptotic vulnerability parameters.
AsympSel_control - The asymptotic parameter control.
nslx_envpars - The number of climate-driven selectivity parameters.
NSlx_devs_param - The number of parameters controlling selectivity deviations.
devParPhase - The estimation phase for the deviation parameter
(when a random walk is considered).
q_controls - The catchability control parameters.
add_cv_controls - Additional CV control parameters for catchability.
add_cv_links - Use of additional variance for each survey (0: ignore; >0 use).
f_controls - The fishing mortality control.
nAgeCompType - The size composition likelihood type.
bTailCompression - The auto tail compression specification.
nvn_ival - The initial value(s) for effective sample size.
nvn_phz - The phase of estimation for the effective sample size.
iCompAggregator - Should the data be aggregated?
lf_catch - The type of predictions for the size composition data (survey-like / catch-like)
lf_lambda - The lamdba for effective sample size.
lf_emphasis - The weight (lambda) for the overall likelihood
m_type - The type of natural mortality.
MrelFem- How does M for females relate to that for males (0 absolute; 1 relative)
Mdev_phz_def - The phase of estimation for natural mortality.
m_stdev - The standard deviation used in the natural mortality deviations.
m_nNodes_sex - The sex-specific number of nodes in natural mortality.
m_nodeyear_sex - The sex-specific years for nodes in natural mortality.
nSizeDevs - The number of breakpoints in natural mortality by size class.
m_size_nodeyear - The specific years for the deviations (blocks) in
natural mortality by size class.
Init_Mdev - Use a specific initial value for natural mortality deviations?
nMdev - The number of natural mortality deviations.
Mdev_controls - Natural mortality deviation control.
tag_emphasis - The emphasis (weight) for the tagging likelihood.
m_maturity - Is there any maturity-specific natural mortality?
m_mat_controls - Immature/mature natural mortality control if any.
rdv_syr - The first year of recruitment estimation deviations.
rdv_eyr - The last year of recruitment estimation deviations.
Term_molt - Consider terminal molting in the model?
rdv_phz - The phase for recruitment estimation.
rec_prop_phz - The phase for recruitment sex-ratio estimation.
init_sex_ratio - The initial value for expected sex-ratio.
rec_ini_phz - The phase for initial recruitment estimation.
bInitializeUnfished - The specification for the initial conditions
(unfished, steady-state, free params, free params revised)
spr_lambda - The proportion of mature male biomass for SPR reference points.
nSRR_flag - The stock-Recruit-Relationship (none, Beverton-Holt)
BRP_rec_sexR - Use years specified to computed average sex ratio in
the calculation of average recruitment for reference points.
NyrEquil - The year to compute equilibrium.
catch_emphasis - The weight on catch for the likelihood component.
Penalty_fdevs - Penalties on deviations.
Penalty_emphasis - Penalties on priors
eof - Logical indicating the end of the file (used for checking the reading).
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
)
}