Training: Calibrating Atlantis using calibrar
A Puget Sound example
Alaia Morell
October 2025
atlantis2ls
Ressources
https://github.com/roliveros-ramos/calibrar
- Package that connects Atlantis and calibrar:
https://github.com/alaiam/atlantis2ls
- AMPS calibration without fisheries:
Training organization
Adapted from Oliveros-Ramos and Shin 2025
1
Adapted from Oliveros-Ramos and Shin 2025
atlantis2ls
1
2
Adapted from Oliveros-Ramos and Shin 2025
1
2
3
Adapted from Oliveros-Ramos and Shin 2025
1
2
4
3
Adapted from Oliveros-Ramos and Shin 2025
1
2
4
3
5
Adapted from Oliveros-Ramos and Shin 2025
1
2
6
4
3
5
6
6
Adapted from Oliveros-Ramos and Shin 2025
1
2
7
6
4
3
5
6
6
Adapted from Oliveros-Ramos and Shin 2025
II. A calibration repository: the Puget Sound example
A calibration repository
https://github.com/alaiam/Atlantis_Calibration
A calibration repository
https://github.com/alaiam/Atlantis_Calibration
1
2
3
4
5
6
7
1
2
7
6
4
3
5
6
6
1) The model
1
A folder that holds the configuration file:
This is the folder that will be copied for each simulation.
Recommandation:
The heavy files (initial conditions, forcing files…) can be stored outside the configuration files.
https://github.com/alaiam/Atlantis_Calibration
1) The model
The model configuration is going to be duplicated X times and each duplicata will be a simulation with a different comination of parameters
https://github.com/alaiam/Atlantis_Calibration
2) The data
2
A folder that holds the data file.
Recommandation:
One file per data type
https://github.com/alaiam/Atlantis_Calibration
2) The data
A file format:
Two columns (Time, Varid)
Row = N (User defined)
Here, N = 2. The data are confronted to the model for 2 timesteps
https://github.com/alaiam/Atlantis_Calibration
2) The data
A file format:
Two columns (Time, Varid)
Row = N (User defined)
Here, N = 2. The data are confronted to the model for 2 timesteps
Varid defined in setting files (see « 3) The objective function »)
https://github.com/alaiam/Atlantis_Calibration
3) The objective function
3
The csv file that collects the information to build the objective function.
A csv file that lists all your data, the type of data, the function to compare to data, the weight.
https://github.com/alaiam/Atlantis_Calibration
3) The objective function
https://github.com/alaiam/Atlantis_Calibration
3) The objective function
Variable name (used in « 5 - Run model function »)
https://github.com/alaiam/Atlantis_Calibration
3) The objective function
Function to compare observed and simulated data
https://github.com/alaiam/Atlantis_Calibration
3) The objective function
Function to compare observed and simulated data
https://github.com/alaiam/Atlantis_Calibration
3) The objective function
https://github.com/roliveros-ramos/calibrar/blob/master/R/calibraR-fitness.R
https://github.com/alaiam/Atlantis_Calibration
3) The objective function
Include in the objective function estimation
https://github.com/alaiam/Atlantis_Calibration
3) The objective function
Weight of this data
https://github.com/alaiam/Atlantis_Calibration
3) The objective function
Include in the outputs
Recommandation: Use false to calibrate and use data coherently
https://github.com/alaiam/Atlantis_Calibration
3) The objective function
Path to data (relative path from the roots of the project)
https://github.com/alaiam/Atlantis_Calibration
3) The objective function
Varid needs to be consistent with data column name (see « 2) The data) »
https://github.com/alaiam/Atlantis_Calibration
4) The parameters
4
https://github.com/alaiam/Atlantis_Calibration
4) The parameters
https://github.com/alaiam/Atlantis_Calibration
4) The parameters
Parameter name
https://github.com/alaiam/Atlantis_Calibration
4) The parameters
Parameter initial guess
https://github.com/alaiam/Atlantis_Calibration
4) The parameters
Parameter minimal bound
https://github.com/alaiam/Atlantis_Calibration
4) The parameters
Parameter maximal bound
https://github.com/alaiam/Atlantis_Calibration
4) The parameters
Parameter phase of calibration
For Atlantis, recommandation = 1
https://github.com/alaiam/Atlantis_Calibration
4) The parameters
Parameter name:
Species_Parameter-type_Transformation
https://github.com/alaiam/Atlantis_Calibration
5) Run Model function
5
https://github.com/alaiam/Atlantis_Calibration
5) Run Model function
A function divided in three parts:
https://github.com/alaiam/Atlantis_Calibration
5) Run Model function
1) The parameter modification: example with « mum »
https://github.com/alaiam/Atlantis_Calibration
5) Run Model function
1) The parameter modification: example with « mum »
2 biological prm files in the simulation folder: the inital before modification and the one with modifications (bio.prm).
.sh needs to call « bio.prm »
https://github.com/alaiam/Atlantis_Calibration
5) Run Model function
2) The Atlantis run
https://github.com/alaiam/Atlantis_Calibration
5) Run Model function
3) The processing of the outputs
https://github.com/alaiam/Atlantis_Calibration
5) Run Model function
3) The processing of the outputs: useful tip if the simulation did not finish
https://github.com/alaiam/Atlantis_Calibration
6) The calibrate script
6
https://github.com/alaiam/Atlantis_Calibration
6) The calibrate script
A script divided in four parts:
https://github.com/alaiam/Atlantis_Calibration
6) The calibrate script
1) Importation of the information
https://github.com/alaiam/Atlantis_Calibration
6) The calibrate script
2) The controls
This part of the script controls calibration options
https://github.com/alaiam/Atlantis_Calibration
6) The calibrate script
3) The cluster management
https://github.com/alaiam/Atlantis_Calibration
6) The calibrate script
4) Run the calibration
https://github.com/alaiam/Atlantis_Calibration
6) The calibrate script
4) Run the calibration
The parameter information
https://github.com/alaiam/Atlantis_Calibration
6) The calibrate script
4) Run the calibration
The objective function information
https://github.com/alaiam/Atlantis_Calibration
6) The calibrate script
4) Run the calibration
The objective algorithm information
https://github.com/alaiam/Atlantis_Calibration
7) The outputs of the calibration
7
https://github.com/alaiam/Atlantis_Calibration
III. Alternative calibration options
(advance training)
3) The objective function
https://github.com/alaiam/Atlantis_Calibration
Other options for the objective function are available in calibrar and are displayed at this link: https://github.com/roliveros-ramos/calibrar/blob/master/R/calibraR-fitness.R
It includes distribution that are normal, lognormal, poisson, multinomial…
Additional function can be added. For example:
3) The objective function
Weight of this data
https://github.com/alaiam/Atlantis_Calibration
Should inversely proportionnal to the uncertainty
2) The data
https://github.com/alaiam/Atlantis_Calibration
1200.5
Stable state
Annual variability
2) The data
https://github.com/alaiam/Atlantis_Calibration
Other type of data can be added:
4) The parameters
Adding a new parameters only requires a new function to modify the prm files
https://github.com/alaiam/Atlantis_Calibration
6) The calibrate script
4) Run the calibration
https://github.com/alaiam/Atlantis_Calibration
methods = c("L-BFGS-B", "nlminb", "Rcgmin", "Rvmmin",
"hjn", "spg", "LBFGSB3", "CMA-ES", "genSA", "DE", "soma", "genoud", "PSO",
"hybridPSO", "mads", "hjkb", "nmkb", "bobyqa", "AHR-ES", "Nelder-Mead",
"CG", "BFGS", "SANN")
Other calibration algorithms are available in the function calibrate (argument « method »).
AHR-ES and Rvmmin are the two methods recommended for Atlantis. For now, this two methods only can record a restart between iterations, which is highly recommended in the case of a long run.
After empirical test, AHR-ES is the most recommended option.