      PROGRAM POST
      COMMON  A(25000)
      COMMON/PLT/DUMMY1(20),IFILE(4)
      COMMON/CALCOM/DUM1(3)
      COMMON/ELRANG/DUM2(21)
      COMMON/GROUP/DUM3(304)
      COMMON/HIDDEN/DUM4(3002)
      COMMON/HP21/DUM5(5)
      COMMON/IWINDO/DUM6(6)
      COMMON/JUNK/DUM7(205)
      COMMON/IFORMT/IFORM
      COMMON/MSTREE/DUM8(4)
      COMMON/PREP/DUM10(25)
      COMMON/RAMTEK/DUM11(4)
      COMMON/ROTAT/DUM12(4)
      COMMON/SENOD1/DUM14(21)
      COMMON/SHLOAD/DUM15(14)
      COMMON/SHRINK/DUM16(2)
      COMMON/STRESS/DUM17(10006)
      COMMON/TRASH/DUM18(201)
      COMMON/CDC100/IJJJ
      COMMON/WATYPE/DUM21(21)
      COMMON/FRECNT/LINE(80),DUM22(17)
      COMMON/FRECNM/MULTIP
      COMMON/VS11VA/IVS11,DUM20(2)
      COMMON/IGL100/IGLKEY,IBAUD,IDEV,IOPT,PXSIZE,PYSIZE,TIM10
      COMMON/NSAP6/ISAP6,DUM9(3)
      COMMON/STOR20/NGPT,N14,MTOT
      COMMON/MES/DUMMY2(23)
      COMMON/PT/DUMMY3(5)
      COMMON/BX/DUMMY4(15)
      COMMON/ANG/DUMMY5(8)
      COMMON/PAR/DUMMY6(6)
      COMMON/ELARRY/NELAR(4,20)
      COMMON/UNIT/II11,II22,DUM19(4)
      COMMON/KAMY/DUM23(44)
      COMMON/TITEL1/DUM24(26)
      DATA IYES/1HY/,NO/1HN/
      CALL STIME
      CALL SECOND(TIM10)
      MTOT=25000
      ISAP6=1
      IJJJ=0
      II11=5
      II22=2
      IFILE(1)=17
      IFILE(2)=18
      IFILE(3)=19
      IFILE(4)=20
      IGLKEY=0
      IVS11=0
      IDFL=IYES
      IFORM=1
      IERROR=0
      CALL OFILES(ERROR)
      IF(IERROR.EQ.1)GO TO 300
      IF(IFILE(4).EQ.0)IDFL=NO
110   CALL CRNCH6(MTOT,NRES)
199   NEXT=0
200   REWIND 18
      READ(18)NGPT,NELT,NLCP
      NLCP=IABS(NLCP)
      NDF=NGPT
      IF(IDFL.NE.IYES)NDF=1
      N1=1
      N2=N1+NGPT
      N3=N2+NGPT
      N4=N3+NGPT
      N5=N4+NGPT
      N6=N5+NGPT
      N7=N6+NGPT
      N8=N7+NDF
      N9=N8+NDF
      N10=N9+NDF
      N11=N10+NELT
      N12=N11+NLCP
      N13=N12+NELT+1
      N14=N13+NELT+1
C     IF(N14.GT.MTOT)CALL ERROR(N14-MTOT)
      CALL MYPLOT(A(N1),A(N2),A(N3),A(N4),A(N5),A(N6),A(N7),
     1A(N8),A(N9),A(N10),A(N11),NGPT,NDF,NELT,NLCP,NEXT,A(N13))
      IF(NEXT.EQ.1)GO TO 199
300   STOP
      END
      BLOCK DATA
      INTEGER SECT,POINT,BEGIN,GETSEC,EPOINT,BLANK,AGET,AGETW
      LOGICAL EOL,EOS,EOF,ERROR,INDEX,GETWRD,IGET,RGET,ERR1
      COMMON/ELARRY/NELAR(4,20)
      COMMON  /FRECNT/ LINE(80),SECT,EOL,EOS,EOF,
     1ERROR,BLANK,ICOMMA,POINT,BEGIN,LENGTH,
     2EPOINT,NSECT,LINENM,MAXSTR,KUNIT,JUNIT,IUNIT
      COMMON /FRECNM/MULTIP
      DATA MULTIP/0/
      DATA BLANK/1H /,ICOMMA/1H,/,ERROR/.FALSE./,
     2POINT/1/,BEGIN/1/,LENGTH/0/,EPOINT/1/,
     3LINE/80*1H /,MAXSTR/1/,LINENM/1/
      DATA NELAR/2,2,6,2,
     13,2,12,26,
     14,4,12,8,
     14,4,8,4,
     18,8,33,54,
     14,4,42,12,
     11,1,1,1,
     14,4,8,4,
     13,2,12,39,
     120,20,60,54,
     18,8,16,52,
     18,8,16,52,
     18,8,16,52,
     14,1,6,6,
     18,8,16,52,
     19,9,27,52,
     120,20,40,40,
     116,16,32,52,8*0/
      END
      SUBROUTINE ANGS
      COMMON /MES/L(10),V(10)
      COMMON /ANG/H,SX,SY,CX,CY,IDC(3)
      IF(L(1).EQ.0.0.AND.L(2).EQ.0.0.AND.L(3).EQ.0.0)GO TO 40
      SX=0.
      DO 11 I=1,3
      IDC(I)=L(I)
      V(I)=L(I)
11    SX=SX+V(I)*V(I)
      SX=SQRT(SX)
      DO 21 I=1,3
21    V(I)=V(I)/SX
      SX=V(2)
      CX=1.-SX*SX
      IF (CX .EQ. 0.) GO TO 31
      CX=SQRT(CX)
      SY=-V(1)/CX
      CY=V(3)/CX
      RETURN
31    SY=0.
      CY=1.
40    RETURN
      END
      SUBROUTINE AXESPT
      COMMON /PLT/IPN,IEN,ILN,XB,YB,SC,SCL,SCD,SCFL,SCFD
      COMMON/RAMTEK/MTEK1
      COMMON/UNIT/I1,I2
      CALL OFFSET (0)
      CALL PLTAXS (1,SC)
      CALL HOME
      RETURN
      END
      SUBROUTINE BOX
      COMMON /MES/L(10),V(10)
      COMMON /BX/BM(3),BLM(6),BLS(6)
      DO 21 I=1,5,2
      I1=I+1
      IF (V(I) .EQ. V(I1)) GO TO 11
      BLM(I)=V(I)
      BLM(I1)=V(I1)
      GO TO 21
11    BLM(I)=BLS(I)
      BLM(I1)=BLS(I1)
21    CONTINUE
      DO 31 I=1,3
      I1=2*I
31    BM(I)=.5*(BLM(I1-1)+BLM(I1))
      RETURN
      END
      SUBROUTINE COMM
      REAL*8 TIT6(13),BLAN8
      INTEGER*2 NOFF(42),BLANK1,IPLAS
      LOGICAL RGET,IGET
      DIMENSION TF(42),LF(41),IDEGR(6),KGROUP(1000)
      COMMON A(25000)
      COMMON/STOR20/NGPT10,N1410,MTOT
      COMMON/VS11VA/IVS11,IMOVE,NSTEP
      COMMON /PLT/IPN,IEN,ILN,XB,YB,SC,SCL,SCD,SCFL,SCFD,ISR,INR,LABL
     1,TYPEU,TYPED,WHAT,LNTYPD,LNTYPU,SCALE,IBCS,IPOINT,ILOAD,I33,I32
      COMMON /MES/L(9),NPR,V(10),I,IS,IERR
      COMMON/BOUND1/IDEGR
      COMMON/UNIT/II11,II22
      COMMON/HIDDEN/IHIDE,NTHIDE,NHIDE(2000)
      COMMON/SHOWAX/ISHOW1
      COMMON/CALCOM/ICAL,XSIZE,YSIZE
      COMMON/MSTREE/S100,S101,KALOR
      COMMON/SHLOAD/ LOAD6,JLOAD(6),SSS1(6),LCASE
      COMMON/RAMTEK/MTEK1,SRAM1
      COMMON/NSAP6/ISAP6,NUMBER
      COMMON/IGL100/IGLKEY,IBAUD,IDEV,IOPT,PXSIZE,PYSIZE,TIM10
      COMMON/ROTAT/IROT,TETA,DIREC,ANTETA
      COMMON/WATYPE/KSTYPE,KOST(20)
      COMMON/SENOD1/ISEND,IR0(2,10)
      COMMON/GROUP/IGR1,IFG1,ILAG1,ITOTG1,IGROUP(100,3)
      COMMON/IWINDO/IWIND,XM1,XM2,YM1,YM2,WINLEN
      COMMON/BOXELN/BASH
      COMMON/ELRANG/IRANG,IRA0(2,10)
      COMMON/SHRINK/ISHR1,SHFACT
      COMMON/STRESS/IFLOK,IST1,SCL1,NSIG,IDIR1
      COMMON/HP21/IHP21
      COMMON/TITEL1/TIT6
      COMMON/WHICHF/IB9,IL9
      DIMENSION N1(40),XR0(2,10),WIND1(10),WIND2(6)
      DATA IPLAS/1H+/,DDDD/1HD/,SSSS/1HS/,UUUU/1HU/,YESYES/1HY/
      DATA BLAN8/4H    /,CCC/1HC/
      DATA TF(1),TF(2),TF(3)/2HPN,2HEN,4HELTS/
      DATA LF(1),LF(2),LF(3)/0,0,0/
      DATA TF(4),TF(5),TF(6)/4HDOTS,4HVDIR,3HBOX/
      DATA LF(4),LF(5),LF(6)/0,30,6/
      DATA TF(7),TF(8),TF(9)/3HVPT,4HRESE,4HPLOT/
      DATA LF(7),LF(8),LF(9)/1,0,0/
      DATA TF(10)/4HNEXT/
      DATA LF(10)/0/
      DATA TF(11)/4HLABE/
      DATA LF(11)/0/
      DATA TF(12),LF(12)/4HSCAL,1/
      DATA TF(13),LF(13)/3HBCS,0/
      DATA TF(14)/4HEXIT/
      DATA TF(15)/4HSHOW/
      DATA TF(16)/4HHELP/
      DATA TF(17)/4HCOOR/
      DATA TF(18)/4HHIST/
      DATA TF(19)/2HHP/
      DATA TF(20)/3HSTR/
      DATA TF(21)/4HTITL/
      DATA TF(22)/4HSHRI/
      DATA TF(23)/4HSELE/
      DATA TF(24)/4HWION/
      DATA TF(25)/4HWIOF/
      DATA TF(26)/4HROTA/
      DATA TF(27)/4HSEND/
      DATA TF(28)/4HSTYP/
      DATA TF(29)/4HCHAR/
      DATA TF(30)/4HEDIT/
      DATA TF(31)/4HGROU/
      DATA TF(32)/4HRAMT/
      DATA TF(33)/4HLOAD/
      DATA TF(34)/4HCAL /
      DATA TF(35)/4HAXIS/
      DATA TF(36)/4HHIDE/
      DATA TF(37)/3HIGL/
      DATA TF(38)/4HMOVE/
      DATA TF(40)/4H    /
      DATA TF(41)/4HWAIT/,TF(42)/4HLINE/,OOO/1H0/,IWHAT/0/
      DATA BL/1H /,BBBB/1HB/
      DATA BLANK1/1H /,PERRI/4HPERI/
      DATA N1/35,13,6,34,29,17,4,30,3,2,14,31,16,36,18,19,37,11,33
     1,38,10,9,1,32,8,26,12,23,27,15,22,20,28,21,5,7,25,24,42,40/
      DATA WIND1/4HDIGI,4HTIZE,4H WIN,4HDOW ,4H,BOT
     1,4HTOM ,4HLEFT,4H HAN,4HD CO,4HRNER/
      DATA WIND2/4HTOP ,4HRIGH,4HT HA,4HND C,4HORNE,1HR/
