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

970306: NetCDF 3.3a Fortran interface bug?



Mark,

>Date: Thu, 6 Mar 1997 16:00:19 +1300 
>From: "Mark Hadfield" <address@hidden>
>Organization: NIWA (Taihoro Nukurangi)
>To: "Steve Emmerson" <address@hidden>
>Subject: Re: 970305: NetCDF 3.3a Fortran interface bug? 
>Keywords: 199703052223.PAA23504

In the above message, you wrote:

> Gidday Steve

Gidday Mark.

(Kiwis say Gidday?!)

> The attached program crashes when linked to version 3.3a but works
> properly when linked to version 2.4.2. System is Digital UNIX V4.0A 
> (Rev. 464). Compiler is f77 or f90 (not sure about versions). Error
> message is:
> 
> Segmentation fault (core dumped)

Got it.  Found the problem (loop-termination condition in file
"fortran/fort-v2compat.c", function reverse(), when <length> is 0).
It'll be fixed in the next release.

> Incidentally, I note that there is a Fortran 90 netCDF module
> (netcdf.f90) in the latest release, defining constants & interfaces for
> some of the subroutines, but that the author gave up on others (eg the
> 'get' and 'put' routines) because of f90's fussiness about argument
> matching. I have written a more ambitious Fortran 90 module, which not
> only defines interfaces for the standard subroutines, but also defines
> specific routines to get & put data of different type & rank, and hides
> these specific routines behind generic interfaces. Automatic type
> conversions are made between netCDF and Fortran data types. There are a
> few aspects that require more thought: how to handle availability of
> arrays of all possible ranks (the Fortran standard specifies a max of
> 7, I believe) or force the user to re-shape data arrays? A huge amount
> of repetition of code with minor variations is required to make the
> whole thing general & it would probably best be handled by a text
> processing facility. Partly as a result of my not having thought thru
> these issues, partly because I have other things to do, the module is
> currently incomplete & undocumented (though my code is so elegant it
> doesn't need comments!). Anyway, the code is attached, in case you're
> interested.

It would seem like this FORTRAN-90 interface duplicates a lot of the
functionality of the new netCDF-3 FORTRAN interface (i.e. automatic type
conversion, vector reversal, etc.).  So, with all due respect, I have to
ask how much of it is really necessary.

--------
Steve Emmerson   <address@hidden>