13.3.3. NAPI Fortran 90 InterfaceΒΆ
The Fortran 90 interface is a wrapper to the C interface with nearly identical routine definitions. As with the Fortran 77 interface, it is necessary to reverse the order of indices in multidimensional arrays, compared to an equivalent C program, so that data are stored in the same order in the NeXus file.
Any program using the F90 API needs to put the following line at
the top (after the PROGRAM
statement):
use NXmodule
Use the following table to convert from the C data types listed with each routine to the Fortran 90 data types.
C data type |
F90 data type |
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The parameters in the next table,
defined in NXmodule
, may be used in defining variables.
Name |
Description |
Value |
---|---|---|
|
Maximum number of dimensions |
|
|
Maximum length of NeXus name |
|
|
Kind parameter for a 1-byte integer |
|
|
Kind parameter for a 2-byte integer |
|
|
Kind parameter for a 4-byte integer |
|
|
Kind parameter for a 4-byte real |
|
|
Kind parameter for an 8-byte real |
|
The bindings are listed at https://github.com/nexusformat/code/tree/master/bindings/f90 and can be built as part of the API distribution https://github.com/nexusformat/code/releases