This functions reads the gmacs.rep file (report file) as a named list within R.

readGMACSrep(
  FileName = NULL,
  verbose = TRUE,
  DatFile = NULL,
  CtlFile = NULL,
  nyrRetro = NULL
)

Arguments

FileName

(character string)- path (and name (e.g. gmacs.rep)) of the report file

verbose

(logical)- (TRUE/FALSE); flag to print processing information

DatFile

(list)- Object containing the .dat file - This is the output of the readGMACSdat() function.

CtlFile

(list)- Object containing the .ctl file - This is the output of the readGMACSctl() function.

nyrRetro

(integer)- Number of year for the retrospective analysis

Value

the gmacs.rep file as a named list.

  • sourcefile - The file source.

  • log_q_catch - The estimated catchability (log space).

  • sdnr_MAR_cpue - The survey-specific standard deviation and median.

  • sdnr_MAR_lf - The standard deviation and median for each size composition data.

  • Francis_weights - The Francis weights.

  • slx_capture - The capture selectivity.

  • slx_retaind - The probability of retention.

  • slx_discard - The probability of discard.

  • Selectivity - The size-specific selectivity for the capture, retained and discards.

  • retained - The first and last year probability of retention by size class.

  • Growth_matrix - The sex-specific growth transition matrix.

  • 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.

  • spr_fofl - The fishing mortality relative to MSY for the OFL.

  • spr_cofl_ret - The retained portion of the OFL.

  • spr_yield - The yield summary (SSB/SSB_F0; SSB/spr_Bmsy; Fbar; OFL).

  • Catches_like - The likelihood for each catch data frame.

  • Index_like - The likelihood for each survey data frame.

  • Size_comp_like - The likelihood for each size composition data frame.

  • Recruit_pen - The recruitment penalties.

  • Growth_like - The likelihood for the growth data.

  • MeanF_pen - The penalty for the mean fishing mortality.

  • MeanF_dev - The penalty for the fishing mortality deviations.

  • M_devs - The penalty for the natural mortality.

  • Rec_ini - The penalty for the initial recruitment.

  • Rec_dev - The penalty for the recruitment deviations.

  • Sex_ratio - The penalty for the sex-ratio.

  • Molt_prob_smooth - The penalty for the smoother of the probability of molting.

  • Free_sel_smooth - The penalty for the smoother of selectivity (when the parameters are freely estimated).

  • Initial_estimated_numbers_at_length - The penalty for the initial number at length.

  • Fdevs (flt) - The penalty for the male fishing mortality deviations.

  • Fdovs (flt) - The penalty for the female fishing mortality deviations.

Examples

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 gmacs.par file ----
repfile  <- readGMACSrep(
FileName = file.path(Dir_Dvpt_Vers, "build", stock, "gmacs.rep", fsep = fsep),
verbose = TRUE,
DatFile = datFile,
CtlFile = ctlFile,
nyrRetro = GMACSdat$N_Year_Retro
)
}