brodeau / aerobulk

AeroBulk is a modern-FORTRAN-based package/library that gathers state-of-the-art aerodynamic bulk formulae algorithms used to compute turbulent air-sea fluxes of momentum, heat and freshwater.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Missing .mod files on compilation?

TomNicholas opened this issue · comments

Hi @brodeau - this package looks super useful to our group and our work!

I'm trying to compile aerobulk locally, first to test it and then eventually to try and create a python wrapper using f2py.

My understanding of Fortran compilation is that I should end up with a .mod file for every .f90 file that has MODULE in it. However when I make using this repo's makefile (symlinked to the make.macro_GnuLinux file), I only seem to get one .mod file, mod_const.mod.

When I try to make the tests they fail with

Makefile:149: warning: ignoring prerequisites on suffix rule definition
Makefile:153: warning: ignoring prerequisites on suffix rule definition
gfortran -O3 -fdefault-real-8 -ffree-line-length-200 -J./mod -I./mod -std=gnu -lstdc++ -I/usr/include -c src/io_ezcdf.f90 -o src/io_ezcdf.o
src/io_ezcdf.f90:3:8:

    3 |    USE netcdf
      |        1
Fatal Error: Cannot open module file ‘netcdf.mod’ for reading at (1): No such file or directory
compilation terminated.
make: *** [Makefile:144: mod/io_ezcdf.mod] Error 1

and I think my efforts to build the f2py wrapper are being prevented by mod_phyml.mod not existing.

Do you have any suggestions as to what I'm doing wrong?

Hello!
You clearly haven't installed the Fortran Netcdf development files installed on your system!
The compiler is looking for netcdf.mod which should come along with your netCDF install!
If u compiled netCDF, then also compile netcdf-fortran, if you install it vi a package manager try to find something "netcdf fortran development" headers/files (libnetcdff-dev on debian-based system)
Cheers, /laurent