10    DO    20 L9L=1,42
20    NOFF(L9L)=BLANK1
      WINLEN=800.0
      IF(IPN.EQ.1)NOFF(1)=IPLAS
      IF(IEN.EQ.1)NOFF(2)=IPLAS
      IF(ILN.EQ.1)NOFF(3)=IPLAS
      IF(LABL.EQ.1)NOFF(11)=IPLAS
      IF(IPOINT.EQ.1)NOFF(4)=IPLAS
      IF(IBCS.EQ.1)NOFF(13)=IPLAS
      IF(IHP21.EQ.1)NOFF(19)=IPLAS
      IF(IST1.EQ.1)NOFF(20)=IPLAS
      IF(ISHR1.EQ.1)NOFF(22)=IPLAS
      IF(IRANG.EQ.1)NOFF(23)=IPLAS
      IF(IWIND.EQ.1)NOFF(24)=IPLAS
      IF(IROT.EQ.1)NOFF(26)=IPLAS
      IF(ISEND.EQ.1)NOFF(27)=IPLAS
      IF(KSTYPE.EQ.1)NOFF(28)=IPLAS
      IF(IGR1.EQ.1)NOFF(31)=IPLAS
      IF(LOAD6.EQ.1)NOFF(33)=IPLAS
      IF(ICAL.EQ.1)NOFF(34)=IPLAS
      IF(ISHOW1.EQ.1)NOFF(35)=IPLAS
      IF(IHIDE.EQ.1)NOFF(36)=IPLAS
      IF(IMOVE.EQ.1)NOFF(38)=IPLAS
      GO TO 200
25    I=42
      IS=42
26    CONTINUE
60    FORMAT(A1)
      IWHAT=0
70    WRITE(*,   80)
80    FORMAT(' LINE FOR UNDEFORMED STRUCTURE ? (SOLID, DASHED OR NONE)')
90    WRITE(*,  85 )
85    FORMAT('  (S/D/0) ?')
      READ(*,   60,ERR=   90)TYPEU
      IF(TYPEU.EQ.BL)TYPEU=OOO
      IF(TYPEU.EQ.OOO)GO TO 120
      WHAT=UUUU
      IF(TYPEU.EQ.SSSS)GO TO   120
      WRITE(*,  170)
      WRITE(*,  430)
100   READ(*,  190,ERR=  460)LNTYPU
      IF(LNTYPU.LE.0)LNTYPU=3434
      IF(IGLKEY.EQ.1.AND.LNTYPU.LE.0)LNTYPU=4
120   IF(NUMBER.EQ.0)GO TO 200
      WRITE(*,  140)
130   WRITE(*,85)
140   FORMAT(' LINE FOR DEFORMED STRUCTURE ? (SOLID, DASHED OR NONE)')
      READ(*,   60,ERR=  130)TYPED
150   FORMAT('   DEFAULT DEFORMED SCALE = ',E12.5)
      IF(TYPED.EQ.BL)TYPED=OOO
      IF(TYPED.EQ.OOO)GO TO 200
      WHAT=DDDD
      IF(TYPEU.NE.OOO)WHAT=BBBB
      IWHAT=1
      IF(TYPED.EQ.SSSS)GO TO   195
160   WRITE(*,  170)
      WRITE(*,  430)
170   FORMAT('  TYPE DASHED LINE CODE OR HIT CARRIAGE RETURN ')
180   READ(*,  190,ERR=  470)LNTYPD
      IF(LNTYPD.LE.0)LNTYPD=3434
      IF(LNTYPD.LE.0.AND.IGLKEY.EQ.1)LNTYPD=4
190   FORMAT(I4)
195   IF(I.EQ.10)RETURN
200   IF (IS .EQ. 9) GO TO   290
      IF(IS.NE.0)GO TO   280
      CALL NEWPAG
      WRITE(*,211)
211   FORMAT(10X,'*** PLEASE ENTER POST MAIN LEVEL COMMANDS ***')
      GO TO 280
215   CONTINUE
      WRITE(*,  220)
220   FORMAT(24X,'*** P O S T  JAN-1982 ***')
      WRITE(*,  230)
230   FORMAT(3X,67(1H-))
      WRITE(*,  240)
240   FORMAT(3X,1H ,15X,'COMMAND SELECTION')
      WRITE(*,  250)
250   FORMAT(3X,1H ,8X,'+ ,MEANS THAT THE <ON/OFF> SWITCH IS <ON>.')
      WRITE(*,  230)
      DO   270 NN=1,38,4
      K1=N1(NN)
260   FORMAT(3X,1H ,4(5X,A4,2X,A1,2X,1H,),5X,1H )
      K2=N1(NN+1)
      K3=N1(NN+2)
      K4=N1(NN+3)
      WRITE(*,  260)TF(K1),NOFF(K1),TF(K2),NOFF(K2)
     1,TF(K3),NOFF(K3),TF(K4),NOFF(K4)
270   CONTINUE
      WRITE(*,  230)
280   WRITE(*,  400)
290   READ(*,  410,ERR=  810)ANS,HELPA
      IF(TF(41).EQ.ANS) GOTO 1680
      IF(TF(42).EQ.ANS)GO TO 25
      DO   300 IS=1,38
      IF (TF(IS) .EQ. ANS) GO TO   310
300   CONTINUE
      IF (ANS .NE. BL) WRITE(*,  420)
      GO TO   280
310   I=IS
      GO TO (  750, 1610,  760,  770,  320,  320,  320,  320,  320,392
     1,  780,  320,  480, 1660,  215,  280,  370, 1440,  800, 1460
     2, 1000, 1040, 1080, 1140, 1130, 1240,  950, 1310, 1360,  370
     3,  820,  380,  550,  640,  740,  700,  680,  910),I
      WRITE(*,  420)
      GO TO   280
320   IF (LF(I).EQ. 0)RETURN
330   WRITE(*,  430)
340   CONTINUE
      IF(I.NE.5)GO TO   350
      CALL GETNL(GET001)
      IF(IGET(L(1)))GO TO   340
      IF(IGET(L(2)))GO TO   340
      IF(IGET(L(3)))GO TO   340
      IF(IHIDE.EQ.1)WRITE(*, 1650)
      IF(IHIDE.EQ.1)IHIDE=-1
350   IF(I.NE.6)GO TO   360
      CALL GETNL(GET001)
      IF(RGET(V(1)))GO TO   340
      IF(RGET(V(2)))GO TO   340
      IF(RGET(V(3)))GO TO   340
      IF(RGET(V(4)))GO TO   340
      IF(RGET(V(5)))GO TO   340
      IF(RGET(V(6)))GO TO   340
360   IF(LF(I).NE.1)RETURN
      WRITE(*,  150)SCALE
      WRITE(*,  430)
      CALL GETNL(GET001)
      IF(RGET(V(1)))GO TO   340
      IF(V(1).EQ.0.0)V(1)=SCALE
370   RETURN
380   MTEK1=-MTEK1
      WRITE(*, 1650)
      GO TO    10
392   CONTINUE
      NUMBER=1
      IF(IWHAT.EQ.0)GO TO 26
      RETURN
400   FORMAT (2H &)
410   FORMAT (A4,1X,A4)
420   FORMAT (16H ILLEGAL COMMAND)
430   FORMAT (2H ?)
440   FORMAT(' ILLEGAL DATA ,INPUT DATA AGAIN ')
450   WRITE(*,  440)
      GO TO   330
460   WRITE(*,  440)
      GO TO   100
470   WRITE(*,  440)
      GO TO   180
480   WRITE(*,  510)
510   FORMAT('  UNAVAILABLE COMMAND ON AT')
      GOTO 10
550   WRITE(*,  630)
630   FORMAT(' UNAVAILABLE COMMAND ON AT')
      GO TO    10
640   ICAL=-ICAL
      IF(ICAL.EQ.1)GO TO   650
      WRITE(*, 1650)
      GO TO    10
650   WRITE(*,  660)
660   FORMAT(' INPUT PLOT SIZE . X,Y (INCH)')
      WRITE(*,  430)
670   CALL GETNL(GET001)
      IF(RGET(XSIZE))GO TO   670
      IF(RGET(YSIZE))GO TO   670
      IF(XSIZE.LE.0)XSIZE=7.0
      IF(YSIZE.LE.0)YSIZE=7.0
      GO TO    10
680   IGLKEY=-IGLKEY
      WRITE(*, 1650)
      GO TO    10
700   IHIDE=-IHIDE
      IF(IHIDE.EQ.1)GO TO   710
      WRITE(*, 1650)
      GO TO    10
710   WRITE(*,  720)
720   FORMAT(' *** START FINDING HIDDEN NODES ***')
      CALL SECOND(T1T1)
      NN1=N1410
      N2=NN1+NGPT10
      N3=N2+NGPT10
      N4=N3+NGPT10
      N5=N4+NGPT10
      N6=N5+NGPT10
      N7=N6+NGPT10
      N8=N7+NGPT10
      N9=N8+NGPT10
      N10=N9+NGPT10
      N11=N10+NGPT10
      IF(N11.GT.MTOT)CALL ERROR(N11-MTOT)
      CALL FINODE(NGPT10,A(NN1),A(N2),A(N3),A(N4),A(N5),A(N6)
     1,A(N7),A(N8),A(N9),A(N10))
      CALL SECOND(T1T2)
      T1TT=T1T2-T1T1
      WRITE(*,  730)T1TT
730   FORMAT(' --- TOTAL CPU USED TO FIND THE HIDDEN NODES ',F12.3
     1,' SECONDS ---')
      GO TO    10
740   CONTINUE
1111  FORMAT (' UNAVAILABLE COMMAND ON AT !')
      WRITE(*, 1111)
      GO TO    10
750   IF(IPN.EQ.1)GO TO  1640
      RETURN
760   IF(ILN.EQ.1)GO TO  1640
      RETURN
770   IF(IPOINT.EQ.1)GO TO  1640
      RETURN
780   IF(LABL.EQ.1)GO TO  1640
      RETURN
800   IF(IGLKEY.NE.1)IHP21=-IHP21
      WRITE(*, 1650)
      GO TO    10
810   WRITE(*,  420)
      GO TO   280
820   IF(ISAP6.NE.1)GO TO   840
      WRITE(*,  830)
830   FORMAT(' THIS COMMAND IS ONLY FOR SAP6NL PROGRAM ')
      GO TO    10
840   IGR1=-IGR1
      IF(IGR1.EQ.1)GO TO   850
      WRITE(*, 1650)
      GO TO    10
850   WRITE(*,  860)
860   FORMAT(' TYPE ELEMENT GROUP NUMBER')
      WRITE(*,  430)
870   CALL GETNL(GET001)
      IF(IGET(ISE1))GO TO   870
      DO   880 MG1=1,ITOTG1
      IF(IGROUP(MG1,1).EQ.ISE1)GO TO   900
880   CONTINUE
      WRITE(*,  890)ISE1
890   FORMAT(' ELEMENT GROUP NUMBER = ',I5,' DOES NOT EXIST')
      GO TO   850
900   IFG1=IGROUP(MG1,2)
      ILAG1=IGROUP(MG1,3)
      GO TO    10
910   IMOVE=-IMOVE
      IF(IMOVE.EQ.1)GO TO   920
      WRITE(*, 1650)
      GO TO    10
920   WRITE(*,  930)
930   FORMAT(' .INPUT THE NUMBER OF MOVE INCREMENTS.')
      WRITE(*,  430)
940   CALL GETNL(GET001)
      IF(IGET(NSTEP))GO TO   940
      IF(NSTEP.LE.0)NSTEP=8
      GO TO    10
950   ISEND=-ISEND
      IF(ISEND.EQ.1)GO TO   960
      WRITE(*, 1650)
      GO TO    10
960   WRITE(*,  970)
970   FORMAT(' TYPE NODE RANGE (MAY TYPE UP TO 10 GROUP)')
      WRITE(*,  430)
980   CALL GETNL(GET001)
      DO   990 LL=1,10
      IF(IGET(IR0(1,LL)))GO TO   980
      IF(IGET(IR0(2,LL)))GO TO   980
990   CONTINUE
      GO TO    10
1000  WRITE(*, 1010)
1010  FORMAT('  TYPE PLOT TITLE:')
      WRITE(*,  430)
      DO  1020 JJ211=1,13
1020  TIT6(JJ211)=BLAN8
      READ(*, 1030,ERR= 1000)TIT6
1030  FORMAT(13A4)
      GO TO   280
1040  ISHR1=-ISHR1
      IF(ISHR1.EQ.1)GO TO  1050
      WRITE(*, 1650)
      GO TO   280
1050  WRITE(*, 1060)
1060  FORMAT(' TYPE SHRINK FACTOR ')
      WRITE(*,  430)
1070  CALL GETNL(GET001)
      IF(RGET(SHFACT))GO TO  1070
      IF(SHFACT.GT.1)SHFACT=1
      IF(SHFACT.LE.0)SHFACT=0.8
      GO TO   280
1080  IRANG=-IRANG
      IF(IRANG.EQ.1)GO TO  1090
      WRITE(*, 1650)
      GO TO   280
1090  WRITE(*, 1100)
1100  FORMAT('  ELEMENT RANGE (MAY TYPE UP TO 10 DIFFERENT GROUPS)')
      WRITE(*,  430)
1110  CALL GETNL(GET001)
      DO  1120 LL=1,10
      IF(IGET(IRA0(1,LL)))GO TO  1110
      IF(IGET(IRA0(2,LL)))GO TO  1110
1120  CONTINUE
      GO TO    10
1130  IWIND=-1
      WRITE(*, 1650)
      XM1=0.
      XM2=800.
      YM1=0.
      YM2=800.
      GO TO    10
1140  WRITE(*, 1150)
1150  FORMAT(' USING CURSOR ?   `Y/N!')
      WRITE(*,  430)
      READ(*,   60,ERR= 1140)AN1
      IF(AN1.EQ.YESYES)GO TO  1200
1160  WRITE(*, 1170)
1170  FORMAT('  INPUT SCREEN WINDOW MINX,MAXX,MINY,MAXY ')
      WRITE(*,  430)
1180  CALL GETNL(GET001)
      IF(IGET(MINX))GO TO  1180
      IF(IGET(MAXX))GO TO  1180
      IF(IGET(MINY))GO TO  1180
      IF(IGET(MAXY))GO TO  1180
      XM1=FLOAT(MINX)
      XM2=FLOAT(MAXX)
      YM1=FLOAT(MINY)
      YM2=FLOAT(MAXY)
      GO TO  1210
1200  CALL MOVABS(20,20)
      CALL ANMODE
      CALL TEXT10(WIND1,40)
      CALL VCURSR(IC1,XM1,YM1)
      CALL MOVABS(600,700)
      CALL ANMODE
      CALL TEXT10(WIND2,21)
      CALL VCURSR(IC1,XM2,YM2)
1210  DIFX=XM2-XM1
      DIFY=YM2-YM1
      IF(DIFX.GT.DIFY)GO TO  1220
      XM2=XM1+DIFY
      GO TO  1230
1220  YM2=YM1+DIFX
1230  I=9
      RETURN
1240  IROT=-IROT
      IF(IROT.EQ.1)GO TO  1250
      WRITE(*, 1650)
      GO TO    10
