Biome4

1 minute read

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.

  1. mkdir hdf5 & cd hdf5

  2. 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
  3. tar -xvzf hdf5.tar.gz
  4. cd hdf5-1.12.0
  5. ./configure --prefix=/usr/local/hdf5 --with-zlib
  6. make
  7. make install
If `make install` fails with Permssion denied:
  1. Create the folder (using sudo)
  2. Claims writes `chown YOUR_USERNAME FOLDERNAME`
Run `make install`

NetCDF-C

  1. Go to Source dir (cd ../.. normally?) and run mkdir netcdf & cd netcdf

  2. curl -L https://github.com/Unidata/netcdf-c/archive/v4.7.4.tar.gz -o netcdf.tar.gz
  3. tar -xvzf netcdf.tar.gz
  4. cd netcdf-c-4.7.4
  5. CPPFLAGS=-I/usr/local/hdf5/include LDFLAGS=-L/usr/local/hdf5/lib ./configure --prefix=/usr/local/netcdf --enable-remote-fortran-bootstrap
  6. make install
If `make install` fails with Permssion denied:
  1. Create the folder (using sudo)
  2. Claims writes `chown YOUR_USERNAME FOLDERNAME`
Run `make install`

NetCDF Fortran

  1. `make build-netcdf-fortran`
  2. 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`
  3. `make install-netcdf-fortran`

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.

  1. mkdir biome4 && cd biome4
  2. curl https://pmip2.lsce.ipsl.fr/share/synth/biome4/biome41.tar.gz -o biome4.tar.gz
  3. tar -xvzf biome4.tar.gz
  4. make clean
  5. replace value after NETCDFINCDIRr with value from nc-config --includedir
  6. replace NETCDFLIB = -lnetcdff -lnetcdf
  7. replace NETCDFLIBDIR with the value from nc-config --libdir
  8. replace FC=g77 with FC=gfortran (please install before hand should be with xcode)
  9. remove -fno-silent from FFLAGS (If problem with Rank Mismatch try adding -fallow-argument-mismatch to FFLAGS)
  10. Edit biome4.f line 250 and replace with: ` write(*,’(A,2F7.2,3F7.1)’)`

Usage

Updated: