      SUBROUTINE CALROT(RORO,IOPT)
C
      INCLUDE 'com_options.f'
      DIMENSION RORO(3,3)
      DATA USQ2 / 0.707106781186547  /
      DATA USQ3 / 0.577350269189626 /
      DATA USQ6 / 0.408248290463863 /
C
      IOPT2 = 1+MOD(IOPT-1,4)
      IF (IOPT.GT.4) THEN
        SIGN = -1.
      ELSE
        SIGN = 1.
      ENDIF
      IF (IOPT2.EQ.1) THEN
        RORO(1,1) = SIGN
        RORO(2,1) = 0.
        RORO(3,1) = 0.
        RORO(1,2) = 0.
        RORO(2,2) = SIGN
        RORO(3,2) = 0.
        RORO(1,3) = 0.
        RORO(2,3) = 0.
        RORO(3,3) = 1.
      ELSEIF(IOPT2.EQ.2) THEN
        RORO(1,1) = -USQ2*SIGN
        RORO(2,1) = USQ2*SIGN
        RORO(3,1) = 0.
        RORO(1,2) = -USQ6
        RORO(2,2) = -USQ6
        RORO(3,2) = 2.*USQ6
        RORO(1,3) = USQ3*SIGN
        RORO(2,3) = USQ3*SIGN
        RORO(3,3) = USQ3*SIGN
      ELSEIF(IOPT2.EQ.3) THEN
        RORO(1,1) = USQ3*SIGN
        RORO(2,1) = USQ3*SIGN
        RORO(3,1) = USQ3*SIGN
        RORO(1,2) = -USQ2*SIGN
        RORO(2,2) = USQ2*SIGN
        RORO(3,2) = 0.
        RORO(1,3) = -USQ6
        RORO(2,3) = -USQ6
        RORO(3,3) = 2.*USQ6
      ELSE
        RORO(1,1) = -USQ6*SIGN
        RORO(2,1) = -USQ6*SIGN
        RORO(3,1) = 2.*USQ6*SIGN
        RORO(1,2) = USQ3*SIGN
        RORO(2,2) = USQ3*SIGN
        RORO(3,2) = USQ3*SIGN
        RORO(1,3) = -USQ2
        RORO(2,3) = USQ2
        RORO(3,3) = 0.
      ENDIF
      END
