C
C *** OUTPUT OF DATA (QN, VN AND WN)***
C
      SUBROUTINE DATOT(DOM,MOM,NOM,NOB,MOB,ROB,RAD,QN,VN,WN)
C
      IMPLICIT REAL*8(A-H,O-Z)
      COMPLEX*16 QN(MOM,MOB),VN(MOM,MOB),WN(MOM,MOB),C1,C2
      DIMENSION ROB(MOB)
      CHARACTER FNAME*15
C
C *** OUTPUT OF QN, VN AND WN ***
C
C   * OUTPUT ON CRT *
C
      WRITE(*,2400)DOM,NOM
      DO 300 IOB=1,NOB
        WRITE(*,2410)ROB(IOB)
        DO 310 K=1,NOM,2
          C1=QN(K  ,IOB)
          C2=QN(K+1,IOB)
          DC1=CDABS(C1)
          DC2=CDABS(C2)
          WRITE(*,2420)C1,DC1,C2,DC2
  310   CONTINUE
  300 CONTINUE
      DO 320 IOB=1,NOB
        WRITE(*,2415)ROB(IOB)
        DO 330 K=1,NOM,2
          C1=VN(K  ,IOB)
          C2=VN(K+1,IOB)
          DC1=CDABS(C1)
          DC2=CDABS(C2)
          WRITE(*,2420)C1,DC1,C2,DC2
  330   CONTINUE
  320 CONTINUE
      DO 340 IOB=1,NOB
        WRITE(*,2417)ROB(IOB)
        DO 350 K=1,NOM,2
          C1=WN(K  ,IOB)
          C2=WN(K+1,IOB)
          DC1=CDABS(C1)
          DC2=CDABS(C2)
          WRITE(*,2420)C1,DC1,C2,DC2
  350   CONTINUE
  340 CONTINUE
C
 2400 FORMAT(/' DOM,NOM=',F6.2,I5)
 2410 FORMAT(/' X=',F10.2,'; QN*2 (Real, Imag, Abs)')
 2415 FORMAT(/' X=',F10.2,'; VN*2 (Real, Imag, Abs)')
 2417 FORMAT(/' X=',F10.2,'; WN*2 (Real, Imag, Abs)')
 2420 FORMAT(2(3D10.3,3X))
C
      WRITE(*,*)
   50 WRITE(*,2310)
      READ(*,'(A)')FNAME
      IF(FNAME(1:1).EQ.' ')GOTO 50
      WRITE(*,2320)
 2310 FORMAT( ' Enter file name : ',\)
 2320 FORMAT( '   Data format for PLOTMS 1: OB => 2: QN, VN and WN')
C      
C   * OUTPUT ON FILE *
C
      OPEN(8,FILE=FNAME)
        WRITE(8,2500)DOM,NOM
        WRITE(8,2510)
        DO 500 IOB=1,NOB
          DO 510 K=1,NOM,4
            WRITE(8,2520)(QN(K+J,IOB),J=0,3)
  510     CONTINUE
  500   CONTINUE
        DO 520 IOB=1,NOB
          DO 530 K=1,NOM,4
            WRITE(8,2520)(VN(K+J,IOB),J=0,3)
  530     CONTINUE
  520   CONTINUE
        DO 540 IOB=1,NOB
          DO 550 K=1,NOM,4
            WRITE(8,2520)(WN(K+J,IOB),J=0,3)
  550     CONTINUE
  540   CONTINUE
      CLOSE(8)
C
 2500 FORMAT(F15.8,I15)
 2510 FORMAT(///)
 2520 FORMAT(8D10.3)
C
C *** OUTPUT OF DATA (GX, GY AND GZ)***
C
C   * OUTPUT ON CRT *
C
      WRITE(*,3000)
      READ(*,*)IYES
      IF(IYES.NE.0)GOTO 9999
C
 3000 FORMAT(/' Output of GX, GY AND GZ? (YES=0): ',\)
C
      CRD=DCOS(RAD)
      SRD=DSIN(RAD)
      DO 600 IOB=1,NOB
        DO 610 K=1,NOM
          C1=QN(K,IOB)
          C2=VN(K,IOB)
          QN(K,IOB)=C1*CRD-C2*SRD
          VN(K,IOB)=C1*SRD+C2*CRD
  610     CONTINUE
  600   CONTINUE
C
      WRITE(*,3400)DOM,NOM
      DO 700 IOB=1,NOB
        WRITE(*,3410)ROB(IOB)
        DO 710 K=1,NOM,2
          C1=QN(K  ,IOB)
          C2=QN(K+1,IOB)
          DC1=CDABS(C1)
          DC2=CDABS(C2)
          WRITE(*,3420)C1,DC1,C2,DC2
  710   CONTINUE
  700 CONTINUE
      DO 720 IOB=1,NOB
        WRITE(*,3415)ROB(IOB)
        DO 730 K=1,NOM,2
          C1=VN(K  ,IOB)
          C2=VN(K+1,IOB)
          DC1=CDABS(C1)
          DC2=CDABS(C2)
          WRITE(*,3420)C1,DC1,C2,DC2
  730   CONTINUE
  720 CONTINUE
      DO 740 IOB=1,NOB
        WRITE(*,3417)ROB(IOB)
        DO 750 K=1,NOM,2
          C1=WN(K  ,IOB)
          C2=WN(K+1,IOB)
          DC1=CDABS(C1)
          DC2=CDABS(C2)
          WRITE(*,3420)C1,DC1,C2,DC2
  750   CONTINUE
  740 CONTINUE
C
 3400 FORMAT(/' DOM,NOM=',F6.2,I5)
 3410 FORMAT(/' X=',F10.2,'; GX*2 (Real, Imag, Abs)')
 3415 FORMAT(/' X=',F10.2,'; GY*2 (Real, Imag, Abs)')
 3417 FORMAT(/' X=',F10.2,'; GZ*2 (Real, Imag, Abs)')
 3420 FORMAT(2(3D10.3,3X))
C
C   * OUTPUT ON FILE *
C
      WRITE(*,*)
   55 WRITE(*,3310)
      READ(*,'(A)')FNAME
      IF(FNAME(1:1).EQ.' ')GOTO 55
      WRITE(*,3320)
 3310 FORMAT( ' Enter file name : ',\)
 3320 FORMAT( '   Data format for PLOTMS 1: OB => 2: GX, GY and GZ')
C      
      OPEN(8,FILE=FNAME)
        WRITE(8,3500)DOM,NOM
        WRITE(8,3510)
        DO 800 IOB=1,NOB
          DO 810 K=1,NOM,4
            WRITE(8,3520)(QN(K+J,IOB),J=0,3)
  810     CONTINUE
  800   CONTINUE
        DO 820 IOB=1,NOB
          DO 830 K=1,NOM,4
            WRITE(8,3520)(VN(K+J,IOB),J=0,3)
  830     CONTINUE
  820   CONTINUE
        DO 840 IOB=1,NOB
          DO 850 K=1,NOM,4
            WRITE(8,3520)(WN(K+J,IOB),J=0,3)
  850     CONTINUE
  840   CONTINUE
      CLOSE(8)
C
 3500 FORMAT(F15.8,I15)
 3510 FORMAT(///)
 3520 FORMAT(8D10.3)
C
 9999 RETURN
      END
