DDS Developers Documentation → Fortran API → put


Index
fdds_addaxis
fdds_align
fdds_axis_prod
fdds_binfd
fdds_calloc
fdds_calloc8
fdds_check
fdds_close
fdds_closepr
fdds_closepr2
fdds_copy
fdds_count
fdds_datadefn
fdds_dict
fdds_errors
fdds_fflush
fdds_free
fdds_genus
fdds_get
fdds_history
fdds_in
fdds_index
fdds_info
fdds_initmpi
fdds_initmpix
fdds_initopenmp
fdds_isreg
fdds_key
fdds_lseek
fdds_lseek8
fdds_malloc
fdds_malloc8
fdds_map
fdds_member
fdds_memuse
fdds_mod
fdds_name
fdds_newer
fdds_next
fdds_object
fdds_offset
fdds_open
fdds_openm
fdds_openpr
fdds_out
fdds_parent
fdds_prec
fdds_prev
fdds_prime
fdds_printf
fdds_printt
fdds_printv
fdds_prtcon
fdds_prterr
fdds_prthdr
fdds_prtmsg
fdds_ptr
fdds_put
fdds_read
fdds_readm
fdds_realloc
fdds_realloc8
fdds_rmaxis
fdds_savepr
fdds_scale
fdds_scanf
fdds_scank
fdds_scant
fdds_scantn
fdds_scanv
fdds_sprintf
fdds_sscanf
fdds_switch
fdds_write
fdds_writem

fdds_put - put one field into a DDS type buffer


SYNOPSIS

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

integer function fdds_putxx(bin, tag, out_buf, offset, in_array[, count])

integer bin
integer tag
array out_buf(*)
integer offset
HostType in_array(*)
integer count

DESCRIPTION

These functions put data into a type field of an output array from an array variable. The data is converted from the host array type, into the type defined for the field. The array type is implied by the function name suffix ("xx"). Vectors are truncated or padded, depending upon the source and destination count.

INPUT

The first four arguments describe an output field within a type buffer. bin is a binary tag, previously obtained from fdds_open.

tag identifies a specific field associated with bin obtained from fdds_member. Note that there is a distinct difference between tags generated from different bin values. This means that you should not be using a tag from the in_bin for anything related to the out_bin. If tag is zero, the default target (trace) is used.

out_buf is the output type buffer into which the output field is found.

offset is a byte offset into out_buf from where the tag is referenced (typically 0).

in_array is the input array from which the data is obtained. The type of in_array is implied by the function name suffix ("xx").

count is the number of elements to convert. This is NOT to be used for fdds_putcb, but is required by each of the other routines.

OUTPUT

The put functions copy (or convert) data from an input array into the output field. Vectors are truncated or padded, depending upon the source and destination count.

The function return value is count, or zero if an error occurred.

A simple byte copy is performed, if the binary formats are the same. The put functions convert between most numeric representations. The allowed combinations are implementation dependent. The functions also convert between ascii and ebcdic character formats. Byte fields can be copied, without conversion, from any array. Conversion is not allowed between numeric and character types. If conversion is not possible, an error is reported and the output field is not changed.

Function     Host Type    in_array Pad
fdds_put     byte         zero
fdds_putcb   character    blank
fdds_puti    integer      zero
fdds_puti2   integer*2    zero
fdds_putr    real         zero
fdds_putff   real         zero (USP fake float)
fdds_putd    real*8       zero
fdds_putc    complex      zero
    
C assignment rules are used to convert float arrays to integer and unsigned fields. Character arrays passed by fdds_putcb are assumed to be padded with blanks. Trailing pad characters are ignored during put processing; they effectively shorten input character arrays. A null character, within a fdds_putcb character array, effectively reduces its count. fdds_putff stuffs floats into consecutive 4-bytes (fake floats).

EXAMPLES

      integer :: out_bin, tag, ier
      integer out_buf(*)
      integer in_array(*)
      ...
      tag = fdds_member(out_bin, 0, 'TagName')
      ...
      ! Store 100 integers of 'TagName' header from in_array in out_buf at correct offsets
      ier = fdds_puti(out_bin, tag, out_buf, 0, in_array, 100)
      ! Write a single trace to output
      ier = fddx_write(out_bin, out_buf, 1)
    

SEE ALSO

      fdds_get
    

AUTHOR

R. L. Selzler, EPTG (May, 1994) Jerry Ehlers, BP America (May 2003)
For additional help, open an issue here