Fortran SFF API to data I/O streams in C++

◆ sff_wtrace__()

int sff_wtrace__ ( integer lu,
char *  wid2line,
integer nsamp,
real fdata,
integer idata,
logical last,
integer ierr,
ftnlen  wid2line_len 
)

Write one trace of data with INFO line.

Description from stuff.f:

c----------------------------------------------------------------------
subroutine sff_WTrace(lu, wid2line, nsamp, fdata, idata, last, ierr)
c
c Write one data block starting with DAST line.
c The File will be closed after writing the last trace.
c
c input:
c lu logical file unit
c wid2line valid WID2 line
c nsamp number of samples
c fdata data array
c last must be true is the trace to be written is the
c last one in this file
c ouput:
c ierr error status (ok: ierr=0)
c
c workspace:
c idata fdata will be converted to idata using sff_f2i
c (both array may be in same memory space - see
c comments on sff_f2i)
c
integer lu, nsamp, idata(nsamp)
real fdata(nsamp)
logical last
character wid2line*132
c----------------------------------------------------------------------

Definition at line 78 of file fapid_sff_wtrace.cc.

References fapidxx::OFileUnits::close(), fapidxx::ostreammanager, and fapidxx::WID2container::wid2.

81 {
82  int retval=0;
83  *ierr=0;
84  try {
85  datrw::oanystream &os=ostreammanager(static_cast<int>(*lu));
86  WID2container wid2c(wid2line, wid2line_len);
87  unsigned int nsamples=static_cast<unsigned int>(*nsamp);
88  os << wid2c.wid2;
89  aff::LinearShape shape(0, nsamples-1, 0);
90  datrw::Tfseries series(shape, aff::SharedHeap<real>(fdata, *nsamp));
91  os << series;
92  if (*last) ostreammanager.close(static_cast<int>(*lu));
93  }
94  catch (...) {
95  *ierr=1;
96  }
97  return(retval);
98 } // int sff_wtrace__
This struct is used to pass WID2 line data within libfapidxx.
Definition: wid2container.h:62
::fapidxx::OFileUnits ostreammanager
the global ostream manager
Definition: fileunit.cc:51
void close(const int &unit)
close the file associated with this file unit
Definition: fileunit.cc:162
Here is the call graph for this function: