#!/bin/csh

set OUTFIL = "plota-brutt.ps"

set FTRACK=vol001.track
set FBAT=vol001.bat
set TITLE="VOLTAIRE Line 001"
set map_dim = 0/100/-4000/0
set FTRACK=vol002.track
set FBAT=vol002.bat
set TITLE="VOLTAIRE Line 002"
set map_dim = 0/120/-4000/0
set FTRACK=vol003.track
set FBAT=vol003.bat
set TITLE="VOLTAIRE Line 003"
set map_dim = 0/120/-4000/0
#set FTRACK=vol004.track
#set FBAT=vol004.bat
#set TITLE="VOLTAIRE Line 004"
#set map_dim = 0/120/-4000/0
#set FTRACK=vol005.track
#set FBAT=vol005.bat
#set TITLE="VOLTAIRE Line 005"
#set map_dim = 0/160/-4000/0
#set FTRACK=vol006.track
#set FBAT=vol006.bat
#set TITLE="VOLTAIRE Line 006"
#set map_dim = 0/270/-4800/0
#set FTRACK=vol007.track
#set FBAT=vol007.bat
#set TITLE="VOLTAIRE Line 007"
#set map_dim = 0/160/-5800/-1000
#set FTRACK=vol008.track
#set FBAT=vol008.bat
#set TITLE="VOLTAIRE Line 008"
#set map_dim = 0/50/-5000/-2000
#set FTRACK=vol009.track
#set FBAT=vol009.bat
#set TITLE="VOLTAIRE Line 009"
#set map_dim = 0/100/-5000/-2000
#set FTRACK=vol010.track
#set FBAT=vol010.bat
#set TITLE="VOLTAIRE Line 010"
#set map_dim = 0/50/-5000/-2000
#
#set FTRACK=vol013.track
#set FBAT=vol013.bat
#set TITLE="VOLTAIRE Line 013"
#set map_dim = 0/100/-5000/-1000
#
#set FTRACK=vol014.track
#set FBAT=vol014.bat
#set TITLE="VOLTAIRE Line 014"
#set map_dim = 0/100/-5000/-1000
#
#set FTRACK=vol015.track
#set FBAT=vol015.bat
#set TITLE="VOLTAIRE Line 015"
#set map_dim = 0/50/-5000/-1000
#
#set FTRACK=vol016.track
#set FBAT=vol016.bat
#set TITLE="VOLTAIRE Line 016"
#set map_dim = 0/60/-5000/-1000
#
#set FTRACK=vol017.track
#set FBAT=vol017.bat
#set TITLE="VOLTAIRE Line 017"
#set map_dim = 0/60/-5000/-1000
#
#set FTRACK=vol018.track
#set FBAT=vol018.bat
#set TITLE="VOLTAIRE Line 018"
#set map_dim = 0/100/-5000/-1000
#
#set FTRACK=vol019.track
#set FBAT=vol019.bat
#set TITLE="VOLTAIRE Line 019"
#set map_dim = 0/100/-5000/-1000
#
#set FTRACK=vol020b.track
#set FBAT=vol020b.bat
#set TITLE="VOLTAIRE Line 020b"
#set map_dim = 0/100/-5000/-1000


#........................................Make tracks
awk '{if(NR>0) print $3,$4,$5,$6}' $FBAT | grdtrack -Gbat_b1.grd -V > $FTRACK
#awk '{if(NR>0) print $3,$4,$5,$6}' $FBAT | grdtrack -Ggebco_0.5m.grd -V > $FTRACK
#exit

gmtset PAPER_MEDIA A4+ PAGE_ORIENTATION landscape MEASURE_UNIT cm
set XOR = 3.
set YOR = 2.
set map_sca = X26/15

psbasemap -R$map_dim -Ba10f1:"Dist [km]":/a500f100:"Depth [m]"::."$TITLE":WSen -J$map_sca -X$XOR -Y$YOR -V -K > $OUTFIL

awk '{if(NR>1) print $4,$3}' $FTRACK | psxy -JX -R -K -O -V -Sc.2 -G255/0/0 -W1/255/0/0 >> $OUTFIL
awk '{if(NR>1) print $4,$5}' $FTRACK | psxy -JX -R -K -O -V -W2/0/0/255 >> $OUTFIL

psxy -JX -V -R -O   <<END>> $OUTFIL
END
#

#xv -rotate -90 $OUTFIL
gv $OUTFIL

