atlantisfmsy_simu: Fmsy estimation in Atlantis ecosystem model.

View source: R/atlantisfmsy_simu.R

atlantisfmsy_simuR Documentation

Fmsy estimation in Atlantis ecosystem model.

Description

Run set of simulations to estimate Fmsy in an Atlantis model for a specific functional group. See Atlantis website for more information on the ecosystem model (https://research.csiro.au/atlantis/, 03/01/2018). The iterative simulations protocole to find Fmsy was defined by Dr. E.A. Fulton (CSIRO) for the IndiSeas project (http://www.indiseas.org/, accessed 03/01/2018). It is designed first to gradualy increase F for a particular functional group in the model up to the collapse of the stock. Then, it narrows down the value of Fmsy (in y-1) with a precision of two decimals. To do so, it copies/pastes all the files necessary to run the calibrated model into a seperate directory and then modifies the parameter files in this directory before each simulation. @section Warning: At the moment, the package is not designed to run on OSX, it only works on Linux and Windows (To run on OSX these functions need to be modified: atlantisfmsy_simu, atlantisfmsy_restart, atlantisfmsy_modelcopy, atlantis_bachchange, and atlantis_paraselect). As well if you are not providing the name of your bach/shell file, this package required that only one batch/shell file is in the model directory (if more than one batch/shell files are present please remove them, leave only the one used to run the calibrated model).

Usage

atlantisfmsy_simu(
  func_grp,
  folder_path,
  model_path,
  exe_name,
  burnin_time,
  fmax,
  save_time = NULL,
  batch_file = NULL,
  fmin = NULL,
  restart = 0
)

Arguments

func_grp

The code of the Atlantis functional group for which Fmsy will be estimated.

folder_path

The working directory: where the Fmsy simulations will be run and stored.

model_path

The directory of the calibrated model (containing all the parameters files and one bach file. Forcing files can be stored in a direct parent directory of model_path). WARNING: Only working if the forcing folder is in the main model directory model_path or if it is in the direct parent directory. If not please either modify this package or modify the path structure of your Atlantis input forcing parameters file.

exe_name

The name of the atlantis executable you used (ex: atlantismain, atlantisNew).

burnin_time

The time in days needed for the model to pseudo-stabilize before starting the additional 30 years of simulation.

fmax

The maximal value of F the simulation is going to test in y-1. WARNING: only work if fmax < 10 y-1 (see atlantis_bachchange).

save_time

The number of days to save from the end of the simulation. Be aware that in case of Fmsy estimation you need to save at least the last 5 years.Default: NULL.

batch_file

The name of the batch/shell file with extension you are using to run your model. If not provided, the function will search for the unique batch file in your folder_path. Default: NULL.

fmin

The minimum value of F to test in y-1 (only used when the simulation are restarted after an interruption). The default value is NULL.

restart

a flag indicating if the simulation is restarted from an interruption or not and if the first set of simulation have been completed or not. The default value is 0. Mainly used by atlantisfmsy_restart.

Value

fmsy The dataframe containing all the values of F (sum of mFC parameter value in y-1) tested and the average yearly catch of the 5 last years of simulation. As well, a message with the Fmsy value for the Atlantis functional group considered is printed and all the simulation necessary to estimate the Fmsy are stored in the folder_path.

See Also

atlantis_checkmodule to check if all the modules are on (physics, biology, and fishery), atlantis_fgrpon to check if the functional group is active, atlantis_fgrpimp to check if the functional group is fished and impacted, atlantis_paraselect for parameters file selection, atlantis_fleetopen to check if fleets are active, atlantis_checkf to check the formulation of the fishing pressure used (i.e. F, effort, dynamics model...), atlantis_fdistri to extract the distribution of fishing pressure amongst fleets, atlantisfmsy_inisimu to initialize and run the first set of simulations, atlantisfmsy_fmaxcatch to find the F with most important catch and set the two next F to be tested, atlantisfmsy_completion to check if Fmsy has been reached, atlantis_fchange to change the value of F, atlantis_bachchange to change the name of output files, str_split_fixed to split a chain of characters, ex_number to extract number from a chain of characters, nc_open to open netCDF4 files, ncvar_get to extract variables from netCDF4 files, nc_close to close netCDF4 files, and read.table to open table stored in text files (.txt, .csv ...).

Examples

atlantisfmsy_simu("COD", "C:/Atlantis/AtlantisEEC/Fmsy",
                  "C:/Atlantis/AtlantisEEC/AtlantisEECF_v3",
                  "atlantismain", 7300, 4, "runAtlantis.bat")
atlantisfmsy_simu("COD", "/home/Atlantis/AtlantisEEC/Fmsy",
                  "/home/Atlantis/AtlantisEEC/AtlantisEECF_v3",
                  "atlantisNew", 7300, 4, "runAtlantis.sh")

## Not run: atlantisfmsy_simu("COD", "C:/Atlantis/AtlantisEEC/Fmsy",
                           "C:/Atlantis/AtlantisEEC/AtlantisEECF_v3",
                           "atlantismain", 7300, 10, "runAtlantis.bat")
## End(Not run)
## Not run: atlantisfmsy_simu("COD", "/home/Atlantis/AtlantisEEC/Fmsy",
                           "/home/Atlantis/AtlantisEEC/AtlantisEECF_v3",
                           "atlantisNew", 7300, 10, "runAtlantis.sh")
## End(Not run)

rgirardi/atlantisfmsy documentation built on Aug. 30, 2022, 9:11 a.m.