C | All input strings are to be null terminated.
All returned strings will have the trailing blanks removed and
will be null terminated.
Variables declared to hold Names, Labels, and Data-Types should
be at least 33 characters long.
ADF.h has a number of variables defined.
An example declaration would be:
char name[ADF_NAME_LENGTH+1]; | ||||||||||||||
Fortran | Strings will be determined using inherited length.
Returned strings will be blank filled to the specified length.
All returned names will be left justified and blank filled on the
right.
There will be no null character.
An example declaration would be:
PARAMETER ADF_NAME_LENGTH=32 CHARACTER*(ADF_NAME_LENGTH) NAME | ||||||||||||||
ID | A unique identifier to access a given node within a file.
This 8-byte field contains sufficient information for ADF to
locate the node within a file.
For any given node, the ID is generated only after the file it
resides in has been opened by a program and the user requests
information about the node.
The ID is valid only within the program that opened the file and
while that file is open.
If the file is closed and reopened, the ID for any given node
will be different.
Within different programs, the node ID for the same node will be
different.
The ID is not ever actually written into a file.
The declaration for variables that will hold node IDs should be for an 8-byte real number. The ID is actually a 64-bit combination of a system-generated file index along with the block and offset of the location of the node on the disk. In general, users do not need to know the internal coding of this information. | ||||||||||||||
error_return | The error code for the ADF routines is the following:
| ||||||||||||||
Indexing | All indexing is Fortran-like in that the starting index is 1 and
the last is N for N items in an index or array
dimension.
The array structure is assumed to be the same as in Fortran
with the first array dimension varying the fastest and the last
dimension varying the slowest.
The index starting at one is used in ADF_Read_Data, ADF_Write_Data, and ADF_Children_Names. The user should be aware of the differences in array indexing between Fortran and C. The subroutines ADF_Read_All_Data and ADF_Write_All_Data merely take a pointer to the beginning of the data, compute how much data is to be read/written, and process as many bytes as have been requested. Thus, these routines effectively make a copy of memory onto disk or vice versa. Given this convention, it is possible for a C program to use standard C conventions for array indexing and use ADF_Write_All_Data to store the array on disk. Then a Fortran program might use ADF_Read_All_Data to read the data set. Unless the user is aware of the structure of the data, it is possible for the array to be transposed relative to what is expected. The implications of the assumed array structure convention can be quite subtle. The subroutines ADF_Write_Data and ADF_Read_Data assume the Fortran array structure in order to index the data. Again, unless the user is aware of the implications of this, it is possible to write an array on disk and later try to change a portion of the data and not change the correct numbers. As long as users are aware of how their data structure maps onto ADF, there will not be any problems. |