fdds_write - write DDS binary data


SYNOPSIS

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

integer function fdds_write(bin, tag, buf, count)

integer bin
integer tag
integer buf(*)
integer count

DESCRIPTION

This function writes data into a binary stream, from a buffer.

INPUT

bin is a binary tag, previously obtained from fdds_open. It specifies a particular binary stream.

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

Data is written from buf. The minimum size is count times the size of tag.

OUTPUT

A byte sequence from the buffer is copied into the stream no conversions are performed.

The return value is the number of types actually written, or EOF if an error occurred before any transfer.

EXAMPLES

In fixed-format Fortran:
      #include <fdds.h>
      integer fd_out
      integer buf(*)
      ...
      ! write 10 traces from type buffer
      j = fdds_write(fd_out, 0, buf, 10)
    

In free-format F90:

      #include <f90dds.h>
      integer fd_out
      integer buf(*)
      ...
      ! write 10 traces from type buffer
      j = fdds_write(fd_out, 0, 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 :: fd_out, nsmp, ntrc, itrc
      real, allocatable :: buffer(:,:)
      
      allocate(buffer(nsmp,ntrc))
      ! write 10 traces from type buffer
      do itrc=1,10
         ier = fdds_write(fd_out, 0, buffer(:,itrc), 1)
      enddo
    

SEE ALSO

fdds_read
fdds_writem
    

AUTHOR

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