      SUBROUTINE FILLIN
C
C SUBROUTINE TO FILL IN THE SPECIAL PARAMETERS FROM THE LIST.
C
      INCLUDE 'RFINE.PRM'
      INCLUDE 'A.INC'
      INCLUDE 'XPAR.INC'
      INCLUDE 'LSMAT.INC'
      INCLUDE 'D.INC'
      INCLUDE 'E.INC'
      INCLUDE 'CNSTRS.INC'
C
      INCLUDE 'SHIFT.INC'
C
C ZERO SPECIAL ARRAYS
C
      MAXSET=0
      DO 310 I=1,6
      DO 310 J=1,3
      OXP(J,I)=0.0
      OXYZ(J,I)=0.0
      DO 300 K=1,NATOM
  300 SXYZ(J,K,I)=0.0
      DO 310 K=1,3
      EL(K,J,I)=0.0
      T(K,J,I)=0.0
  310 S(K,J,I)=0.0
C
C LOOP THROUGH SPECIAL PARAMETERS
C
      DO 410 NRG=1,NPAR
      P=PAR(NRG)
      IP=I4(IPAR(NRG))
      ISET=I2(IPAR(NRG))
      IF(ISET.GT.MAXSET)MAXSET=ISET
      JD=(IP+2)/3
      GO TO(320,330,340,360,360,370,370,380,380,380),JD
C SPECIAL ORIGIN
  320 OXYZ(IP,ISET)=P
      GO TO 410
C ORIENTATION
  330 OXP(IP-3,ISET)=P
      GO TO 410
C SPECIAL XYZ. FIND ALL ATOMS THAT ARE INVOLVED.
  340 LDEGN=2*NDEGN
      DO 350 I=1,LDEGN,2
      IF(I2(KDEGN(I)).NE.NRG)GO TO 350
      IF(I1(KDEGN(I)).NE.0)GO TO 350
      NA=I3(KDEGN(I))
      SXYZ(IP-6,NA,ISET)=P
  350 CONTINUE
      GO TO 410
C T TENSOR ELEMENT
  360 I=IP-9
      J=IND2(1,I)
      K=IND2(2,I)
      T(J,K,ISET)=P
      IF(J.NE.K)T(K,J,ISET)=P
      GO TO 410
C     L TENSOR ELEMENT
  370 I=IP-15
      J=IND2(1,I)
      K=IND2(2,I)
      EL(J,K,ISET)=P
      IF(J.NE.K)EL(K,J,ISET)=P
      GO TO 410
C     ELEMENT OF S TENSOR
  380 I=IP-21
      IF(I.GT.6)GO TO 390
      J=IND2(1,I)
      K=IND2(2,I)
      GO TO 400
  390 K=IND2(1,I-3)
      J=IND2(2,I-3)
  400 S(J,K,ISET)=P
  410 CONTINUE
C CALCULATE EULER ROTATION MATRICES AND VARIOUS TRANSFORMATIONS
      DO 420 I=1,MAXSET
      CALL EULER(OXP(3,I),OXP(2,I),OXP(1,I),TRNS(1,1,I))
      CALL TRNSPS(TRNS(1,1,I),TRANSI(1,1,I))
      CALL MULMM(TRANSI(1,1,I),ATOX,TTRNSI(1,1,I))
      CALL DTDOMG(OXP(3,I),OXP(2,I),OXP(1,I),TRNSDO(1,1,I))
      CALL DTDCHI(OXP(3,I),OXP(2,I),OXP(1,I),TRNSDC(1,1,I))
  420 CALL DTDPHI(OXP(3,I),OXP(2,I),OXP(1,I),TRNSDP(1,1,I))
      RETURN
      END
