Requirements DINEOF


Revision as of 20:21, 8 February 2013 by Jmb (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search



If you plan to compile yourself and/or adapt DINEOF to your needs you must have:

  • a Linux or UNIX environment
  • A Fortran 90 compiler (such as gfortran, g95, ifort, pgf90,...)

For optional NetCDF output you also need the NetCDF library with Fortran 90 bindings. Support for Microsoft Windows in underway (DINEOF for Windows)

Installing NetCDF and ARPACK

From Source

From Linux Distribution

If you want to use gfortran and if your Linux distribution provides NetCDF and ARPACK compiled with gfortran (e.g. Ubuntu 8.04 Hardy Heron), you can use those libraries. In Ubuntu you:

sudo apt-get install libarpack2-dev libnetcdf-dev

The file

# Include file for gfortran Fortran compiler on Linux

F90C := gfortran

# -ff2c is necessary if AKPACK is compiled with g77

LD := $(F90C)

# necessary for gfortran 4.1, but default since 4.2
F90FLAGS += -frecord-marker=4

ifeq ($(FORMAT),big_endian)
 F90FLAGS += -fconvert=big-endian

ifdef DEBUG
 F90FLAGS += -g -fbounds-check
 F90FLAGS += -O3 -ffast-math

# Library locations

INCLUDES =  -I/usr/include/
DINEOF_LIBRARIES =  -L/usr/lib -larpack  -llapack  -lblas  -lnetcdff -lnetcdf
CROSSVAL_LIBRARIES = -L/usr/lib -lnetcdff -lnetcdf


Note the -lnetcdff.

Note that:

  • We strongly recommend that you use the same compiler to compile ARPACK, NetCDF, and DINEOF, unless you know what you're doing.
  • ARPACK and the optional NetCDF libraries should be compiled with the same Fortran 90 compiler. However, it is possible with some tweaking to mix g77 and gfortran.
  • Some Linux distributions (e.g. Fedora 5, Ubuntu 6.10) only include the Fortran 77 bindings of NetCDF. If you want to use NetCDF, you probably need to compile NetCDF with Fortran 90 bindings by your own.

I copied my using those libraries below.

For Mac OS

  • Download Arpack [1] and its patch folder
  • Extract them:
zcat arpack96.tar.Z | tar -xvf -
zcat patch.tar.Z | tar -xvf - 
  • Go into directory ARPACK and edit file
    • home = path to the folder ARPACK that was just extracted
    • BLASdir: don't modify, or put the path to your own library if installed
BLASdir      = /usr/lib
    • LAPACKdir: idem
    • ARPACKLIB: transform the line
ARPACKLIB  = $(home)/libarpack_$(PLAT).a 


ARPACKLIB  = $(home)/libarpack.a 

for the name of the library

    • FC: if needed, change F77 into gfortran (or something else)
    • FFLAGS: remove the flag '-cg89' (not recognized)
    • MAKE: check the path of the command make, e.g.,
which make

and adapt the line

MAKE       =  /usr/bin/make
  • Go into directory ARPACK'ARPACK/UTIL and edit file second.f. Comment the line
Personal tools