[netcdfgroup] Bug in netcdf4_constants.f90 (NAG compiler)

Hi,

At about line 30 in file netcdf4_constants.f90, the following code:

integer (kind = EightByteInt),  parameter, public :: &
     nf90_fill_uint   = 4294967295_8

should be changed to read:

integer (kind = EightByteInt),  parameter, public :: &
     nf90_fill_uint   = 4294967295_EightByteInt

This is needed because the NAG compiler does not, by default, use the typical practice of using byte counts for kinds. An 8-byte integer actually has a kind of 4. (Kinds are 1, 2, 3, and 4 for one-byte, two-byte, four-byte, and eight-byte integers. Kind=8 is not accepted.)

NAG does have a -kind=byte compilation option. But use of this option introduces further problems. Namely that all Fortran code that USEs a module compiled in this mode must also be compiled the same way. Which is a pain for large programs that use libraries from multiple sources.

I checked the netcdf-fortran-4.4-beta1 tarball, and the bug is not fixed. The same code appears in file netcdf_constants.f90 at around line 152.

Walter



  • 2013 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdfgroup archives: