C   07/06/96 606071909  MEMBER NAME  SMOPMC   (S4)          FORTG1
      SUBROUTINE SMOPMC
      RETURN
      END
      SUBROUTINE SMOP(X,Y,DY,N,SY)
      COMMON/FDST/LLA,LLB,LLC,NKA,NKB
      REAL X(120),Y(120),DY(120),SY(120)
      REAL YI(120),W(120)
C
      IP=1
      DO 20 I=1,N
      YI(I)=Y(I)
      IF(DY(I).LE.0.0) GOTO 20
      IF(Y(I).LE.0.0)  GOTO 20
      SE=SQRT(Y(I))
      IF(ABS(SE-DY(I)).GT.1.E-3*SE) GOTO 30
   20 CONTINUE
      IP=0
C
C
   30 CALL SMHIST(YI,SY,DY,N,IP)
      CALL DEKB(NKB)
      SUM=0.0
      DO 40 I=1,N
      SUM=SUM+SY(I)
   40 CALL GEND(NKA,100,SY(I),X(I))
      IF(SUM.LE.0.0) GOTO 100
      SUM=1000.0/SUM
      DO 50 I=1,N
   50 CALL GEND(NKA+500,100,SY(I)*SUM,X(I))
      CALL PSAF(NKA)
      CALL PSAF(NKA+500)
  100 RETURN
      END
