[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[netCDF #EDQ-194344]: Use NetCDF Problems



Florian,

> I tried using version 4.0.1 but it still not work.
> 
> I put netcdf.dll, netcdf.lib, ncgen.exe and ncdump.exe in my
> system32.  Then I created a Fortran project and add the file
> simple_xy_wr.f90 from unidata website but it doesn't compile
> (problem with the "use netcdf"). I don't know what I have to do with
> the netcdf.inc.

As the answer to the FAQ "How can I use netCDF-4 with Windows?" says:

  Note that we have not ported the F90 or C++ APIs to the Windows
  platform, only the C and F77 APIs. User contributions of ports to
  F90 windows compilers are very welcome (send them to
  address@hidden).

Therefor unless you can build the Fortran-90 API from the source, you
will have to use the C or Fortran-77 interface.  So you should try
compiling the equivalent F77 example simple_xy_wr.f instead.

Another user has reported success in building the F90 API for Windows:

  http://www.unidata.ucar.edu/netcdf/docs/other-builds.html#windows_ifort_f90

To answer your question about "netcdf.inc", Fortran-90 programs don't
do anything with the netcdf.inc file, that's for Fortran-77 programs
to include.  The "use netcdf" statement is supposed to find a compiled
Fortran-90 module file named netcdf.mod that was built for a
particular Fortran compiler and that contains all the run-time
declarations needed to know about the argument types and return types
for all the netCDF Fortran-90 functions.  If you can compile the
Fortran-90 netCDF API from source, you would have to install the
netcdf.mod file somewhere and tell your compiler where to look for it,
typically with a -I or -M flag.

--Russ

Russ Rew                                         UCAR Unidata Program
address@hidden                     http://www.unidata.ucar.edu



Ticket Details
===================
Ticket ID: EDQ-194344
Department: Support netCDF
Priority: Normal
Status: Closed