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

20021003: NetCDF 3.5.1 beta version on Cray T3E



Helen,

>Date: Thu, 03 Oct 2002 14:53:57 +0100
>From: Helen Fairhurst <address@hidden>
>Organization: Met Office
>To: address@hidden,
>To: address@hidden
>Subject: Re: NetCDF 3.5.1 beta version on Cray T3E

The above message contained the following (abbreviated for clarity):

> Hi Steve, Russ, 
> 
> It's a Thursday, so it must an email from Helen about T3Es :)
> I'm still at the same point as previously. Thanks for your 
> email, Steve. 
...

> checking if Fortran "byte" is C "signed char"... no
> checking if Fortran "byte" is C "short"... yes
> checking if Fortran "byte" is C "int"... no
> checking if Fortran "byte" is C "long"... no
> checking if Fortran "integer*2" is C "short"... yes
> checking if Fortran "integer*2" is C "int"... no
> checking if Fortran "integer*2" is C "long"... no
> checking if Fortran "integer" is C "int"... yes
> checking if Fortran "real" is C "float"... no
> checking if Fortran "real" is C "double"... yes
> checking if Fortran "doubleprecision" is C "double"... yes
> checking for Fortran-equivalent to netCDF "byte"... byte
> checking for Fortran-equivalent to netCDF "short"... integer*2

> configure:2323: checking if Fortran "real" is C "float"
> configure:2332: /opt/ctl/bin/cc -c -DNDEBUG -O3 conftest.c
> configure:2334: /opt/ctl/bin/f90 -g -F -dp -c conftestf.f
> configure:2336: /opt/ctl/bin/f90 -o conftest -g -F -dp  conftestf.o
> conftest.o  
> configure:2338: ./conftest
> configure:2323: checking if Fortran "real" is C "double"

> #define NF_INT1_IS_C_SHORT 1
> #define NF_INT2_IS_C_SHORT 1
> #define NF_INT_IS_C_INT 1
> #define NF_REAL_IS_C_DOUBLE 1
> #define NF_DOUBLEPRECISION_IS_C_DOUBLE 1

> FFLAGS          = -g -F -dp

I think I see the problem. In your development environment, a Fortran
REAL is the same as a Fortran DOUBLEPRECISION (due to the -dp option).
Unfortunately, this violates the Fortran standard which requires that a
DOUBLEPRECISION occupy twice as much memory as a REAL. It also causes
problems for the Fortran-90 interface (which was designed assuming this
mandate) because it creates an ambiguity between the REAL-handling
routines and the DOUBLEPRECISION-handling routines.

More information on the problem can be found at

    http://www.unidata.ucar.edu/cgi-bin/mfs/70/4830?52#mfs

As I see it, you have the following options:

    1.  Forego the use of the "-dp" option; or

    2.  Forego the use of the Fortran-90 interface; or

    3.  Modify the Fortran-90 interface to remove the abiguity between
        REAL- and DOUBLEPRECISION-handling routines. At a minimum, this
        would require removal of all "FourByteReal" declarations from
        the file f90/netcdf_overloads.f90.

Your problem seems related to one already in our email archive but
dealing with 8-byte integers.  If your interested, you can view the 
thread by going to

    http://www.unidata.ucar.edu/glimpsedocs/ghnetcdf.html

and searching for "200204250907.g3P97sa28336".

Please let us know what you decide.

Regards,
Steve Emmerson   <http://www.unidata.ucar.edu>