F77 standard

Ray Osborn ROsborn at anl.gov
Thu Sep 23 15:15:58 BST 1999


Again, this is something that could be left to the users, as long as we 
provide alternatives (i.e. NXputchardata etc) when it's not supported by
their compiler.  I know that it's not universal because Absoft Pro Fortran
for Linux doesn't allow it.

As it now stands, NAPIF.F is not reliably portable (even with NXputchardata
etc.) because it uses BYTE as a variable type to pass strings to NAPI.C.  It
is possible that, on some compilers, the users will have to substitute
INTEGER*1 or LOGICAL*1 for the BYTE declaration.  Freddie seemed to think
that BYTE was reasonably portable, but it's not guaranteed.  Therefore, we
will have to warn the users in the README files that it may be necessary to
substitute different variable types if NAPIF.F doesn't compile.  I presume
that BYTE does work with g77 so that it satisfies Mark's criterion.  If we
also provide NXputchardata etc, then we have not worsened the
non-portability.  If the users prefer to use the EQUIVALENCE or %REF
technique, it is up to them to test that it works for their compiler; it's
not our problem.  I have expanded the test routines and will post them to
the CVS server some time today so that it is easy for them to check.

Note that the decision to use EQUIVALENCE, %REF or NXputchardata is for the
person writing the NeXus application, not those of us writing the API.

I don't believe that we can avoid providing the extra character routines,
but it will be possible to avoid using them according to the user's
preference.  Hopefully, this satisfies both sides of the argument.

When the test routines are posted, please check them out on your own
compilers so that we can assess their utility.

Regards,
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





> I've found something else that works that it a bit easier than an
> equivalence (it is also non-standard, but supported by g77 and DEC
> compilers):
>
> You pass the string using %REF(name) ... this passes the address of the
> string bytes rather than the address of the string descriptor, and so
> makes it behave like "C"
>
> Freddie
>
> On Thu, 23 Sep 1999, Mark Koennecke wrote:
>
>>
>>   May be,
>>
>>   perhaps we should make the requirement that the gnu-fortran compiler,
>>   g77, supports whatever we do. As this compiler is available for almost
>>   all platforms there is at least an option for users.
>>
>>
>>                            Mark
>>
>>




More information about the NeXus-developers mailing list