      SUBROUTINE UPDATE(IPARAM, IELMNT, PARAM, MODE,KFN)
      implicit double precision (A-H,O-Z)
      include 'MOP6FILE'
************************************************************************
*
*  UPDATE UPDATES THE common BLOCKS WHICH HOLD ALL THE PARAMETERS FOR
*         RUNNING MNDO.
*         IPARAM REFERS TO THE TYPE OF PARAMETER,
*         IELMNT REFERS TO THE ELEMENT,
*         PARAM IS THE VALUE OF THE PARAMETER, AND
*         IF MODE = 1 THEN A common BLOCK IS UPDATED,
*         IF MODE = 2 THEN A DATUM IS EXTRACTED FROM THE common BLOCK.
*
************************************************************************
      common /MNDO/  USSM(107), UPPM(107), UDDM(107), ZSM(107),ZPM(107),
     1ZDM(107), BETASM(107), BETAPM(107), BETADM(107), ALPM(107),
     2EISOLM(107), DDM(107), QQM(107), AMM(107), ADM(107), AQM(107)
     3,GSSM(107),GSPM(107),GPPM(107),GP2M(107),HSPM(107), POLVOM(107)
      common /EXPONT/ ZS(107),ZP(107),ZD(107)
     1       /NATORB/ NATORB(107)
     2       /BETAS / BETAS(107),BETAP(107),BETAD(107)
     3       /VSIPS / VS(107),VP(107),VD(107)
     4       /ONELEC/ USS(107),UPP(107),UDD(107)
     5       /MULTIP/ DD(107),QQ(107),AM(107),AD(107),AQ(107)
     6       /TWOELE/ GSS(107),GSP(107),GPP(107),GP2(107),HSP(107)
     7                ,GSD(107),GPD(107),GDD(107)
     8       /ALPHA / ALP(107)
     9       /IDEAS / GUESS1(107,10), GUESS2(107,10), GUESS3(107,10)
      common /GAUSS / FN1(107),FN2(107)
      go to
     1(10,20,30,40,50,60,70,80,90,100,110,120,130,140,150,160,170,180,
     2190,200,210,220,230,240,250),IPARAM
   10 USS (IELMNT)=PARAM
      USSM(IELMNT)=PARAM
      return
   20 UPP (IELMNT)=PARAM
      UPPM(IELMNT)=PARAM
      return
   30 UDD (IELMNT)=PARAM
      UDDM(IELMNT)=PARAM
      return
   40 ZS (IELMNT)=PARAM
      ZSM(IELMNT)=PARAM
      return
   50 ZP (IELMNT)=PARAM
      ZPM(IELMNT)=PARAM
      return
   60 ZD (IELMNT)=PARAM
      ZDM(IELMNT)=PARAM
      return
   70 BETAS (IELMNT)=PARAM
      BETASM(IELMNT)=PARAM
      return
   80 BETAP (IELMNT)=PARAM
      BETAPM(IELMNT)=PARAM
      return
   90 BETAD (IELMNT)=PARAM
      BETADM(IELMNT)=PARAM
      return
  100 GSS (IELMNT)=PARAM
      GSSM(IELMNT)=PARAM
      return
  110 GSP (IELMNT)=PARAM
      GSPM(IELMNT)=PARAM
      return
  120 GPP (IELMNT)=PARAM
      GPPM(IELMNT)=PARAM
      return
  130 GP2 (IELMNT)=PARAM
      GP2M(IELMNT)=PARAM
      return
  140 HSP (IELMNT)=PARAM
      HSPM(IELMNT)=PARAM
      return
  150 return
  160 return
  170 return
  180 ALP (IELMNT)=PARAM
      ALPM(IELMNT)=PARAM
      return
  190 return
  200 return
  210 return
  220 GUESS1(IELMNT,KFN)=PARAM
      return
  230 GUESS2(IELMNT,KFN)=PARAM
      return
  240 GUESS3(IELMNT,KFN)=PARAM
      return
  250 NATORB(IELMNT)=PARAM
      I=INT(PARAM+0.5)
      if (I.NE.9.AND.I.NE.4.AND.I.NE.1) then
         write(MIOB,
     %     '(///10X,'' UNACCEPTABLE VALUE FOR NO. OF ORBITALS'',
     %              '' ON ATOM'')')
c
         call filclo !  J/M
         stop ' in UPDATE - strange number of orbitals on atom!'
c
      end if
      end
