      SUBROUTINE newfrm(string, iparse)
c	fwj haberl   21-MAR-1989 20:21:33
c		subroutine for XPLOT
c	implicit undefined(a-z)
c	implicit none
      INCLUDE 'xplot.inc'
      CHARACTER*(*) string
      INTEGER*4 iparse, icom, iflag, idelim, ix, iy, nret
      REAL*4 viewx(xplotmax), viewy(yplotmax)
      REAL*4 plen, odivx, odivy
      INTEGER*4 maxscm
      PARAMETER (maxscm=2)
      CHARACTER*(1) subcom(maxscm)
      DATA subcom/'x', 'y'/
 
      CALL xgtmch(string, iparse, subcom, maxscm, 'frame x y', icom,
     &            iflag, idelim, *900)
      IF (iflag.NE.0) THEN
         GOTO 900
      ENDIF
      odivx = 1./divx
      odivy = 1./divy
      DO ix = 1, divx
         viewx(ix) = odivx
      ENDDO
      DO iy = 1, divy
         viewy(iy) = odivy
      ENDDO
      IF (icom.EQ.1) THEN
         CALL xgtrl4(string, iparse, divx, 'viewport size', 1, viewx,
     &               nret, iflag, idelim)
         plen = framex2(divx) - framex1(1)
         DO ix = 1, divx
            plenx(ix) = plen*viewx(ix)
         ENDDO
      ELSEIF (icom.EQ.2) THEN
         CALL xgtrl4(string, iparse, divy, 'viewport size', 1, viewy,
     &               nret, iflag, idelim)
         plen = framey2(divy) - framey1(1)
         DO iy = 1, divy
            pleny(iy) = plen*viewy(iy)
         ENDDO
      ELSE
         GOTO 900
      ENDIF
      CALL frame
      RETURN
 900  CONTINUE
      WRITE (*, '(a)') ' Viewports not changed'
      RETURN
      END
