Commit db684f2e authored by thomas.forbriger's avatar thomas.forbriger
Browse files

[FEATURE] (pamo): provide file format selection

Compile pamo.f to pamo and pamox, where the latter makes use of libfapidxx in
order to provide various input file formats.
parent 9b7793b9
......@@ -47,7 +47,7 @@
# ============================================================================
#
PROGRAMS=damplo pamo splot stuplo susplo stuplox damplox
PROGRAMS=damplo pamo splot stuplo susplo stuplox damplox üamox
.PHONY: all
all: install
......@@ -109,7 +109,7 @@ pamo damplo: %: %.o
stuplox: %x: %.o
$(FC) $< -o $@ -ltf $(PGPLOTLIB) $(LDFLAGS) \
-lfapidxx -ldatrwxx -lsffxx -lgsexx -ltime++ -laff
damplox: %x: %.o
pamox damplox: %x: %.o
$(FC) $< -o $@ -ltf -lsffu -ltime \
-lfapidxx -ldatrwxx -lsffxx -lgsexx -ltime++ -laff \
$(PGPLOTLIB) $(LDFLAGS)
......
c this is <pamo.f>
c $Id$
c
c Copyright 1996, 2010 by Thomas Forbriger
c
......@@ -31,11 +30,12 @@ c V1.5 14/06/02 extended title string
c V1.6 19/06/02 print time in movie
c V1.7 24/02/06 provide colour output and arrows
c V1.8 27/02/06 support component swapping
c V1.9 04/11/15 provide input format selection
c
c======================================================================
character*70 version, title
character*80 version, title
parameter(version=
& 'PAMO V1.8 particle motion (Stromboli 96 Tilte)')
& 'PAMO V1.9 particle motion (Stromboli 96 Tilte)')
c
integer delay
parameter(delay=90)
......@@ -58,6 +58,7 @@ c
c
integer inctime(7), fulltime(7), temptime(7)
character*35 timestring
character*80 inputformat
c
logical debug, animate, gifmode, usecolour, plotarrows, swapcompo
integer speed, mil, sec, reachmil, reachsec, pglwidth
......@@ -67,20 +68,22 @@ c
integer listindex(maxindex)
c commandline
integer maxopt, lastarg, iargc
parameter(maxopt=11)
parameter(maxopt=12)
character*2 optid(maxopt)
character*80 optarg(maxopt)
logical optset(maxopt), opthasarg(maxopt)
c here are the keys to our commandline options
data optid/2h-d,2h-D,2h-a,2h-t,2h-s,2h-G,2h-c,2h-l,2h-C,2h-i,2h-S/
data optid/'-d','-D','-a','-t','-s','-G','-c','-l','-C','-i',
& '-S','-f'/
data opthasarg/.TRUE.,2*.FALSE.,2*.TRUE.,.FALSE.,2*.TRUE.,.false.,
& .true.,.false./
data optarg/3hx11,2*1h-,4hPAMO,1h1,1h-,2h1.,1h1,1h-,1h0,1h-/
& .true.,.false.,.true./
data optarg/'x11',2*'-','PAMO','1','-','1.','1','-','0','-',
& 'sff'/
c----------------------------------------------------------------------
print *,version
print *,'Usage: pamo file [ -d device ] [ -t title ] [ -a ]'
print *,' [-s speed] [-G] [-c v] [-l v] [-C]'
print *,' [-i list] [-S]'
print *,' [-i list] [-S] [-f type]'
print *,' or: pamo -help'
if (iargc().lt.1) stop 'ERROR: no parameters'
call getarg(1, filename)
......@@ -105,7 +108,10 @@ c----------------------------------------------------------------------
print *,'-i list list of sample index values for which'
print *,' arrowheads should be plotted'
print *,'-S swap components'
print *,'-f type input files are of file format ''type'' '
call pgp_showdevices
print *,' '
call sff_help_formats
stop
endif
c----------------------------------------------------------------------
......@@ -131,16 +137,22 @@ c----------------------------------------------------------------------
2 continue
endif
swapcompo=optset(11)
inputformat=optarg(12)
call getarg(1, filename)
c----------------------------------------------------------------------
call sff_select_input_format(inputformat, ierr)
if (ierr.ne.0)
& stop 'ERROR: selected input format is not supported'
call sff_ROpen(lu, filename, lver, timestamp, code, ierr)
if (ierr.ne.0) stop 'ERROR: opening file'
ynsamp=maxsamp
xnsamp=maxsamp
call sff_RTrace(lu, tanf, dt, wid2liney, ynsamp, fy, iy, code, last, ierr)
call sff_RTrace(lu, tanf, dt, wid2liney, ynsamp,
& fy, iy, code, last, ierr)
if (ierr.ne.0) stop 'ERROR: reading first trace (y=N)'
if (last) stop 'ERROR: just one trace in file'
call sff_RTrace(lu, tanf, dt, wid2linex, xnsamp, fx, ix, code, last, ierr)
call sff_RTrace(lu, tanf, dt, wid2linex, xnsamp,
& fx, ix, code, last, ierr)
if (ierr.ne.0) stop 'ERROR: reading second trace (x=E)'
if (.not.(last)) close (lu)
c
......
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