C
C *** PLOT OF ONE CHANNNEL WAVE DATA FROM DISK FILE ***
C
      SUBROUTINE WVPLOT(TITL,WV,NWV,MWV,DT)
C
C *** TITL : TITLE OF EACH CHANNEL
C *** WV   : WAVE AMPLITUDE DATA
C *** NWV  : WAVE DATA NUMBER
C *** MWV  : NWV IN MAIN PROGRAM DIMENSION
C          : IF MWV > 2**13(=8192), CAN NOT USE !!!
C *** DT   : DELTA TIME ( SEC ) 
C
      CHARACTER TITL*50,YUNIT*6
      DIMENSION WV(32800)
C
C *** MWV CHECK ***
C
      IF(MWV.NE.32800)THEN
      WRITE(*,*)' FROM SUBROUTINE WVPLOT :'
      WRITE(*,*)' MWV.NE.32800 !!!!, THEN STOP !!!!'
      STOP
      END IF
C
C *** SEARCH OF MAXIMUM AMPLITUDE AND DURATION  ***
C
      AMX=0.0
      DO 100 IWV=1,NWV
      AWV=ABS(WV(IWV))
      IF(AWV.GE.AMX)THEN
      AMX=AWV
      IWVMX=IWV
      END IF
  100 CONTINUE
C
      AMX=WV(IWVMX)
      AMXTM=DT*FLOAT(IWVMX-1)
      DUR=DT*FLOAT(NWV-1)
C
C *** OUTPUT OF DATA INFORMATION ***
C
      WRITE(*,*)
      WRITE(*,1000)
   10 WRITE(*,1010)
      WRITE(*,1020)DUR
      WRITE(*,1030)AMX,AMXTM
 1000 FORMAT(' FROM SUBROUTINE WVPLOT :')
 1010 FORMAT(' DATA INFORMATION :')
 1020 FORMAT(' WAVE DURATION (SEC) = ',F8.3)
 1030 FORMAT(' MAXIMUM AMPLITUDE = ',F10.5,' ,TIME (SEC) = ',F8.3/)
C
C *** INPUT OF PLOTTER AXIS DATA ***
C
      WRITE(*,1100)
      WRITE(*,1110)
      READ(*,*)XVAL
      WRITE(*,1120)
      READ(*,*)XLEN
      XLEN=XLEN*100.0
      WRITE(*,1130)
      READ(*,*)NUX
      XFAC=XLEN/XVAL
      WRITE(*,1140)
      READ(*,*)YVAL
      WRITE(*,1150)
      READ(*,*)YLEN
      YLEN=YLEN*100.0
      WRITE(*,1160)
      READ(*,*)NUY
      YFAC=YLEN/YVAL
      WRITE(*,1170)
      READ(*,*)IYUT
      IF(IYUT.EQ.1)YUNIT='  (CM)'
      IF(IYUT.EQ.2)YUNIT='(KINE)'
      IF(IYUT.EQ.3)YUNIT=' (GAL)'
 1100 FORMAT(' CONTROLL DATA INPUT :')
 1110 FORMAT(/' ENTER X-AXIS MAX VALUE ( DURATION : sec ) :',\)
 1120 FORMAT(' ENTER X-AXIS LENGTH ON PLOTTER ( cm ) :',\)
 1130 FORMAT(' ENTER X-AXIS UNIT NUMBER :',\)
 1140 FORMAT(/' ENTER Y-AXIS MAX VALUE ( Y-AXIS AMP > MAX AMP ) :',\)
 1150 FORMAT(' ENTER Y-AXIS LENGTH ON PLOTTER ( AMP : cm ) :',\)
 1160 FORMAT(' ENTER Y-AXIS UNIT NUMBER :',\)
 1170 FORMAT(/' 1:DISP(CM),2:VEL(KINE),3:ACC(GAL) ? :',\)
C
      WRITE(*,1200)
      READ(*,*)XOR
      XOR=(XOR+2.0)*100.0
      WRITE(*,1210)
      READ(*,*)YOR
      YOR=(YOR+2.0)*100.0+YLEN
      WRITE(*,1220)
      READ(*,*)IYES
      IF(IYES.NE.0)GOTO 10
 1200 FORMAT(/' ENTER X LEFT SIDE EDGE POSITION (cm):',\)
 1210 FORMAT(' ENTER Y DOWN SIDE EDGE POSITION (cm):',\)
 1220 FORMAT(/' ALL INPUT DATA OK ? ( YES = 0 ) :',\)
C
C *** OUTPUT PLOTTER DATA ***
C 
      OPEN(6,FILE='PW.DAT')
C
C   * PEN, TERM, AXIS, UNIT CHARACTER AND TITL PLOT *
C
      WRITE(6,2000)
      WRITE(6,2010)
      WRITE(6,2020)XOR,YOR
      WRITE(6,2030)XLEN,NUX
      WRITE(6,2020)XOR+XLEN-100.0,YOR-60.0
      WRITE(6,2040)XVAL
      WRITE(6,2020)XOR+XLEN-100.0,YOR-120.0
      WRITE(6,2050)
      WRITE(6,2020)XOR,YOR-YLEN
      WRITE(6,2060)2.0*YLEN,2*NUY
      WRITE(6,2020)XOR-40.0,YOR-YLEN-60.0
      WRITE(6,2070)-YVAL
      WRITE(6,2020)XOR-40.0,YOR-80.0
      WRITE(6,2080)0.0
      WRITE(6,2020)XOR-40.0,YOR+YLEN-80.0
      WRITE(6,2070)YVAL
      WRITE(6,2020)XOR-100.0,YOR+YLEN-180.0
      WRITE(6,2090)YUNIT
      WRITE(6,2020)XOR-100.0,YOR-YLEN-150.0
      WRITE(6,2100)TITL
 2000 FORMAT(2HJ1)
 2010 FORMAT(3H=<<)
 2020 FORMAT(1HM,F6.1,1H,F6.1,1H,)
 2030 FORMAT(3HX3,,F6.1,1H,I2,2H<<)
 2040 FORMAT(7HR0,S30,,1HP,F5.1,2H<<)
 2050 FORMAT(7HR0,S30,,8HP(SEC)<<)
 2060 FORMAT(3HX2,,F6.1,1H,I2,2H<<)
 2070 FORMAT(9HR900,S30,,1HP,F5.2,2H<<)
 2080 FORMAT(9HR900,S30,,1HP,F4.1,2H<<)
 2090 FORMAT(9HR900,S30,,1HP,A6,2H<<)
 2100 FORMAT(7HR0,S30,,1HP,A50,2H<<)
C
C   * DATA PLOT *
C
      WRITE(6,2200)XOR,YOR+WV(1)*YFAC
      DO 200 IWV=1,NWV-1
      WRITE(6,2210)XOR+DT*FLOAT(IWV)*XFAC,YOR+WV(IWV+1)*YFAC
  200 CONTINUE
      WRITE(6,2200)XOR+DT*FLOAT(IWV)*XFAC+500.0,YOR
 2200 FORMAT(1HM,F6.1,1H,F6.1,1H,)
 2210 FORMAT(1HD,F6.1,1H,F6.1,1H,)
C
      CLOSE(6)
C
      WRITE(*,3000)
 3000 FORMAT(' USE FOR PLOTTER : A> COPY PW.DAT PRN')
      WRITE(*,*)
C
      RETURN
      END
      