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

Re: netcdf and flint...



Pete,

> As you may know, I am working on a flint description of the netcdf 
> library.  
> 
> I need a Fortran code(s) which exercises *all* netcdf routines so that I 
> can make sure that I don't have typos in the definitions.    It is
> critical that the codes have no netcdf interface errors of any kind.
> (They do not have to be executeable codes, the only requirement is that
> they contain correct calling sequences, with properly dimensioned
> arrays, etc...)
> 
> How can I get such codes?  Do either of you have some available? 

The netCDF source distribution includes a test program for all the functions
and subroutines in the Fortran interface, in netcdf/fortran/ftest.f, but I'm
not sure this will meet your requirements.

First of all, the ftest.f program is actually generated for each platform
from a macro-processor source (ftest.src) as part of building and installing
the library, using sed and m4 scripts.  Thus ftest.f is not portable and
differs for each system.  It cannot be made portable, because different
systems have different ways of

  - calling C from Fortran,
  - including an external file of declarations with the non-standard
    `include' statement,
  - declaring non-standard data types required by the netCDF Fortran
    interface, such as integer*1 and integer*2

The interface also requires that addresses be passed to functions that can
return either reals or integers (e.g. NCVGT), and I think this might make
flint emit lots of error messages when it detects such usages.  the Fortran
interface for netCDF was designed so it would work on every major computing
platform, but to make it portable according to the stricter Fortran-77
standards would have been impractical, since the standard didn't recognize
the existence of integer*2 variables or the necessity to use such
declarations when calling C functions from Fortran.

Finally, I don't think the ftest.f test program is a particularly good
example of Fortran coding and style, so it may cause lots of flint errors
that have nothing to do with the netCDF library.  Although we've
successfully compiled and run it on all kinds of Fortran compilers from PCs
to Crays, you may discover lots of cruft with flint.

--Russ

__________________________________________________________________________
                      
Russ Rew                                              UCAR Unidata Program
address@hidden                                        P.O. Box 3000
(303)497-8645                                 Boulder, Colorado 80307-3000