source: trunk/README.FORTRAN90 @ 1822

Revision 201, 3.1 KB checked in by nexus, 10 years ago (diff)

Removed some of the comments concerning 64-bit systems. The
NXhandle structure is so much larger in the HDF5 version that it
is now redundant (or may need revisiting)

Ray

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
Line 
1The NeXus Fortran 90 interface consists of a single Fortran 90 module
2containing all the global parameters and function definitions. The
3routines are called exactly like their C counterparts, although some
4arguments have been made optional because their values can be determined
5automatically.  See <http://www.neutron.anl.gov/NeXus/NeXus_F90.html>
6for details of the individual routines.
7
8There must be a USE statement to incorporate the NeXus module e.g.
9
10   use NXmodule
11   
12(N.B. if the F90 utility module NXUmodule is USEd, it is not necessary
13to specify NXmodule as well.)
14
15The Fortran 90 interface uses two derived types for the NXhandle and
16NXLink structures.
17
18    type(NXhandle) :: file_id
19    type(NXlink) :: link_id
20
21There are also several KIND parameters defined for producing
22different-length storage.  They are not guaranteed to produce the
23required result, but should work on most Fortran 90 compilers.
24
25    NXi1 - one-byte integers
26    NXi2 - two-byte integers
27    NXi4 - four-byte integers
28    NXr4 - four-byte floating points
29    NXr8 - eight-byte floating points (double precision)
30   
31There is no way of distinguishing signed and unsigned integers, so
32unsigned integers are mapped to signed integers of the same length.  It
33is possible to read variables into arrays of different storage size,
34provided there is no overflow.
35
36--- Compatibility Issues ---
37
38This version has been tested on Alpha/VMS, Windows NT, Linux, and Mac
39OS X (using Absoft Pro Fortran 90).  In the latest versions of the API
40(after v 1.3.1), the Fortran 90 code does not require access to the
41internal details of the NXhandle structure.
42
43--- Running the Examples ---
44
45The Fortran 90 library is now built by the standard Makefile with the
46following option
47
48   make libf90
49   
50See the README file for further instructions.
51
52The Fortran 90 test program, NXtest, should print the following:
53
54 Number of global attributes:   4
55    NeXus_version = 2.0.0.
56    file_name = NXtest.nx5
57    HDF5_Version = 1.4.3
58    file_time = 2002-05-17 15:22:29
59 Group: entry(NXentry) contains   8 items
60    ch_data : NX_CHAR   
61    Values : NeXus data         
62    Subgroup: data(NXdata)
63    i1_data : NX_INT8   
64    Values :   1  2  3  4
65    i2_data : NX_INT16 
66    Values :   1000  2000  3000  4000
67    i4_data : NX_INT32 
68    Values :   1000000  2000000  3000000  4000000
69    r4_data : NX_FLOAT32
70    Values :   1.00000  2.00000  3.00000  4.00000
71           :   5.00000  6.00000  7.00000  8.00000
72           :   9.00000  10.0000  11.0000  12.0000
73           :   13.0000  14.0000  15.0000  16.0000
74           :   17.0000  18.0000  19.0000  20.0000
75    r8_data : NX_FLOAT64
76    Values :   1.00000  2.00000  3.00000  4.00000
77           :   5.00000  6.00000  7.00000  8.00000
78           :   9.00000  10.0000  11.0000  12.0000
79           :   13.0000  14.0000  15.0000  16.0000
80           :   17.0000  18.0000  19.0000  20.0000
81    ch_attribute : NeXus               
82    i4_attribute :   42
83    r4_attribute :   3.14159
84    Subgroup: sample(NXsample)
85 Link Check OK
86
87--
88Ray Osborn
89Materials Science Division
90Argonne National Laboratory
91Argonne, IL 60439-4845, USA
92
93Email: ROsborn@anl.gov
94
95$Id$
Note: See TracBrowser for help on using the repository browser.