1250  WRITE(*, 1260)
1260  FORMAT('  AXES FOR ROTATION ,X,Y,Z ')
      WRITE(*,  430)
      READ(*, 1270,ERR= 1250)DIREC
1270  FORMAT(A1)
1280  WRITE(*, 1290)
1290  FORMAT('  ANGLE OF ROTATION')
      WRITE(*,  430)
1300  CALL GETNL(GET001)
      IF(RGET(TETA))GO TO  1300
      ANTETA=TETA
      TETA=4.*ATAN(1.0)*(TETA)/180.0
      RETURN
1310  KSTYPE=-(KSTYPE)
      IF(KSTYPE.EQ.1)GO TO  1320
      WRITE(*, 1650)
      GO TO    10
1320  WRITE(*, 1330)
1330  FORMAT(' SELECT ELEMENT TYPE (1,2,4,..) ,RETURN SELECT ALL ')
      WRITE(*,  430)
1340  CALL GETNL(GET001)
      DO  1350 JOJO=1,20
      IF(IGET(KOST(JOJO)))GO TO  1340
1350  CONTINUE
      GO TO    10
1360  WRITE(*, 1370)
1370  FORMAT(' SELECT CHARACTER SIZE (1,2,3,4) 4014/15 ONLY ')
      WRITE(*,  430)
1380  CALL GETNL(GET001)
      IF(IGET(ICHAR))GO TO  1380
      IF(ICHAR.LE.0)ICHAR=1
1430  CALL TERM(3,1024)
      CALL CHRSIZ(ICHAR)
      GO TO    10
1440  XSAVE1=XM1
      XSAVE2=XM2
      YSAVE1=YM1
      YSAVE2=YM2
      WINLEN=1024.
1450	CONTINUE
C1450  CALL PCURVE
      WINLEN=800.0
      XM1=XSAVE1
      XM2=XSAVE2
      YM1=YSAVE1
      YM2=YSAVE2
      GO TO   280
1460  IF(IFLOK.EQ.1)GO TO  1490
1470  WRITE(*, 1480)
1480  FORMAT(' THERE IS NO STRESS FILE ')
      GO TO   280
1490  IST1=-IST1
      IF(IST1.EQ.1)GO TO  1500
      WRITE(*, 1650)
      KALOR=0
      GO TO    10
1500  WRITE(*, 1510)
1510  FORMAT(' TYPE STRESS COLUMN ')
      WRITE(*,  430)
1520  CALL GETNL(GET001)
      IF(IGET(NSIG))GO TO  1520
      IF(NSIG.GT.10.OR.NSIG.LT.1)GO TO  1590
1560  WRITE(*, 1570)
1570  FORMAT(' HORIZONTAL OR VERTICAL STRESS VECTOR `H/V! ')
      WRITE(*,  430)
      READ(*,   60,ERR= 1560)IDIR1
1580  CALL READST(IOK1)
      IF(IOK1.EQ.1)GO TO    10
      IST1=-1
      KALOR=0
      WRITE(*, 1480)
      GO TO    10
1590  WRITE(*, 1600)
1600  FORMAT(' SELECT STRESS COLUMN BETWEEN 1,10 ')
      GO TO  1500
1610  IF(IEN.NE.1)GO TO  1620
      GO TO  1640
1620  WRITE(*, 1630)
1630  FORMAT(' BOX AROUND ELEMENT NUMBER ? `Y/N! ')
      WRITE(*,  430)
      READ(*,   60,ERR= 1610)BASH
      RETURN
1640  WRITE(*, 1650)
1650  FORMAT(' ..TURNED OFF .')
      RETURN
1660  CONTINUE
      CALL SECOND(TIM20)
      TIMET=TIM20-TIM10
      WRITE(*, 1670)TIMET
1670  FORMAT(2X,10(1H-),'TOTAL CPU TIME =',F12.3,' SECONDS'
     1,10(1H-))
      STOP
1680  CONTINUE
      GOTO 280
1690  FORMAT(F4.0)
      STOP
      END
      SUBROUTINE CONV (I,T)
      DIMENSION T(1)
      XX=FLOAT(I)
      KK=LENSTR(T,XX)
      RETURN
      END
      SUBROUTINE CRNCH6(MTOTM,NRES)
      IMPLICIT REAL*8(A-H,O-Z)
      COMMON  A(25000)
      REAL*8 NPAR
      COMMON /TRASH/IA,IDDMHI(200)
      COMMON/UNIT/II11,II22
      COMMON /PREP/ XMX,XAD,KSKIP,NDYN,I1,I99,POS,PRTCOD
     1,POSSAV,PRTOFF,PRTON,PRTDUM,IDIRC,KK(4)
      COMMON /ELPAR/ NPAR(14),NUMNP,MBAND,NELTYP,N1,N2,N3,N4,N5,MTOT,NEQ
     1,N2P,N3P,NMRI,NTRI,N1P,NUMEL,NUMEL2,KZ(10,2),NEMN
      COMMON /JUNK/ DUM(100),G,JJ(3)
      COMMON/NSAP6/ISAP6
      COMMON/MODEL/MODEL1
      COMMON/TITEL1/TIT1(13)
      COMMON/IFORMT/IFORM
      DIMENSION HED(20)
      MCARDS=4
      REWIND 31
      MTOT=MTOTM
