Commit f2d0da52 authored by thomas.forbriger's avatar thomas.forbriger Committed by thomas.forbriger
Browse files

merge libfapidxx bugfix and libs enhancements from trunk

This is a legacy commit from before 2015-03-01.
It may be incomplete as well as inconsistent.
See COPYING.legacy and README.history for details.


SVN Path:     http://gpitrsvn.gpi.uni-karlsruhe.de/repos/TFSoftware/branches/libdatrwxx.su2
SVN Revision: 3516
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent 89475c6b
# this is <Makefile.buildingblocks>
# ----------------------------------------------------------------------------
# $Id: $
# $Id$
#
# Copyright (c) 2010 by Thomas Forbriger (BFO Schiltach)
#
......@@ -148,6 +148,19 @@ libaff.a: $(INSTHEADER) $(LIBOBS)
ranlib $@
/bin/mv -vpf $@ $(LIBINSTALLPATH)
#======================================================================
# reinstall target
# is necessary in case of header file problems (e.g. remcmmnt not installed)
.PHONY: clean-include
clean-include:
/bin/rm -fv $(INSTHEADER)
.PHONY: reinstall
reinstall:
$(MAKE) clean
$(MAKE) clean-include
$(MAKE) install
#======================================================================
# documentation part
# ------------------
......
......@@ -34,11 +34,13 @@ LIBDIRS=libaff \
libfapidxx \
TARGETS=$(addsuffix .install,$(LIBDIRS))
REINSTALL=$(addsuffix .reinstall,$(LIBDIRS))
INSTINCLUDE=$(addsuffix .install-include,$(LIBDIRS))
DOCTARGETS=$(addsuffix .doc,$(LIBDIRS))
CLEANTARGETS=$(addsuffix .clean,$(LIBDIRS))
all: $(INSTINCLUDE) $(TARGETS)
reinstall: $(REINSTALL)
doc: $(DOCTARGETS)
show: ; @echo $(TARGETS)
......@@ -56,6 +58,7 @@ clean:
$(MAKE) $(CLEANTARGETS)
%.install: %; cd $<; $(MAKE) install
%.reinstall: %; -(cd $<; $(MAKE) reinstall)
%.install-include: %; -(cd $<; $(MAKE) install-include)
%.doc: %; -(cd $<; $(MAKE) install doxyfull doc; $(MAKE))
%.clean: %; cd $<; $(MAKE) clean
......
......@@ -230,6 +230,19 @@ $(INCINSTALLPATH)/%.h: %.h.strip
.PHONY: install-include
install-include: $(INSTHEADER)
#======================================================================
# reinstall target
# is necessary in case of header file problems (e.g. remcmmnt not installed)
.PHONY: clean-include
clean-include:
/bin/rm -fv $(INSTHEADER)
.PHONY: reinstall
reinstall:
$(MAKE) clean
$(MAKE) clean-include
$(MAKE) install
#======================================================================
# documentation part
# ------------------
......
......@@ -168,6 +168,19 @@ $(INCINSTALLPATH)/%.h: %.h.strip
.PHONY: install-include
install-include: $(INSTHEADER)
#======================================================================
# reinstall target
# is necessary in case of header file problems (e.g. remcmmnt not installed)
.PHONY: clean-include
clean-include:
/bin/rm -fv $(INSTHEADER)
.PHONY: reinstall
reinstall:
$(MAKE) clean
$(MAKE) clean-include
$(MAKE) install
#======================================================================
# documentation part
# ------------------
......
......@@ -67,6 +67,7 @@ edit: flist; vim $<
.PHONY: clean
clean: ;
-find . -name \*.bak | xargs --no-run-if-empty /bin/rm -v
-find . -name \*.h.strip | xargs --no-run-if-empty /bin/rm -v
-/bin/rm -vf flist *.o fapidtest
#======================================================================
......@@ -131,6 +132,16 @@ INSTHEADER=$(addprefix $(INCINSTALLPATH)/,$(HEADERS))
.PHONY: install-include
install-include: $(INSTHEADER)
.PHONY: clean-include
clean-include:
/bin/rm -fv $(INSTHEADER)
.PHONY: reinstall
reinstall:
$(MAKE) clean
$(MAKE) clean-include
$(MAKE) install
#======================================================================
# create the binary library
# -------------------------
......
......@@ -88,7 +88,8 @@ int sff_ropens__(integer *lu, char *filename, real *version, char *timestamp,
*ierr=0;
try {
datrw::ianystream &is=
istreammanager.open(int(*lu), stringfromfstring(filename, filename_len));
istreammanager.open(static_cast<int>(*lu),
stringfromfstring(filename, filename_len));
sff::SRCE srce;
std::string ocode;
if (is.hassrce())
......@@ -102,15 +103,16 @@ int sff_ropens__(integer *lu, char *filename, real *version, char *timestamp,
fillfstring(srce.type, type__, type_len);
char thecs=sff::coosysID(srce.cs);
fillfstring(std::string(&thecs, 1), cs, cs_len);
*c1=real(srce.cx);
*c2=real(srce.cy);
*c3=real(srce.cz);
*c1=static_cast<real>(srce.cx);
*c2=static_cast<real>(srce.cy);
*c3=static_cast<real>(srce.cz);
fillfstring(srceline.substr(74,6), date, date_len);
fillfstring(srceline.substr(81,10), time, time_len);
// timestamp and version got lost
sff::STAT stat;
fillfstring(stat.timestamp, timestamp, timestamp_len);
*version=real(sff::STAT::libversion);
*version=static_cast<real>(sff::STAT::libversion);
// std::cerr << "leaving sff_ropens__" << std::endl;
}
catch(...) {
*ierr=1;
......
......@@ -31,6 +31,8 @@
* REVISIONS and CHANGES
* - 17/11/2010 V1.0 Thomas Forbriger
* - 26/11/2010 V1.1 added multi format control functions
* - 01/12/2010 V1.2 we must not use long int for logical and ftnlen
* either
*
* ============================================================================
*/
......@@ -39,7 +41,7 @@
#ifndef TF_FAPIDSFF_H_VERSION
#define TF_FAPIDSFF_H_VERSION \
"TF_FAPIDSFF_H V1.1"
"TF_FAPIDSFF_H V1.2"
#define TF_FAPIDSFF_H_CVSID \
"$Id$"
......@@ -53,22 +55,26 @@ extern "C" {
#ifndef F2C_INCLUDE
/* FORTRAN (f2c) types needed by the wrapper functions */
/* igfortran and g77 on 64bit system apparently do not use long int */
/* gfortran and g77 on 64bit system apparently do not use long int */
#ifdef __x86_64
//! Fortran integer type
typedef int integer;
//! Fortran logical type
typedef int logical;
//! Fortran string size type
typedef int ftnlen;
#else
//! Fortran integer type
typedef long int integer;
//! Fortran logical type
typedef long int logical;
//! Fortran string size type
typedef long int ftnlen;
#endif
//! Fortran real type (single precision)
typedef float real;
//! Fortran double real type
typedef double doublereal;
//! Fortran logical type
typedef long int logical;
//! Fortran string size type
typedef long int ftnlen;
#else
#warning "f2c.h is read from somewhere else!"
#ifdef __x86_64
......
......@@ -41,6 +41,7 @@
#include<fstream>
#include <fapidxx/fileunit.h>
#include <fapidxx/error.h>
#include <fapidxx/helper.h>
namespace fapidxx {
......
......@@ -44,6 +44,7 @@
"$Id$"
#include<string>
#include<iostream>
#include<libtime++.h>
#include<fapidxx/fapidsff.h>
......@@ -66,6 +67,23 @@ namespace fapidxx {
} // namespace fapidxx
/*----------------------------------------------------------------------*/
/*! \brief produce debug output
*
* \param C output will be generated if C == true
* \param N name of function
* \param M message to print
*/
#define FAPIDXX_debug(C,N,M) \
if (C) { \
std::cerr << "DEBUG (" << N << ", " \
<< __FILE__ << " line #" << __LINE__ << "):" << std::endl \
<< " " << M << std::endl; \
std::cerr.flush(); \
}
#endif // FAPIDXX_HELPER_H_VERSION (includeguard)
/* ----- END OF helper.h ----- */
......@@ -233,6 +233,19 @@ $(INCINSTALLPATH)/%.h: %.h.strip
.PHONY: install-include
install-include: $(INSTHEADER)
#======================================================================
# reinstall target
# is necessary in case of header file problems (e.g. remcmmnt not installed)
.PHONY: clean-include
clean-include:
/bin/rm -fv $(INSTHEADER)
.PHONY: reinstall
reinstall:
$(MAKE) clean
$(MAKE) clean-include
$(MAKE) install
#======================================================================
# tests
# -----
......
......@@ -144,6 +144,19 @@ $(INCINSTALLPATH)/%.h: %.h.strip
.PHONY: install-include
install-include: $(INSTHEADER)
#======================================================================
# reinstall target
# is necessary in case of header file problems (e.g. remcmmnt not installed)
.PHONY: clean-include
clean-include:
/bin/rm -fv $(INSTHEADER)
.PHONY: reinstall
reinstall:
$(MAKE) clean
$(MAKE) clean-include
$(MAKE) install
#======================================================================
# documentation part
# ------------------
......
......@@ -156,6 +156,19 @@ $(ROOTINCINSTALLPATH)/%.h: %.h.strip
.PHONY: install-include
install-include: $(INSTHEADER) $(INSTROOTHEADER)
#======================================================================
# reinstall target
# is necessary in case of header file problems (e.g. remcmmnt not installed)
.PHONY: clean-include
clean-include:
/bin/rm -fv $(INSTHEADER) $(INSTROOTHEADER)
.PHONY: reinstall
reinstall:
$(MAKE) clean
$(MAKE) clean-include
$(MAKE) install
#----------------------------------------------------------------------
# eaxmple and test code
......
......@@ -177,6 +177,19 @@ $(INCINSTALLPATH)/%.h: $(CXXDIR)/%.h.strip
.PHONY: install-include
install-include: $(INSTHEADER)
#======================================================================
# reinstall target
# is necessary in case of header file problems (e.g. remcmmnt not installed)
.PHONY: clean-include
clean-include:
/bin/rm -fv $(INSTHEADER)
.PHONY: reinstall
reinstall:
$(MAKE) clean
$(MAKE) clean-include
$(MAKE) install
#----------------------------------------------------------------------
# create the binary library
# -------------------------
......
......@@ -143,6 +143,19 @@ $(INCINSTALLPATH)/%.h: %.h.strip
.PHONY: install-include
install-include: $(INSTHEADER)
#======================================================================
# reinstall target
# is necessary in case of header file problems (e.g. remcmmnt not installed)
.PHONY: clean-include
clean-include:
/bin/rm -fv $(INSTHEADER)
.PHONY: reinstall
reinstall:
$(MAKE) clean
$(MAKE) clean-include
$(MAKE) install
#======================================================================
# documentation part
# ------------------
......
......@@ -108,6 +108,19 @@ $(INCINSTALLPATH)/%.h: %.h
.PHONY: install-include
install-include: $(INSTHEADER)
#======================================================================
# reinstall target
# is necessary in case of header file problems (e.g. remcmmnt not installed)
.PHONY: clean-include
clean-include:
/bin/rm -fv $(INSTHEADER)
.PHONY: reinstall
reinstall:
$(MAKE) clean
$(MAKE) clean-include
$(MAKE) install
#======================================================================
# documentation part
# ------------------
......
......@@ -184,6 +184,19 @@ $(INCINSTALLPATH)/%.h: %.h.strip
.PHONY: install-include
install-include: $(INSTHEADER)
#======================================================================
# reinstall target
# is necessary in case of header file problems (e.g. remcmmnt not installed)
.PHONY: clean-include
clean-include:
/bin/rm -fv $(INSTHEADER)
.PHONY: reinstall
reinstall:
$(MAKE) clean
$(MAKE) clean-include
$(MAKE) install
#======================================================================
# documentation part
# ------------------
......
......@@ -232,6 +232,19 @@ $(LOCINCLUDEDIR)/%.h: %.h
.PHONY: install-include
install-include: $(addprefix $(LOCINCLUDEDIR)/,$(HEADERS))
#======================================================================
# reinstall target
# is necessary in case of header file problems (e.g. remcmmnt not installed)
.PHONY: clean-include
clean-include:
/bin/rm -fv $(addprefix $(LOCINCLUDEDIR)/,$(HEADERS))
.PHONY: reinstall
reinstall:
$(MAKE) clean
$(MAKE) clean-include
$(MAKE) install
#======================================================================
#
# library dependency definitions
......
......@@ -143,6 +143,19 @@ $(INCINSTALLPATH)/%.h: %.h.strip
.PHONY: install-include
install-include: $(INSTHEADER)
#======================================================================
# reinstall target
# is necessary in case of header file problems (e.g. remcmmnt not installed)
.PHONY: clean-include
clean-include:
/bin/rm -fv $(INSTHEADER)
.PHONY: reinstall
reinstall:
$(MAKE) clean
$(MAKE) clean-include
$(MAKE) install
#======================================================================
# documentation part
# ------------------
......
......@@ -134,6 +134,13 @@ c eval selection
& 'WARNING (readdata): something wrong with your ',
& 'selections for ',
& infile(1:(index(infile,' ')-1)),'?'
if (debug) then
print *,'DEBUG: use selection list'
print *,'DEBUG: list: ',selection
c do j=1,maxselect
c print *,'DEBUG: select ',j,takethis(j)
c enddo
endif
c set file format
elseif (selection(1:2).eq.'f:') then
i=i+1
......@@ -183,6 +190,7 @@ c cycle through all traces
last=.false.
do while (.not.last)
j=j+1
if (debug) print *,'DEBUG: start reading trace ',j
c
c find out whether we want this trace
takeit=.true.
......@@ -193,6 +201,10 @@ c find out whether we want this trace
takeit=.false.
endif
endif
if (debug) then
print *,'DEBUG: trace ',j,' takeit: ',takeit,
& ' selection: ',takethis(j)
endif
c
c work on trace
if (takeit) then
......@@ -257,9 +269,12 @@ c to me this appears to be a close which should not be here
endif
else
print *,' skip trace no. ',j
if (debug) print *,'DEBUG: processing trace ',j
call skipdata(lu, last)
if (debug) print *,'DEBUG: processing trace ',j
tifcount=tifcount+1
endif
if (debug) print *,'DEBUG: end reading trace ',j
enddo
call sff_close(lu, ierr)
if (ierr.ne.0) stop 'ERROR (readdata): closing data file'
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment