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

Re: 20020207: Installing netCDF on Windows Platform



>To: address@hidden
>From: "Guy Gersbach" <address@hidden>
>Subject: Re: 20020207: Installing netCDF on Windows Platform
>Organization: .
>Keywords: AbsoftProFORTRAN compiler, Windows

Guy,

> Absoft have replied to say that these routines are not in the library
> (netcdf.lib) and want to confirm what libraries these modules are in.
> 
> I have also noticed that the netcdf.inc files states that they are
> defined to ensure backwards compatibility with a previous version of the
> library.  Is this anything to do with the issue?

If the library was built with the Fortran interface, they should be
there.  It's possible to build the library with just the C or C++/C
interfaces, in which case no code for the Fortran version 2 or version
3 interfaces would be there.  But it's difficult to get just the
version 3 Fortran interfaces without the version 2 interfaces, unless
you explicitly set the "NO_NETCDF_2" macro before building, with a C
option like "-DNO_NETCDF_2".

The sources for the netCDF-2 Fortran interfaces are in the
distribution in the file src/fortran/fort-v2compat.c.  So, for
example, the source for the function NCVID is generated by a macro
call in that file:

/* FORTRAN interface to the above. */
FCALLSCFUN3(NF_INT,c_ncvid,NCVID,ncvid,
    NCID,STRING,PRCODE)

where "FCALLSCFUN3" is one of the macros defined in the cfortran.h
file.

As I'm looking at it, it appears that only five Fortran functions are
defined using the FCALLSCFUN3 macro: NCCRE, NCOPN, NCDID, NCVID, and
NCSFIL.  According to your original message, these are not the same as
the set of functions that couldn't be found:

> ... I've had partial success in using the NetCDF 
> Windows library with AbsoftProFORTRAN 7.0 for windows.  However I 
> appear to be running into a problem with the following 
> sub-routines/functions:
> 
> NCVID
> NCCRE
> NCOPN
> NCVDEF
> NCDDEF and 
> NCSFIL?

So in particular, if you have NCDID and NCVID working from the Fortran
netcdf-2 backward compatibility interface (and these would be tested
when you run the separate test for the netcdf-2 Fortran), there
shouldn't be any obstacle to getting these other functions working the
same way.

Just by way of a little explanation, the FCALLSCFUN3 macro just
generates some "jacket" code to have a Fortran function, such as
NCVID, call a C function, such as c_ncvid, using the Fortran-to-C
conventions appropriate for the compilers ...

--Russ