netCDF > gfortran > ( netcdf.incをインクルード時の指定 > gfortran tmp.f90 -I/usr/include -lnetcdf -lnetcdff ) / ( -lnetcdfと-lnetcdffの違い )


動作環境
CentOS6.8 64bit

以下のディレクトリにnetcdf.incがあるとする。

/usr/include/netcdf.inc

Fortran90のソフトにて以下の宣言(と関連処理)があるとする。

include 'netcdf.inc'

以上の状況でFortan90プログラムをコンパイルするには

gfortran tmp.f90 -I/usr/include -lnetcdf -lnetcdff

-lnetcdf-lnetcdffの違いは以下にあった。
http://www.unidata.ucar.edu/support/help/MailArchives/netcdf/msg11396.html

The extra 'f' in the -netcdff refers to the fortran library, whereas -lnetcdf is the c library.