*-----------------------------------------------------------------------
*     Copyright (C) 2000-2022 GFD Dennou Club. All rights reserved.
*-----------------------------------------------------------------------
      SUBROUTINE GRSTRF


      CALL GLRGET('RUNDEF',RUNDEF)

      CALL SGIGET('ITR',ITR)

      CALL SGRGET('VXMIN',VXMIN)
      IF (VXMIN.EQ.RUNDEF) THEN
        CALL MSGDMP('E','GRSTRF','VXMIN IS NOT DEFINED.')
      END IF
      CALL SGRGET('VXMAX',VXMAX)
      IF (VXMAX.EQ.RUNDEF) THEN
        CALL MSGDMP('E','GRSTRF','VXMAX IS NOT DEFINED.')
      END IF
      CALL SGRGET('VYMIN',VYMIN)
      IF (VYMIN.EQ.RUNDEF) THEN
        CALL MSGDMP('E','GRSTRF','VYMIN IS NOT DEFINED.')
      END IF
      CALL SGRGET('VYMAX',VYMAX)
      IF (VYMAX.EQ.RUNDEF) THEN
        CALL MSGDMP('E','GRSTRF','VYMAX IS NOT DEFINED.')
      END IF

      IF (1.LE.ITR .AND. ITR.LE.4) THEN
        CALL SGRGET('UXMIN',UXMIN)
        IF (UXMIN.EQ.RUNDEF) THEN
          CALL MSGDMP('E','GRSTRF','UXMIN IS NOT DEFINED.')
        END IF
        CALL SGRGET('UXMAX',UXMAX)
        IF (UXMAX.EQ.RUNDEF) THEN
          CALL MSGDMP('E','GRSTRF','UXMAX IS NOT DEFINED.')
        END IF
        CALL SGRGET('UYMIN',UYMIN)
        IF (UYMIN.EQ.RUNDEF) THEN
          CALL MSGDMP('E','GRSTRF','UYMIN IS NOT DEFINED.')
        END IF
        CALL SGRGET('UYMAX',UYMAX)
        IF (UYMAX.EQ.RUNDEF) THEN
          CALL MSGDMP('E','GRSTRF','UYMAX IS NOT DEFINED.')
        END IF
      ELSE IF (5.LE.ITR .AND. ITR.LE.7) THEN
        CALL SGRGET('SIMFAC',SIMFAC)
        IF (SIMFAC.EQ.RUNDEF) THEN
          CALL MSGDMP('E','GRSTRF','SIMFAC IS NOT DEFINED.')
        END IF
        CALL SGRGET('VXOFF',VXOFF)
        IF (VXOFF.EQ.RUNDEF) THEN
          CALL MSGDMP('E','GRSTRF','VXOFF IS NOT DEFINED.')
        END IF
        CALL SGRGET('VYOFF',VYOFF)
        IF (VYOFF.EQ.RUNDEF) THEN
          CALL MSGDMP('E','GRSTRF','VYOFF IS NOT DEFINED.')
        END IF
      ELSE IF (10.LE.ITR .AND. ITR.LE.24 .OR.
     +         30.LE.ITR .AND. ITR.LE.34 ) THEN
        CALL SGRGET('SIMFAC',SIMFAC)
        IF (SIMFAC.EQ.RUNDEF) THEN
          CALL MSGDMP('E','GRSTRF','SIMFAC IS NOT DEFINED.')
        END IF
        CALL SGRGET('VXOFF',VXOFF)
        IF (VXOFF.EQ.RUNDEF) THEN
          CALL MSGDMP('E','GRSTRF','VXOFF IS NOT DEFINED.')
        END IF
        CALL SGRGET('VYOFF',VYOFF)
        IF (VYOFF.EQ.RUNDEF) THEN
          CALL MSGDMP('E','GRSTRF','VYOFF IS NOT DEFINED.')
        END IF
        CALL SGRGET('PLX',PLX)
        IF (PLX.EQ.RUNDEF) THEN
          CALL MSGDMP('E','GRSTRF','PLX IS NOT DEFINED.')
        END IF
        CALL SGRGET('PLY',PLY)
        IF (PLY.EQ.RUNDEF) THEN
          CALL MSGDMP('E','GRSTRF','PLY IS NOT DEFINED.')
        END IF
        CALL SGRGET('PLROT',PLROT)
        IF (PLROT.EQ.RUNDEF) THEN
          CALL MSGDMP('E','GRSTRF','PLROT IS NOT DEFINED.')
        END IF
        CALL SGRGET('TXMIN',TXMIN)
        IF (TXMIN.EQ.RUNDEF) THEN
          CALL MSGDMP('E','GRSTRF','TXMIN IS NOT DEFINED.')
        END IF
        CALL SGRGET('TXMAX',TXMAX)
        IF (TXMAX.EQ.RUNDEF) THEN
          CALL MSGDMP('E','GRSTRF','TXMAX IS NOT DEFINED.')
        END IF
        CALL SGRGET('TYMIN',TYMIN)
        IF (TYMIN.EQ.RUNDEF) THEN
          CALL MSGDMP('E','GRSTRF','TYMIN IS NOT DEFINED.')
        END IF
        CALL SGRGET('TYMAX',TYMAX)
        IF (TYMAX.EQ.RUNDEF) THEN
          CALL MSGDMP('E','GRSTRF','TYMAX IS NOT DEFINED.')
        END IF
      END IF

      CALL SGSTRF

      END
