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

[netCDF #VEL-999254]: Porting NetCDF3.6.1-p1 to Windows 32 & 64-bit



> Dear Unidata people,
> 
> I am experiencing an issues that a couple of people seem to have, but
> have not yet found a solution.
> 
> I am attempting to port NetCDF 3.6.1-p1 onto Windows XP 32-bit and (once
> this works), onto a 64-bit machine with an Intel Fortran compiler. I have
> managed to compile the dll for the C interface but have issues with the
> Fortran interface
> 
> Has anyone managed to achieve this task, or could shed some light onto
> how one might go about achieving it. I have extensively searched the posts
> but not found a suitable outcome. Any advice would be greatly appreciated.
> 
> Kind regards
> 
> Jack Pickering
> 
> 

Howdy Jack!

The F90 API has never been ported to Windows here at Unidata; I'm not aware 
that anyone else has done so, but it should not be hard.

The F90 API depends on the F77 API, which is really just a bunch of C 
functions, which take advantage of the name mangling scheme of your local 
fortran compiler, so that when you call nf_open, it will really call a function 
called nf_open_ for some compilers, or nf_open__ for others (note the extra 
underscore.)

The way to get the correct name mangling for your fortran compiler is to set 
the correct C preprocessor flag (usually pgiFortran or f2cFortran) and compile 
the (C) code in the fortran directory. This will add a bunch of C functions, 
which look like F77 functions, in your dll.

Then, from F90, add the DLL and the include file for the F77 API, and you 
should be able to build the F90 code.

Good luck,

Ed

Ticket Details
===================
Ticket ID: VEL-999254
Department: Support netCDF
Priority: Urgent
Status: Closed