C THIS SUBROUTINE IS A SUPPLEMENT TO FFTID PROGRAM 

 C AND DRAWS A PROFILE OF BATHYMETRIC DATA 

 C C0MPILER(DIAG=3) 



SUBROUTINE BATHXS(DATA,NPTS,GRIDKM) 



DIMENSION DATA(l) 

 C CONVERT DEPTHS IN KILOMETERS TO METERS 

 C WRITE(I0UT,3)(DATA(I),I=1,10) 

 C 3 FORMATC ' ,10(F10.5,1X )) 



DO 5 I=1,NPTS 

 5 DATA(I)=DATA(I)*1000. 



CALL PL0T(0.,10.,-3) 

 C FIND MAXIMUM AND MINIMUM DEPTH 



DEPMIN=0.0 



DEPMAX=0.0 



DO 10 I=1,NPTS 



IF(DATA(I).LT.DEPMIN) DEPMIN=DATA( I ) 



10 IF(DATA(I).GT.DEPMAX) DEPMAX=DATA(I ) 

 CC ROUND TO NEAREST 100 



DEPMAX=(AINT(DEPMAX/100. )*100. )+100. 



DEPMIN=(AINT(DEPMIN/100. )*100. )-100. 



IF(GRIDKM,GT. 0.0001) GO TO 11 



DEPMAX=-1.0 



DEPMIN=1.0 



GO TO 12 



11 IF(GRIDKM.GE.O.Ol) GO TO 12 

 DEPMAX=-20.0 

 DEPMIN=20.0 



12 YSCALE=-(DEPMAX-DEPMIN)/4. 

 C SETUP AXES 



CALL AXES(0.,0.,' DEPTH (IN METERS )' ,18,4.0,90. ,1.00, DEPMAX.YSCALE 

 *,-l) 

 XDIST=FLOAT(NPTS)*GRIOKM 

 XSCALE=12.805/XDIST 

 XINC=1.0 



55 XTICK=XSCALE 



56 IF(XTICK.GT.l.) GO TO 60 

 XINC=2.*XINC 

 XTICK=2.*XTICK 



GO TO 56 

 60 IF(GRIDKM.GT. 0.0001) GO TO 70 



CALL AXES(0. 0,0.0, 'DISTANCE (IN 0.1 METERS) ' ,24, 12. 805, 0.0, XTICK 

 *, 0.0, 1.0,1) 



GO TO 90 

 70 IF(GRIDKM.GT.O.Ol) GO TO 80 



CALL AXES(0. 0,0.0, 'DISTANCE (IN 100 METERS) ' ,24, 12. 805,0. 0,XTICK 

 *, 0.0, 1.0, 3) 



GO TO 90 

 80 CALL AXES (0.0, 0.0, 'DISTANCE (IN KILOMETERS )' ,24, 12. 805,0.0, XTICK 



*,0.0,XINC,-1) 

 90 DO 100 I=1,NPTS 



YVAL=-((DEPMAX-DATA(I))/YSCALE) 



XVAL = (FLOAT ( I )*GR IDKM )*XSCALE 



IF(I.EQ.l) CALL PLOT(0.0,YVAL,3) 



197 