10    CONTINUE
      XAD=0.5E00
      NADND=0
      I1=100000
      NRES=12
      NSELEM=0
      MONE=-1
      MITWO=-2
      MODEL1=0
      NC=0
      NLC=0
      KSKIP=0
      MSKIP=0
      NUMEL=0
      NUMEL2=0
      NUMNP=0
      XMX=55000.
      KET=0
      NTRI=0
      NMRI=0
      NELD=1
      MBAND=1
      KKG=0
      NEAD=1
      NDKOD=0
      NZZAD=0
      IES=0
      DO 20 I=1,MCARDS
20    KK(I)=0
      ISAPP=IYES
40    CONTINUE
71    KG=0
      GSAV=COMND
      NTY=0
      NTERM=NEAD
90    NP=1
      IF(KK(1).GT.0)NP=NUMNP
      KK(1) =1
91    IF(IFORM.EQ.0)READ(31)TIT1
      IF(IFORM.EQ.1)READ(31,92)TIT1
      IF(IFORM.EQ.0)READ(31)NUMNP
      IF(IFORM.EQ.1)READ(31,506)NUMNP
506   FORMAT(5X,I5)
92    FORMAT(13A4)
      IF(NUMNP.EQ.MONE)ISAP6=1
      IF(NUMNP.EQ.MONE.AND.IFORM.EQ.0)READ(31)NUMNP
      IF(NUMNP.EQ.MITWO)MODEL1=1
      IF(NUMNP.EQ.MONE.AND.IFORM.EQ.1)READ(31,506)NUMNP
      IF(NUMNP.EQ.MITWO.AND.IFORM.EQ.1)READ(31,506)NUMNP
      IF(NUMNP.GT.0)GO TO 106
      WRITE(*,507)NUMNP
507   FORMAT(' TOTAL NUMBER OF NODE FOR PLOTTING IS =',I5)
      STOP
106   IF(NUMNP.EQ.0)NUMNP=NP
110   CONTINUE
      N2=NUMNP*3
      IF(N2.GT.MTOT)  CALL ERROR (N2-MTOT)
      NZZ=NUMNP
      IF(NP.GT.NUMNP) NZZ=NP
      CALL NODINP (NC,NUMNP,NP,A(1),NZZ,ISAPP)
120   NE=1
      IF(KK(2).GT.0)NE=NUMEL
      KK(2) =1
121   IF(IFORM.EQ.0)READ(31)NF22
      IF(IFORM.EQ.1)READ(31,508)NF22
508   FORMAT(5X,I5)
      JJ(1)=NF22
      IF(NF22.GT.0)GO TO 131
      WRITE(*,510)NF22
510   FORMAT(' TOTAL NUMBER OF ELEMENTS FOR PLOTTING IS = ',I5)
      STOP
131   JJ(2)=20
      NUMEL=JJ(1)
      IF(NUMEL.EQ.0) NUMEL=NE
      IF(JJ(2).GT.0) NDMX=JJ(2)
      IF(NDMX.LE.8) NEAD=1
      IF(NDMX.GT.8)  NADND=(NDMX-9)/3+1
      IF(NDMX.GT.8)NZZAD=NUMEL
      IF(NEAD.GT.NUMEL) NZZAD=NEAD
      NZZ=NUMEL
      IF(NE.GT.NUMEL) NZZ=NE
      N2=NZZ*5+1
      N3=N2+NADND*NZZAD
      IF(N3.GT.MTOT) CALL ERROR(N3-MTOT)
      IF(NDMX.GT.8) NDKOD=1
      NZZ35=NZZAD
      NAD35=NADND
      IF(NZZ35.LE.0)NZZ35=1
      IF(NAD35.LE.0)NAD35=1
      CALL ELINP(NUMEL,A(1),NE,NZZ,A(N2),NEAD,NZZAD,NADND,NDKOD,
     1NZZ35,NAD35,ISAPP)
160   CONTINUE
      NADEL=1
      IF(NEAD.GT.1) NADEL=NUMEL
      N2=NUMEL*5+1
      DO 170 I=1,4
      MM=I
      NE35=NADEL
      ND35=NADND
      IF(NE35.LE.0)NE35=1
      IF(ND35.LE.0)ND35=1
170   CALL PROUT(MM,A(1),A(1),A(1),A(N2),NUMNP,NUMEL,NUMEL2,NADND,NADEL,
     1NDKOD,NDMX,IES,NRES,NE35,ND35)
240   RETURN
      END
      SUBROUTINE DINIT
      COMMON/IWINDO/IWIND,XM1,XM2,YM1,YM2
      COMMON/IGL100/IGLKEY
      COMMON/LAB/ILAB
      CALL ERASE
      CALL NEWPAG
      IF(ILAB.EQ.0) GOTO 500
      CALL SWINDO(0,1000,0,800)
      GOTO 600
500   CALL SWINDO(0,800,0,800)
600   CALL DWINDO(XM1,XM2,YM1,YM2)
      CALL MOVEA(0.,0.)
      RETURN
      END
      SUBROUTINE ELINP(NUMEL,ID2,NE,NZZ,ID4,NEAD,NZZAD,NADND,NDKOD,
     1NZZ35,NAD35,ISAPP)
      IMPLICIT REAL*8(A-H,O-Z)
      DIMENSION ID2(NZZ,5),ID4(NZZ35,NAD35)
      REAL*8  MLT2
      REAL*8  ID2,ID4
      COMMON/PREP/XMX,XAD,KSKIP,NDYN,I1
      COMMON/UNIT/II11,II22
      COMMON/JUNK/IX(8),IXI(8),IP(4),IPI(5),I,J,N,MT,
     1MTYPI,MTYP,K1,K2,K3,KN1,KN2,NI,KO,L,NG,MG,KM,NNI
      COMMON /ELARRY/NELAR(4,20)
      COMMON/NSAP6/ISAP6
      COMMON/GROUP/IGR1,IFG1,ILAG1,ITOTG1,IGROUP(100,3)
      COMMON/IFORMT/IFORM
      COMMON/TRASH/ IA(100),IAI(100)
      IG1=1
      II4=4
      ITOTG1=0
      IP(1)=0
      IP(2)=0
      IP(3)=0
      IP(4)=0
      MLT=10000
      MLT2=MLT*MLT
      DO 5 I=1,8
