📓 Brandon et al. ICES J MAR SCI. 2017. Management strategy evaluation of the Potential Biological Removal (PBR) framework. PBR is used for managing rates of human caused mortality of marine mammals in U.S. commercial fisheries.
Fortran R
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
PBR Netbeans
LICENSE.md
README.md

README.md

Welcome to the PBR Tier System Code Repository


This repository currently includes Fortran 90/95 code for an age- and sex-structured operating model for the population dynamics of marine mammals. The operating model can mimick the dynamics of either a single stock, or two stocks of the same species which overlap spatially. A draft mathematical description of the full operating model is available here

This code allows for a tier system approach to management strategy evaluation. The PBR formula as evaluated by Wade (1998) makes use of only the most recent estimate of abundance, irrespective of its precision and the number of estimates available. A tier system would assign species or stocks to different tiers based on the availability and quality of data.

Ultimately, a tier system approach would serve to optimize available information for each stock. For example, preliminary research has indicated that the availability and use of multiple estimates of abundance leads to an ability to meet conservation management objectives, while also resulting in lower variability in PBR limits through time, relative to the current approach. Increased stability in PBR would likely reduce the economic uncertainty associated with human activities that are regulated according to this limit (e.g. commercial fisheries bycatch in the U.S.).

The Fortran code has been developed under Mac OS 10.9.5, using the free, open source, GNU Fortran 95 (gfortran) compiler. Cross-platform instructions are provided below for compiling the Fortran code using gfortran. Compiled executables for Mac OS X and Windows are available here.

Additionally, R code is provided which serves as a script to:

  • Automate the generation of input files for trials;
  • Batch multiple runs of simulation trials through shell commands;
  • Compile performance statistics across the batch, and;
  • Plot output.

Instructions for installing R are available here.

The Fortran and R code files are located in the PBR Netbeans folder. The README.md file in that folder contains an overview description of each code file and notes on running the R controller script.


Funding and Contributors

Funding for this project was provided by the U.S. Western Pacific Fisheries Management Council. Drs. John R. Brandon, André E. Punt (U.W.), Paula Moreno (U.S.M), and Randall R. Reeves (Okapi Wildlife Assoc.) are collaborators, working together as part of the Independent Advisory Team for Marine Mammal Assessment (IAT). The IAT was formed under the Science Center for Marine Fisheries, with the goal of developing research projects that serve to reduce uncertainty in marine mammal stock assessment. The Science Center is managed under the U.S. National Science Foundation's Industry and University Cooperative Research Program.


Cross-platform (Mac, Windows, Linux) Instructions for Compiling the Fortran Code

Compiling the Fortran code under Mac OS X

(1). Recent versions of Mac OS X may have the gfortran compiler pre-installed. You can check if your machine has this installed by opening the terminal and typing

gfortran --version

(2). If you see a message like the one below, your machine has gfortran installed, and you can skip to step 5 (noting step 3):

GNU Fortran (GCC) 4.2.3
Copyright (C) 2007 Free Software Foundation, Inc.

GNU Fortran comes with NO WARRANTY, to the extent permitted by law.
You may redistribute copies of GNU Fortran
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING

(3). If you get an error message (e.g. the gfortran command can not be found), try installing Apple's XCode command-line tools by typing:

xcode-select --install

(4). Then re-type the gfortran -v command. If that doesn't work, you'll need to install gfortran. Links and instructions can be found at: http://hpc.sourceforge.net/

(5). Assuming you have gfortran installed, the next step is to make sure that you are in the working directory with the Fortran files downloaded from this repository (e.g. ~/PBR-Tier-System-master/PBR Netbeans). You can use the cd terminal command to change directories.

cd Your-working-directory-here
# e.g.
# cd ~/PBR-Tier-System-master/PBR\ Netbeans

(6). Next, use this command to compile the Fortran code:

gfortran A_Random_module.f90 BRENT.f90 Declare_variables_module.f90 Eigen_module.f90 Generate_random_numbers_module.f90 Initialize_pop_module.f90 PBR_Errorcheck_module.f90 PBR_FileIO_Module.f90 PBR_calcs_module.f90 main.f90 -o main -fbounds-check -framework accelerate 

