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

support differnt input and output file type

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:
SVN Revision: 3864
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent af946823
......@@ -25,11 +25,12 @@ c 30/04/1997 Thomas Forbriger (IfG Stuttgart)
c 09/01/98 V1.1 set source type too
c 24/06/00 V1.2 don't use the error output channel for standard usage info
c 17/01/11 V1.3 use libfapidxx interface
c 12/04/11 V1.4 support different input and output file type
program chaco
character*79 version
parameter(version='CHACO V1.3 change coordinates')
parameter(version='CHACO V1.4 change coordinates')
integer maxsamp, maxfree
parameter(maxsamp=100000, maxfree=400)
......@@ -59,22 +60,22 @@ c======================================================================
c commandline
integer maxopt, lastarg, iargc
character*80 arg, fileformat
character*80 arg, fileformat, outformat
character*3 optid(maxopt)
character*40 optarg(maxopt)
logical optset(maxopt), opthasarg(maxopt)
c here are the keys to our commandline options
data optid/'-ty'/
data opthasarg/.true./
data optarg/'sff'/
data optid/'-ty','-ot'/
data opthasarg/2*.true./
data optarg/2*'sff'/
c output usage
print *, version
print *, 'Usage: chaco infile outfile cofile c1,c2,c3 cs'
print *,' sourcetype [-ty f]'
print *,' sourcetype [-ty f] [-ot f]'
print *, 'or: chaco -help'
print *, 'or: chaco -xhelp'
if (iargc().eq.1) then
......@@ -95,6 +96,8 @@ c output usage
print *,'sourcetype something like ''sledge-hammer'' or ''SISSY'' '
print *,' '
print *,'-ty f select data file format f'
print *,'-ot f select output data file format f, if'
print *,' output format differs from input format'
print *,' '
print *,'As infile and outfile will be open at the same time'
print *,'the must not have the same name!'
......@@ -123,6 +126,8 @@ c get arguments
call tf_cmdline(7, lastarg, maxopt, optid,
& optarg, optset, opthasarg)
if (optset(2)) outformat=optarg(2)
c open coordinate file
......@@ -151,6 +156,8 @@ c add FREE line
50 format("changed SRCE line from: (cs,c1,c2,c3) ",a1,3(1x,f12.3))
c open output file
print *,'opening output file ',outfile(1:index(outfile,' '))
call sff_select_output_format(outformat, ierr)
if ( stop 'ERROR: selecting output file format'
call sff_WOpenFS(luout, outfile, free, nfree, stype,
& cs, c1, c2, c3, date, time, ierr)
if ( stop 'ERROR (chaco): opening output 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