5     IX(I)=0
      KO=1
80    CONTINUE
113   KN1=0
      KN2=0
      IF(IFORM.EQ.0)READ(31)MTYP
      IF(IFORM.EQ.1)READ(31,700)MTYP,IGRRR
84    FORMAT(I5)
700   FORMAT(5X,I5,6X,I5)
      IF(MTYP.LE.0)GO TO 420
      MHI=NELAR(1,MTYP)
114   IF(MTYP.EQ.10.OR.MTYP.EQ.16.OR.MTYP.EQ.17)GO TO 510
      IF(MTYP.EQ.18)GO TO 510
      GO TO 118
510   IF(IFORM.EQ.0)
     1READ(31)N,(IX(I),I=1,8),(IA(J20),J20=9,20)
      IF(IFORM.EQ.1)
     2READ(31,183)N,(IX(I),I=1,8),(IA(J20),J20=9,20)
183   FORMAT(5X,I5,20(I5))
      GO TO 124
118   IF(IFORM.EQ.0)
     1READ(31)N,(IX(I),I=1,MHI)
      IF(IFORM.EQ.1)
     2READ(31,183)N,(IX(I),I=1,MHI)
83    FORMAT(10(I5,1X),I5)
124   IF(N.EQ.0) GO TO 420
      WRITE(17)N,MTYP
130   FORMAT(16I5)
132   IF(ID2(N,1).GT.0.0 .AND. IX(1).EQ.0) GO TO 360
230   KO=0
231   IF(MTYP.NE.0) CALL ELSZ(MTYP)
232   IF(KN1.GT.0) GO TO 240
      MTYPI=MTYP*10**8
240   NII=NI
      NI=N
      DO 250  I=1,8
250   IXI(I)=IX(I)
      DO 260  I=1,4
260   ID2(N,I)=IX(I)+IX(I+4)*I1
      ID2(N,5)=MTYPI
      IF(NUMEL.EQ.1) GO TO 270
      IF(NZZAD.LE.1) GO TO 80
270   CONTINUE
      IF(MTYP.EQ.0) GO TO 80
      IF(NELAR(1,MTYP).LE.8) GO TO 80
      NODES=NELAR(1,MTYP)
330   KOUNT=0
      DO 340 I=9,NODES
340   IAI(I)=IA(I)
      DO 350 J=9,NODES,3
      KOUNT=KOUNT+1
      M2=IA(J+1)
      M3=IA(J+2)
      IF((J+1).GT.NODES) M2=0
      IF((J+2).GT.NODES) M3=0
      ID4(N,KOUNT)=IA(J)+M2*MLT+M3*MLT2
350   CONTINUE
      NDKOD = 1
      GO TO 80
360   NI=N
      IF(KN1.EQ.0) KN1=NI
      IF(KN2.EQ.0)KN2=1
      KDT=KN1-N
      IF(KDT.EQ.0.AND.KN2.EQ.1)  GO TO 370
      KDT= MOD(KDT,KN2)
      IF(KDT.NE.0) KSKIP=1
      IF(KDT.NE.0) GO TO 80
370   CONTINUE
      DO 410 J=N,KN1,KN2
      MT=ID2(J,5)
      KM=100
      DO 380 I=1,4
      IPI(I)= MOD(MT,KM)
380   MT=MT/KM
      IF(MTYP.GT.0) MT=MTYP
      IF(MTYP.NE.0) CALL ELSZ(MTYP)
      DO 390 I=1,4
      IF(IP(I).GT.0) IPI(I)=IP(I)
      IF(IP(I).LT.0) IPI(I)=0
390   CONTINUE
      IPI(5)=MT
      MTI=IPI(1)
      DO 400 I=1,4
      KM=100**I
400   MTI=MTI+IPI(I+1)*KM
410   ID2(J,5)=MTI
      GO TO 80
420   REWIND II4
      WRITE (II4) ((ID2(I,J),J=1,5),I=1,NUMEL)
      IF(NDKOD.EQ.1) NEAD=NUMEL
      IF(NDKOD.EQ.1) WRITE (II4) ((ID4(I,J),J=1,NADND),I=1,NUMEL)
      RETURN
      END
      SUBROUTINE ELSZ(N)
      COMMON/SIZE/NDMX,MXDF,NSMX,NTERM,NADND
      COMMON/ELARRY/NELAR(4,20)
      COMMON/UNIT/II11,II22
      MAXEL=20
      IF(N.GT.0.AND.N.LE.MAXEL) GO TO 20
10    CONTINUE
      WRITE(*,30)N
30    FORMAT(' *** ILLEGAL ELEMENT TYPE = ',I5,'  ***')
      STOP
20    IF(NELAR(1,N).EQ.0) GO TO 10
      IF(NELAR(1,N).GT.NDMX) NDMX=NELAR(1,N)
      IF(NELAR(3,N).GT.MXDF) MXDF=NELAR(3,N)
      IF(NELAR(4,N).GT.NSMX) NSMX=NELAR(4,N)
      RETURN
      END
