      SUBROUTINE UPDATE(IPARAM, IELMNT, PARAM, MODE,KFN)
      IMPLICIT DOUBLE PRECISION (A-H,O-Z)
************************************************************************
*
*  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)
      GOTO
     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(6,'(///10X,'' UNACCEPTABLE VALUE FOR NO. OF ORBITALS'',
     1'' ON ATOM'')')
         CALL WRAPUP()
      ENDIF
      END
