Fortran 77 Interface

Ray Osborn ROsborn at anl.gov
Fri Sep 17 20:59:50 BST 1999


Freddie had made the suggestion that we should require the user to 
equivalence any character string to an integer*1 (or BYTE) array, which
he/she then uses as the NXputdata/NXgetdata argument etc. I've just checked
that this works fine on our Alpha/VMS system, even without making any
arrangements to null-terminate the passed array.  I don't think that this is
because VMS Fortran initializes all arrays as 0 since I used the same buffer
more than once, the second time with a shorter string.  The second time, the
buffer would have been padded with spaces.

My tentative conclusion is that Freddie is right that null termination is
not required here because we only pass the array to and from HDF with a
defined length.  In other words, we don't even have to modify
NXputdata/NXgetdata to cope with NX_CHAR datatypes.  This would satisfy
Mark's preference to have the same interface for C and F77 interfaces.

It does require that the user use EQUIVALENCE statements but this is fairly
easy to explain.

Any more opinions?

Ray
--
Dr Ray Osborn                Tel: +1 (630) 252-9011
Materials Science Division   Fax: +1 (630) 252-7777
Argonne National Laboratory  E-mail: ROsborn at anl.gov
Argonne, IL 60439-4845




More information about the NeXus-developers mailing list