fdds_readm - read DDS binary stream and map buffer


SYNOPSIS

#include <fdds.h> (fixed-format sources)
#include <f90dds.h> (free-format sources)

integer function fdds_readm(in_bin, in_tag, out_bin, out_tag, out_buf, count)

integer in_bin
integer in_tag
integer out_bin
integer out_tag
integer out_buf(*)
integer count

DESCRIPTION

This function reads data from a binary stream and maps it into a type buffer.

INPUT

In_bin is a binary tag, previously obtained from fdds_open. It specifies an input binary stream.

in_tag is a field tag, previously obtained eg. from fdds_member. It specifies a tag associated with in_bin. This provides a scale factor for count. If in_tag is zero (nominal), it defaults to the SEQUENCE (trace type) associated with in_bin.

Out_bin is a binary tag, previously obtained from fdds_open. It specifies an output binary stream.

out_tag is a field tag, previously obtained, for example, from fdds_member. It specifies a tag associated with out_bin. This provides a scale factor for count. If out_tag is zero (nominal), it defaults to the SEQUENCE (trace type) associated with out_bin.

Data is read into out_buf. The minimum size is count times the size of out_tag.

OUTPUT

A byte sequence is copied from in_bin into a temporary buffer. Data is moved from the buffer to out_buf, while converting from in_tag to out_tag. fdds_readm is preferable to executing fdds_read and fdds_map directly.

The return value is the number of types actually read and mapped. EOF is returned if an error occurred before any transfer.

EXAMPLES

In fixed-format Fortran:
      #include <fdds.h>
      integer in_bin, out_bin
      integer out_buf(*)
      ...
!     read 10 traces into type buffer
      j = fdds_readm(in_bin, 0, out_bin, 0, out_buf, 10)
    

In free-format F90:

      #include <f90dds.h>
      integer in_bin, out_bin
      integer out_buf(*)
      ...
!     read 10 traces into type buffer
      j = fdds_readm(in_bin, 0, out_bin, 0, out_buf, 10)
    

Using the DDS module:
(Note that the DDS module requires that data arrays passed to I/O functions be 1 dimensional.)

      use dds
      
      integer :: in_bin, out_bin, nsmp, ntrc, itrc
      real, allocatable :: buffer(:,:)
      
      allocate(buffer(nsmp, ntrc))
      ! read 10 traces into type buffer
      do itrc=1,10
        ier = fdds_readm(in_bin, 0, out_bin, 0, buffer(:,itrc), 1)
      enddo
    

SEE ALSO

fdds_read
fdds_map
fdds_write
    

AUTHOR

R. L. Selzler, EPTG (May, 1994)