jedbrown/cmake-modules

Use netcdf statement in Fortran

Closed this issue · 3 comments

Hi,
I want to read a netcdf file using Fortran 90 and compling with gfortran. I'm seeing this error . Fatal error: can't open module file 'netcdf.mod' for reading at (1): no such file or directory
I compiled using
gfortran firstread.f90 -o first.x
My source code looks like
Program first read
Use netcdf
Implicit none
Character (len=*), parameter :: f_name= " pr_historical.nc"
Integer , parameter:: ndim=3, nlats=201, nlon=194
......
....
end program firstread.
Thanks

In addition, I installed netcdf- Fortran on my system on path /use/local/include.

You'll need gfortran -I/usr/local/include if that's where your module files are installed. But this does not appear to be a question about these Find modules so I'm closing this issue.