netcdf-java icon indicating copy to clipboard operation
netcdf-java copied to clipboard

Handling of CDL `long`, `int`, and `uint64`

Open ethanrd opened this issue 3 years ago • 4 comments

In CDL, long is a synonym for the int data type (4-byte signed integer). In netCDF-Java, ArrayType.LONG and ArrayType.ULONG are 8-byte integers but they use long and ulong when writing CDL.

I'm working on the develop branch.

I'll post some example CDL shortly.

ethanrd avatar Apr 30 '21 04:04 ethanrd

This CDL snippet:

      int vint(dim) ;
      long vlong(dim) ;
      uint vuint(dim) ;

      int64 vint64(dim) ;
      uint64 vuint64(dim) ;

When run through ncgen and the results through ncdump results in this CDL:

	int vint(dim) ;
	int vlong(dim) ;
	uint vuint(dim) ;
	int64 vint64(dim) ;
	uint64 vuint64(dim) ;

Whereas, when the result of the ncgen is read into netCDF-Java and written as CDL, the results are:

    int vint(dim=3);

    ulong vuint64(dim=3);

    long vint64(dim=3);

    uint vuint(dim=3);

    int vlong(dim=3);

ethanrd avatar Apr 30 '21 04:04 ethanrd

good catch. should be an easy fix.

On Thu, Apr 29, 2021 at 10:26 PM Ethan Davis @.***> wrote:

This CDL snippet:

  int vint(dim) ;
  long vlong(dim) ;
  uint vuint(dim) ;

  int64 vint64(dim) ;
  uint64 vuint64(dim) ;

When run through ncgen and the results through ncdump results in this CDL:

int vint(dim) ; int vlong(dim) ; uint vuint(dim) ; int64 vint64(dim) ; uint64 vuint64(dim) ;

Whereas, when the result of the ncgen is read into netCDF-Java and written as CDL, the results are:

int vint(dim=3);

ulong vuint64(dim=3);

long vint64(dim=3);

uint vuint(dim=3);

int vlong(dim=3);

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Unidata/netcdf-java/issues/669#issuecomment-829795526, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEVZQAOQKIIPR2EBAEUXHTTLIWQRANCNFSM433JJX4A .

JohnLCaron avatar May 09 '21 15:05 JohnLCaron

@ethanrd - there should be a fix for this on develop if you'd like to give it a spin 👍

lesserwhirls avatar May 13 '21 21:05 lesserwhirls

Actually Im going to reopen this in case we want to backport.

JohnLCaron avatar May 17 '21 15:05 JohnLCaron