(7). Once everything compiles, you can run the program by typing:

./main

Compiling the Fortran code under Windows

Windows doesn't come with gfortran pre-installed. Nevertheless, it's worth double checking that it hasn't been installed at some point in the past (perhaps bundled-in with another installation).

(1). Open the command prompt and type:

gfortran --version

(2). If you see a message like the one below, your machine has gfortran installed, and you can skip to step 5:

GNU Fortran (GCC) 4.7 20111220 (experimental)
Copyright (C) Free Sofware Foundation, Inc.

(3). If you get an error message (e.g. the gfortran command can not be found), download MinGW from: http://sourceforge.net/projects/mingw

(4). Follow the installation steps in this video: https://www.youtube.com/watch?v=oVfAU1ziOjg

(5). Assuming you have gfortran installed, the next step is to make sure that you are in the working directory with the Fortran files downloaded from this repository (e.g. C:\PBR-Tier-System-master\PBR Netbeans). You can use the cd terminal command to change directories if you need.

cd Type-your-working-directory-here
# e.g.
# cd C:\PBR-Tier-System-master\PBR Netbeans

(6). Next, use this command to compile the Fortran code:

gfortran A_Random_module.f90 BRENT.f90 Declare_variables_module.f90 Eigen_module.f90 Generate_random_numbers_module.f90 Initialize_pop_module.f90 PBR_Errorcheck_module.f90 PBR_FileIO_Module.f90 PBR_calcs_module.f90 main.f90 liblapack.a libblas.a -o main 

(7). Once everything compiles, you can run the program by typing:

main

Compiling the Fortran code under Ubuntu Linux

(Thanks to Michael Mathews for his trouble-shooting help with Linux)

It has been reported that on Fedora, the Lapack and Blas packages only have the shared libraries (ie, *.so files), and to get the static libraries you will need to install lapack-static and blas-static. Also on a 64 bit Fedora install the libraries are in /usr/lib64 not /usr/lib.

The instructions below were tested on Ubuntu v14.04 running through Oracle VirtualBox Virtual Machine (v5.0.12) under Mac OS 10.11.

(1). Open the terminal and type:

gfortran --version

(2). If you see a message like the one below, your machine has gfortran installed, and you can skip to step 5:

GNU Fortran (Ubuntu 4.8.4-2ubuntu1~14.04) 4.8.4
Copyright (C) 2013 Free Software Foundation, Inc.

(3). If you get an error message (e.g. the gfortran command can not be found) type:

sudo apt-get install gfortran

(4). Assuming you now have gfortran installed, the next step is to check whether you have the LAPACK and BLAS libraries installed. If you have R installed, LAPACK and BLAS should be installed already in the /usr/lib/ directory. You can check by typing:

locate liblapack.a
locate libblas.a

If you see those files in the usr/lib/ directory, you can move on to the next step. Otherwise, you'll need to install LAPACK and BLAS. These libraries are available from: http://www.netlib.org/lapack

(5). Assuming you have gfortran, LAPACK and BLAS installed, make sure you are in the working directory with the Fortran files downloaded from this repository (e.g. ~/PBR-Tier-System-master/PBR Netbeans). You can use the cd terminal command to change directories if you need.

cd Type-your-working-directory-here
# e.g.
# cd ~/PBR-Tier-System-master/PBR Netbeans

(6). Next, use this command to compile the Fortran code:

gfortran A_Random_module.f90 BRENT.f90 Declare_variables_module.f90 Eigen_module.f90 Generate_random_numbers_module.f90 Initialize_pop_module.f90 PBR_Errorcheck_module.f90 PBR_FileIO_Module.f90 PBR_calcs_module.f90 main.f90 -o main -L/usr/lib/ -llapack -lblas 

(7). Once everything compiles, you can run the program by typing:

./main

Top


References

Wade, P. R. 1998. Calculating limits to the allowable human-caused mortality of cetaceans and pinnipeds. Marine Mammal Science, 14:1–37.


last updated: 2015 Jan

contact: jbrandon@gmail.com