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

issue error message and abort, if WID2 modification function are

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.
accidentally called with a libfapidxx or sffxx formatted string


SVN Path:     http://gpitrsvn.gpi.uni-karlsruhe.de/repos/TFSoftware/trunk
SVN Revision: 3867
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent 25b3a516
......@@ -43,12 +43,15 @@ c just leads to trouble with Y2K
c updated format for sffu_srcetime (fill with zeroes)
c 04/11/02 V1.08 - changed date to timearray in dttodate
c date is a reserved keyword
c 13/04/11 V1.09 check whether WID2 manipulating functions are
c called with a WID2 character string created by
c libfapidxx
c
c----------------------------------------------------------------------
c
c subroutines and what they do
c
c sffu_libversion returns actual library version V1.00
c sffu_libversion returns current library version V1.00
c sffu_timesrce set date from SFF SRCE line V1.07
c sffu_srcetime set SRCE date from date V1.07
c sffu_timewid2 set date from SFF WID2 line V1.07
......@@ -57,6 +60,7 @@ c sffu_seconds calculate real seconds from date V1.00
c sffu_dttodate fill real sampling interval in date record V1.01
c sffu_offset calculate receiver offset V1.02
c sffu_tfirst calculate relative time of first sample V1.02
c sffu_checkwid2 check WID2 ID sequence V1.09
c
c most subroutines that deal with time and date call subroutines from
c libtime.a
......@@ -65,11 +69,11 @@ c======================================================================
c
real function sffu_libversion()
c
c returns actual library version
c returns current library version
c
cE
real version
parameter(version=1.08)
parameter(version=1.09)
sffu_libversion=version
return
end
......@@ -132,6 +136,7 @@ c
cE
integer i, day, month
c
call sffu_checkwid2(wid2line, 'sffu_timewid2')
read(wid2line(6:28), '(i4,5(1x,i2),1x,i3)')
& odate(1), month, day, (odate(i), i=3,6)
call time_fullyear(odate(1))
......@@ -153,6 +158,7 @@ cE
character*23 string
integer d(7), i, day, month
c
call sffu_checkwid2(wid2line, 'sffu_setwid2time')
call time_copy(date, d)
call time_norm(d)
call time_getdate(day, month, d)
......@@ -266,6 +272,7 @@ cE
real sffu_seconds, secs
integer time_compare
c
call sffu_checkwid2(wid2line, 'sffu_tfirst')
call sffu_timesrce(date, time, sdate)
call sffu_timewid2(wid2line, rdate)
call time_sub(sdate, rdate, diff)
......@@ -275,5 +282,37 @@ c
return
end
c
cS
c----------------------------------------------------------------------
c
subroutine sffu_checkwid2(wid2line, caller)
c
c check WID2 character string ID
c
character*132 wid2line
character*(*) caller
c
c wid2line: WID2 line character string
c caller: name of calling function or program
cE
if (wid2line(1:4).ne.'WID2') then
print *,'ERROR: sffu_checkwid2 called by ',
& caller,':'
if (wid2line(1:4).eq.'WIDY') then
print *,' WID2 character string apparently ',
& 'was created by libfapidxx'
print *,' identifier is WIDY, not WID2'
else if (wid2line(1:4).eq.'WIDX') then
print *,' WID2 character string apparently ',
& 'was created by libsffxx'
print *,' identifier is WIDX, not WID2'
else
print *,' WID2 character string has unknown ',
& 'identifier: ', wid2line(1:4)
endif
stop 'cannot handle this...'
endif
return
end
c
c ----- END OF libsffu.f -----
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