Biome4
Introduction
Installation
Install Netcdf
According to the website biome4 needs netcdf 3.X to work however netcdf 4.7.4 has been tested and everything seemed to work.
Install from Package Manager
On Macs newer than Mojave you can use brew. On Unix based systems you should also be able to do something similar:
- Mac
brew install netcdf
- Unix
apt install libnetcdf-dev libnetcdff-dev
- Windows ??
Source
You will need to compile:
- HDF5 (working)
- NetCDF c (working)
- NetCDF Fortran (not working)
You can also recompile the packages from Source if your system is not supported.
HDF5 (needed by NetCDF)
Do this from some directory where you want to keep the source files.
-
mkdir hdf5 & cd hdf5
curl https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.12/hdf5-1.12.0/src/hdf5-1.12.0.tar.gz -o hdf5.tar.gz
tar -xvzf hdf5.tar.gz
cd hdf5-1.12.0
./configure --prefix=/usr/local/hdf5 --with-zlib
make
make install
If `make install` fails with Permssion denied:
- Create the folder (using sudo)
- Claims writes `chown YOUR_USERNAME FOLDERNAME`
NetCDF-C
-
Go to Source dir (
cd ../..
normally?) and runmkdir netcdf & cd netcdf
curl -L https://github.com/Unidata/netcdf-c/archive/v4.7.4.tar.gz -o netcdf.tar.gz
tar -xvzf netcdf.tar.gz
cd netcdf-c-4.7.4
CPPFLAGS=-I/usr/local/hdf5/include LDFLAGS=-L/usr/local/hdf5/lib ./configure --prefix=/usr/local/netcdf --enable-remote-fortran-bootstrap
make install
If `make install` fails with Permssion denied:
- Create the folder (using sudo)
- Claims writes `chown YOUR_USERNAME FOLDERNAME`
NetCDF Fortran
- `make build-netcdf-fortran`
- `make install-netcdf-fortran`
You will need git for this to work the easiest way to do this on Mac is to install xcode.
If you get an error about git and it is installed check line 23 `/dev/null1` doesn't seem to work on Mac you will need to replace it with `/dev/null`
Add the /usr/local/netcdf/bin
to your ~/.bashrc or ~/.zshrc to make netcdf executables availible everywhere
Biome4
From Source directory
See here for bug online / doc.
mkdir biome4 && cd biome4
curl https://pmip2.lsce.ipsl.fr/share/synth/biome4/biome41.tar.gz -o biome4.tar.gz
tar -xvzf biome4.tar.gz
make clean
- replace value after NETCDFINCDIRr with value from
nc-config --includedir
- replace
NETCDFLIB = -lnetcdff -lnetcdf
- replace NETCDFLIBDIR with the value from
nc-config --libdir
- replace
FC=g77
withFC=gfortran
(please install before hand should be with xcode) - remove
-fno-silent
from FFLAGS (If problem with Rank Mismatch try adding-fallow-argument-mismatch
to FFLAGS) - Edit biome4.f line 250 and replace with: ` write(*,’(A,2F7.2,3F7.1)’)`