c cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c
c                                                                      c
c                             -----------                              c
c                             | SDECAY: |                              c
c                             -----------                              c
c                                                                      c
c  A Fortran code for the decay widths and the branching ratios of     c
c  the supersymmetric particles in the Minimal Supersymmetric          c
c  Standard Model.                                                     c
c                                                                      c
c -------------------------------------------------------------------- c
c                                                                      c
c  The program is written by M.Muhlleitner, A.Djouadi and Y.Mambrini   c
c                                                                      c
c  VERSION 1.3                                                         c
c  Last changes: Aug 19, 2014                                          c
c  The reference to be used for the program is:                        c
c           Comput.Phys.Commun.168(2005)46  [hep-ph/0311167]           c
c                                                                      c
c -------------------------------------------------------------------- c
c                                                                      c
c  The Fortran code SDECAY, deals with the decays of supersymmetric    c
c  (SUSY) particles in the framework of the Minimal Supersymmetric     c
c  Standard Model (MSSM), and includes the most important higher       c
c  order effects. It uses the RGE program SuSpect for the calcula-     c
c  tion of the mass spectrum and the soft SUSY-breaking parameters     c
c  and evaluates the various couplings of the SUSY particles and       c
c  MSSM Higgs bosons. It calculates the decay widths and the bran-     c
c  ching ratios of all the two-body decay modes, including the QCD     c
c  corrections to the processes involving squarks and gluinos and      c
c  the dominant electroweak effects to all processes. It also calcu-   c
c  lates the loop induced two-body decay channels, as well as all the  c
c  possibly important higher order decay modes: the three-body decays  c
c  of charginos, neutralinos, gluinos and the top squarks and the      c
c  four-body decays of the top squark. The program also calculates     c
c  the decay widths and branching ratios of the heavy top quark.       c
c                                                                      c
c -------------------------------------------------------------------- c
c                                                                      c
c  Besides the SuSpect files needed for the evaluation of the spec-    c
c  trum, the code contains only one source file, the present one       c
c  sdecay.f written in Fortran77, and one input file, sdecay.in, from  c
c  which any choice of approximation in the calculation is driven      c
c  [include or not the higher order corrections and/or decays, the     c
c  choice of the various scales, the order of perturbation at which    c
c  some couplings are calculated, etc]. All results for the total      c
c  decay widths and branching ratios are given in the output file      c
c  sdecay.out, either in a simple and transparent form or in the SUSY  c
c  Les Houches Accord form. [This choice can also be made in the input c
c  file.]                                                              c
c                                                                      c
c cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c

      program sdecay

      implicit double precision (a-h,m,o-z)
      double precision neutwchar,neutzneut,neuthcchar,neuthlneut,
     .       neuthhneut,neuthaneut,neutsell,neutselr,
     .       neutstau1,neutstau2,neutsn1,neutsn2,neutst1,neutst2,
     .       neutsupl,neutsupr,neutsdownl,neutsdownr,neuttot2,
     .       neuttot2lo,neuttot2nlo,
     .       neuttot,neutsb1,neutsb2,neutsnel,ninjphoton,
     .       nraddec,neutgammagravitino,neutZgravitino,
     .       neuthlgravitino,neuttotmulti,neuttotrad,neuthhgravitino,
     .       neuthagravitino,neutgrav2bod
      double precision minval(1:20),smval(1:20),massval(1:50),
     .       nmixval(4,4),umixval(2,2),vmixval(2,2),stopmixval(2,2),
     .       sbotmixval(2,2),staumixval(2,2),hmixval(1:10),
     .       gaugeval(1:3),msoftval(1:100),auval(3,3),adval(3,3),
     .       aeval(3,3),yuval(3,3),ydval(3,3),yeval(3,3),qvalue(1:20),
     .       extval(0:100),m_softval(1:100)
      double precision nl,nq
      integer nx1t,ny1t,nnlo,imod(1:2)
      integer check(1:22)
      character spinfo1*100,spinfo2*100,modselval*100,mincom(1:20)*20,
     .          extcom(0:100)*20,softcom(1:100)*20,m_softcom(1:100)*20,
     .          hmixcom(1:10)*20

      dimension ichoice(11),warning(1:10),flagneut3bod(4),
     .          flagchar3bod(2)
      dimension amneut(4),xmneut(4),amchar(2)
      dimension uu(2,2),vv(2,2),zz(4,4),zp(4,4)
      dimension glnjgluon(4),brglnjgluon(4)
      dimension nraddec(4,4),brnraddec(4,4)
      dimension ahl(4,4),ahh(4,4),aa(4,4)
      dimension gkhlr(2,2),gkhll(2,2),gkhhr(2,2),gkhhl(2,2),gkhar(2,2),
     .          gkhal(2,2)
      dimension ql(4,2),qr(4,2),or(4,2),ol(4,2)
      dimension opl(2,2),opr(2,2),onl(4,4),onr(4,4)
      dimension ale(2,2),altau(2,2),alsne(2,2),blsne(2,2),alsnt(2,2),
     .          blsnt(2,2)
      dimension alsbo(2,2),aksbo(2,2),alsto(2,2),aksto(2,2)
      dimension alup(2,2),aldo(2,2)
      dimension ae(2,4),be(2,4),atau(2,4),btau(2,4),anu(2,4),bnu(2,4),
     .          antau(2,4),bntau(2,4)
      dimension atop(2,4),btop(2,4),abo(2,4),bbo(2,4)
      dimension aup(2,4),bup(2,4),ado(2,4),bdo(2,4)
      dimension gltt(2,2),ghtt(2,2)
      dimension glbb(2,2),ghbb(2,2)
      dimension gctb(2,2),chctb(2,2)
      dimension gztt(2,2),gzbb(2,2),gztautau(2,2)
      dimension gwtb(2,2),gwntau(2,2)
      dimension gul(2),gur(2),gdl(2),gdr(2),gtl(2),gtr(2),gbl(2),gbr(2)
      dimension charst1(2),charst2(2),charsb1(2),charsb2(2),
     .          charsupl(2),charsupr(2),charsdownl(2),charsdownr(2),
     .          charsnel(2),charsn1(2),charsn2(2),charsell(2),
     .          charstau1(2),charstau2(2),charselr(2)
      dimension qcdcharst1(2),qcdcharst2(2),qcdcharsb1(2),qcdcharsb2(2)
      dimension qcdcharsupl(2),qcdcharsupr(2),qcdcharsdownl(2),
     .          qcdcharsdownr(2)
      dimension charwneut(2,4),charhcneut(2,4)
      dimension charwgravitino(2),charhcgravitino(2)
      dimension chartot2(2),chartot(2),chartotmulti(2),chartot2lo(2),
     .          chartot2nlo(2),chargrav2bod(2)
      dimension flagchartot2(2),flagcondchar(2)
      dimension xchitau(2,4),xchiel(2,4),xchiup(2,4),xchimu(2,4),
     .          xchich(2,4),xchitop(2,4),xgluiupdb(2),xgluichsb(2),
     .          xgluitopbb(2)
      dimension brcharst1(2),brcharst2(2),brcharsb1(2),brcharsb2(2),
     .          brcharsupl(2),brcharsupr(2),brcharsdownl(2),
     .          brcharsdownr(2),brcharsnel(2),brcharsn1(2),
     .          brcharsn2(2),brcharsell(2),brcharstau1(2),brcharselr(2),
     .          brcharstau2(2),brcharhcneut(2,4),brcharwneut(2,4)
      dimension brcharwgravitino(2),brcharhcgravitino(2)
      dimension brntaunut(2,4),brnelnue(2,4),brnmunumu(2,4),
     .          brnupdb(2,4),brnchsb(2,4),brntopbb(2,4)
      dimension brglupdb(2),brglchsb(2),brgltopbb(2)
      dimension neutwchar(4,2),neutzneut(4,4),neuthcchar(4,2),
     .          neuthlneut(4,4),neuthhneut(4,4),neuthaneut(4,4),
     .          neutsnel(4),neutsell(4),neutselr(4),neutstau1(4),
     .          neutstau2(4),neutsn1(4),neutsn2(4),neutst1(4),
     .          neutst2(4),neutsupl(4),neutsupr(4),neutsdownl(4),
     .          neutsdownr(4),neutsb1(4),neutsb2(4)
      dimension neutgammagravitino(4),neutZgravitino(4),neutgrav2bod(4),
     .          neuthlgravitino(4),neuthhgravitino(4),neuthagravitino(4)
      dimension qcdneutst1(4),qcdneutst2(4),qcdneutsb1(4),qcdneutsb2(4)
      dimension qcdneutsupl(4),qcdneutsupr(4),qcdneutsdownl(4),
     .          qcdneutsdownr(4)
      dimension neuttot2(4),neuttot(4),neuttotmulti(4),neuttotrad(4),
     .          neuttot2lo(4),neuttot2nlo(4)
      dimension flagneuttot2(4),flagcondneut(4)
      dimension xneutel(4,4),xneutmu(4,4),xneuttau(4,4),
     .          xneutnue(4,4),xneutnumu(4,4),xneutnutau(4,4),
     .          xneutup(4,4),xneutdow(4,4),xneutst(4,4),xneutch(4,4),
     .          xneutbot(4,4),xneuttop(4,4),xgluinoup(4),
     .          xgluinodo(4),xgluinoch(4),xgluinost(4),xgluinobot(4),
     .          xgluinotop(4),xchelne(4,2),xchmunmu(4,2),
     .          xchtauntau(4,2),xchubdow(4,2),xchcbs(4,2),xchtbb(4,2)
      dimension brneutst1(4),brneutst2(4),brneutsb1(4),brneutsb2(4),
     .          brneutsupl(4),brneutsupr(4),brneutsdownl(4),
     .          brneutsdownr(4),brneutsnel(4),brneutsn1(4),
     .          brneutsn2(4),brneutsell(4),brneutselr(4),
     .          brneutstau1(4),brneutstau2(4),brneutwchar(4,2),
     .          brneuthcchar(4,2),brneutzneut(4,4),brneuthlneut(4,4),
     .          brneuthhneut(4,4),brneuthaneut(4,4)
      dimension brneutup(4,4),brneutdow(4,4),brneutch(4,4),
     .          brneutst(4,4),brneutbot(4,4),brneuttop(4,4),
     .          brneutel(4,4),brneutmu(4,4),brneuttau(4,4),
     .          brneutnue(4,4),brneutnumu(4,4),brneutnutau(4,4),
     .          brchubd(4,2),brchcbs(4,2),brchtbb(4,2),brchelne(4,2),
     .          brchmunmu(4,2),brchtauntau(4,2),brglup(4),brgldo(4),
     .          brglch(4),brglst(4),brgltop(4),brglbot(4)
      dimension brneutgamgrav(4),brneutzgrav(4),brneuthlgrav(4),
     .          brneuthhgrav(4),brneuthagrav(4)
      dimension xintegoup(4),xintegodn(4),xintegotp(4),xintegobt(4),
     .          xintegoud(2),xintegotb(2),xintegocc(2)
      dimension brgoup(4),brgoch(4),brgodn(4),brgost(4),brgotp(4),
     .          brgobt(4),brgoud(2),brgocs(2),brgotb(2)
      dimension suplneutup(4),suprneutup(4),suplchardow(2),
     .          suprchardow(2),qcdsuplneutup(4),qcdsuprneutup(4),
     .          qcdsuplchardow(2),qcdsuprchardow(2)
      dimension brsuplnup(4),brsuplcdow(2),brsuprnup(4),brsuprcdow(2)
      dimension sdowlneutdow(4),sdowlcharup(2),sdowrneutdow(4),
     .          sdowrcharup(2),qcdsdowlneutdow(4),qcdsdowlcharup(2),
     .          qcdsdowrneutdow(4),qcdsdowrcharup(2)
      dimension brsdowlndow(4),brsdowrndow(4),brsdowlchup(2),
     .          brsdowrchup(2)
      dimension st1neutt(4),st2neutt(4),st1charb(2),st2charb(2),
     .          st1hcsb(2),st2hcsb(2),st1wsb(2),st2wsb(2),stoptot2(2),
     .          qcdst1neut(4),qcdst2neut(4),qcdst1charb(2),
     .          qcdst2charb(2),qcdst1hcsb(2),qcdst2hcsb(2),
     .          stoptot2lo(2),stoptot2nlo(2),stoptotrad(2),
     .          stoptotmulti(2),flagstoptot2(2),flagcondstop(2),
     .          qcdst1wsb(2),qcdst2wsb(2)
      dimension brst1neutt(4),brst2neutt(4),brst1charb(2),
     .          brst2charb(2),brst1hcsb(2),brst2hcsb(2),brst1wsb(2),
     .          brst2wsb(2)
      dimension xintegstopw(2,4),xintegstoph(2,4),xintegststau(2,2),
     .          xintegstsntau(2,2),xintegstsel(2,2),xintegstsnel(2),
     .          xintegstbsbst(2,2),xintegstbbsbt(2,2),
     .          xintegsttausbnu(2,2),xintegstelsbnu(2,2),
     .          xintegstupsbdow(2,2),stoptot(2)
      dimension brstopw(2,4),brstoph(2,4),brststau(2,2),
     .          brstsntau(2,2),brstsel(2,2),brstsnel(2),
     .          brstbsbst(2,2),brstbbsbt(2,2),brsttausbnu(2,2),
     .          brstelsbnu(2,2),brstupsbdow(2,2)
      dimension sb1neutt(4),sb2neutt(4),sb1chart(2),sb2chart(2),
     .          sb1hcst(2),sb2hcst(2),sb1wst(2),sb2wst(2),sbottot2(2),
     .          qcdsb1neut(4),qcdsb2neut(4),qcdsb1chart(2),
     .          qcdsb2chart(2),qcdsb1hcst(2),qcdsb2hcst(2),
     .          sbottot2lo(2),sbottot2nlo(2),sbottotmulti(2),
     .          qcdsb1wst(2),qcdsb2wst(2)
      dimension brsb1neutt(4),brsb2neutt(4),brsb1chart(2),
     .          brsb2chart(2),brsb1hcst(2),brsb2hcst(2),brsb1wst(2),
     .          brsb2wst(2)
      dimension flagsbottot2(2),flagcondsbot(2)
      dimension xintegsbstau(2,2),xintegsbsntau(2,2),xintegsbsel(2,2),
     .          xintegsbtstsb(2,2),xintegsbtbstb(2,2),
     .          xintegsbtaustnu(2,2),xintegsbelstnu(2,2),
     .          xintegsbupstdow(2,2),xintegsbsnel(2),sbottot(2)
      dimension brsbstau(2,2),brsbsntau(2,2),brsbsel(2,2),
     .          brsbtstsb(2,2),brsbtbstb(2,2),brsbtaustnu(2,2),
     .          brsbelstnu(2,2),brsbupstdow(2,2),brsbsnel(2)
      dimension sellneute(4),selrneute(4),sellcharnue(2),selrcharnue(2)
      dimension brsellneute(4),brselrneute(4),brsellcharnue(2),
     .          brselrcharnue(2)
      dimension snellneut(4),snellchar(2),brsnellneut(4),
     .          brsnellchar(4)
      dimension sntauneut(4),sntauchar(2),sntau1hcstau(2),sntau1wstau(2)
      dimension brsntauneut(4),brsntauchar(2),brsntau1hcstau(2),
     .          brsntau1wstau(2)
      dimension stau1neut(4),stau2neut(4),stau1char(2),stau2char(2),
     .          stau1hcsn(2),stau2hcsn(2),stau1wsn(2),stau2wsn(2)
      dimension brstau1neut(4),brstau2neut(4),brstau1char(2),
     .          brstau2char(2),brstau1hcsn(2),brstau2hcsn(2),
     .          brstau1wsn(2),brstau2wsn(2)
      dimension topneutrstop(4,2),brtopneutrstop(4,2)
      dimension hlbrsc(2,2),hlbrsn(4,4),hhbrsc(2,2),
     .          hhbrsn(4,4),habrsc(2,2),habrsn(4,4),hcbrsu(2,4),
     .          hhbrst(2,2),hhbrsb(2,2),hcbrstb(2,2),hlbrsn1(4,4),
     .          hhbrsn1(4,4),habrsn1(4,4)
      dimension whlgd(4),whcgd(2),whhgd(4),whagd(4),bhlgd(4),bhhgd(4),
     .          bhagd(4),bhcgd(2)

c --- the common blocks read in by sdecay and needed in suspect2.f --- c
      COMMON/SU_SMPAR/dalfinv,dsw2,dalphas,dmt,dmb,dmc,dmtau
      COMMON/SU_RGSCAL/dqewsb,dehigh,delow
      COMMON/SU_MSSMHPAR/dmhu2,dmhd2,dma,dmu
      COMMON/SU_MSSMGPAR/dm1,dm2,dm3 
      COMMON/SU_MSSMSLEP/dmsl,dmtaur,dmel,dmer
      COMMON/SU_MSSMSQUA/dmsq,dmtr,dmbr,dmuq,dmur,dmdr
      COMMON/SU_ATRI3/dal,dau,dad
      COMMON/SU_ATRI12/dal1,dau1,dad1
      COMMON/SU_MSUGRA/m0,mhalf,a0
      COMMON/SU_RADEWSB/sgnmu0,tgbeta
      COMMON/SU_GMSB/mgmmess,mgmsusy,nl,nq
      COMMON/SU_AMSB/m32,am0,cq,cu,cd,cl,ce,chu,chd
      COMMON/SU_PASS/ichoice
c ----------------- common blocks needed in sdecay ------------------- c
      COMMON/SD_input/flaginput,ninlha
      COMMON/SD_param/sdgf,sdmz,sdmw,pi,g2
      COMMON/SD_mwmzpole/amwp,amzp
      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2
      COMMON/SD_squarkud/asup1,asup2,asdown1,asdown2
      COMMON/SD_sfermionetau/ase1,ase2,astau1,astau2
      COMMON/SD_sneutrino/asne1,asne2,asntau1,asntau2
      COMMON/SD_gluino/mgluino
      COMMON/SD_hmass/ama,aml,amh,amch,amar
      COMMON/SD_mixang/alp_mssm,tanbeta
      COMMON/SD_mixmat/uu,vv,zz,zp
      COMMON/SD_weinberg/sw,cw
      COMMON/SD_sfmixang/sdthet,sdtheb,sdthel,cum,sum,cdm,sdm,cem,sem
      COMMON/SD_fermion/samt,samb,samtau
      COMMON/SD_mbmsbar/mbmsbar
      COMMON/SD_break/sdatop,sdabot,sdatau,sdmu
      COMMON/SD_break1/sdaup,sdadown,sdael
      COMMON/SD_runmcalc/rmtc,rmbc,rmtauc
      COMMON/SD_refscale/amuref
      COMMON/SD_pizz/sdpizz
      COMMON/SD_piww/sdpiww
      COMMON/SD_scaleofewsb/scaleofewsb
      COMMON/SD_gmsb/sd_mgmsusy,sd_mgmmess
      COMMON/SD_massgrav/mgravitino
c ------- common blocks of the couplings needed for the widths ------- c
      COMMON/SD_coup1/ahl,ahh,aa
      COMMON/SD_coup2/gkhll,gkhhl,gkhal,gkhlr,gkhhr,gkhar
      COMMON/SD_coup3/ql,qr,ol,or
      COMMON/SD_coup4/opl,opr,onl,onr
      COMMON/SD_coup5/ale,altau,alsne,blsne,alsnt,blsnt
      COMMON/SD_coup6/alsto,aksto,alsbo,aksbo
      COMMON/SD_coup7/alup,aldo
      COMMON/SD_coup8/ae,be,atau,btau,anu,bnu,antau,bntau      
      COMMON/SD_coup9/atop,btop,abo,bbo
      COMMON/SD_coup10/aup,bup,ado,bdo
      COMMON/SD_coup11/gltt,ghtt,gatt
      COMMON/SD_coup12/glbb,ghbb,gabb
      COMMON/SD_coup13/gctb,chctb
      COMMON/SD_coup14/chctbl,chctbr,chctaunur,chctaunul
      COMMON/SD_coup15/achtop,vchtop,achtau,vchtau
      COMMON/SD_coup16/czttl,czttr,czbbl,czbbr,cztautaul,cztautaur,
     .                 cznunul,cznunur
      COMMON/SD_coup17/azztoptop,vzztoptop,azztautau,vzztautau,
     .                 azzneutneut,vzzneutneut,azzbotbot,vzzbotbot
      COMMON/SD_coup18/awff,vwff
      COMMON/SD_coup19/gztt,gzbb,gztautau
      COMMON/SD_coup20/gwtb,gwntau
      COMMON/SD_coup21/gtr,gtl,gbr,gbl,gur,gul,gdr,gdl
      COMMON/SD_yukawa/yt,yb,ytau
      COMMON/SD_coupewsb/alsew,g2ew,g1ew
      COMMON/SD_runcoupscale/scalechoice,scaleofcoupling,inumloop
      COMMON/SD_scheme/idrbar
      COMMON/SD_nx1/nx1t,ny1t

c --------- common block needed for the neutralino loop decays ------- c
      COMMON/SD_loopdecij/ni,nj

c -------------- common block given by SD_read_leshouches ------------ c
      COMMON/SD_leshouches1/spinfo1,spinfo2,modselval,mincom,extcom,
     .                      softcom,hmixcom
      COMMON/SD_leshouches2/minval,extval,smval,massval,nmixval,umixval,
     .                      vmixval,stopmixval,sbotmixval,staumixval,
     .                      hmixval,gaugeval,msoftval,auval,adval,
     .                      aeval,yuval,ydval,yeval,alphaval,qvalue,imod
      COMMON/SD_checkval/check
c --------- some additional common blocks for the output file -------- c
      COMMON/SD_ewsbv/vewsb
      COMMON/SD_outparam/salpha_MS,alphasmzms
      COMMON/SD_break2/sd_m1,sd_m2,sd_m3
      COMMON/SD_break3/sd_mel,sd_mer,sd_muq,sd_mur,sd_mdr
      COMMON/SD_break4/sd_msl,sd_mtaur,sd_msq,sd_mtr,sd_mbr
      COMMON/SD_break5/sd_mel1,sd_mel2,sd_mer1,sd_mer2,sd_muq1,sd_muq2,
     .                 sd_mur1,sd_mur2,sd_mdr1,sd_mdr2
      COMMON/SD_break6/m_softval,m_softcom
      COMMON/SD_warning/warning
c -- The following common blocks contain the branching ratios and ---- c
c -- total width of the respective SUSY particle which are calculated  c
c -- by SDECAY. They are not used in the program itself, but may be -- c
c -- useful when SDECAY is linked to other programs. ----------------- c
      COMMON/SD_char2body/brcharst1,brcharst2,brcharsb1,brcharsb2,
     .         brcharsupl,brcharsupr,brcharsdownl,brcharsdownr,
     .         brcharsnel,brcharsn1,brcharsn2,brcharsell,brcharselr,
     .         brcharstau1,brcharstau2,brcharhcneut,brcharwneut,
     .         brcharzchic,brcharhlchic,brcharhhchic,brcharhachic
      COMMON/SD_char2bodygrav/brcharwgravitino,brcharhcgravitino
      COMMON/SD_char3body/brntaunut,brnelnue,brnmunumu,brnupdb,brnchsb,
     .         brntopbb,brglupdb,brglchsb,brgltopbb,brchee,brchmumu,
     .         brchtautau,brchnene,brchnmunmu,brchntauntau,brchupup,
     .         brchdodo,brchchch,brchstst,brchtoptop,brchbotbot
      COMMON/SD_charwidth/chartot
      COMMON/SD_neut2body/brneutst1,brneutst2,brneutsb1,brneutsb2,
     .         brneutsupl,brneutsupr,brneutsdownl,brneutsdownr,
     .         brneutsnel,brneutsn1,brneutsn2,brneutsell,brneutselr,
     .         brneutstau1,brneutstau2,brneutwchar,brneuthcchar,
     .         brneutzneut,brneuthlneut,brneuthhneut,brneuthaneut
      COMMON/SD_neut2bodygrav/brneutgamgrav,brneutzgrav,brneuthlgrav,
     .         brneuthhgrav,brneuthagrav
      COMMON/SD_neut3body/brneutup,brneutdow,brneutch,brneutst,
     .         brneutbot,brneuttop,brneutel,brneutmu,brneuttau,
     .         brneutnue,brneutnumu,brneutnutau,brchubd,brchcbs, 
     .         brchtbb,brchelne,brchmunmu,brchtauntau,brglup,brgldo,
     .         brglch,brglst,brgltop,brglbot
      COMMON/SD_neutloop/brnraddec
      COMMON/SD_neutwidth/neuttot
      COMMON/SD_glui2body/brgst1,brgst2,brgsb1,brgsb2,brgsupl,brgsupr,
     .         brgsdownl,brgsdownr
      COMMON/SD_glui3body/brgoup,brgoch,brgodn,brgost,brgotp,brgobt,
     .         brgoud,brgocs,brgotb,brhcst1b,brwst1b
      COMMON/SD_gluiloop/brglnjgluon
      COMMON/SD_gluiwidth/gluitot
      COMMON/SD_sup2body/brsuplnup,brsuplcdow,brsuplglui,
     .                   brsuprnup,brsuprcdow,brsuprglui
      COMMON/SD_supwidth/supltot2,suprtot2
      COMMON/SD_sdown2body/brsdowlndow,brsdowlchup,brsdowlglui,
     .                     brsdowrndow,brsdowrchup,brsdowrglui
      COMMON/SD_sdownwidth/sdowltot2,sdowrtot2
      COMMON/SD_stop2body/brst1neutt,brst2neutt,brst1charb,brst1hcsb,
     .          brst1wsb,brst2charb,brst2hcsb,brst2wsb,brst1glui,
     .          brst2glui,brst2hl,brst2hh,brst2ha,brst2ztop
      COMMON/SD_stop3body/brstopw,brstoph,brststau,brstsntau,brstsel,
     .          brstbsbst,brstbbsbt,brsttausbnu,brstelsbnu,brstupsbdow,
     .          brstsnel,brst2st1tt,brst2st1startt,brst2st1bb,
     .          brst2st1uu,brst2st1dd,brst2st1ee,brst2st1nunu,
     .          brst2st1tautau
      COMMON/SD_stoploop/brgamma,brgammaup,brgammagluino
      COMMON/SD_stop4body/brgamma4bod,brgammaup4bod,brgammagluino4bod,
     .          br4bodoffshelltau
      COMMON/SD_stopwidth/stoptot4
      COMMON/SD_sbot2body/brsb1neutt,brsb2neutt,brsb1chart,brsb2chart,
     .          brsb1hcst,brsb2hcst,brsb1wst,brsb2wst,brsb1glui,
     .          brsb2glui,brsb2hl,brsb2hh,brsb2ha,brsb2zbot
      COMMON/SD_sbot3body/brsbstau,brsbsntau,brsbsel,brsbtstsb,
     .          brsbtbstb,brsbtaustnu,brsbelstnu,brsbupstdow,brsbsnel,
     .          brsb2sb1bb,brsb2sb1starbb,brsb2sb1tt,brsb2sb1uu,
     .          brsb2sb1dd,brsb2sb1ee,brsb2sb1nunu,brsb2sb1tautau
      COMMON/SD_sbotwidth/sbottot
      COMMON/SD_sel2body/brsellneute,brsellcharnue,
     .                   brselrneute,brselrcharnue
      COMMON/SD_selwidth/selltot2,selrtot2
      COMMON/SD_snel2body/brsnellneut,brsnellchar
      COMMON/SD_snelwidth/sneltot2
      COMMON/SD_stau2body/brstau1neut,brstau2neut,brstau1char,
     .          brstau1hcsn,brstau1wsn,brstau2char,brstau2hcsn,
     .          brstau2wsn,brstau2hl,brstau2hh,brstau2ha,brstau2ztau
      COMMON/SD_stau2bodygrav/brstautaugrav
      COMMON/SD_stauwidth/stau1tot2,stau2tot2
      COMMON/SD_sntau2body/brsntauneut,brsntauchar,brsntau1wstau,
     .          brsntau1hcstau
      COMMON/SD_sntauwidth/sntautot2
      COMMON/SD_top2body/brtopbw,brtopbh,brtopneutrstop
      COMMON/SD_topwidth/toptot2

c ------------------------ external functions ------------------------ c
      external SD_alphascall,SD_yuk

c --------------------- The input and output files ------------------- c

      nin   = 20
      nout  = 21
      ninlha= 22
      nis   = 23

      open(nin,file='sdecay.in',status='unknown')

      read(nin,*)
      read(nin,*)
      read(nin,*)
      read(nin,*)
      read(nin,*) flaginput
      read(nin,*)
      read(nin,*)
      read(nin,*) flagoutput
      read(nin,*)
      read(nin,*)
      read(nin,*) flagqcd
      read(nin,*)
      read(nin,*)
      read(nin,*) flagmulti
      read(nin,*)
      read(nin,*)
      read(nin,*)
      read(nin,*) flagloop
      read(nin,*)
      read(nin,*)
      read(nin,*) flagsusytop
      read(nin,*)
      read(nin,*)
      read(nin,*)
      read(nin,*) flagnlspgmsb
      read(nin,*)
      read(nin,*)
      read(nin,*)
      read(nin,*)
      read(nin,*) idrbar
      read(nin,*)
      read(nin,*)
      read(nin,*)
      read(nin,*) scalechoice
      read(nin,*)
      read(nin,*)
      read(nin,*) scaleofcoupling

      
      if(flagoutput.eq.1.D0) then
         open(nout,file="sdecay_slha.out")
      elseif(flagoutput.eq.0.D0) then
         open(nout,file="sdecay.out")
      endif

c-Number of loops for the calculation of the running strong coupling  -c
      inumloop = 2

c ------ The input a la SUSY Les Houches Accord or a la SuSpect ------ c

      tmpinput = flaginput
      if(tmpinput.eq.0) then
         flaginput = 1
      elseif(tmpinput.eq.1) then
         flaginput = 0
      endif

      if(flaginput.eq.1) then

         open(ninlha,file='SD_leshouches.in',status='unknown')

      elseif(flaginput.eq.0) then

         open(nis,file='suspect2.in',status='unknown')

         do i=1,9
            read(nis,*)
         enddo
         read(nis,*) ichoice(1)
         read(nis,*)
         read(nis,*)
         read(nis,*)
         read(nis,*) ichoice(2)
         read(nis,*)
         read(nis,*)
         read(nis,*)
         read(nis,*) ichoice(3)
         read(nis,*)
         read(nis,*)
         read(nis,*)
         read(nis,*) ichoice(4)
         read(nis,*)
         read(nis,*)
         read(nis,*)
         read(nis,*) ichoice(5)
         read(nis,*)
         read(nis,*)
         read(nis,*)
         read(nis,*) ichoice(6)
         read(nis,*)
         read(nis,*)
         read(nis,*)
         read(nis,*)
         read(nis,*)
         read(nis,*) ichoice(7)
         read(nis,*)
         read(nis,*)
         read(nis,*)
         read(nis,*) ichoice(8)
         read(nis,*)
         read(nis,*)
         read(nis,*) ichoice(9)
         read(nis,*)
         read(nis,*)
         read(nis,*)
         read(nis,*)
         read(nis,*)
         read(nis,*) ichoice(10)
         read(nis,*)
         read(nis,*)
         read(nis,*)
         read(nis,*)
         read(nis,*)
         read(nis,*) ichoice(11)
         read(nis,*)
         read(nis,*)
         read(nis,*)
         read(nis,*) dalfinv, dalphas, dmt, dmb, dmtau
         read(nis,*)
         read(nis,*)
         read(nis,*) dehigh,  dqewsb
         read(nis,*)
         read(nis,*)
         read(nis,*)

         if(flagnlspgmsb.eq.1.D0) then
            ichoice(1) = 11
         endif

c ---- minimal supergravity input ----
         if(ichoice(1).eq.10) then
            read(nis,*) m0,  mhalf,  a0,  tgbeta,  sgnmu0
            
         elseif(ichoice(1).eq.11) then
c ---- Gauge Mediated Supersymmetry Breaking  input ---- 
            do i=1,4
               read(nis,*)
            enddo
            read(nis,*) mgmmess, mgmsusy, tgbeta,  sgnmu0, nl, nq

         elseif(ichoice(1).eq.12) then
c ---- Anomaly Mediated Supersymmetry Breaking  input ---- 
            do i=1,8
               read(nis,*)
            enddo
            read(nis,*) m32,am0,tgbeta,sgnmu0,cq,cu,cd,cl,ce,chu,chd

         else
c ---- i.e. non-universal arbitrary input case ----
            do i=1,12
               read(nis,*)
            enddo
            read(nis,*) dmhu2,  dmhd2, tgbeta, sgnmu0
            read(nis,*)
            read(nis,*) dm1,  dm2,  dm3
            read(nis,*)
            read(nis,*) dmsl,  dmtaur, dmsq,  dmtr,  dmbr
            read(nis,*) 
            read(nis,*) dmel, dmer, dmuq,  dmur, dmdr
            read(nis,*) 
            read(nis,*) dal, dau, dad, dal1, dau1, dad1
            read(nis,*)
            read(nis,*)
            read(nis,*) dma, dmu
            dmu = sgnmu0*dabs(dmu)
            dmhu2in = dmhu2
            dmhd2in = dmhd2
         endif

      endif

c ------------ initializing the parameters needed in sdecay ---------- c

      call SD_common_ini

      if(imod(1).eq.1.and.imod(2).eq.2) then
         flagnlspgmsb    = 1.D0
      endif

c ------------- initializing the couplings needed in sdecay ---------- c
      call SD_couplings

c -------------------- some settings of parameters ------------------- c
      nx1t  = 32
      ny1t  = 32


c ==================================================================== c
c ==================================================================== c
c                 The decay widths and branching ratios                c
c ==================================================================== c
c ==================================================================== c

c--------------------------------------------------------------------- c
c             chargino1 and chargino2 2- and 3-body decays             c
c--------------------------------------------------------------------- c

c -- initialization --

      do i=1,2,1
         flagchar3bod(i) = 1.D0

         chartot(i)      = 0.D0
         chartot2(i)     = 0.D0
         chartot2lo(i)   = 0.D0
         chartot2nlo(i)  = 0.D0
         chartotmulti(i) = 0.D0

         charst1(i)    = 0.D0
         charst2(i)    = 0.D0
         charsb1(i)    = 0.D0
         charsb2(i)    = 0.D0
         charsupl(i)   = 0.D0
         charsupr(i)   = 0.D0
         charsdownl(i) = 0.D0
         charsdownr(i) = 0.D0
         charsnel(i)   = 0.D0 
         charsn1(i)    = 0.D0
         charsn2(i)    = 0.D0 
         charsell(i)   = 0.D0
         charselr(i)   = 0.D0
         charstau1(i)  = 0.D0
         charstau2(i)  = 0.D0
         do j=1,4,1
            charwneut(i,j)  = 0.D0
            charhcneut(i,j) = 0.D0
            xchitau(i,j)    = 0.D0
            xchiel(i,j)     = 0.D0
            xchiup(i,j)     = 0.D0
            xchimu(i,j)     = 0.D0
            xchich(i,j)     = 0.D0
            xchitop(i,j)    = 0.D0
         end do
         qcdcharst1(i) = 0.D0
         qcdcharst2(i) = 0.D0
         qcdcharsb1(i) = 0.D0
         qcdcharsb2(i) = 0.D0
         qcdcharsupl(i)= 0.D0
         qcdcharsupr(i)= 0.D0
         qcdcharsdownl(i) = 0.D0
         qcdcharsdownr(i) = 0.D0
         xgluiupdb(i)  = 0.D0
         xgluichsb(i)  = 0.D0
         xgluitopbb(i) = 0.D0
         charwgravitino(i)  = 0.D0
         charhcgravitino(i) = 0.D0
      end do

      char2zchic1   = 0.D0
      char2hlchic1  = 0.D0
      char2hhchic1  = 0.D0
      char2hachic1  = 0.D0
      xchar1tau     = 0.D0
      xchar1nue     = 0.D0
      xchar1numu    = 0.D0
      xchar1nutau   = 0.D0
      xchar1up      = 0.D0
      xchar1dow     = 0.D0
      xchar1ch      = 0.D0
      xchar1str     = 0.D0
      xchar1top     = 0.D0
      xchar1bot     = 0.D0

c -- the 2-body decays and 2-body total widths --

      call SD_char2bod(charst1,charst2,charsb1,charsb2,charsupl,
     .     charsupr,charsdownl,charsdownr,charsnel,charsn1,
     .     charsn2,charsell,charselr,charstau1,charstau2,char2zchic1,
     .     char2hlchic1,char2hhchic1,char2hachic1,charwneut,
     .     charhcneut,qcdcharst1,qcdcharst2,qcdcharsb1,qcdcharsb2,
     .     qcdcharsupl,qcdcharsupr,qcdcharsdownl,qcdcharsdownr)

      if(flagnlspgmsb.eq.1.D0) then
         call SD_gmsbchar2bod(charwgravitino,charhcgravitino)
      endif

      do i=1,2,1
         chartot2lo(i) = charst1(i)+charst2(i)+charsb1(i)+charsb2(i)+
     .        2.D0*charsupl(i)+2.D0*charsupr(i)+2.D0*charsdownl(i)+
     .        2.D0*charsdownr(i)+2.D0*charsnel(i)+charsn1(i)+
     .        charsn2(i)+2.D0*charsell(i)+2.D0*charselr(i)+
     .        charstau1(i)+charstau2(i)+
     .        charwneut(i,1)+charwneut(i,2)+charwneut(i,3)+
     .        charwneut(i,4)+charhcneut(i,1)+charhcneut(i,2)+
     .        charhcneut(i,3)+charhcneut(i,4)
      end do
      chartot2lo(2) = chartot2lo(2)+char2zchic1+char2hlchic1+
     .                char2hhchic1+char2hachic1

      if(flagqcd.eq.1.D0) then
         do i=1,2,1
            chartot2nlo(i) = chartot2lo(i)+qcdcharst1(i)+qcdcharst2(i)+
     .           qcdcharsb1(i)+qcdcharsb2(i)+2.D0*(qcdcharsupl(i)+
     .           qcdcharsupr(i)+qcdcharsdownl(i)+qcdcharsdownr(i)) 
         end do
      endif

      if(flagnlspgmsb.eq.1.D0) then
         do i=1,2,1
            chargrav2bod(i) = charwgravitino(i)+charhcgravitino(i)
         enddo
      endif

      if(flagqcd.eq.0.D0) then
         do i=1,2,1
            chartot2(i) = chartot2lo(i)
         end do
      elseif(flagqcd.eq.1.D0) then
         do i=1,2,1
            chartot2(i) = chartot2nlo(i)
         end do
      endif

c -------------------------------------------------------------------- c

c -- the 3-body decays and 3-body total widths --

      if(flagmulti.eq.1.D0) then
         call SD_xintegchipm(xchitau,xchiel,xchiup,xchimu,xchich,
     .        xchitop,xchar1el,xchar1mu,xchar1tau,
     .        xchar1nue,xchar1numu,xchar1nutau,
     .        xchar1up,xchar1dow,xchar1ch,xchar1str,
     .        xchar1top,xchar1bot,xgluiupdb,xgluichsb,
     .        xgluitopbb)
      endif

      do i=1,2,1
         if(chartot2(i).eq.0.D0.and.flagmulti.eq.1.D0) then
            chartotmulti(i)=0.D0
            do j=1,4,1
               chartotmulti(i) = chartotmulti(i)+xchitau(i,j)+
     .              xchiel(i,j)+xchiup(i,j)+xchimu(i,j)+xchich(i,j)+
     .              xchitop(i,j)
            end do
            chartotmulti(i) = chartotmulti(i)+xgluiupdb(i)+
     .           xgluichsb(i)+xgluitopbb(i)
            if(i.eq.2) then
               chartotmulti(i) = chartotmulti(i)+xchar1tau+xchar1nue
     .              +xchar1numu+xchar1nutau+xchar1up+xchar1dow
     .              +xchar1ch+xchar1str+xchar1top+xchar1bot
            endif
         endif
      end do

c ------------------------ the total widths -------------------------- c

      do i=1,2,1
         if(flagmulti.eq.0.D0) then
            chartot(i)=chartot2(i)
         elseif(flagmulti.eq.1.D0) then
            if(chartot2(i).eq.0.D0) then
               chartot(i)=chartotmulti(i)
            else
               chartot(i)=chartot2(i)
            endif
         endif
      end do

      if(flagnlspgmsb.eq.1.D0) then
         do i=1,2,1
            if(chartotmulti(i).eq.0.D0) flagchar3bod(i) = 0.D0
            chartot(i) = chartot(i)+chargrav2bod(i)
         end do
      endif

c -------------------- the chargino branching ratios ----------------- c

c -- for the 2-body decays --

      if(flagqcd.eq.1.D0)  then
         do i=1,2,1
            charst1(i)    = charst1(i)+qcdcharst1(i)
            charst2(i)    = charst2(i)+qcdcharst2(i)
            charsb1(i)    = charsb1(i)+qcdcharsb1(i)
            charsb2(i)    = charsb2(i)+qcdcharsb2(i)
            charsupl(i)   = charsupl(i)+qcdcharsupl(i)
            charsupr(i)   = charsupr(i)+qcdcharsupr(i)
            charsdownl(i) = charsdownl(i)+qcdcharsdownl(i)
            charsdownr(i) = charsdownr(i)+qcdcharsdownr(i)
         end do
      endif

      do i=1,2,1
         brcharst1(i)    = charst1(i)/chartot(i)
         brcharst2(i)    = charst2(i)/chartot(i)
         brcharsb1(i)    = charsb1(i)/chartot(i)
         brcharsb2(i)    = charsb2(i)/chartot(i)
         brcharsupl(i)   = charsupl(i)/chartot(i)
         brcharsupr(i)   = charsupr(i)/chartot(i)
         brcharsdownl(i) = charsdownl(i)/chartot(i)
         brcharsdownr(i) = charsdownr(i)/chartot(i)
         brcharsnel(i)   = charsnel(i)/chartot(i)
         brcharsn1(i)    = charsn1(i)/chartot(i)
         brcharsn2(i)    = charsn2(i)/chartot(i)
         brcharsell(i)   = charsell(i)/chartot(i)
         brcharselr(i)   = charselr(i)/chartot(i)
         brcharstau1(i)  = charstau1(i)/chartot(i)
         brcharstau2(i)  = charstau2(i)/chartot(i)
         do j=1,4,1
            brcharhcneut(i,j) = charhcneut(i,j)/chartot(i)
            brcharwneut(i,j)  = charwneut(i,j)/chartot(i)
         end do
      end do
      brcharzchic  = char2zchic1/chartot(2)
      brcharhlchic = char2hlchic1/chartot(2)
      brcharhhchic = char2hhchic1/chartot(2)
      brcharhachic = char2hachic1/chartot(2)

      if(flagnlspgmsb.eq.1.D0) then
         do i=1,2,1
            brcharwgravitino(i)  = charwgravitino(i)/chartot(i)
            brcharhcgravitino(i) = charhcgravitino(i)/chartot(i)
         end do
      endif

c -- for the 3-body decays --

      do i=1,2,1
         if(chartot2(i).eq.0.D0.and.flagmulti.eq.1.D0) then
            do j=1,4,1
               brntaunut(i,j) = xchitau(i,j)/chartot(i)
               brnelnue(i,j)  = xchiel(i,j)/chartot(i)
               brnmunumu(i,j) = xchimu(i,j)/chartot(i)
               brnupdb(i,j)   = xchiup(i,j)/chartot(i)
               brnchsb(i,j)   = xchich(i,j)/chartot(i)
               brntopbb(i,j)  = xchitop(i,j)/chartot(i)
            end do
            brglupdb(i)  = xgluiupdb(i)/chartot(i)
            brglchsb(i)  = xgluichsb(i)/chartot(i)
            brgltopbb(i) = xgluitopbb(i)/chartot(i)
         endif
      end do

      if(chartot2(2).eq.0.D0.and.flagmulti.eq.1.D0) then
         brchee       = xchar1el/chartot(2)
         brchmumu     = xchar1mu/chartot(2)
         brchtautau   = xchar1tau/chartot(2)
         brchnene     = xchar1nue/chartot(2)
         brchnmunmu   = xchar1numu/chartot(2)
         brchntauntau = xchar1nutau/chartot(2)
         brchupup     = xchar1up/chartot(2)
         brchdodo     = xchar1dow/chartot(2)
         brchchch     = xchar1ch/chartot(2)
         brchstst     = xchar1str/chartot(2)
         brchtoptop   = xchar1top/chartot(2)
         brchbotbot   = xchar1bot/chartot(2)
      endif

c -------------------------------------------------------------------- c
c              neutralino1/2/3/4 2- and 3-body decays                  c
c                         and loop decays                              c
c -------------------------------------------------------------------- c

c -- initialization --

      do i=1,4,1
         flagneut3bod(i)= 1.D0

         neuttot(i)     = 0.D0
         neuttot2(i)    = 0.D0
         neuttot2lo(i)  = 0.D0
         neuttot2nlo(i) = 0.D0
         neuttotmulti(i)= 0.D0
         neuttotrad(i)  = 0.D0

         neutst1(i)      = 0.D0
         neutst2(i)      = 0.D0
         neutsb1(i)      = 0.D0
         neutsb2(i)      = 0.D0
         neutsupl(i)     = 0.D0
         neutsupr(i)     = 0.D0
         neutsdownl(i)   = 0.D0
         neutsdownr(i)   = 0.D0
         neutsnel(i)     = 0.D0
         neutsn1(i)      = 0.D0
         neutsn2(i)      = 0.D0
         neutsell(i)     = 0.D0
         neutselr(i)     = 0.D0
         neutstau1(i)    = 0.D0
         neutstau2(i)    = 0.D0
         neuthcchar(i,1) = 0.D0
         neuthcchar(i,2) = 0.D0 
         neutwchar(i,1)  = 0.D0
         neutwchar(i,2)  = 0.D0
         do j=1,4,1
            nraddec(i,j) = 0.D0

            neutzneut(i,j)  = 0.D0
            neuthlneut(i,j) = 0.D0
            neuthhneut(i,j) = 0.D0
            neuthaneut(i,j) = 0.D0
            xneutel(i,j)    = 0.D0
            xneutmu(i,j)    = 0.D0
            xneuttau(i,j)   = 0.D0
            xneutnue(i,j)   = 0.D0
            xneutnumu(i,j)  = 0.D0
            xneutnutau(i,j) = 0.D0
            xneutup(i,j)    = 0.D0
            xneutdow(i,j)   = 0.D0
            xneutst(i,j)    = 0.D0
            xneutch(i,j)    = 0.D0
            xneutbot(i,j)   = 0.D0
            xneuttop(i,j)   = 0.D0
         end do
         do j = 1,2,1
            xchelne(i,j)    = 0.D0
            xchmunmu(i,j)   = 0.D0
            xchtauntau(i,j) = 0.D0
            xchubdow(i,j)   = 0.D0
            xchcbs(i,j)     = 0.D0
            xchtbb(i,j)     = 0.D0
         end do
         qcdneutst1(i)    = 0.D0
         qcdneutst2(i)    = 0.D0
         qcdneutsb1(i)    = 0.D0
         qcdneutsb2(i)    = 0.D0
         qcdneutsupl(i)   = 0.D0
         qcdneutsupr(i)   = 0.D0
         qcdneutsdownl(i) = 0.D0
         qcdneutsdownr(i) = 0.D0
         xgluinoup(i)     = 0.D0
         xgluinodo(i)     = 0.D0
         xgluinoch(i)     = 0.D0
         xgluinost(i)     = 0.D0
         xgluinotop(i)    = 0.D0
         xgluinobot(i)    = 0.D0
         neutgammagravitino(i) = 0.D0
         neutZgravitino(i)     = 0.D0
         neuthlgravitino(i)    = 0.D0
         neuthhgravitino(i)    = 0.D0
         neuthagravitino(i)    = 0.D0
      end do

      stautaugravitino = 0.D0
      ninjphoton       = 0.D0

c -- the 2-body decays and 2-body total widths --
      call SD_neut2bod(neutwchar,neutzneut,neuthcchar,neuthlneut,
     .     neuthhneut,neuthaneut,neutsnel,neutsell,neutselr,
     .     neutstau1,neutstau2,neutsn1,neutsn2,neutst1,neutst2,
     .     neutsb1,neutsb2,neutsupl,neutsupr,neutsdownl,neutsdownr,
     .     qcdneutst1,qcdneutst2,qcdneutsb1,qcdneutsb2,qcdneutsupl,
     .     qcdneutsupr,qcdneutsdownl,qcdneutsdownr)
   
      if(flagnlspgmsb.eq.1.D0) then
         call SD_gmsb2bod(neutgammagravitino,neutZgravitino,
     .                       neuthlgravitino,neuthhgravitino,
     .                       neuthagravitino,stautaugravitino)
      endif

      do i=1,4,1
         neuttot2lo(i) = 2.D0*(neutst1(i)+neutst2(i)+neutsb1(i)+
     .           neutsb2(i)+2.D0*neutsupl(i)+2.D0*neutsupr(i)+
     .           2.D0*neutsdownl(i)+2.D0*neutsdownr(i)+2.D0*
     .           neutsnel(i)+neutsn1(i)+neutsn2(i)+2.D0*neutsell(i)+
     .           2.D0*neutselr(i)+neutstau1(i)+neutstau2(i)+
     .           neuthcchar(i,1)+neuthcchar(i,2)+neutwchar(i,1)+
     .           neutwchar(i,2))
         do j=1,4,1
            neuttot2lo(i) = neuttot2lo(i)+neutzneut(i,j)+
     .                  neuthlneut(i,j)+neuthhneut(i,j)+neuthaneut(i,j)
         enddo
      enddo

      if(flagnlspgmsb.eq.1.D0) then
         do i=1,4,1
            neutgrav2bod(i) = neutgammagravitino(i)+
     .           neutZgravitino(i)+neuthlgravitino(i)+
     .           neuthhgravitino(i)+neuthagravitino(i)
         enddo
      endif

      if(flagqcd.eq.1.D0) then
         do i=1,4,1
            neuttot2nlo(i) = 2.D0*(qcdneutst1(i)+qcdneutst2(i)+
     .           qcdneutsb1(i)+qcdneutsb2(i)+2.D0*qcdneutsupl(i)+2.D0*
     .           qcdneutsupr(i)+2.D0*qcdneutsdownl(i)+2.D0*
     .           qcdneutsdownr(i)) + neuttot2lo(i)
         end do
      endif

      if(flagqcd.eq.0.D0) then
         do i=1,4,1
            neuttot2(i) = neuttot2lo(i)
         end do
      elseif(flagqcd.eq.1.D0) then
         do i=1,4,1
            neuttot2(i) = neuttot2nlo(i)
         end do
      endif

c--------------------------------------------------------------------- c

c -- the 3-body decays and 3-body total widths --

      if(flagmulti.eq.1.D0) then
         call SD_xintegneut(xneutel,xneutmu,xneuttau,xneutnue,xneutnumu,
     .                   xneutnutau,xneutup,xneutdow,xneutst,xneutch,
     .                   xneutbot,xneuttop,xchelne,xchmunmu,xchtauntau,
     .                   xchubdow,xchcbs,xchtbb,xgluinoup,xgluinodo,
     .                   xgluinoch,xgluinost,xgluinotop,xgluinobot)
      endif

      do i=1,4,1
         if(neuttot2(i).eq.0.D0.and.flagmulti.eq.1.D0) then
            neuttotmulti(i) = 0.D0
            do j=1,4,1
               neuttotmulti(i) = neuttotmulti(i)+xneutel(i,j)+
     .              xneutmu(i,j)+xneuttau(i,j)+xneutnue(i,j)+
     .              xneutnumu(i,j)+xneutnutau(i,j)+xneutup(i,j)+
     .              xneutdow(i,j)+xneutst(i,j)+xneutch(i,j)+
     .              xneutbot(i,j)+xneuttop(i,j)
            end do
            do j=1,2,1
               neuttotmulti(i) = neuttotmulti(i)+2.D0*(xchelne(i,j)+
     .              xchmunmu(i,j)+xchtauntau(i,j)+
     .              xchubdow(i,j)+xchcbs(i,j)+xchtbb(i,j))
            end do
            neuttotmulti(i) = neuttotmulti(i)+xgluinoup(i)+
     .           xgluinodo(i)+xgluinoch(i)+xgluinost(i)+
     .           xgluinotop(i)+xgluinobot(i)
         endif
      end do

c--------------------------------------------------------------------- c

c -- the loop decays neutralino_i -> neutralino_j + photon and 
c -- the loop total widths --

      do ni = 1,4,1
         if(neuttot2(ni).eq.0.D0.and.flagloop.eq.1.D0) then
            do nj = 1,4,1
               if(nj.ge.ni) then
                  nraddec(ni,nj)=0.D0
               elseif(nj.lt.ni) then
                  call SD_neutraddecay(ninjphoton)
                  nraddec(ni,nj)=ninjphoton
               endif
            end do
         endif
      end do

      do i=1,4,1
         if(neuttot2(i).eq.0.D0.and.flagloop.eq.1.D0) then
            neuttotrad(i) = 0.D0
            do j=1,4,1
               neuttotrad(i) = neuttotrad(i)+nraddec(i,j)
            end do
         endif
      end do

c ------------------------ the total widths -------------------------- c

      do i=1,4,1
         if(flagmulti.eq.0.D0.and.flagloop.eq.0.D0) then
            neuttot(i) = neuttot2(i)
         elseif(flagmulti.eq.1.D0.and.flagloop.eq.0.D0) then
            if(neuttot2(i).eq.0.D0) then
               neuttot(i) = neuttotmulti(i)
            else
               neuttot(i) = neuttot2(i)
            endif
         elseif(flagmulti.eq.0.D0.and.flagloop.eq.1.D0) then
            if(neuttot2(i).eq.0.D0) then
               neuttot(i) = neuttotrad(i)
            else
               neuttot(i) = neuttot2(i)
            endif
         elseif(flagmulti.eq.1.D0.and.flagloop.eq.1.D0) then
            if(neuttot2(i).eq.0.D0) then
               neuttot(i) = neuttotmulti(i)+neuttotrad(i)
            else
               neuttot(i) = neuttot2(i)
            endif
         endif
      end do

      if(flagnlspgmsb.eq.1.D0) then
         do i=1,4,1
            if(neuttotmulti(i).eq.0.D0) flagneut3bod(i) = 0.D0
            neuttot(i) = neuttot(i) + neutgrav2bod(i) 
         end do
      endif

c ------------------- the neutralino branching ratios ---------------- c

c -- for the 2-body decays --

      if(flagqcd.eq.1.D0) then
         do i=1,4,1
            neutst1(i)    = neutst1(i)+qcdneutst1(i)
            neutst2(i)    = neutst2(i)+qcdneutst2(i)
            neutsb1(i)    = neutsb1(i)+qcdneutsb1(i)
            neutsb2(i)    = neutsb2(i)+qcdneutsb2(i)
            neutsupl(i)   = neutsupl(i)+qcdneutsupl(i)
            neutsupl(i)   = neutsupl(i)+qcdneutsupl(i)
            neutsupr(i)   = neutsupr(i)+qcdneutsupr(i)
            neutsupr(i)   = neutsupr(i)+qcdneutsupr(i)
            neutsdownl(i) = neutsdownl(i)+qcdneutsdownl(i)
            neutsdownl(i) = neutsdownl(i)+qcdneutsdownl(i)
            neutsdownr(i) = neutsdownr(i)+qcdneutsdownr(i)
            neutsdownr(i) = neutsdownr(i)+qcdneutsdownr(i)
         end do
      endif

      do i=1,4,1
         brneutst1(i)    = neutst1(i)/neuttot(i)
         brneutst2(i)    = neutst2(i)/neuttot(i)
         brneutsb1(i)    = neutsb1(i)/neuttot(i)
         brneutsb2(i)    = neutsb2(i)/neuttot(i)
         brneutsupl(i)   = neutsupl(i)/neuttot(i)
         brneutsupr(i)   = neutsupr(i)/neuttot(i)
         brneutsdownl(i) = neutsdownl(i)/neuttot(i)
         brneutsdownr(i) = neutsdownr(i)/neuttot(i)
         brneutsnel(i)   = neutsnel(i)/neuttot(i)
         brneutsn1(i)    = neutsn1(i)/neuttot(i)
         brneutsn2(i)    = neutsn2(i)/neuttot(i)
         brneutsell(i)   = neutsell(i)/neuttot(i)
         brneutselr(i)   = neutselr(i)/neuttot(i)
         brneutstau1(i)  = neutstau1(i)/neuttot(i)
         brneutstau2(i)  = neutstau2(i)/neuttot(i)
         do j=1,2,1
            brneutwchar(i,j)  = neutwchar(i,j)/neuttot(i)
            brneuthcchar(i,j) = neuthcchar(i,j)/neuttot(i)
         end do
         do j=1,4,1
            brneutzneut(i,j)  = neutzneut(i,j)/neuttot(i)
            brneuthlneut(i,j) = neuthlneut(i,j)/neuttot(i)
            brneuthhneut(i,j) = neuthhneut(i,j)/neuttot(i)
            brneuthaneut(i,j) = neuthaneut(i,j)/neuttot(i)
         end do
      end do

      if(flagnlspgmsb.eq.1.D0) then
         do i=1,4,1
            brneutgamgrav(i) = neutgammagravitino(i)/neuttot(i)
            brneutzgrav(i)   = neutZgravitino(i)/neuttot(i)
            brneuthlgrav(i)  = neuthlgravitino(i)/neuttot(i)
            brneuthhgrav(i)  = neuthhgravitino(i)/neuttot(i)
            brneuthagrav(i)  = neuthagravitino(i)/neuttot(i)
         end do
      endif

c -- for the 3-body and loop decays --

      do i=1,4,1
         if(neuttot2(i).eq.0.D0.and.flagmulti.eq.1.D0) then
            do j=1,4,1
               brneutup(i,j)    = xneutup(i,j)/neuttot(i)
               brneutdow(i,j)   = xneutdow(i,j)/neuttot(i)
               brneutch(i,j)    = xneutch(i,j)/neuttot(i)
               brneutst(i,j)    = xneutst(i,j)/neuttot(i)
               brneutbot(i,j)   = xneutbot(i,j)/neuttot(i)
               brneuttop(i,j)   = xneuttop(i,j)/neuttot(i)
               brneutel(i,j)    = xneutel(i,j)/neuttot(i)
               brneutmu(i,j)    = xneutmu(i,j)/neuttot(i)
               brneuttau(i,j)   = xneuttau(i,j)/neuttot(i)
               brneutnue(i,j)   = xneutnue(i,j)/neuttot(i)
               brneutnumu(i,j)  = xneutnumu(i,j)/neuttot(i)
               brneutnutau(i,j) = xneutnutau(i,j)/neuttot(i)
            end do
            do j=1,2,1
               brchubd(i,j)     = xchubdow(i,j)/neuttot(i)
               brchcbs(i,j)     = xchcbs(i,j)/neuttot(i)
               brchtbb(i,j)     = xchtbb(i,j)/neuttot(i)
               brchelne(i,j)    = xchelne(i,j)/neuttot(i)
               brchmunmu(i,j)   = xchmunmu(i,j)/neuttot(i)
               brchtauntau(i,j) = xchtauntau(i,j)/neuttot(i)
            end do
            brglup(i)  = xgluinoup(i)/neuttot(i)
            brgldo(i)  = xgluinodo(i)/neuttot(i)
            brglch(i)  = xgluinoch(i)/neuttot(i)
            brglst(i)  = xgluinost(i)/neuttot(i)
            brgltop(i) = xgluinotop(i)/neuttot(i)
            brglbot(i) = xgluinobot(i)/neuttot(i)
         endif
      end do

      do i=1,4,1
         if(neuttot2(i).eq.0.D0.and.flagloop.eq.1.D0) then
            do j=1,4,1
               brnraddec(i,j)   = nraddec(i,j)/neuttot(i) 
            end do
         endif
      end do

c -------------------------------------------------------------------- c
c                       gluino 2- and 3-body decays                    c
c--------------------------------------------------------------------- c

c -- initialization --
      flagglui3bod = 1.D0

      gluitot     = 0.D0
      gluitot2    = 0.D0
      gluitot2lo  = 0.D0
      gluitot2nlo = 0.D0
      gluitotmulti= 0.D0
      gluitotrad  = 0.D0
 
      gst1    = 0.D0
      gst2    = 0.D0
      gsb1    = 0.D0
      gsb2    = 0.D0
      gsupl   = 0.D0
      gsupr   = 0.D0
      gsdownl = 0.D0
      gsdownr = 0.D0

      ggravgl = 0.D0

      qcdgst1    = 0.D0
      qcdgst2    = 0.D0
      qcdgsb1    = 0.D0
      qcdgsb2    = 0.D0
      qcdgsupl   = 0.D0
      qcdgsupr   = 0.D0
      qcdgsdownl = 0.D0
      qcdgsdownr = 0.D0

      do i=1,4,1
         xintegoup(i) = 0.D0
         xintegodn(i) = 0.D0
         xintegotp(i) = 0.D0
         xintegobt(i) = 0.D0
         glnjgluon(i) = 0.D0
      end do

      do i=1,2,1
         xintegoud(i) = 0.D0
         xintegotb(i) = 0.D0
      end do

      xinteghcst1b = 0.D0
      xintegwst1b  = 0.D0
 
c -- the 2-body decays and 2-body total widths --

      call SD_glui2bod(gst1,gst2,gsb1,gsb2,gsupl,gsupr,gsdownl,gsdownr,
     .                qcdgst1,qcdgst2,qcdgsb1,qcdgsb2,qcdgsupl,qcdgsupr,
     .                qcdgsdownl,qcdgsdownr)

      if(flagnlspgmsb.eq.1.D0) then
         call SD_gluinograv(ggravgl)
      endif

      gluitot2lo = 2.D0*(gst1+gst2+gsb1+gsb2+2.D0*gsupl+2.D0*gsupr+
     .           2.D0*gsdownl+2.D0*gsdownr)

      gluitot2nlo = 2.D0*(qcdgst1+qcdgst2+qcdgsb1+qcdgsb2+2.D0*qcdgsupl
     .                   +2.D0*qcdgsupr+2.D0*qcdgsdownl+2.D0*qcdgsdownr)
     .            + gluitot2lo

      if(flagqcd.eq.0.D0) then
         gluitot2 = gluitot2lo
      elseif(flagqcd.eq.1.D0) then
         gluitot2 = gluitot2nlo
      endif

c -------------------------------------------------------------------- c

c -- the 3-body decays and 3-body total widths --

      if(gluitot2.eq.0.D0.and.flagmulti.eq.1.D0) then
         call SD_xinteggo(xintegoup,xintegodn,xintegotp,xintegobt,
     .                    xintegoud,xintegotb,xinteghcst1b,xintegwst1b,
     .                    xintegocc) 
      endif

      if(gluitot2.eq.0.D0.and.flagmulti.eq.1.D0) then
         gluitotmulti=0.D0
         do i=1,4,1
            gluitotmulti=gluitotmulti+2.D0*xintegoup(i)+
     .           2.D0*xintegodn(i)+xintegotp(i)+xintegobt(i)
         end do
         do i=1,2,1
            gluitotmulti = gluitotmulti+4.D0*xintegoud(i)+
     .           2.D0*xintegotb(i)
         end do
         gluitotmulti = gluitotmulti+2.D0*xinteghcst1b+2.D0*xintegwst1b
      endif

c -------------------------------------------------------------------- c

c -- the loop decays gluino -> neutralino_i + gluon and 
c -- the loop total width --

      if(gluitot2.eq.0.D0.and.flagloop.eq.1.D0) then
         call SD_gluiraddecay(glnjgluon)
         gluitotrad=0.D0
         do i=1,4,1
            gluitotrad=gluitotrad+glnjgluon(i)
         end do
      endif

c ------------------------ the total widths -------------------------- c

      if(flagmulti.eq.0.D0.and.flagloop.eq.0.D0) then
         gluitot = gluitot2
      elseif(flagmulti.eq.1.D0.and.flagloop.eq.0.D0) then
         if(gluitot2.eq.0.D0) then
            gluitot = gluitotmulti
         else
            gluitot = gluitot2
         endif
      elseif(flagmulti.eq.0.D0.and.flagloop.eq.1.D0) then
         if(gluitot2.eq.0.D0) then
            gluitot = gluitotrad
         else
            gluitot = gluitot2
         endif
      elseif(flagmulti.eq.1.D0.and.flagloop.eq.1.D0) then
         if(gluitot2.eq.0.D0) then
            gluitot = gluitotmulti+gluitotrad
         else
            gluitot = gluitot2
         endif
      endif

      if(flagnlspgmsb.eq.1.D0) then
         if(gluitotmulti.eq.0.D0) flagglui3bod = 0.D0
         gluitot = gluitot + ggravgl
      endif

c -------------------- the gluino branching ratios ------------------- c

c -- for the 2-body decays --

      if(flagqcd.eq.1.D0) then
         gst1    = gst1+qcdgst1
         gst2    = gst2+qcdgst2
         gsb1    = gsb1+qcdgsb1
         gsb2    = gsb2+qcdgsb2
         gsupl   = gsupl+qcdgsupl
         gsupr   = gsupr+qcdgsupr
         gsdownl = gsdownl+qcdgsdownl
         gsdownr = gsdownr+qcdgsdownr
      endif

      brgst1    = gst1/gluitot
      brgst2    = gst2/gluitot
      brgsb1    = gsb1/gluitot
      brgsb2    = gsb2/gluitot
      brgsupl   = gsupl/gluitot
      brgsupr   = gsupr/gluitot
      brgsdownl = gsdownl/gluitot
      brgsdownr = gsdownr/gluitot

      if(flagnlspgmsb.eq.1.D0) then
         brggravgl = ggravgl/gluitot
      endif

c -- for the 3-body and loop decays --

      if(gluitot2.eq.0.D0.and.flagmulti.eq.1.D0) then
         do i=1,4,1
            brgoup(i)=xintegoup(i)/gluitot
            brgoch(i)=xintegoup(i)/gluitot
            brgodn(i)=xintegodn(i)/gluitot
            brgost(i)=xintegodn(i)/gluitot
            brgotp(i)=xintegotp(i)/gluitot
            brgobt(i)=xintegobt(i)/gluitot
         end do
         do i=1,2,1
            brgoud(i)=xintegoud(i)/gluitot
            brgocs(i)=xintegoud(i)/gluitot
            brgotb(i)=xintegotb(i)/gluitot
         end do
         brhcst1b = xinteghcst1b/gluitot
         brwst1b  = xintegwst1b/gluitot
      endif     

      if(gluitot2.eq.0.D0.and.flagloop.eq.1.D0) then
         do i=1,4,1
            brglnjgluon(i)=glnjgluon(i)/gluitot
         end do
      endif

c -------------------------------------------------------------------- c
c                           sup 2-body decays                          c
c -------------------------------------------------------------------- c

c -- initialization --

      supltot2 = 0.D0
      suprtot2 = 0.D0
      supltot2lo = 0.D0
      suprtot2lo = 0.D0
      supltot2nlo = 0.D0
      suprtot2nlo = 0.D0

      do i=1,4,1
         suplneutup(i) = 0.D0
         suprneutup(i) = 0.D0
         qcdsuplneutup(i) = 0.D0
         qcdsuprneutup(i) = 0.D0
      end do

      do i=1,2,1
         suplchardow(i) = 0.D0
         suprchardow(i) = 0.D0
         qcdsuplchardow(i) = 0.D0
         qcdsuprchardow(i) = 0.D0
      end do

      suplglui = 0.D0
      suprglui = 0.D0
      qcdsuplglui = 0.D0
      qcdsuprglui = 0.D0

c ------------------------------------------------------------------- c

      call SD_sup2bod(suplneutup,suprneutup,suplchardow,suprchardow,
     .                suplglui,suprglui,qcdsuplneutup,qcdsuprneutup,
     .                qcdsuplchardow,qcdsuprchardow,qcdsuplglui,
     .                qcdsuprglui)

      supltot2lo = suplneutup(1)+suplneutup(2)+suplneutup(3)
     .           + suplneutup(4)+suplchardow(1)+suplchardow(2)
     .           + suplglui

      suprtot2lo = suprneutup(1)+suprneutup(2)+suprneutup(3)
     .           + suprneutup(4)+suprchardow(1)+suprchardow(2)
     .           + suprglui

      supltot2nlo = supltot2lo + qcdsuplneutup(1)+qcdsuplneutup(2)
     .            + qcdsuplneutup(3)+qcdsuplneutup(4)+qcdsuplchardow(1)
     .            + qcdsuplchardow(2)+qcdsuplglui

      suprtot2nlo = suprtot2lo + qcdsuprneutup(1)+qcdsuprneutup(2)
     .            + qcdsuprneutup(3)+qcdsuprneutup(4)+qcdsuprchardow(1)
     .            + qcdsuprchardow(2)+qcdsuprglui

      if(flagqcd.eq.0.D0) then
         supltot2 = supltot2lo
         suprtot2 = suprtot2lo
      elseif(flagqcd.eq.1.D0) then
         supltot2 = supltot2nlo
         suprtot2 = suprtot2nlo
      endif

      if(flagqcd.eq.1.D0) then
         do i=1,4,1
            suplneutup(i) = suplneutup(i)+qcdsuplneutup(i)
            suprneutup(i) = suprneutup(i)+qcdsuprneutup(i)
         end do
         do i=1,2,1
            suplchardow(i) = suplchardow(i)+qcdsuplchardow(i)
            suprchardow(i) = suprchardow(i)+qcdsuprchardow(i)
         end do
         suplglui = suplglui+qcdsuplglui
         suprglui = suprglui+qcdsuprglui
      endif

      do i=1,4,1
         brsuplnup(i) = suplneutup(i)/supltot2
         brsuprnup(i) = suprneutup(i)/suprtot2
      end do
      do i=1,2,1
         brsuplcdow(i) = suplchardow(i)/supltot2
         brsuprcdow(i) = suprchardow(i)/suprtot2
      end do
      brsuplglui = suplglui/supltot2
      brsuprglui = suprglui/suprtot2
    
c -------------------------------------------------------------------- c
c                         sdown 2-body decays                          c
c -------------------------------------------------------------------- c

c -- initialization --

      sdowltot2 = 0.D0
      sdowrtot2 = 0.D0
      sdowltot2lo = 0.D0
      sdowrtot2lo = 0.D0
      sdowltot2nlo = 0.D0
      sdowrtot2nlo = 0.D0

      do i=1,4,1
         sdowlneutdow(i) = 0.D0
         sdowrneutdow(i) = 0.D0
         qcdsdowlneutdow(i) = 0.D0
         qcdsdowrneutdow(i) = 0.D0
      end do

      do i=1,2,1
         sdowlcharup(i) = 0.D0
         sdowrcharup(i) = 0.D0
         qcdsdowlcharup(i) = 0.D0
         qcdsdowrcharup(i) = 0.D0
      end do

      sdowlglui = 0.D0
      sdowrglui = 0.D0
      qcdsdowlglui = 0.D0
      qcdsdowrglui = 0.D0

c -------------------------------------------------------------------- c

      call SD_sdown2bod(sdowlneutdow,sdowlcharup,sdowrneutdow,
     .                  sdowrcharup,sdowlglui,sdowrglui,qcdsdowlneutdow,
     .                  qcdsdowlcharup,qcdsdowrneutdow,qcdsdowrcharup,
     .                  qcdsdowlglui,qcdsdowrglui)

      sdowltot2lo = sdowlneutdow(1)+sdowlneutdow(2)+sdowlneutdow(3)+
     .              sdowlneutdow(4)+sdowlcharup(1)+sdowlcharup(2)+
     .              sdowlglui
 
      sdowrtot2lo = sdowrneutdow(1)+sdowrneutdow(2)+sdowrneutdow(3)+
     .              sdowrneutdow(4)+sdowrcharup(1)+sdowrcharup(2)+
     .              sdowrglui

      sdowltot2nlo = sdowltot2lo + qcdsdowlneutdow(1)+
     .               qcdsdowlneutdow(2)+qcdsdowlneutdow(3)+
     .               qcdsdowlneutdow(4)+qcdsdowlcharup(1)+
     .               qcdsdowlcharup(2)+qcdsdowlglui
 
      sdowrtot2nlo = sdowrtot2lo + qcdsdowrneutdow(1)+
     .               qcdsdowrneutdow(2)+qcdsdowrneutdow(3)+
     .               qcdsdowrneutdow(4)+qcdsdowrcharup(1)+
     .               qcdsdowrcharup(2)+qcdsdowrglui

      if(flagqcd.eq.0.D0) then
         sdowltot2 = sdowltot2lo
         sdowrtot2 = sdowrtot2lo
      elseif(flagqcd.eq.1.D0) then
         sdowltot2 = sdowltot2nlo
         sdowrtot2 = sdowrtot2nlo
      endif

      if(flagqcd.eq.1.D0) then
         do i=1,4,1
            sdowlneutdow(i) = sdowlneutdow(i)+qcdsdowlneutdow(i)
            sdowrneutdow(i) = sdowrneutdow(i)+qcdsdowrneutdow(i)
         end do
         do i=1,2,1
            sdowlcharup(i) = sdowlcharup(i)+qcdsdowlcharup(i)
            sdowrcharup(i) = sdowrcharup(i)+qcdsdowrcharup(i)
         end do
         sdowlglui = sdowlglui+qcdsdowlglui
         sdowrglui = sdowrglui+qcdsdowrglui
      endif

      do i=1,4,1
         brsdowlndow(i) = sdowlneutdow(i)/sdowltot2
         brsdowrndow(i) = sdowrneutdow(i)/sdowrtot2
      end do
      do i=1,2,1
         brsdowlchup(i) = sdowlcharup(i)/sdowltot2
         brsdowrchup(i) = sdowrcharup(i)/sdowrtot2
      end do
      brsdowlglui = sdowlglui/sdowltot2
      brsdowrglui = sdowrglui/sdowrtot2

c -------------------------------------------------------------------- c
c                 stop1 and stop2 2- and 3-body decays                 c
c                          and loop decays                             c
c -------------------------------------------------------------------- c

c -- initialization --

      stoptotrad(1) = 0.D0
      sigma4bodtot  = 0.D0
      do i=1,2,1
         stoptot(i)    = 0.D0
         stoptot2(i)   = 0.D0
         stoptot2lo(i) = 0.D0
         stoptot2nlo(i)= 0.D0
         stoptotmulti(i) = 0.D0

         st1charb(i) = 0.D0
         st1hcsb(i)  = 0.D0
         st1wsb(i)   = 0.D0
         st2charb(i) = 0.D0
         st2hcsb(i)  = 0.D0
         st2wsb(i)   = 0.D0
         qcdst1charb(i) = 0.D0
         qcdst1hcsb(i)  = 0.D0
         qcdst1wsb(i)   = 0.D0
         qcdst2charb(i) = 0.D0
         qcdst2hcsb(i)  = 0.D0
         qcdst2wsb(i)   = 0.D0
         xintegstsnel(i) = 0.D0

         do j=1,4,1
            xintegstopw(i,j) = 0.D0
            xintegstoph(i,j) = 0.D0
         end do

         do j=1,2,1
            xintegststau(i,j)    = 0.D0
            xintegstsntau(i,j)   = 0.D0
            xintegstsel(i,j)     = 0.D0
            xintegstbsbst(i,j)   = 0.D0
            xintegstbbsbt(i,j)   = 0.D0
            xintegsttausbnu(i,j) = 0.D0
            xintegstelsbnu(i,j)  = 0.D0
            xintegstupsbdow(i,j) = 0.D0
         end do
      end do

      do i=1,4,1
         st1neutt(i) = 0.D0
         st2neutt(i) = 0.D0
         qcdst1neut(i) = 0.D0
         qcdst2neut(i) = 0.D0
      end do

      st1glui = 0.D0
      st2glui = 0.D0
      st2hl   = 0.D0
      st2hh   = 0.D0
      st2ha   = 0.D0
      st2ztop = 0.D0
      qcdst1glui = 0.D0
      qcdst2glui = 0.D0
      qcdst2hl   = 0.D0
      qcdst2hh   = 0.D0
      qcdst2ha   = 0.D0
      qcdst2ztop = 0.D0
      xintegst2st1tt     = 0.D0
      xintegst2st1bb     = 0.D0
      xintegst2st1uu     = 0.D0
      xintegst2st1dd     = 0.D0
      xintegst2st1ee     = 0.D0
      xintegst2st1nunu   = 0.D0
      xintegst2st1tautau = 0.D0
      xintegst2st1startt = 0.D0
      gamma       = 0.D0
      gammaup     = 0.D0
      gammagluino = 0.D0

c -- the 2-body decays and 2-body total widths --

      call SD_st2bod(st1neutt,st2neutt,st1charb,st2charb,st1glui,
     .               st2glui,st1hcsb,st2hl,st2hh,st2ha,st2hcsb,
     .               st1wsb,st2wsb,st2ztop,qcdst1neut,qcdst2neut,
     .               qcdst1charb,qcdst2charb,qcdst1glui,qcdst2glui,
     .               qcdst1hcsb,qcdst2hcsb,qcdst2hl,qcdst2hh,
     .               qcdst2ha,qcdst2ztop,qcdst1wsb,qcdst2wsb)

      stoptot2lo(1)=st1neutt(1)+st1neutt(2)+st1neutt(3)+st1neutt(4)+
     .            st1charb(1)+st1charb(2)+st1glui+st1hcsb(1)+
     .            st1hcsb(2)+st1wsb(1)+st1wsb(2)

      stoptot2lo(2)=st2neutt(1)+st2neutt(2)+st2neutt(3)+st2neutt(4)+
     .            st2charb(1)+st2charb(2)+st2glui+st2hl+st2hh+st2ha+
     .            st2hcsb(1)+st2hcsb(2)+st2wsb(1)+st2wsb(2)+st2ztop

      stoptot2nlo(1) = stoptot2lo(1) + qcdst1neut(1)+qcdst1neut(2)+
     .            qcdst1neut(3)+qcdst1neut(4)+qcdst1charb(1)+
     .            qcdst1charb(2)+qcdst1glui+qcdst1hcsb(1)+qcdst1hcsb(2)+
     .            qcdst1wsb(1)+qcdst1wsb(2)

      stoptot2nlo(2) = stoptot2lo(2) + qcdst2neut(1)+qcdst2neut(2)+
     .            qcdst2neut(3)+qcdst2neut(4)+qcdst2charb(1)+
     .            qcdst2charb(2)+qcdst2glui+qcdst2hcsb(1)+qcdst2hcsb(2)+
     .            qcdst2hl+qcdst2hh+qcdst2ha+qcdst2ztop+qcdst2wsb(1)+
     .            qcdst2wsb(2)

      if(flagqcd.eq.0.D0) then
         do i=1,2,1
            stoptot2(i) = stoptot2lo(i)
         end do
      elseif(flagqcd.eq.1.D0) then
         do i=1,2,1
            stoptot2(i) = stoptot2nlo(i)
         end do
      endif

c -------------------------------------------------------------------- c

c -- the 3-body decays and 3-body total widths --

      call SD_xintegstop(xintegstopw,xintegstoph,xintegststau,
     .     xintegstsntau,xintegstsel,xintegstsnel,xintegstbsbst,
     .     xintegstbbsbt,xintegsttausbnu,xintegstelsbnu,
     .     xintegstupsbdow,xintegst2st1tt,xintegst2st1bb,
     .     xintegst2st1uu,xintegst2st1dd,xintegst2st1ee,
     .     xintegst2st1nunu,xintegst2st1tautau,xintegst2st1startt)  

      do i=1,2,1
         if(stoptot2(i).eq.0.D0) then
            stoptotmulti(i) = 0.D0
            do j=1,4,1
               stoptotmulti(i) = stoptotmulti(i)+xintegstopw(i,j)+
     .              xintegstoph(i,j)
            end do
            do j=1,2,1
               stoptotmulti(i) = stoptotmulti(i)+xintegststau(i,j)+
     .              xintegstsntau(i,j)+2.D0*xintegstsel(i,j)+
     .              xintegstbsbst(i,j)+xintegstbbsbt(i,j)+
     .              xintegsttausbnu(i,j)+2.D0*xintegstelsbnu(i,j)+
     .              2.D0*xintegstupsbdow(i,j)
            end do
            stoptotmulti(i) = stoptotmulti(i)+2.D0*xintegstsnel(i)
            if(i.eq.2) then
               stoptotmulti(i) = stoptotmulti(i)+
     .              xintegst2st1tt+xintegst2st1bb+
     .              2.D0*xintegst2st1uu+2.D0*xintegst2st1dd+
     .              2.D0*xintegst2st1ee+3.D0*xintegst2st1nunu+
     .              xintegst2st1tautau+xintegst2st1startt
            endif
         endif
      end do

c -------------------------------------------------------------------- c

c -- the loop decays and the total widths --

      if(stoptot2(1).eq.0.D0.and.flagloop.eq.1.D0) then
         call SD_hikasakob1(gamma,gammaup,gammagluino)
      endif

      if(stoptot2(2).eq.0.D0.and.flagloop.eq.1.D0) then
         call SD_hikasakob2(gamma2)
      endif

      if(stoptot2(1).eq.0.D0.and.flagloop.eq.1.D0) then
         stoptotrad(1) = gamma+gammaup+gammagluino
      endif

c -------------------------------------------------------------------- c

c -- the stop1 4-body decays                        

      if(flagmulti.eq.1.D0.and.stoptot2(1).eq.0.D0.and.
     .stoptotmulti(1).eq.0.D0) then
      
         call SD_rstart(12,34,56,78)

         call SD_st4bod(ast1,sigmato,sigmasn,sigmaw,sigmah,ainter,
     .                  sigmae,sigmaq)

         sigma4bodtot=sigmato+sigmaw+sigmah+2.D0*ainter+2.D0*sigmae
     .        +6.D0*sigmaq
      endif

c ------------------------ the total widths -------------------------- c

      if(flagmulti.eq.0.D0.and.flagloop.eq.0.D0) then
         stoptot(1) = stoptot2(1)
      elseif(flagmulti.eq.1.D0.and.flagloop.eq.0.D0) then
         if(stoptot2(1).eq.0.D0) then
            if(stoptotmulti(1).ne.0.D0) then
               stoptot(1) = stoptotmulti(1)
            else
               stoptot(1) = sigma4bodtot
            endif
         else
            stoptot(1) = stoptot2(1)
         endif
      elseif(flagmulti.eq.0.D0.and.flagloop.eq.1.D0) then
         if(stoptot2(1).eq.0.D0) then
            stoptot(1) = stoptotrad(1)
         else
            stoptot(1) = stoptot2(1)
         endif
      elseif(flagmulti.eq.1.D0.and.flagloop.eq.1.D0) then
         if(stoptot2(1).eq.0.D0) then
            if(stoptotmulti(1).ne.0.D0) then
               stoptot(1) = stoptotmulti(1)+stoptotrad(1)
            else
               stoptot(1) = sigma4bodtot+stoptotrad(1)
            endif
         else
            stoptot(1) = stoptot2(1)
         endif
      endif

      if(flagmulti.eq.0.D0) then
         stoptot(2) = stoptot2(2)
      elseif(flagmulti.eq.1.D0) then
         if(stoptot2(2).eq.0.D0) then
            stoptot(2) = stoptotmulti(2)
         else
            stoptot(2) = stoptot2(2)
         endif
      endif

c ---------------------- the stop branching ratios ------------------- c

c -- for the 2-body decays --

      if(flagqcd.eq.1.D0) then
         do i=1,4,1
            st1neutt(i) = st1neutt(i)+qcdst1neut(i)
            st2neutt(i) = st2neutt(i)+qcdst2neut(i)
         end do
         do i=1,2,1
            st1charb(i) = st1charb(i) + qcdst1charb(i)
            st2charb(i) = st2charb(i) + qcdst2charb(i)
            st1hcsb(i)  = st1hcsb(i) + qcdst1hcsb(i)
            st2hcsb(i)  = st2hcsb(i) + qcdst2hcsb(i)
            st1wsb(i)   = st1wsb(i) + qcdst1wsb(i)
            st2wsb(i)   = st2wsb(i) + qcdst2wsb(i)
         end do
         st1glui = st1glui + qcdst1glui
         st2glui = st2glui + qcdst2glui
         st2hl   = st2hl + qcdst2hl
         st2hh   = st2hh + qcdst2hh
         st2ha   = st2ha + qcdst2ha
         st2ztop = st2ztop + qcdst2ztop
      endif

      do i=1,4,1
         brst1neutt(i) = st1neutt(i)/stoptot(1)
         brst2neutt(i) = st2neutt(i)/stoptot(2)
      end do
      do i=1,2,1
         brst1charb(i) = st1charb(i)/stoptot(1)
         brst1hcsb(i)  = st1hcsb(i)/stoptot(1)
         brst1wsb(i)   = st1wsb(i)/stoptot(1)
         brst2charb(i) = st2charb(i)/stoptot(2)
         brst2hcsb(i)  = st2hcsb(i)/stoptot(2)
         brst2wsb(i)   = st2wsb(i)/stoptot(2)
      end do
      brst1glui = st1glui/stoptot(1)
      brst2glui = st2glui/stoptot(2)
      brst2hl   = st2hl/stoptot(2)
      brst2hh   = st2hh/stoptot(2)
      brst2ha   = st2ha/stoptot(2)
      brst2ztop = st2ztop/stoptot(2)

c -- for the 3-body and loop decays --

      do i=1,2,1
         if(stoptot2(i).eq.0.D0.and.flagmulti.eq.1.D0) then
            do j=1,4,1
               brstopw(i,j) = xintegstopw(i,j)/stoptot(i)
               brstoph(i,j) = xintegstoph(i,j)/stoptot(i)
            end do
            do j=1,2,1
               brststau(i,j)    = xintegststau(i,j)/stoptot(i)
               brstsntau(i,j)   = xintegstsntau(i,j)/stoptot(i)
               brstsel(i,j)     = xintegstsel(i,j)/stoptot(i)
               brstbsbst(i,j)   = xintegstbsbst(i,j)/stoptot(i)
               brstbbsbt(i,j)   = xintegstbbsbt(i,j)/stoptot(i)
               brsttausbnu(i,j) = xintegsttausbnu(i,j)/stoptot(i)
               brstelsbnu(i,j)  = xintegstelsbnu(i,j)/stoptot(i)
               brstupsbdow(i,j) = xintegstupsbdow(i,j)/stoptot(i)
            end do
            brstsnel(i)    = xintegstsnel(i)/stoptot(i)
         endif
      end do

      if(stoptot2(2).eq.0.D0.and.flagmulti.eq.1.D0) then
         brst2st1tt     = xintegst2st1tt/stoptot(2)
         brst2st1startt = xintegst2st1startt/stoptot(2)
         brst2st1bb     = xintegst2st1bb/stoptot(2)
         brst2st1uu     = xintegst2st1uu/stoptot(2)
         brst2st1dd     = xintegst2st1dd/stoptot(2)
         brst2st1ee     = xintegst2st1ee/stoptot(2)
         brst2st1nunu   = xintegst2st1nunu/stoptot(2)
         brst2st1tautau = xintegst2st1tautau/stoptot(2)
      endif

      if(stoptot2(1).eq.0.D0.and.flagloop.eq.1.D0) then
         brgamma       = gamma/stoptot(1)
         brgammaup     = gammaup/stoptot(1)
         brgammagluino = gammagluino/stoptot(1)
      endif

c -- for the 4-body decays

      if(flagmulti.eq.1.D0.and.stoptot2(1).eq.0.D0.and.
     .stoptotmulti(1).eq.0.D0) then

         if(flagloop.eq.1.D0) then
            stoptot4          = sigma4bodtot+gamma+gammaup+gammagluino
            brgamma4bod       = gamma/stoptot4
            brgammaup4bod     = gammaup/stoptot4
            brgammagluino4bod = gammagluino/stoptot4
            br4bodoffshelltau = sigma4bodtot/stoptot4
         elseif(flagloop.eq.0.D0) then
            stoptot4 = sigma4bodtot
            brgamma4bod       = 0.D0
            brgammaup4bod     = 0.D0
            brgammagluino4bod = 0.D0
            br4bodoffshelltau = sigma4bodtot/stoptot4
         endif

      endif

c -------------------------------------------------------------------- c
c                    sbottom1/2 2- and 3-body decays                   c
c -------------------------------------------------------------------- c

c -- initialization --

      do i=1,2,1
         sbottot(i)    = 0.D0
         sbottot2(i)   = 0.D0
         sbottot2lo(i) = 0.D0
         sbottot2nlo(i)= 0.D0
         sbottotmulti(i) = 0.D0

         sb1chart(i) = 0.D0
         sb1hcst(i)  = 0.D0
         sb1wst(i)   = 0.D0

         sb2chart(i) = 0.D0
         sb2hcst(i)  = 0.D0
         sb2wst(i)   = 0.D0

         qcdsb1chart(i) = 0.D0
         qcdsb1hcst(i)  = 0.D0
         qcdsb1wst(i)   = 0.D0

         qcdsb2chart(i) = 0.D0
         qcdsb2hcst(i)  = 0.D0
         qcdsb2wst(i)   = 0.D0

         xintegsbsnel(i) = 0.D0
         do j=1,2,1
            xintegsbstau(i,j)    = 0.D0
            xintegsbsntau(i,j)   = 0.D0
            xintegsbsel(i,j)     = 0.D0
            xintegsbtstsb(i,j)   = 0.D0
            xintegsbtbstb(i,j)   = 0.D0
            xintegsbtaustnu(i,j) = 0.D0
            xintegsbelstnu(i,j)  = 0.D0
            xintegsbupstdow(i,j) = 0.D0
         end do
      end do

      do j=1,4,1
         sb1neutt(j) = 0.D0
         sb2neutt(j) = 0.D0

         qcdsb1neut(j) = 0.D0
         qcdsb2neut(j) = 0.D0
      end do

      sb1glui = 0.D0
      sb2glui = 0.D0
      sb2hl   = 0.D0
      sb2hh   = 0.D0
      sb2ha   = 0.D0
      sb2zbot = 0.D0

      qcdsb1glui = 0.D0
      qcdsb2glui = 0.D0
      qcdsb2hl   = 0.D0
      qcdsb2hh   = 0.D0
      qcdsb2ha   = 0.D0
      qcdsb2zbot = 0.D0

      xintegsb2sb1bb     = 0.D0
      xintegsb2sb1tt     = 0.D0
      xintegsb2sb1uu     = 0.D0
      xintegsb2sb1dd     = 0.D0
      xintegsb2sb1ee     = 0.D0
      xintegsb2sb1nunu   = 0.D0
      xintegsb2sb1tautau = 0.D0
      xintegsb2sb1starbb = 0.D0

c -- the 2-body decays and 2-body total widths --

      call SD_sb2bod(sb1neutt,sb2neutt,sb1chart,sb2chart,sb1glui,
     .               sb2glui,sb1hcst,sb2hl,sb2hh,sb2ha,sb2hcst,sb1wst,
     .               sb2wst,sb2zbot,qcdsb1neut,qcdsb2neut,qcdsb1chart,
     .               qcdsb2chart,qcdsb1glui,qcdsb2glui,qcdsb1hcst,
     .               qcdsb2hcst,qcdsb2hl,qcdsb2hh,qcdsb2ha,qcdsb2zbot,
     .               qcdsb1wst,qcdsb2wst)

      sbottot2lo(1)=sb1neutt(1)+sb1neutt(2)+sb1neutt(3)+sb1neutt(4)+
     .              sb1chart(1)+sb1chart(2)+sb1glui+sb1hcst(1)+
     .              sb1hcst(2)+sb1wst(1)+sb1wst(2)

      sbottot2lo(2)=sb2neutt(1)+sb2neutt(2)+sb2neutt(3)+sb2neutt(4)+
     .              sb2chart(1)+sb2chart(2)+sb2glui+sb2hcst(1)+
     .              sb2hcst(2)+sb2wst(1)+sb2wst(2)+sb2hl+sb2hh+sb2ha+
     .              sb2zbot

      sbottot2nlo(1)=sbottot2lo(1) + qcdsb1neut(1)+qcdsb1neut(2)+
     .               qcdsb1neut(3) + qcdsb1neut(4)+qcdsb1chart(1)+
     .               qcdsb1chart(2)+ qcdsb1glui+qcdsb1hcst(1)+
     .               qcdsb1hcst(2)+qcdsb1wst(1)+qcdsb1wst(2)

      sbottot2nlo(2)=sbottot2lo(2) + qcdsb2neut(1)+qcdsb2neut(2)+
     .               qcdsb2neut(3)+qcdsb2neut(4)+qcdsb2chart(1)+
     .               qcdsb2chart(2)+qcdsb2glui+qcdsb2hcst(1)+
     .               qcdsb2hcst(2)+qcdsb2hl+qcdsb2hh+qcdsb2ha +
     .               qcdsb2zbot+qcdsb2wst(1)+qcdsb2wst(2)

      if(flagqcd.eq.0.D0) then
         do i=1,2,1
            sbottot2(i) = sbottot2lo(i)
         end do
      elseif(flagqcd.eq.1.D0) then
         do i=1,2,1
            sbottot2(i) = sbottot2nlo(i)
         end do
      endif

c -------------------------------------------------------------------- c

c -- the 3-body decays and the 3-body total widths

      call SD_xintegsbottom(xintegsb2sb1bb,xintegsb2sb1tt,
     .       xintegsb2sb1uu,xintegsb2sb1dd,xintegsb2sb1ee,
     .       xintegsb2sb1nunu,xintegsb2sb1tautau,xintegsb2sb1starbb,
     .       xintegsbtstsb,xintegsbtbstb,xintegsbtaustnu,xintegsbelstnu,
     .       xintegsbupstdow,xintegsbstau,xintegsbsntau,xintegsbsel,
     .       xintegsbsnel)

      do i=1,2,1
         if(sbottot2(i).eq.0.D0) then
            sbottotmulti(i) = 0.D0
            do j=1,2,1
               sbottotmulti(i) = sbottotmulti(i)+xintegsbstau(i,j)+
     .              xintegsbsntau(i,j)+2.D0*xintegsbsel(i,j)+
     .              xintegsbtstsb(i,j)+xintegsbtbstb(i,j)+
     .              xintegsbtaustnu(i,j)+2.D0*xintegsbelstnu(i,j)+
     .              2.D0*xintegsbupstdow(i,j)
            end do
            sbottotmulti(i) = sbottotmulti(i)+2.D0*xintegsbsnel(i)
            if(i.eq.2) then
               sbottotmulti(i) = sbottotmulti(i)+xintegsb2sb1bb+
     .              xintegsb2sb1tt+2.D0*xintegsb2sb1uu+
     .              2.D0*xintegsb2sb1dd+2.D0*xintegsb2sb1ee+
     .              3.D0*xintegsb2sb1nunu+xintegsb2sb1tautau+
     .              xintegsb2sb1starbb
            endif
         endif
      enddo
      
c ------------------------ the total widths -------------------------- c

      do i=1,2,1
         if(flagmulti.eq.0.D0) then
            sbottot(i) = sbottot2(i)
         elseif(flagmulti.eq.1.D0) then
            if(sbottot2(i).eq.0.D0) then
               sbottot(i) = sbottotmulti(i)
            else
               sbottot(i) = sbottot2(i)
            endif
         endif
      end do

c --------------------- the sbottom branching ratios ----------------- c

c -- for the 2-body decays --

      if(flagqcd.eq.1.D0) then
         do i=1,4,1
            sb1neutt(i) = sb1neutt(i)+qcdsb1neut(i)
            sb2neutt(i) = sb2neutt(i)+qcdsb2neut(i)
         end do
         do i=1,2,1
            sb1chart(i) = sb1chart(i) + qcdsb1chart(i)
            sb2chart(i) = sb2chart(i) + qcdsb2chart(i)
            sb1hcst(i)  = sb1hcst(i) + qcdsb1hcst(i)
            sb2hcst(i)  = sb2hcst(i) + qcdsb2hcst(i)
            sb1wst(i)   = sb1wst(i) + qcdsb1wst(i)
            sb2wst(i)   = sb2wst(i) + qcdsb2wst(i)
         end do
         sb1glui = sb1glui + qcdsb1glui
         sb2glui = sb2glui + qcdsb2glui
         sb2hl   = sb2hl + qcdsb2hl
         sb2hh   = sb2hh + qcdsb2hh
         sb2ha   = sb2ha + qcdsb2ha
         sb2zbot = sb2zbot + qcdsb2zbot
      endif

      do i=1,4,1
         brsb1neutt(i)=sb1neutt(i)/sbottot2(1)
         brsb2neutt(i)=sb2neutt(i)/sbottot2(2)
      end do
      do i=1,2,1
         brsb1chart(i) = sb1chart(i)/sbottot2(1)
         brsb2chart(i) = sb2chart(i)/sbottot2(2)
         brsb1hcst(i)  = sb1hcst(i)/sbottot2(1)
         brsb2hcst(i)  = sb2hcst(i)/sbottot2(2)
         brsb1wst(i)   = sb1wst(i)/sbottot2(1)
         brsb2wst(i)   = sb2wst(i)/sbottot2(2)
      end do
      brsb1glui = sb1glui/sbottot2(1)
      brsb2glui = sb2glui/sbottot2(2)
      brsb2hl   = sb2hl/sbottot2(2)
      brsb2hh   = sb2hh/sbottot2(2)
      brsb2ha   = sb2ha/sbottot2(2)
      brsb2zbot = sb2zbot/sbottot2(2)

c -- for the 3-body decays --

      do i=1,2,1
         if(sbottot2(i).eq.0.D0.and.flagmulti.eq.1.D0) then
            do j=1,2,1
               brsbstau(i,j)    = xintegsbstau(i,j)/sbottot(i)
               brsbsntau(i,j)   = xintegsbsntau(i,j)/sbottot(i)
               brsbsel(i,j)     = xintegsbsel(i,j)/sbottot(i)
               brsbtstsb(i,j)   = xintegsbtstsb(i,j)/sbottot(i)
               brsbtbstb(i,j)   = xintegsbtbstb(i,j)/sbottot(i)
               brsbtaustnu(i,j) = xintegsbtaustnu(i,j)/sbottot(i)
               brsbelstnu(i,j)  = xintegsbelstnu(i,j)/sbottot(i)
               brsbupstdow(i,j) = xintegsbupstdow(i,j)/sbottot(i)
            end do
            brsbsnel(i) = xintegsbsnel(i)/sbottot(i)
         endif
      end do

      if(sbottot2(2).eq.0.D0.and.flagmulti.eq.1.D0) then
         brsb2sb1bb     = xintegsb2sb1bb/sbottot(2)
         brsb2sb1starbb = xintegsb2sb1starbb/sbottot(2)
         brsb2sb1tt     = xintegsb2sb1tt/sbottot(2)
         brsb2sb1uu     = xintegsb2sb1uu/sbottot(2)
         brsb2sb1dd     = xintegsb2sb1dd/sbottot(2)
         brsb2sb1ee     = xintegsb2sb1ee/sbottot(2)
         brsb2sb1nunu   = xintegsb2sb1nunu/sbottot(2)
         brsb2sb1tautau = xintegsb2sb1tautau/sbottot(2)
      endif

c -------------------------------------------------------------------- c
c                     selectron 2-body decays                          c
c -------------------------------------------------------------------- c

c -- initialization --

      selltot2 = 0.D0
      selrtot2 = 0.D0

      do i =1,2,1
         sellcharnue(i) = 0.D0
         selrcharnue(i) = 0.D0
      end do

      do j=1,4,1
        sellneute(j) = 0.D0
        selrneute(j) = 0.D0
      end do

c -------------------------------------------------------------------- c

      call SD_sel2bod(sellneute,sellcharnue,selrneute,selrcharnue)

      selltot2=sellneute(1)+sellneute(2)+sellneute(3)+sellneute(4)+
     .         sellcharnue(1)+sellcharnue(2)

      selrtot2=selrneute(1)+selrneute(2)+selrneute(3)+selrneute(4)+
     .         selrcharnue(1)+selrcharnue(2)

      do i=1,4,1
         brsellneute(i) = sellneute(i)/selltot2
         brselrneute(i) = selrneute(i)/selrtot2
      end do
      do i=1,2,1
         brsellcharnue(i) = sellcharnue(i)/selltot2
         brselrcharnue(i) = selrcharnue(i)/selrtot2
      end do

c -------------------------------------------------------------------- c
c                  sneutrino_electron 2-body decays                    c
c -------------------------------------------------------------------- c

c -- initialization --

      sneltot2 = 0.D0

      snellchar(1) = 0.D0
      snellchar(2) = 0.D0

      do j=1,4,1
         snellneut(j) = 0.D0
      end do

c -------------------------------------------------------------------- c

      call SD_snel2bod(snellneut,snellchar)

      sneltot2=snellneut(1)+snellneut(2)+snellneut(3)+
     .         snellneut(4)+snellchar(1)+snellchar(2)

      do i=1,4,1
         brsnellneut(i) = snellneut(i)/sneltot2
      end do
      do i=1,2,1
         brsnellchar(i) = snellchar(i)/sneltot2
      end do

c -------------------------------------------------------------------- c
c                      stau1/2 2-body decays                           c
c -------------------------------------------------------------------- c

c -- initialization --

      stau1tot2 = 0.D0 
      stau2tot2 = 0.D0

      do j=1,4,1
         stau1neut(j) = 0.D0
         stau2neut(j) = 0.D0
      end do

      do i=1,2,1
         stau1char(i) = 0.D0
         stau1hcsn(i) = 0.D0
         stau1wsn(i)  = 0.D0

         stau2char(i) = 0.D0
         stau2hcsn(i) = 0.D0
         stau2wsn(i)  = 0.D0
      end do

      stau2hl   = 0.D0 
      stau2hh   = 0.D0
      stau2ha   = 0.D0
      stau2ztau = 0.D0

c -------------------------------------------------------------------- c

      call SD_stau2bod(stau1neut,stau1char,stau2neut,stau2char,
     .                 stau1hcsn,stau2hcsn,stau2hl,stau2hh,stau2ha,
     .                 stau2ztau,stau1wsn,stau2wsn)

      stau1tot2=stau1neut(1)+stau1neut(2)+stau1neut(3)+stau1neut(4)+
     .          stau1char(1)+stau1char(2)+stau1hcsn(1)+stau1hcsn(2)+
     .          stau1wsn(1)+stau1wsn(2)

      if(flagnlspgmsb.eq.1.D0) then
         stau1tot2 = stau1tot2+stautaugravitino
      endif

      stau2tot2=stau2neut(1)+stau2neut(2)+stau2neut(3)+stau2neut(4)+
     .          stau2char(1)+stau2char(2)+stau2hcsn(1)+stau2hcsn(2)+
     .          stau2wsn(1)+stau2wsn(2)+stau2hl+stau2hh+stau2ha+
     .          stau2ztau

      do i=1,4,1
         brstau1neut(i)=stau1neut(i)/stau1tot2
         brstau2neut(i)=stau2neut(i)/stau2tot2
      end do
      do i=1,2,1
         brstau1char(i)=stau1char(i)/stau1tot2
         brstau1hcsn(i)=stau1hcsn(i)/stau1tot2
         brstau1wsn(i) =stau1wsn(i)/stau1tot2
         brstau2char(i)=stau2char(i)/stau2tot2
         brstau2hcsn(i)=stau2hcsn(i)/stau2tot2
         brstau2wsn(i) =stau2wsn(i)/stau2tot2
      end do
      brstau2hl   = stau2hl/stau2tot2
      brstau2hh   = stau2hh/stau2tot2
      brstau2ha   = stau2ha/stau2tot2
      brstau2ztau = stau2ztau/stau2tot2

      if(flagnlspgmsb.eq.1.D0) then
         brstautaugrav = stautaugravitino/stau1tot2
      endif

c -------------------------------------------------------------------- c
c                    sneutrino_tau 2-body decays                       c
c -------------------------------------------------------------------- c

c -- initialization --

      sntautot2 = 0.D0

      do i=1,2,1
         sntauchar(i)    = 0.D0
         sntau1hcstau(i) = 0.D0
         sntau1wstau(i)  = 0.D0
      end do

      do j=1,4,1
         sntauneut(j) = 0.D0
      end do

c -------------------------------------------------------------------- c

      call SD_sntau2bod(sntauneut,sntauchar,sntau1hcstau,sntau1wstau)

      sntautot2=sntauneut(1)+sntauneut(2)+sntauneut(3)+
     .          sntauneut(4)+sntauchar(1)+sntauchar(2)+
     .          sntau1hcstau(1)+sntau1hcstau(2)+
     .          sntau1wstau(1)+sntau1wstau(2)

      do i=1,4,1
         brsntauneut(i) = sntauneut(i)/sntautot2
      end do
      do i=1,2,1
         brsntauchar(i)    = sntauchar(i)/sntautot2
         brsntau1wstau(i)  = sntau1wstau(i)/sntautot2
         brsntau1hcstau(i) = sntau1hcstau(i)/sntautot2
      end do

c -------------------------------------------------------------------- c
c                          top 2-body decays                           c
c -------------------------------------------------------------------- c

c -- initialization --

      toptot2 = 0.D0
      
      topbw = 0.D0
      topbh = 0.D0

      do i=1,4,1
         do j=1,2,1
            topneutrstop(i,j) = 0.D0
         end do
      end do

c -------------------------------------------------------------------- c

      if(flagsusytop.eq.1.D0) then
         call SD_top2bod(topbw,topbh,topneutrstop)
         
         toptot2 = topbw+topbh
         do i=1,4,1
            do j=1,2,1
               toptot2 = toptot2 + topneutrstop(i,j)
            end do
         end do
         
         brtopbw        = topbw/toptot2
         brtopbh        = topbh/toptot2
         do i=1,4,1
            do j=1,2,1
               brtopneutrstop(i,j) = topneutrstop(i,j)/toptot2
            end do
         end do
      endif

c ==================================================================== c
c                          The output file                             c
c ==================================================================== c
c -------------------------------------------------------------------- c

      if(flagoutput.eq.1.D0) then

c ------------------ output a la Les Houches accord ------------------ c

      unlikely = -123456789D0

      id =1
      idb=-1
      iu =2
      iub=-2
      is =3
      isb=-3
      ic =4
      icb=-4
      ib =5
      ibb=-5
      it =6
      itb=-6

      ie   =11
      ine  =12
      imu  =13
      inmu =14
      itau =15
      intau=16

      ihl=25
      ihh=35
      iha=36
      ihc=37
      igl=21
      iga=22
      iz =23
      iwc=24

      isdl=1000001
      isdr=2000001
      isul=1000002
      isur=2000002
      issl=1000003
      issr=2000003
      iscl=1000004
      iscr=2000004
      isb1=1000005
      isb2=2000005
      ist1=1000006
      ist2=2000006

      iglo=1000021
      in1 =1000022
      in2 =1000023
      in3 =1000025
      in4 =1000035
      ic1 =1000024
      ic2 =1000037

      intau1=1000016 
      intau2=2000016 
      inel  =1000012
      iner  =2000012
      inmul =1000014
      inmur =2000014
      
      isell =1000011
      iselr =2000011
      ismul =1000013
      ismur =2000013
      istau1=1000015
      istau2=2000015

      igrav =1000039

c maggie comment: This is not a PDG code:
      if1 = 3000001
      if2 = 4000001 

      write(nout,105)
      write(nout,50) "                              ====================
     .="
      write(nout,50) "                              | THE SDECAY OUTPUT 
     .|"
      write(nout,50) "                              ====================
     .="
      write(nout,105)
      write(nout,105)

      write(nout,50)'             --------------------------------------
     .---------------'
      write(nout,50)'             |  SUSY Les Houches Accord - MSSM Spec
     .trum + Decays |'
      write(nout,50)'             |                                     
     .              |'
      write(nout,50)'             |                     SDECAY 1.3      
     .              |'
      write(nout,50)'             |                                     
     .              |'
      write(nout,50)'             |  Authors: M.Muhlleitner, A.Djouadi a
     .nd Y.Mambrini |'
      write(nout,50)'             |  Ref.:    Comput.Phys.Commun.168(200
     .5)46          |'
      write(nout,50)'             |           [hep-ph/0311167]          
     .              |'
      write(nout,50)'             |                                     
     .              |'
      write(nout,50)'             |  In case of problems please send an 
     .email to      |'
      write(nout,50)'             |           muehlleitner@lapp.in2p3.fr
     .              |'
      write(nout,50)'             |           djouadi@mail.cern.ch
     .              |'
      write(nout,50)'             |           yann.mambrini@th.u-psud.fr
     .              |'
      write(nout,50)'             |                                     
     .              |'
      write(nout,50)'             |  If not stated otherwise all DRbar c
     .ouplings and  |'
      write(nout,49)'             |  soft SUSY breaking masses are given
     . at the scale |'
      write(nout,49)'             |  Q=',scaleofewsb
      write(nout,50)'             |                                     
     .              |'
      write(nout,50)'             --------------------------------------
     .---------------'
      write(nout,105)

      if(check(2).ne.1) then
         write(nout,105)
         write(nout,50)'WARNING: The Block SMINPUTS has not been given.'
         write(nout,50)'At least mb(mb)_MSbar is needed in SDECAY 
     .however.'
      endif

      if(check(3).ne.1.and.check(4).ne.1) then
         write(nout,105)
         write(nout,50)'WARNING: Neither Block EXTPAR nor Block MINPAR h
     .as been given.'
         write(nout,50)'For SDECAY necessary parameters might miss.'
      endif

      if(check(4).ne.1.and.check(15).ne.1) then
         write(nout,105)
         write(nout,50)'WARNING: The soft SUSY breaking masses have not
     .been given.'
      endif

      if(check(4).ne.1.and.check(16).ne.1) then
         write(nout,105)
         write(nout,50)'WARNING: AU has not been given. It is needed in 
     .SDECAY however.'
      endif

      if(check(4).ne.1.and.check(17).ne.1) then
         write(nout,105)
         write(nout,50)'WARNING: AD has not been given. It is needed in 
     .SDECAY however.'
      endif

      if(check(4).ne.1.and.check(18).ne.1) then
         write(nout,105)
         write(nout,50)'WARNING: AE has not been given. It is needed in 
     .SDECAY however.'
      endif

      if(check(5).ne.1) then
         write(nout,105)
         write(nout,50)'WARNING: The Block MASS has not been given. It i
     .s needed in SDECAY however.'
      endif

      if(check(6).ne.1) then
         write(nout,105)
         write(nout,50)'WARNING: The Block NMIX has not been given. It i
     .s needed in SDECAY however.'
      endif

      if(check(7).ne.1) then
         write(nout,105)
         write(nout,50)'WARNING: The Block UMIX has not been given. It i
     .s needed in SDECAY however.'
      endif

      if(check(8).ne.1) then
         write(nout,105)
         write(nout,50)'WARNING: The Block VMIX has not been given. It i
     .s needed in SDECAY however.'
      endif

      if(check(9).ne.1) then
         write(nout,105)
         write(nout,50)'WARNING: The Block STOPMIX has not been given. I
     .t is needed in SDECAY however.'
      endif

      if(check(10).ne.1) then
         write(nout,105)
         write(nout,50)'WARNING: The Block SBOTMIX has not been given. I
     .t is needed in SDECAY however.'
      endif

      if(check(11).ne.1) then
         write(nout,105)
         write(nout,50)'WARNING: The Block STAUMIX has not been given. I
     .t is needed in SDECAY however.'
      endif

      if(check(12).ne.1) then
         write(nout,105)
         write(nout,50)'WARNING: The Block ALPHA has not been given. It 
     .is needed in SDECAY however.'
      endif

      if(check(13).ne.1) then
         write(nout,105)
         write(nout,50)'WARHNING: The Block HMIX has not been given.'
         write(nout,50)'It is needed for a consistent calculation howeve
     .r'
      endif

      if(check(14).ne.1) then
         write(nout,105)
         write(nout,50)'WARHNING: The Block GAUGE has not been given.'
         write(nout,50)'It is needed for a consistent calculation howeve
     .r'
      endif

      if(check(19).ne.1) then
         write(nout,105)
         write(nout,50)'WARNING: The Block YU has not been given. It is 
     .needed in SDECAY however.'
      endif

      if(check(20).ne.1) then
         write(nout,105)
         write(nout,50)'WARNING: The Block YD has not been given. It is 
     .needed in SDECAY however.'
      endif

      if(check(21).ne.1) then
         write(nout,105)
         write(nout,50)'WARNING: The Block YE has not been given. It is 
     .needed in SDECAY however.'
      endif

      if(hmixval(3).eq.unlikely) then
         write(nout,105)
         write(nout,50)'WARNING: The DRbar value for the VEV at the scal
     .e Q has not been given.'
         write(nout,50)'Instead v=246 GeV has been chosen.'
         write(nout,50)'However, the QCD corrections to the decays canno
     .t be calculated consistently'
         write(nout,50)'in this case.'
      endif

      if(warning(1).eq.1.D0) then
         write(nout,105)
         write(nout,50)'WARNING: No scale Q has been given.'
      endif

      if(warning(2).eq.1.D0) then
         write(nout,105)
         write(nout,50)'WARNING: For the gauge couplings g1 and g2 the 
     .DRbar values at the scale Q are not given.'
         write(nout,50)'They are calculated instead from alpha_ew_MSbar 
     .at M_Z.'
         write(nout,50)'The decay widths and the QCD corrections cannot
     .be calculated consistently.'
      endif

      if(warning(3).eq.1.D0) then
         write(nout,105)
         write(nout,50)'WARNING: No DRbar value for tanbeta has been giv
     .en at the scale Q.'
         write(nout,50)'tanbeta at the scale M_input is taken instead.'
      endif

      if(warning(4).eq.1.D0) then
         write(nout,105)
         write(nout,50)'WARNING: No DRbar value for tanbeta has been giv
     .en at the scale Q.'
         write(nout,50)'tanbeta at the scale M_Z is taken instead.'
      endif

      if(warning(5).eq.1.D0) then
         write(nout,105)
         write(nout,50)'WARNING: No value for tanbeta has been given.'
         write(nout,50)'It is needed in SDECAY however.'
      endif

c ----------------------------------- c
c Information about the decay program c
c ----------------------------------- c

      write(nout,105)
      write(nout,51) 'DCINFO','Decay Program information'
      write(nout,61) 1,'SDECAY      # decay calculator'
      write(nout,61) 2,'1.3         # version number'

c ----------------------------------------------------------------- c
c The program information: Which spectrum calculator has been used. c
c ----------------------------------------------------------------- c

      write(nout,105)
      write(nout,51) 'SPINFO','Spectrum calculator information'
      write(nout,61) 1,spinfo1(1:50)
      write(nout,61) 2,spinfo2(1:50)

c ------------------------------------------------ c
c Information on the model which has been selected c
c ------------------------------------------------ c

      write(nout,105)
      write(nout,51) 'MODSEL','Model selection'
      write(nout,62) imod(1),imod(2),modselval(1:50)

c ----------------------- c
c The SM input parameters c
c ----------------------- c

      if(check(2).eq.1) then
      write(nout,105)
      write(nout,51) 'SMINPUTS','Standard Model inputs'
      write(nout,52) 1,1.D0/salpha_MS,'alpha_em^-1(M_Z)^MSbar'
      write(nout,52) 2,sdgf,'G_F [GeV^-2]'
      write(nout,52) 3,alphasmzms,'alpha_S(M_Z)^MSbar'
      write(nout,52) 4,amzp,'M_Z pole mass'
      if(smval(5).ne.0.D0) then
         write(nout,52) 5,mbmsbar,'mb(mb)^MSbar'
      endif
      write(nout,52) 6,samt,'mt pole mass'
      write(nout,52) 7,samtau,'mtau pole mass'
      endif

c ------------------------------------------------ c
c Input parameters for minimal/default SUSY models c
c ------------------------------------------------ c

      if(check(3).eq.1) then
         write(nout,105)
         write(nout,51) 'MINPAR','Input parameters - minimal models'
         unlikely = -123456789D0
         do ii=1,20,1
            if(minval(ii).ne.unlikely) then
               write(nout,52) ii,minval(ii),mincom(ii)
            endif
         end do
      endif

c ------------------------------------------------------------------- c
c Optional input parameters for non-minimal/non-universal SUSY models c
c ------------------------------------------------------------------- c

      if(check(4).eq.1) then
         write(nout,105)
         write(nout,51) 'EXTPAR','Input parameters - non-minimal models'
         unlikely = -123456789D0
         do ii=1,100,1
            if(extval(ii-1).ne.unlikely) then
               write(nout,52) ii-1,extval(ii-1),extcom(ii-1)
            endif
         end do
      endif

c ----------------- c
c The mass spectrum c
c ----------------- c

      if(check(5).eq.1) then
      write(nout,105)
      write(nout,51) 'MASS','Mass Spectrum'
      write(nout,50) 'PDG code           mass       particle'
      write(nout,52) iwc,amwp,'W+'
      write(nout,52) ihl,aml,'h'
      write(nout,52) ihh,amh,'H'
      write(nout,52) iha,ama,'A'
      write(nout,52) ihc,amch,'H+'
      write(nout,52) ib,samb,'b-quark pole mass calculated from mb(mb)_M
     .sbar'
      write(nout,52) isdl,asdown1,'~d_L'
      write(nout,52) isdr,asdown2,'~d_R'
      write(nout,52) isul,asup1,'~u_L'
      write(nout,52) isur,asup2,'~u_R'
      write(nout,52) issl,asdown1,'~s_L'
      write(nout,52) issr,asdown2,'~s_R'
      write(nout,52) iscl,asup1,'~c_L'
      write(nout,52) iscr,asup2,'~c_R'
      write(nout,52) isb1,asb1,'~b_1'
      write(nout,52) isb2,asb2,'~b_2'
      write(nout,52) ist1,ast1,'~t_1'
      write(nout,52) ist2,ast2,'~t_2'
      write(nout,52) isell,ase1,'~e_L'
      write(nout,52) iselr,ase2,'~e_R'
      write(nout,52) inel,asne1,'~nu_eL'
      write(nout,52) ismul,ase1,'~mu_L'
      write(nout,52) ismur,ase2,'~mu_R'
      write(nout,52) inmul,asne1,'~nu_muL'
      write(nout,52) istau1,astau1,'~tau_1'
      write(nout,52) istau2,astau2,'~tau_2'
      write(nout,52) intau1,asntau1,'~nu_tauL'
      write(nout,52) iglo,mgluino,'~g'
      write(nout,52) in1,xmneut(1),'~chi_10'
      write(nout,52) in2,xmneut(2),'~chi_20'
      write(nout,52) in3,xmneut(3),'~chi_30'
      write(nout,52) in4,xmneut(4),'~chi_40'
      write(nout,52) ic1,amchar(1),'~chi_1+'
      write(nout,52) ic2,amchar(2),'~chi_2+'
      if(mgravitino.ne.unlikely) then
         write(nout,52) igrav,mgravitino,'~gravitino'
      endif
      endif

c ------------------------------------------------------------------- c
c The neutralino mixing matrix N and the chargino mixing matrices U,V c
c ------------------------------------------------------------------- c
      
      if(check(6).eq.1) then
      write(nout,105)
      write(nout,51) 'NMIX','Neutralino Mixing Matrix'
      write(nout,53) 1,1,zz(1,1),'N_11'
      write(nout,53) 1,2,zz(1,2),'N_12'
      write(nout,53) 1,3,zz(1,3),'N_13'
      write(nout,53) 1,4,zz(1,4),'N_14'
      write(nout,53) 2,1,zz(2,1),'N_21'
      write(nout,53) 2,2,zz(2,2),'N_22'
      write(nout,53) 2,3,zz(2,3),'N_23'
      write(nout,53) 2,4,zz(2,4),'N_24'
      write(nout,53) 3,1,zz(3,1),'N_31'
      write(nout,53) 3,2,zz(3,2),'N_32'
      write(nout,53) 3,3,zz(3,3),'N_33'
      write(nout,53) 3,4,zz(3,4),'N_34'
      write(nout,53) 4,1,zz(4,1),'N_41'
      write(nout,53) 4,2,zz(4,2),'N_42'
      write(nout,53) 4,3,zz(4,3),'N_43'
      write(nout,53) 4,4,zz(4,4),'N_44'
      endif

      if(check(7).eq.1) then
      write(nout,105)
      write(nout,51) 'UMIX','Chargino Mixing Matrix U'
      write(nout,53) 1,1,uu(1,1),'U_11'
      write(nout,53) 1,2,uu(1,2),'U_12'
      write(nout,53) 2,1,uu(2,1),'U_21'
      write(nout,53) 2,2,uu(2,2),'U_22'
      endif

      if(check(8).eq.1) then
      write(nout,105)
      write(nout,51) 'VMIX','Chargino Mixing Matrix V'
      write(nout,53) 1,1,vv(1,1),'V_11'
      write(nout,53) 1,2,vv(1,2),'V_12'
      write(nout,53) 2,1,vv(2,1),'V_21'
      write(nout,53) 2,2,vv(2,2),'V_22'
      endif

c ------------------------------------------ c
c The stop, sbottom and stau mixing matrices c
c ------------------------------------------ c

      if(check(9).eq.1) then
      write(nout,105)
      write(nout,51) 'STOPMIX','Stop Mixing Matrix'
      write(nout,53) 1,1,dcos(sdthet),'cos(theta_t)'
      write(nout,53) 1,2,dsin(sdthet),'sin(theta_t)'
      write(nout,53) 2,1,-dsin(sdthet),'-sin(theta_t)'
      write(nout,53) 2,2,dcos(sdthet),'cos(theta_t)'
      endif

      if(check(10).eq.1) then
      write(nout,105)
      write(nout,51) 'SBOTMIX','Sbottom Mixing Matrix'
      write(nout,53) 1,1,dcos(sdtheb),'cos(theta_b)'
      write(nout,53) 1,2,dsin(sdtheb),'sin(theta_b)'
      write(nout,53) 2,1,-dsin(sdtheb),'-sin(theta_b)'
      write(nout,53) 2,2,dcos(sdtheb),'cos(theta_b)'
      endif

      if(check(11).eq.1) then
      write(nout,105)
      write(nout,51) 'STAUMIX','Stau Mixing Matrix'
      write(nout,53) 1,1,dcos(sdthel),'cos(theta_tau)'
      write(nout,53) 1,2,dsin(sdthel),'sin(theta_tau)'
      write(nout,53) 2,1,-dsin(sdthel),'-sin(theta_tau)'
      write(nout,53) 2,2,dcos(sdthel),'cos(theta_tau)'
      endif

c ------------------------------------------------------------------- c
c The angle alpha in the Higgs sector and the Higgs mixing parameters c
c ------------------------------------------------------------------- c

      if(check(12).eq.1) then
      write(nout,105)
      write(nout,51) 'ALPHA','Higgs mixing'
      write(nout,60) alp_mssm,'Mixing angle in the neutral Higgs boson s
     .ector'
      endif

      if(check(13).eq.1) then
         write(nout,105)
         write(nout,54) 'HMIX Q=',scaleofewsb,'DRbar Higgs Parameters'
         unlikely = -123456789D0
         do i=1,10,1
            if(hmixval(i).ne.unlikely) then
               write(nout,52) i,hmixval(i),hmixcom(i)
            endif
         end do
      endif

c ------------------- c
c The gauge couplings c
c ------------------- c

      write(nout,105)      
      write(nout,54) 'GAUGE Q=',scaleofewsb,'The gauge couplings'
      if(gaugeval(1).ne.0.D0) then
         write(nout,55) 1,g1ew,'gprime(Q) DRbar'
      endif
      if(gaugeval(2).ne.0.D0) then
         write(nout,55) 2,g2ew,'g(Q) DRbar'
      endif
      if(scalechoice.eq.1.D0) then
            write(nout,55) 3,dsqrt(4.D0*pi*alsew),'g3(Q) DRbar'
      elseif(scalechoice.eq.2.D0) then
         if(idrbar.eq.1) then
            write(nout,56) 3,'g3(Q) DRbar depends on the scale Q = mass 
     .of the decaying particle'
         elseif(idrbar.eq.0) then
            write(nout,56) 3,'g3(Q) MSbar depends on the scale Q = mass 
     .of the decaying particle'
         endif
      elseif(scalechoice.eq.3.D0) then
         tmpals = SD_alphascall(scaleofcoupling,inumloop)
         if(idrbar.eq.1) then 
            write(nout,57) 3,dsqrt(4.D0*pi*tmpals),
     .           'g3(Q) DRbar, Q=',scaleofcoupling
         elseif(idrbar.eq.0) then
            write(nout,57) 3,dsqrt(4.D0*pi*tmpals),
     .           'g3(Q) MSbar, Q=',scaleofcoupling
         endif
      endif

c ------------------------------------- c
c The trilinear couplings Au, Ad and Ae c
c ------------------------------------- c

      if(check(16).eq.1) then
      write(nout,105)
      write(nout,54) 'AU Q=',scaleofewsb,'The trilinear couplings'
      write(nout,53) 1,1,auval(1,1),'A_u(Q) DRbar'
      write(nout,53) 2,2,auval(2,2),'A_c(Q) DRbar'
      write(nout,53) 3,3,auval(3,3),'A_t(Q) DRbar'
      endif

      if(check(17).eq.1) then
      write(nout,105)
      write(nout,54) 'AD Q=',scaleofewsb,'The trilinear couplings'
      write(nout,53) 1,1,adval(1,1),'A_d(Q) DRbar'
      write(nout,53) 2,2,adval(2,2),'A_s(Q) DRbar'
      write(nout,53) 3,3,adval(3,3),'A_b(Q) DRbar'
      endif

      if(check(18).eq.1) then
      write(nout,105)
      write(nout,54) 'AE Q=',scaleofewsb,'The trilinear couplings'
      write(nout,53) 1,1,aeval(1,1),'A_e(Q) DRbar'
      write(nout,53) 2,2,aeval(2,2),'A_mu(Q) DRbar'
      write(nout,53) 3,3,aeval(3,3),'A_tau(Q) DRbar'
      endif

c ---------------------------------- c
c The Yukawa couplings Yu, Yd and Ye c
c ---------------------------------- c

      if(check(19).eq.1) then
      write(nout,105)
      write(nout,54) 'Yu Q=',scaleofewsb,'The Yukawa couplings'
      if(scalechoice.eq.1.D0) then
         write(nout,53) 1,1,yuval(1,1),'y_u(Q) DRbar'
         write(nout,53) 2,2,yuval(2,2),'y_c(Q) DRbar'
         write(nout,53) 3,3,yt,'y_t(Q) DRbar'
      elseif(scalechoice.eq.2.D0) then         
         if(idrbar.eq.1) then
            write(nout,58) 3,3,'y_t DRbar depends on the scale Q = mass 
     .of the decaying particle'
         elseif(idrbar.eq.0) then
            write(nout,58) 3,3,'y_t MSbar depends on the scale Q = mass 
     .of the decaying particle'
         endif
      elseif(scalechoice.eq.3.D0) then
         call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
         if(idrbar.eq.1) then
            write(nout,59) 3,3,SD_yuk(1,runmt),'y_t(Q) DRbar/g^2, Q=',
     .                  scaleofcoupling
         elseif(idrbar.eq.0) then
            write(nout,59) 3,3,SD_yuk(1,runmt),'y_t(Q) MSbar/g^2, Q=',
     .                  scaleofcoupling
         endif
      endif 
      endif

      if(check(20).eq.1) then
      write(nout,105)
      write(nout,54) 'Yd Q=',scaleofewsb,'The Yukawa couplings'
      if(scalechoice.eq.1.D0) then
         write(nout,53) 1,1,ydval(1,1),'y_d(Q) DRbar'
         write(nout,53) 2,2,ydval(2,2),'y_s(Q) DRbar'
         write(nout,53) 3,3,yb,'y_b(Q) DRbar'
      elseif(scalechoice.eq.2.D0) then         
         if(idrbar.eq.1) then
            write(nout,58) 3,3,'y_b DRbar depends on the scale Q = mass 
     .of the decaying particle'
         elseif(idrbar.eq.0) then
            write(nout,58) 3,3,'y_b MSbar depends on the scale Q = mass 
     .of the decaying particle'
         endif
      elseif(scalechoice.eq.3.D0) then
         call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
         if(idrbar.eq.1) then
            write(nout,59) 3,3,SD_yuk(2,runmb),'y_b(Q) DRbar/g^2, Q=',
     .                  scaleofcoupling
         elseif(idrbar.eq.0) then
            write(nout,59) 3,3,SD_yuk(2,runmb),'y_b(Q) MSbar/g^2, Q=',
     .                  scaleofcoupling
         endif
      endif 
      endif

      if(check(21).eq.1) then
      write(nout,105)
      write(nout,54) 'Ye Q=',scaleofewsb,'The Yukawa couplings'
      if(scalechoice.eq.1.D0) then
         write(nout,53) 1,1,yeval(1,1),'y_e(Q) DRbar'
         write(nout,53) 2,2,yeval(2,2),'y_mu(Q) DRbar'
         write(nout,53) 3,3,ytau,'y_tau(Q) DRbar'
      elseif(scalechoice.eq.2.D0) then         
         write(nout,53) 3,3,ytau,'y_tau(Q) DRbar'
      elseif(scalechoice.eq.3.D0) then
         write(nout,53) 3,3,ytau,'y_tau(Q) DRbar'
      endif 
      endif

c ----------------------------- c
c The soft SUSY breaking masses c
c ----------------------------- c

      if(check(15).eq.1) then
         write(nout,105)
         write(nout,54) 'MSOFT Q=',scaleofewsb,'The soft SUSY breaking m
     .asses at the scale Q'
         unlikely = -123456789D0
         do ii=1,99,1
            if(m_softval(ii).ne.unlikely) then
               if(ii.ne.11.and.ii.ne.12.and.ii.ne.13.and.ii.ne.23.and.
     .            ii.ne.24.and.ii.ne.25.and.ii.ne.26) then
                  write(nout,52) ii,m_softval(ii),m_softcom(ii)
               endif
            endif
         end do
      endif

c --------------- c
c The decay table c
c --------------- c

      write(nout,105)
      write(nout,105)
      write(nout,105)

      write(nout,50) '                            ================='
      write(nout,50) '                            |The decay table|'
      write(nout,50) '                            ================='

      if(flagqcd.eq.1.D0) then
        write(nout,105)
        write(nout,50) '- The QCD corrections to the decays gluino -> sq
     .uark  + quark'
        write(nout,50) '                                    squark -> ga
     .ugino + quark_prime'
        write(nout,50) '                                    squark -> sq
     .uark_prime + Higgs'
        write(nout,50) '                                    squark -> gl
     .uino  + quark'
        write(nout,50) '  are included.'
      endif

      if(flagmulti.eq.1.D0) then
         write(nout,105)
         write(nout,50) '- The multi-body decays for the inos, stops and
     . sbottoms are included.'
      endif

      if(flagloop.eq.1.D0) then
         write(nout,105)
         write(nout,50) '- The loop induced decays for the gluino, neutr
     .alinos and stops'
         write(nout,50) '  are included.'
      endif

      if(flagsusytop.eq.1.D0) then
         write(nout,105)
         write(nout,50) '- The SUSY decays of the top quark are included
     ..'
      endif

      if(flagnlspgmsb.eq.1.D0) then
         write(nout,105)
         write(nout,50) '- Possible decays of the NLSP in GMSB models ar
     .e included.'
      endif

      write(nout,105)
      write(nout,105)

c ---------- c
c Top decays c
c ---------- c

      if(flagsusytop.eq.1.D0) then
      if(toptot2.ne.0.D0) then
      write(nout,99)
      write(nout,100) it,toptot2,'top decays'
      write(nout,101)
      if(brtopbw.ne.0.D0) then
      write(nout,102) brtopbw,2,ib,iwc,              'BR(t ->  b    W+)'
      endif
      if(brtopbh.ne.0.D0) then
      write(nout,102) brtopbh,2,ib,ihc,              'BR(t ->  b    H+)'
      endif
      if(brtopneutrstop(1,1).ne.0.D0) then
      write(nout,102) brtopneutrstop(1,1),2,ist1,in1,'BR(t -> ~t_1 ~chi_
     .10)'
      endif
      if(brtopneutrstop(2,1).ne.0.D0) then
      write(nout,102) brtopneutrstop(2,1),2,ist1,in2,'BR(t -> ~t_1 ~chi_
     .20)'
      endif
      if(brtopneutrstop(3,1).ne.0.D0) then
      write(nout,102) brtopneutrstop(3,1),2,ist1,in3,'BR(t -> ~t_1 ~chi_
     .30)'
      endif
      if(brtopneutrstop(4,1).ne.0.D0) then
      write(nout,102) brtopneutrstop(4,1),2,ist1,in4,'BR(t -> ~t_1 ~chi_
     .40)'
      endif
      if(brtopneutrstop(1,2).ne.0.D0) then
      write(nout,102) brtopneutrstop(1,2),2,ist2,in1,'BR(t -> ~t_2 ~chi_
     .10)'
      endif
      if(brtopneutrstop(2,2).ne.0.D0) then
      write(nout,102) brtopneutrstop(2,2),2,ist2,in2,'BR(t -> ~t_2 ~chi_
     .20)'
      endif
      if(brtopneutrstop(3,2).ne.0.D0) then
      write(nout,102) brtopneutrstop(3,2),2,ist2,in3,'BR(t -> ~t_2 ~chi_
     .30)'
      endif
      if(brtopneutrstop(4,2).ne.0.D0) then
      write(nout,102) brtopneutrstop(4,2),2,ist2,in4,'BR(t -> ~t_2 ~chi_
     .40)'
      endif
      else
         write(nout,99)
         write(nout,100) it,0.000000000E+00,'top decays' 
      endif
      endif

c ------------- c
c Gluino decays c
c ------------- c

      flagmultiloop = flagmulti+flagloop

      if(gluitot2.eq.0.D0) then
         flaggluitot2 = 10.D0
      elseif(gluitot2.ne.0.D0) then
         flaggluitot2 = 40.D0
      endif
      flagcondglui = flaggluitot2+flagmultiloop

      write(nout,105)

      if(flagcondglui.eq.10.D0) then
         write(nout,99)
         write(nout,100) iglo,0.000000000E+00,'gluino decays'
      elseif(flagcondglui.eq.40.D0.or.flagcondglui.eq.41.D0.or.
     .flagcondglui.eq.42) then
         write(nout,99)
         write(nout,100) iglo,gluitot2,'gluino decays'
      write(nout,101)
      if(brgsdownl.ne.0.D0) then
      write(nout,102) brgsdownl,2,isdl,idb,'BR(~g -> ~d_L  db)'
      write(nout,102) brgsdownl,2,-isdl,id,'BR(~g -> ~d_L* d )'
      endif
      if(brgsdownr.ne.0.D0) then
      write(nout,102) brgsdownr,2,isdr,idb,'BR(~g -> ~d_R  db)'
      write(nout,102) brgsdownr,2,-isdr,id,'BR(~g -> ~d_R* d )'
      endif
      if(brgsupl.ne.0.D0) then
      write(nout,102) brgsupl,2,isul,iub  ,'BR(~g -> ~u_L  ub)'
      write(nout,102) brgsupl,2,-isul,iu  ,'BR(~g -> ~u_L* u )'
      endif
      if(brgsupr.ne.0.D0) then
      write(nout,102) brgsupr,2,isur,iub  ,'BR(~g -> ~u_R  ub)'
      write(nout,102) brgsupr,2,-isur,iu  ,'BR(~g -> ~u_R* u )'
      endif
      if(brgsdownl.ne.0.D0) then
      write(nout,102) brgsdownl,2,issl,isb,'BR(~g -> ~s_L  sb)'
      write(nout,102) brgsdownl,2,-issl,is,'BR(~g -> ~s_L* s )'
      endif
      if(brgsdownr.ne.0.D0) then
      write(nout,102) brgsdownr,2,issr,isb,'BR(~g -> ~s_R  sb)'
      write(nout,102) brgsdownr,2,-issr,is,'BR(~g -> ~s_R* s )'
      endif
      if(brgsupl.ne.0.D0) then
      write(nout,102) brgsupl,2,iscl,icb  ,'BR(~g -> ~c_L  cb)'
      write(nout,102) brgsupl,2,-iscl,ic  ,'BR(~g -> ~c_L* c )'
      endif
      if(brgsupr.ne.0.D0) then
      write(nout,102) brgsupr,2,iscr,icb  ,'BR(~g -> ~c_R  cb)'
      write(nout,102) brgsupr,2,-iscr,ic  ,'BR(~g -> ~c_R* c )'
      endif
      if(brgsb1.ne.0.D0) then
      write(nout,102) brgsb1,2,isb1,ibb   ,'BR(~g -> ~b_1  bb)'
      write(nout,102) brgsb1,2,-isb1,ib   ,'BR(~g -> ~b_1* b )'
      endif
      if(brgsb2.ne.0.D0) then
      write(nout,102) brgsb2,2,isb2,ibb   ,'BR(~g -> ~b_2  bb)'
      write(nout,102) brgsb2,2,-isb2,ib   ,'BR(~g -> ~b_2* b )'
      endif
      if(brgst1.ne.0.D0) then
      write(nout,102) brgst1,2,ist1,itb   ,'BR(~g -> ~t_1  tb)'
      write(nout,102) brgst1,2,-ist1,it   ,'BR(~g -> ~t_1* t )'
      endif
      if(brgst2.ne.0.D0) then
      write(nout,102) brgst2,2,ist2,itb   ,'BR(~g -> ~t_2  tb)'
      write(nout,102) brgst2,2,-ist2,it   ,'BR(~g -> ~t_2* t )'
      endif
      if(flagnlspgmsb.eq.1.D0.and.brggravgl.ne.0.D0) then
      write(nout,102) brggravgl,2,igrav,igl,'BR(~g -> ~G g)'
      endif

      elseif(flagcondglui.eq.11.D0.or.flagcondglui.eq.12.D0) then
         if(gluitot.ne.0.D0) then
            write(nout,99)
            write(nout,100) iglo,gluitot,'gluino decays'
            if(flagloop.eq.1.D0) then
      write(nout,101)
      if(brglnjgluon(1).ne.0.D0) then
      write(nout,102) brglnjgluon(1),2,in1,igl,'BR(~g -> ~chi_10 g)'
      endif
      if(brglnjgluon(2).ne.0.D0) then
      write(nout,102) brglnjgluon(2),2,in2,igl,'BR(~g -> ~chi_20 g)'
      endif
      if(brglnjgluon(3).ne.0.D0) then
      write(nout,102) brglnjgluon(3),2,in3,igl,'BR(~g -> ~chi_30 g)'
      endif
      if(brglnjgluon(4).ne.0.D0) then
      write(nout,102) brglnjgluon(4),2,in4,igl,'BR(~g -> ~chi_40 g)'
      endif
            endif
c
      if(flagnlspgmsb.eq.1.D0.and.brggravgl.ne.0.D0) then
      write(nout,101)
      write(nout,102) brggravgl,2,igrav,igl,'BR(~g -> ~G      g)'
      endif
c
            if(flagmulti.eq.1.D0) then
      if(flagglui3bod.eq.1.D0) then
         write(nout,103)
      endif
      if(brgodn(1).ne.0.D0) then
      write(nout,104) brgodn(1),3,in1,id,idb  ,'BR(~g -> ~chi_10 d  db)'
      endif
      if(brgodn(2).ne.0.D0) then
      write(nout,104) brgodn(2),3,in2,id,idb  ,'BR(~g -> ~chi_20 d  db)'
      endif
      if(brgodn(3).ne.0.D0) then
      write(nout,104) brgodn(3),3,in3,id,idb  ,'BR(~g -> ~chi_30 d  db)'
      endif
      if(brgodn(4).ne.0.D0) then
      write(nout,104) brgodn(4),3,in4,id,idb  ,'BR(~g -> ~chi_40 d  db)'
      endif
      if(brgoup(1).ne.0.D0) then
      write(nout,104) brgoup(1),3,in1,iu,iub  ,'BR(~g -> ~chi_10 u  ub)'
      endif
      if(brgoup(2).ne.0.D0) then
      write(nout,104) brgoup(2),3,in2,iu,iub  ,'BR(~g -> ~chi_20 u  ub)'
      endif
      if(brgoup(3).ne.0.D0) then
      write(nout,104) brgoup(3),3,in3,iu,iub  ,'BR(~g -> ~chi_30 u  ub)'
      endif
      if(brgoup(4).ne.0.D0) then
      write(nout,104) brgoup(4),3,in4,iu,iub  ,'BR(~g -> ~chi_40 u  ub)'
      endif
      if(brgodn(1).ne.0.D0) then
      write(nout,104) brgodn(1),3,in1,is,isb  ,'BR(~g -> ~chi_10 s  sb)'
      endif
      if(brgodn(2).ne.0.D0) then
      write(nout,104) brgodn(2),3,in2,is,isb  ,'BR(~g -> ~chi_20 s  sb)'
      endif
      if(brgodn(3).ne.0.D0) then
      write(nout,104) brgodn(3),3,in3,is,isb  ,'BR(~g -> ~chi_30 s  sb)'
      endif
      if(brgodn(4).ne.0.D0) then
      write(nout,104) brgodn(4),3,in4,is,isb  ,'BR(~g -> ~chi_40 s  sb)'
      endif
      if(brgoup(1).ne.0.D0) then
      write(nout,104) brgoup(1),3,in1,ic,icb  ,'BR(~g -> ~chi_10 c  cb)'
      endif
      if(brgoup(2).ne.0.D0) then
      write(nout,104) brgoup(2),3,in2,ic,icb  ,'BR(~g -> ~chi_20 c  cb)'
      endif
      if(brgoup(3).ne.0.D0) then
      write(nout,104) brgoup(3),3,in3,ic,icb  ,'BR(~g -> ~chi_30 c  cb)'
      endif
      if(brgoup(4).ne.0.D0) then
      write(nout,104) brgoup(4),3,in4,ic,icb  ,'BR(~g -> ~chi_40 c  cb)'
      endif
      if(brgobt(1).ne.0.D0) then
      write(nout,104) brgobt(1),3,in1,ib,ibb  ,'BR(~g -> ~chi_10 b  bb)'
      endif
      if(brgobt(2).ne.0.D0) then
      write(nout,104) brgobt(2),3,in2,ib,ibb  ,'BR(~g -> ~chi_20 b  bb)'
      endif
      if(brgobt(3).ne.0.D0) then
      write(nout,104) brgobt(3),3,in3,ib,ibb  ,'BR(~g -> ~chi_30 b  bb)'
      endif
      if(brgobt(4).ne.0.D0) then
      write(nout,104) brgobt(4),3,in4,ib,ibb  ,'BR(~g -> ~chi_40 b  bb)'
      endif
      if(brgotp(1).ne.0.D0) then
      write(nout,104) brgotp(1),3,in1,it,itb  ,'BR(~g -> ~chi_10 t  tb)'
      endif
      if(brgotp(2).ne.0.D0) then
      write(nout,104) brgotp(2),3,in2,it,itb  ,'BR(~g -> ~chi_20 t  tb)'
      endif
      if(brgotp(3).ne.0.D0) then
      write(nout,104) brgotp(3),3,in3,it,itb  ,'BR(~g -> ~chi_30 t  tb)'
      endif
      if(brgotp(4).ne.0.D0) then
      write(nout,104) brgotp(4),3,in4,it,itb  ,'BR(~g -> ~chi_40 t  tb)'
      endif
      if(brgoud(1).ne.0.D0) then
      write(nout,104) brgoud(1),3,ic1,id,iub  ,'BR(~g -> ~chi_1+ d  ub)'
      write(nout,104) brgoud(1),3,-ic1,iu,idb ,'BR(~g -> ~chi_1- u  db)'
      endif
      if(brgoud(2).ne.0.D0) then
      write(nout,104) brgoud(2),3,ic2,id,iub  ,'BR(~g -> ~chi_2+ d  ub)'
      write(nout,104) brgoud(2),3,-ic2,iu,idb ,'BR(~g -> ~chi_2- u  db)'
      endif
      if(brgoud(1).ne.0.D0) then
      write(nout,104) brgoud(1),3,ic1,is,icb  ,'BR(~g -> ~chi_1+ s  cb)'
      write(nout,104) brgoud(1),3,-ic1,ic,isb ,'BR(~g -> ~chi_1- c  sb)'
      endif
      if(brgoud(2).ne.0.D0) then
      write(nout,104) brgoud(2),3,ic2,is,icb  ,'BR(~g -> ~chi_2+ s  cb)'
      write(nout,104) brgoud(2),3,-ic2,ic,isb ,'BR(~g -> ~chi_2- c  sb)'
      endif
      if(brgotb(1).ne.0.D0) then
      write(nout,104) brgotb(1),3,ic1,ib,itb  ,'BR(~g -> ~chi_1+ b  tb)'
      write(nout,104) brgotb(1),3,-ic1,it,ibb ,'BR(~g -> ~chi_1- t  bb)'
      endif
      if(brgotb(2).ne.0.D0) then
      write(nout,104) brgotb(2),3,ic2,ib,itb  ,'BR(~g -> ~chi_2+ b  tb)'
      write(nout,104) brgotb(2),3,-ic2,it,ibb ,'BR(~g -> ~chi_2- t  bb)'
      endif
      if(brwst1b.ne.0.D0) then
      write(nout,104) brwst1b,3,ist1,ibb,-iwc ,'BR(~g -> ~t_1    bb W-)'
      write(nout,104) brwst1b,3,-ist1,ib,iwc  ,'BR(~g -> ~t_1*   b  W+)'
      endif
      if(brhcst1b.ne.0.D0) then
      write(nout,104) brhcst1b,3,ist1,ibb,-ihc,'BR(~g -> ~t_1    bb H-)'
      write(nout,104) brhcst1b,3,-ist1,ib,ihc ,'BR(~g -> ~t_1*   b  H+)'
      endif
      endif
      elseif(gluitot.eq.0.D0) then
         write(nout,99)
         write(nout,100) iglo,0.000000000E+00,'gluino decays'
      endif
      endif

c ------------ c
c Stop1 decays c
c ------------ c

      flagmultiloop = flagmulti+flagloop
      do i=1,2,1
         if(stoptot2(i).eq.0.D0) then
            flagstoptot2(i) = 10.D0
         elseif(stoptot2(i).ne.0.D0) then
            flagstoptot2(i) = 40.D0
         endif
      end do

      flagcondstop(1) = flagstoptot2(1)+flagmultiloop
      flagcondstop(2) = flagstoptot2(2)+flagmulti

      write(nout,105)

      if(flagcondstop(1).eq.10.D0) then
         write(nout,99)
         write(nout,100) 1000006,0.000000000E+00,'stop1 decays'
      elseif(flagcondstop(1).eq.40.D0.or.flagcondstop(1).eq.41.D0.or.
     .flagcondstop(1).eq.42.D0) then
      write(nout,99)
      write(nout,100) 1000006,stoptot2(1),'stop1 decays'

      write(nout,101)
      if(brst1neutt(1).ne.0.D0) then
      write(nout,102) brst1neutt(1),2,in1,it  ,'BR(~t_1 -> ~chi_10 t )'
      endif
      if(brst1neutt(2).ne.0.D0) then
      write(nout,102) brst1neutt(2),2,in2,it  ,'BR(~t_1 -> ~chi_20 t )'
      endif
      if(brst1neutt(3).ne.0.D0) then
      write(nout,102) brst1neutt(3),2,in3,it  ,'BR(~t_1 -> ~chi_30 t )'
      endif
      if(brst1neutt(4).ne.0.D0) then
      write(nout,102) brst1neutt(4),2,in4,it  ,'BR(~t_1 -> ~chi_40 t )'
      endif
      if(brst1charb(1).ne.0.D0) then
      write(nout,102) brst1charb(1),2,ic1,ib  ,'BR(~t_1 -> ~chi_1+ b )'
      endif
      if(brst1charb(2).ne.0.D0) then
      write(nout,102) brst1charb(2),2,ic2,ib  ,'BR(~t_1 -> ~chi_2+ b )'
      endif
      if(brst1glui.ne.0.D0) then
      write(nout,102) brst1glui    ,2,iglo,it ,'BR(~t_1 -> ~g      t )'
      endif
      if(brst1hcsb(1).ne.0.D0) then
      write(nout,102) brst1hcsb(1) ,2,isb1,ihc,'BR(~t_1 -> ~b_1    H+)'
      endif
      if(brst1hcsb(2).ne.0.D0) then
      write(nout,102) brst1hcsb(2) ,2,isb2,ihc,'BR(~t_1 -> ~b_2    H+)'
      endif
      if(brst1wsb(1).ne.0.D0) then
      write(nout,102) brst1wsb(1)  ,2,isb1,iwc,'BR(~t_1 -> ~b_1    W+)'
      endif
      if(brst1wsb(2).ne.0.D0) then
      write(nout,102) brst1wsb(2)  ,2,isb2,iwc,'BR(~t_1 -> ~b_2    W+)'
      endif

      elseif(flagcondstop(1).eq.11.D0.or.flagcondstop(1).eq.12.D0) then
         if(stoptot(1).ne.0.D0) then
            write(nout,99)
            write(nout,100) 1000006,stoptot(1),'stop1 decays'
            if(flagloop.eq.1.D0) then
      write(nout,101)
      if(brgamma.ne.0.D0) then
      write(nout,102) brgamma      ,2,in1,ic  ,'BR(~t_1 -> ~chi_10 c )'
      endif
      if(brgammaup.ne.0.D0) then
      write(nout,102) brgammaup    ,2,in1,iu  ,'BR(~t_1 -> ~chi_10 u )'
      endif
      if(brgammagluino.ne.0.D0) then
      write(nout,102) brgammagluino,2,iglo,ic ,'BR(~t_1 -> ~g      c )'
      endif
            endif
            if(flagmulti.eq.1.D0) then
               if(stoptotmulti(1).ne.0.D0) then
      write(nout,103)
      if(brstopw(1,1).ne.0.D0) then
      write(nout,104) brstopw(1,1),3,in1,ib,iwc,       'BR(~t_1 -> ~chi_
     .10  b  W+)'
      endif
      if(brstopw(1,2).ne.0.D0) then
      write(nout,104) brstopw(1,2),3,in2,ib,iwc,       'BR(~t_1 -> ~chi_
     .20  b  W+)'
      endif
      if(brstopw(1,3).ne.0.D0) then
      write(nout,104) brstopw(1,3),3,in3,ib,iwc,       'BR(~t_1 -> ~chi_
     .30  b  W+)'
      endif
      if(brstopw(1,4).ne.0.D0) then
      write(nout,104) brstopw(1,4),3,in4,ib,iwc,       'BR(~t_1 -> ~chi_
     .40  b  W+)'
      endif
      if(brstoph(1,1).ne.0.D0) then
      write(nout,104) brstoph(1,1),3,in1,ib,ihc,       'BR(~t_1 -> ~chi_
     .10  b  H+)'
      endif
      if(brstoph(1,2).ne.0.D0) then
      write(nout,104) brstoph(1,2),3,in2,ib,ihc,       'BR(~t_1 -> ~chi_
     .20  b  H+)'
      endif
      if(brstoph(1,3).ne.0.D0) then
      write(nout,104) brstoph(1,3),3,in3,ib,ihc,       'BR(~t_1 -> ~chi_
     .30  b  H+)'
      endif
      if(brstoph(1,4).ne.0.D0) then
      write(nout,104) brstoph(1,4),3,in4,ib,ihc,       'BR(~t_1 -> ~chi_
     .40  b  H+)'
      endif
      if(brstsntau(1,1).ne.0.D0) then
      write(nout,104) brstsntau(1,1),3,intau1,ib,-itau,'BR(~t_1 -> ~nu_t
     .auL b  tau+)'
      endif
      if(brstsnel(1).ne.0.D0) then
      write(nout,104) brstsnel(1),3,inel,ib,-ie,       'BR(~t_1 -> ~nu_e
     .L   b  e+)'
      write(nout,104) brstsnel(1),3,inmul,ib,-imu,     'BR(~t_1 -> ~nu_m
     .uL  b  mu+)'
      endif
      if(brststau(1,1).ne.0.D0) then
      write(nout,104) brststau(1,1),3,-istau1,ib,intau,'BR(~t_1 -> ~tau_
     .1+  b  nu_tau)'
      endif
      if(brststau(1,2).ne.0.D0) then
      write(nout,104) brststau(1,2),3,-istau2,ib,intau,'BR(~t_1 -> ~tau_
     .2+  b  nu_tau)'
      endif
      if(brstsel(1,1).ne.0.D0) then
      write(nout,104) brstsel(1,1),3,-isell,ib,ine,    'BR(~t_1 -> ~e_L+
     .    b  nu_e)'
      endif
      if(brstsel(1,2).ne.0.D0) then
      write(nout,104) brstsel(1,2),3,-iselr,ib,ine,    'BR(~t_1 -> ~e_R+
     .    b  nu_e)'
      endif
      if(brstsel(1,1).ne.0.D0) then
      write(nout,104) brstsel(1,1),3,-ismul,ib,inmu,   'BR(~t_1 -> ~mu_L
     .+   b  nu_mu)'
      endif
      if(brstsel(1,2).ne.0.D0) then
      write(nout,104) brstsel(1,2),3,-ismur,ib,inmu,   'BR(~t_1 -> ~mu_R
     .+   b  nu_mu)'
      endif
      if(brstbsbst(1,1).ne.0.D0) then
      write(nout,104) brstbsbst(1,1),3,-isb1,ib,it,    'BR(~t_1 -> ~b_1*
     .    b  t)'
      endif
      if(brstbsbst(1,2).ne.0.D0) then
      write(nout,104) brstbsbst(1,2),3,-isb2,ib,it,    'BR(~t_1 -> ~b_2*
     .    b  t)'
      endif
      if(brstbbsbt(1,1).ne.0.D0) then
      write(nout,104) brstbbsbt(1,1),3,isb1,ibb,it,    'BR(~t_1 -> ~b_1
     .    bb t)'
      endif
      if(brstbbsbt(1,2).ne.0.D0) then
      write(nout,104) brstbbsbt(1,2),3,isb2,ibb,it,    'BR(~t_1 -> ~b_2
     .    bb t)'
      endif
      if(brstupsbdow(1,1).ne.0.D0) then
      write(nout,104) brstupsbdow(1,1),3,isb1,idb,iu,  'BR(~t_1 -> ~b_1
     .    db u)'
      endif
      if(brstupsbdow(1,2).ne.0.D0) then
      write(nout,104) brstupsbdow(1,2),3,isb2,idb,iu,  'BR(~t_1 -> ~b_2
     .    db u)'
      endif
      if(brstupsbdow(1,1).ne.0.D0) then
      write(nout,104) brstupsbdow(1,1),3,isb1,isb,ic,  'BR(~t_1 -> ~b_1
     .    sb c)'
      endif
      if(brstupsbdow(1,2).ne.0.D0) then
      write(nout,104) brstupsbdow(1,2),3,isb2,isb,ic,  'BR(~t_1 -> ~b_2
     .    sb c)'
      endif
      if(brsttausbnu(1,1).ne.0.D0) then
      write(nout,104) brsttausbnu(1,1),3,isb1,-itau,intau,'BR(~t_1 -> ~b
     ._1     tau+ nu_tau)'
      endif
      if(brsttausbnu(1,2).ne.0.D0) then
      write(nout,104) brsttausbnu(1,2),3,isb2,-itau,intau,'BR(~t_1 -> ~b
     ._2     tau+ nu_tau)'
      endif
      if(brstelsbnu(1,1).ne.0.D0) then
      write(nout,104) brstelsbnu(1,1),3,isb1,-ie,ine,  'BR(~t_1 -> ~b_1 
     .    e+   nu_e)'
      endif
      if(brstelsbnu(1,2).ne.0.D0) then
      write(nout,104) brstelsbnu(1,2),3,isb2,-ie,ine,  'BR(~t_1 -> ~b_2 
     .    e+   nu_e)'
      endif
      if(brstelsbnu(1,1).ne.0.D0) then
      write(nout,104) brstelsbnu(1,1),3,isb1,-imu,inmu,'BR(~t_1 -> ~b_1 
     .    mu+  nu_mu)'
      endif
      if(brstelsbnu(1,2).ne.0.D0) then
      write(nout,104) brstelsbnu(1,2),3,isb2,-imu,inmu,'BR(~t_1 -> ~b_2 
     .    mu+  nu_mu)'
      endif
      else
         if(stoptot4.ne.0.D0) then
            write(nout,107)
            if(br4bodoffshelltau.ne.0.D0) then
            write(nout,106) br4bodoffshelltau,4,in1,ib,if1,if2,'BR(~t_1 
     .-> chi_10 b f fbarprime)'
         endif
         endif
      endif
      endif
      elseif(stoptot(1).eq.0.D0) then
         write(nout,99)
         write(nout,100) 1000006,0.000000000E+00,'stop1 decays'
      endif
      endif

c ------------ c
c Stop2 decays c
c ------------ c

      write(nout,105)

      if(flagcondstop(2).eq.10.D0) then
         write(nout,99)
         write(nout,100) 2000006,0.000000000E+00,'stop2 decays'
      elseif(flagcondstop(2).eq.40.D0.or.flagcondstop(2).eq.41.D0) then
         write(nout,99)
         write(nout,100) 2000006,stoptot2(2),'stop2 decays'

      write(nout,101)
      if(brst2neutt(1).ne.0.D0) then
      write(nout,102) brst2neutt(1),2,in1,it  ,'BR(~t_2 -> ~chi_10 t )'
      endif
      if(brst2neutt(2).ne.0.D0) then
      write(nout,102) brst2neutt(2),2,in2,it  ,'BR(~t_2 -> ~chi_20 t )'
      endif
      if(brst2neutt(2).ne.0.D0) then
      write(nout,102) brst2neutt(3),2,in3,it  ,'BR(~t_2 -> ~chi_30 t )'
      endif
      if(brst2neutt(4).ne.0.D0) then
      write(nout,102) brst2neutt(4),2,in4,it  ,'BR(~t_2 -> ~chi_40 t )'
      endif
      if(brst2charb(1).ne.0.D0) then
      write(nout,102) brst2charb(1),2,ic1,ib  ,'BR(~t_2 -> ~chi_1+ b )'
      endif
      if(brst2charb(2).ne.0.D0) then
      write(nout,102) brst2charb(2),2,ic2,ib  ,'BR(~t_2 -> ~chi_2+ b )'
      endif
      if(brst2glui.ne.0.D0) then
      write(nout,102) brst2glui    ,2,iglo,it ,'BR(~t_2 -> ~g      t )'
      endif
      if(brst2hl.ne.0.D0) then
      write(nout,102) brst2hl      ,2,ist1,ihl,'BR(~t_2 -> ~t_1    h )'
      endif
      if(brst2hh.ne.0.D0) then
      write(nout,102) brst2hh      ,2,ist1,ihh,'BR(~t_2 -> ~t_1    H )'
      endif
      if(brst2ha.ne.0.D0) then
      write(nout,102) brst2ha      ,2,ist1,iha,'BR(~t_2 -> ~t_1    A )'
      endif
      if(brst2hcsb(1).ne.0.D0) then
      write(nout,102) brst2hcsb(1) ,2,isb1,ihc,'BR(~t_2 -> ~b_1    H+)'
      endif
      if(brst2hcsb(2).ne.0.D0) then
      write(nout,102) brst2hcsb(2) ,2,isb2,ihc,'BR(~t_2 -> ~b_2    H+)'
      endif
      if(brst2ztop.ne.0.D0) then
      write(nout,102) brst2ztop    ,2,ist1,iz ,'BR(~t_2 -> ~t_1    Z )'
      endif
      if(brst2wsb(1).ne.0.D0) then
      write(nout,102) brst2wsb(1)  ,2,isb1,iwc,'BR(~t_2 -> ~b_1    W+)'
      endif
      if(brst2wsb(2).ne.0.D0) then
      write(nout,102) brst2wsb(2)  ,2,isb2,iwc,'BR(~t_2 -> ~b_2    W+)'
      endif

      elseif(flagcondstop(2).eq.11.D0) then
         if(stoptot(2).ne.0.D0) then
            write(nout,99)
            write(nout,100) 2000006,stoptot(2),'stop2 decays'

      write(nout,103)
      if(brstopw(2,1).ne.0.D0) then
      write(nout,104) brstopw(2,1),3,in1,ib,iwc,       'BR(~t_2 -> ~chi_
     .10  b  W+)'
      endif
      if(brstopw(2,2).ne.0.D0) then
      write(nout,104) brstopw(2,2),3,in2,ib,iwc,       'BR(~t_2 -> ~chi_
     .20  b  W+)'
      endif
      if(brstopw(2,3).ne.0.D0) then
      write(nout,104) brstopw(2,3),3,in3,ib,iwc,       'BR(~t_2 -> ~chi_
     .30  b  W+)'
      endif
      if(brstopw(2,4).ne.0.D0) then
      write(nout,104) brstopw(2,4),3,in4,ib,iwc,       'BR(~t_2 -> ~chi_
     .40  b  W+)'
      endif
      if(brstoph(2,1).ne.0.D0) then
      write(nout,104) brstoph(2,1),3,in1,ib,ihc,       'BR(~t_2 -> ~chi_
     .10  b  H+)'
      endif
      if(brstoph(2,2).ne.0.D0) then
      write(nout,104) brstoph(2,2),3,in2,ib,ihc,       'BR(~t_2 -> ~chi_
     .20  b  H+)'
      endif
      if(brstoph(2,3).ne.0.D0) then
      write(nout,104) brstoph(2,3),3,in3,ib,ihc,       'BR(~t_2 -> ~chi_
     .30  b  H+)'
      endif
      if(brstoph(2,4).ne.0.D0) then
      write(nout,104) brstoph(2,4),3,in4,ib,ihc,       'BR(~t_2 -> ~chi_
     .40  b  H+)'
      endif
      if(brstsntau(2,1).ne.0.D0) then
      write(nout,104) brstsntau(2,1),3,intau1,ib,-itau,'BR(~t_2 -> ~nu_t
     .auL b  tau+)'
      endif
      if(brstsnel(2).ne.0.D0) then
      write(nout,104) brstsnel(2),3,inel,ib,-ie,       'BR(~t_2 -> ~nu_e
     .L   b  e+)'
      write(nout,104) brstsnel(2),3,inmul,ib,-imu,     'BR(~t_2 -> ~nu_m
     .uL  b  mu+)'
      endif
      if(brststau(2,1).ne.0.D0) then
      write(nout,104) brststau(2,1),3,-istau1,ib,intau,'BR(~t_2 -> ~tau_
     .1+  b  nu_tau)'
      endif
      if(brststau(2,2).ne.0.D0) then
      write(nout,104) brststau(2,2),3,-istau2,ib,intau,'BR(~t_2 -> ~tau_
     .2+  b  nu_tau)'
      endif
      if(brstsel(2,1).ne.0.D0) then
      write(nout,104) brstsel(2,1),3,-isell,ib,ine,    'BR(~t_2 -> ~e_L+
     .    b  nu_e)'
      endif
      if(brstsel(2,2).ne.0.D0) then
      write(nout,104) brstsel(2,2),3,-iselr,ib,ine,    'BR(~t_2 -> ~e_R+
     .    b  nu_e)'
      endif
      if(brstsel(2,1).ne.0.D0) then      
      write(nout,104) brstsel(2,1),3,-ismul,ib,inmu,   'BR(~t_2 -> ~mu_L
     .+   b  nu_mu)'
      endif
      if(brstsel(2,2).ne.0.D0) then
      write(nout,104) brstsel(2,2),3,-ismur,ib,inmu,   'BR(~t_2 -> ~mu_R
     .+   b  nu_mu)'
      endif
      if(brstbsbst(2,1).ne.0.D0) then
      write(nout,104) brstbsbst(2,1),3,-isb1,ib,it,    'BR(~t_2 -> ~b_1*
     .    b  t)'
      endif
      if(brstbsbst(2,2).ne.0.D0) then
      write(nout,104) brstbsbst(2,2),3,-isb2,ib,it,    'BR(~t_2 -> ~b_2*
     .    b  t)'
      endif
      if(brstbbsbt(2,1).ne.0.D0) then
      write(nout,104) brstbbsbt(2,1),3,isb1,ibb,it,    'BR(~t_2 -> ~b_1
     .    bb t)'
      endif
      if(brstbbsbt(2,2).ne.0.D0) then
      write(nout,104) brstbbsbt(2,2),3,isb2,ibb,it,    'BR(~t_2 -> ~b_2
     .    bb t)'
      endif
      if(brstupsbdow(2,1).ne.0.D0) then
      write(nout,104) brstupsbdow(2,1),3,isb1,idb,iu,  'BR(~t_2 -> ~b_1
     .    db u)'
      endif
      if(brstupsbdow(2,2).ne.0.D0) then
      write(nout,104) brstupsbdow(2,2),3,isb2,idb,iu,  'BR(~t_2 -> ~b_2
     .    db u)'
      endif
      if(brstupsbdow(2,1).ne.0.D0) then
      write(nout,104) brstupsbdow(2,1),3,isb1,isb,ic,  'BR(~t_2 -> ~b_1
     .    sb c)'
      endif
      if(brstupsbdow(2,2).ne.0.D0) then
      write(nout,104) brstupsbdow(2,2),3,isb2,isb,ic,  'BR(~t_2 -> ~b_2
     .    sb c)'
      endif
      if(brsttausbnu(2,1).ne.0.D0) then
      write(nout,104) brsttausbnu(2,1),3,isb1,-itau,intau,'BR(~t_2 -> ~b
     ._1     tau+ nu_tau)'
      endif
      if(brsttausbnu(2,2).ne.0.D0) then
      write(nout,104) brsttausbnu(2,2),3,isb2,-itau,intau,'BR(~t_2 -> ~b
     ._2     tau+ nu_tau)'
      endif
      if(brstelsbnu(2,1).ne.0.D0) then
      write(nout,104) brstelsbnu(2,1),3,isb1,-ie,ine,  'BR(~t_2 -> ~b_1 
     .    e+   nu_e)'
      endif
      if(brstelsbnu(2,2).ne.0.D0) then
      write(nout,104) brstelsbnu(2,2),3,isb2,-ie,ine,  'BR(~t_2 -> ~b_2 
     .    e+   nu_e)'
      endif
      if(brstelsbnu(2,1).ne.0.D0) then
      write(nout,104) brstelsbnu(2,1),3,isb1,-imu,inmu,'BR(~t_2 -> ~b_1 
     .    mu+  nu_mu)'
      endif
      if(brstelsbnu(2,2).ne.0.D0) then
      write(nout,104) brstelsbnu(2,2),3,isb2,-imu,inmu,'BR(~t_2 -> ~b_2 
     .    mu+  nu_mu)'
      endif
      if(brst2st1tt.ne.0.D0) then
      write(nout,104) brst2st1tt,3,ist1,it,itb,        'BR(~t_2 -> ~t_1
     .    t    tb)'
      write(nout,104) brst2st1tt,3,-ist1,it,it,        'BR(~t_2 -> ~t_1*
     .    t    t )'
      endif
      if(brst2st1bb.ne.0.D0) then
      write(nout,104) brst2st1bb,3,ist1,ib,ibb,        'BR(~t_2 -> ~t_1
     .    b    bb)'
      endif
      if(brst2st1uu.ne.0.D0) then
      write(nout,104) brst2st1uu,3,ist1,iu,iub,        'BR(~t_2 -> ~t_1
     .    u    ub)'
      endif
      if(brst2st1dd.ne.0.D0) then
      write(nout,104) brst2st1dd,3,ist1,id,idb,        'BR(~t_2 -> ~t_1
     .    d    db)'
      endif
      if(brst2st1uu.ne.0.D0) then
      write(nout,104) brst2st1uu,3,ist1,ic,icb,        'BR(~t_2 -> ~t_1
     .    c    cb)'
      endif
      if(brst2st1dd.ne.0.D0) then
      write(nout,104) brst2st1dd,3,ist1,is,isb,        'BR(~t_2 -> ~t_1
     .    s    sb)'
      endif
      if(brst2st1ee.ne.0.D0) then
      write(nout,104) brst2st1ee,3,ist1,ie,-ie,        'BR(~t_2 -> ~t_1
     .    e+   e-)'
      write(nout,104) brst2st1ee,3,ist1,imu,-imu,      'BR(~t_2 -> ~t_1
     .    mu+  mu-)'
      endif
      if(brst2st1tautau.ne.0.D0) then
      write(nout,104) brst2st1tautau,3,ist1,itau,-itau,'BR(~t_2 -> ~t_1
     .    tau+ tau-)'
      endif
      if(brst2st1nunu.ne.0.D0) then
      write(nout,104) brst2st1nunu,3,ist1,ine,-ine,    'BR(~t_2 -> ~t_1
     .    nu_e   nu_eb)'
      write(nout,104) brst2st1nunu,3,ist1,inmu,-inmu,  'BR(~t_2 -> ~t_1
     .    nu_mu  nu_mub)'
      write(nout,104) brst2st1nunu,3,ist1,intau,-intau,'BR(~t_2 -> ~t_1
     .    nu_tau nu_taub)'
      endif

      elseif(stoptot(2).eq.0.D0) then
      write(nout,99)
      write(nout,100) 2000006,0.000000000E+00,'stop2 decays'

      endif
      endif

c --------------- c
c Sbottom1 decays c
c --------------- c

      do i=1,2,1
         if(sbottot2(i).eq.0.D0) then
            flagsbottot2(i) = 10.D0
         elseif(sbottot2(i).ne.0.D0) then
            flagsbottot2(i) = 40.D0
         endif
         flagcondsbot(i) = flagsbottot2(i)+flagmulti
      end do

      write(nout,105)      

      if(flagcondsbot(1).eq.10.D0) then
         write(nout,99)
         write(nout,100) 1000005,0.000000000E+00,'sbottom1 decays'
      elseif(flagcondsbot(1).eq.40.D0.or.flagcondsbot(1).eq.41.D0) then
         write(nout,99)
         write(nout,100) 1000005,sbottot2(1),'sbottom1 decays'

      write(nout,101)
      if(brsb1neutt(1).ne.0.D0) then
      write(nout,102) brsb1neutt(1),2,in1,ib  ,'BR(~b_1 -> ~chi_10 b )'
      endif
      if(brsb1neutt(2).ne.0.D0) then
      write(nout,102) brsb1neutt(2),2,in2,ib  ,'BR(~b_1 -> ~chi_20 b )'
      endif
      if(brsb1neutt(3).ne.0.D0) then
      write(nout,102) brsb1neutt(3),2,in3,ib  ,'BR(~b_1 -> ~chi_30 b )'
      endif
      if(brsb1neutt(4).ne.0.D0) then
      write(nout,102) brsb1neutt(4),2,in4,ib  ,'BR(~b_1 -> ~chi_40 b )'
      endif
      if(brsb1chart(1).ne.0.D0) then
      write(nout,102) brsb1chart(1),2,-ic1,it ,'BR(~b_1 -> ~chi_1- t )'
      endif
      if(brsb1chart(2).ne.0.D0) then
      write(nout,102) brsb1chart(2),2,-ic2,it ,'BR(~b_1 -> ~chi_2- t )'
      endif
      if(brsb1glui.ne.0.D0) then
      write(nout,102) brsb1glui,2,iglo,ib     ,'BR(~b_1 -> ~g      b )'
      endif
      if(brsb1hcst(1).ne.0.D0) then
      write(nout,102) brsb1hcst(1),2,ist1,-ihc,'BR(~b_1 -> ~t_1    H-)'
      endif
      if(brsb1hcst(2).ne.0.D0) then
      write(nout,102) brsb1hcst(2),2,ist2,-ihc,'BR(~b_1 -> ~t_2    H-)'
      endif
      if(brsb1wst(1).ne.0.D0) then
      write(nout,102) brsb1wst(1),2,ist1,-iwc ,'BR(~b_1 -> ~t_1    W-)'
      endif
      if(brsb1wst(2).ne.0.D0) then
      write(nout,102) brsb1wst(2),2,ist2,-iwc ,'BR(~b_1 -> ~t_2    W-)'
      endif

      elseif(flagcondsbot(1).eq.11.D0) then
         if(sbottot(1).ne.0.D0) then
            write(nout,99)
            write(nout,100) 1000005,sbottot(1),'sbottom1 decays'

      write(nout,103)
      if(brsbsntau(1,1).ne.0.D0) then
      write(nout,104) brsbsntau(1,1),3,-intau1,it,itau,'BR(~b_1 -> ~nu_t
     .auL* t    tau-)'
      endif
      if(brsbsnel(1).ne.0.D0) then
      write(nout,104) brsbsnel(1),3,-inel,it,ie,       'BR(~b_1 -> ~nu_e
     .L*   t    e-)'
      write(nout,104) brsbsnel(1),3,-inmul,it,imu,     'BR(~b_1 -> ~nu_m
     .uL*  t    mu-)'
      endif
      if(brsbstau(1,1).ne.0.D0) then
      write(nout,104) brsbstau(1,1),3,istau1,it,-intau,'BR(~b_1 -> ~tau_
     .1-   t    nu_taub)'
      endif
      if(brsbstau(1,2).ne.0.D0) then
      write(nout,104) brsbstau(1,2),3,istau2,it,-intau,'BR(~b_1 -> ~tau_
     .2-   t    nu_taub)'
      endif
      if(brsbsel(1,1).ne.0.D0) then
      write(nout,104) brsbsel(1,1),3,isell,it,-ine,    'BR(~b_1 -> ~e_L-
     .     t    nu_eb)'
      endif
      if(brsbsel(1,2).ne.0.D0) then
      write(nout,104) brsbsel(1,2),3,iselr,it,-ine,    'BR(~b_1 -> ~e_R-
     .     t    nu_eb)'
      endif
      if(brsbsel(1,1).ne.0.D0) then
      write(nout,104) brsbsel(1,1),3,ismul,it,-inmu,   'BR(~b_1 -> ~mu_L
     .-    t    nu_mub)'
      endif
      if(brsbsel(1,2).ne.0.D0) then
      write(nout,104) brsbsel(1,2),3,ismur,it,-inmu,   'BR(~b_1 -> ~mu_R
     .-    t    nu_mub)'
      endif
      if(brsbtstsb(1,1).ne.0.D0) then
      write(nout,104) brsbtstsb(1,1),3,-ist1,it,ib,    'BR(~b_1 -> ~t_1*
     .     t    b)'
      endif
      if(brsbtstsb(1,2).ne.0.D0) then
      write(nout,104) brsbtstsb(1,2),3,-ist2,it,ib,    'BR(~b_1 -> ~t_2*
     .     t    b)'
      endif
      if(brsbtbstb(1,1).ne.0.D0) then
      write(nout,104) brsbtbstb(1,1),3,ist1,-it,ib,    'BR(~b_1 -> ~t_1
     .     tb   b)'
      endif
      if(brsbtbstb(1,2).ne.0.D0) then
      write(nout,104) brsbtbstb(1,2),3,ist2,-it,ib,    'BR(~b_1 -> ~t_2
     .     tb   b)'
      endif
      if(brsbupstdow(1,1).ne.0.D0) then
      write(nout,104) brsbupstdow(1,1),3,ist1,iub,id,  'BR(~b_1 -> ~t_1 
     .     ub   d)'
      endif
      if(brsbupstdow(1,2).ne.0.D0) then
      write(nout,104) brsbupstdow(1,2),3,ist2,iub,id,  'BR(~b_1 -> ~t_2 
     .     ub   d)'
      endif
      if(brsbupstdow(1,1).ne.0.D0) then
      write(nout,104) brsbupstdow(1,1),3,ist1,icb,is,  'BR(~b_1 -> ~t_1 
     .     cb   s)'
      endif
      if(brsbupstdow(1,2).ne.0.D0) then
      write(nout,104) brsbupstdow(1,2),3,ist2,icb,is,  'BR(~b_1 -> ~t_2 
     .     cb   s)'
      endif
      if(brsbtaustnu(1,1).ne.0.D0) then
      write(nout,104) brsbtaustnu(1,1),3,ist1,itau,-intau,'BR(~b_1 -> ~t
     ._1      tau- nu_taub)'
      endif
      if(brsbtaustnu(1,2).ne.0.D0) then
      write(nout,104) brsbtaustnu(1,2),3,ist2,itau,-intau,'BR(~b_1 -> ~t
     ._2      tau- nu_taub)'
      endif
      if(brsbelstnu(1,1).ne.0.D0) then
      write(nout,104) brsbelstnu(1,1),3,ist1,ie,-ine,  'BR(~b_1 -> ~t_1
     .     e-   nu_eb)'
      endif
      if(brsbelstnu(1,2).ne.0.D0) then
      write(nout,104) brsbelstnu(1,2),3,ist1,ie,-ine,  'BR(~b_1 -> ~t_2
     .     e-   nu_eb)'
      endif
      if(brsbelstnu(1,1).ne.0.D0) then
      write(nout,104) brsbelstnu(1,1),3,ist1,imu,-inmu,'BR(~b_1 -> ~t_1
     .     mu-  nu_mub)'
      endif
      if(brsbelstnu(1,2).ne.0.D0) then
      write(nout,104) brsbelstnu(1,2),3,ist1,imu,-inmu,'BR(~b_1 -> ~t_2
     .     mu-  nu_mub)'
      endif

      elseif(sbottot(1).eq.0.D0) then
         write(nout,99)
         write(nout,100) 1000005,0.000000000E+00,'sbottom1 decays'
      endif
      endif

c --------------- c
c Sbottom2 decays c
c --------------- c

      write(nout,105)

      if(flagcondsbot(2).eq.10.D0) then
         write(nout,99)
         write(nout,100) 2000005,0.000000000E+00,'sbottom2 decays'
      elseif(flagcondsbot(2).eq.40.D0.or.flagcondsbot(2).eq.41.D0) then
         write(nout,99)
         write(nout,100) 2000005,sbottot2(2),'sbottom2 decays'

      write(nout,101)
      if(brsb2neutt(1).ne.0.D0) then
      write(nout,102) brsb2neutt(1),2,in1,ib  ,'BR(~b_2 -> ~chi_10 b )'
      endif
      if(brsb2neutt(2).ne.0.D0) then
      write(nout,102) brsb2neutt(2),2,in2,ib  ,'BR(~b_2 -> ~chi_20 b )'
      endif
      if(brsb2neutt(3).ne.0.D0) then
      write(nout,102) brsb2neutt(3),2,in3,ib  ,'BR(~b_2 -> ~chi_30 b )'
      endif
      if(brsb2neutt(4).ne.0.D0) then
      write(nout,102) brsb2neutt(4),2,in4,ib  ,'BR(~b_2 -> ~chi_40 b )'
      endif
      if(brsb2chart(1).ne.0.D0) then
      write(nout,102) brsb2chart(1),2,-ic1,it ,'BR(~b_2 -> ~chi_1- t )'
      endif
      if(brsb2chart(2).ne.0.D0) then
      write(nout,102) brsb2chart(2),2,-ic2,it ,'BR(~b_2 -> ~chi_2- t )'
      endif
      if(brsb2glui.ne.0.D0) then
      write(nout,102) brsb2glui,2,iglo,ib     ,'BR(~b_2 -> ~g      b )'
      endif
      if(brsb2hl.ne.0.D0) then
      write(nout,102) brsb2hl,2,isb1,ihl      ,'BR(~b_2 -> ~b_1    h )'
      endif
      if(brsb2hh.ne.0.D0) then
      write(nout,102) brsb2hh,2,isb1,ihh      ,'BR(~b_2 -> ~b_1    H )'
      endif
      if(brsb2ha.ne.0.D0) then
      write(nout,102) brsb2ha,2,isb1,iha      ,'BR(~b_2 -> ~b_1    A )'
      endif
      if(brsb2hcst(1).ne.0.D0) then
      write(nout,102) brsb2hcst(1),2,ist1,-ihc,'BR(~b_2 -> ~t_1    H-)'
      endif
      if(brsb2hcst(2).ne.0.D0) then
      write(nout,102) brsb2hcst(2),2,ist2,-ihc,'BR(~b_2 -> ~t_2    H-)'
      endif
      if(brsb2zbot.ne.0.D0) then
      write(nout,102) brsb2zbot,2,isb1,iz     ,'BR(~b_2 -> ~b_1    Z )'
      endif
      if(brsb2wst(1).ne.0.D0) then
      write(nout,102) brsb2wst(1),2,ist1,-iwc ,'BR(~b_2 -> ~t_1    W-)'
      endif
      if(brsb2wst(2).ne.0.D0) then
      write(nout,102) brsb2wst(2),2,ist2,-iwc ,'BR(~b_2 -> ~t_2    W-)'
      endif

      elseif(flagcondsbot(2).eq.11.D0) then
         if(sbottot(2).ne.0.D0) then
            write(nout,99)
            write(nout,100) 2000005,sbottot(2),'sbottom2 decays'

      write(nout,103)
      if(brsbsntau(2,1).ne.0.D0) then
      write(nout,104) brsbsntau(2,1),3,-intau1,it,itau,'BR(~b_2 -> ~nu_t
     .auL* t      tau-)'
      endif
      if(brsbsnel(2).ne.0.D0) then
      write(nout,104) brsbsnel(2),3,-inel,it,ie,       'BR(~b_2 -> ~nu_e
     .L*   t      e-)'
      write(nout,104) brsbsnel(2),3,-inmul,it,imu,     'BR(~b_2 -> ~nu_m
     .uL*  t      mu-)'
      endif
      if(brsbstau(2,1).ne.0.D0) then
      write(nout,104) brsbstau(2,1),3,istau1,it,-intau,'BR(~b_2 -> ~tau_
     .1-   t      nu_taub)'
      endif
      if(brsbstau(2,2).ne.0.D0) then
      write(nout,104) brsbstau(2,2),3,istau2,it,-intau,'BR(~b_2 -> ~tau_
     .2-   t      nu_taub)'
      endif
      if(brsbsel(2,1).ne.0.D0) then
      write(nout,104) brsbsel(2,1),3,isell,it,-ine,    'BR(~b_2 -> ~e_L-
     .     t      nu_eb)'
      endif
      if(brsbsel(2,2).ne.0.D0) then
      write(nout,104) brsbsel(2,2),3,iselr,it,-ine,    'BR(~b_2 -> ~e_R-
     .     t      nu_eb)'
      endif
      if(brsbsel(2,1).ne.0.D0) then
      write(nout,104) brsbsel(2,1),3,ismul,it,-inmu,   'BR(~b_2 -> ~mu_L
     .-    t      nu_mub)'
      endif
      if(brsbsel(2,2).ne.0.D0) then
      write(nout,104) brsbsel(2,2),3,ismur,it,-inmu,   'BR(~b_2 -> ~mu_R
     .-    t      nu_mub)'
      endif
      if(brsbtstsb(2,1).ne.0.D0) then
      write(nout,104) brsbtstsb(2,1),3,-ist1,it,ib,    'BR(~b_2 -> ~t_1*
     .     t      b)'
      endif
      if(brsbtstsb(2,2).ne.0.D0) then
      write(nout,104) brsbtstsb(2,2),3,-ist2,it,ib,    'BR(~b_2 -> ~t_2*
     .     t      b)'
      endif
      if(brsbtbstb(2,1).ne.0.D0) then
      write(nout,104) brsbtbstb(2,1),3,ist1,-it,ib,    'BR(~b_2 -> ~t_1
     .     tb     b)'
      endif
      if(brsbtbstb(2,2).ne.0.D0) then
      write(nout,104) brsbtbstb(2,2),3,ist2,-it,ib,    'BR(~b_2 -> ~t_2
     .     tb     b)'
      endif
      if(brsbupstdow(2,1).ne.0.D0) then
      write(nout,104) brsbupstdow(2,1),3,ist1,iub,id,  'BR(~b_2 -> ~t_1 
     .     ub     d)'
      endif
      if(brsbupstdow(2,2).ne.0.D0) then
      write(nout,104) brsbupstdow(2,2),3,ist2,iub,id,  'BR(~b_2 -> ~t_2 
     .     ub     d)'
      endif
      if(brsbupstdow(2,1).ne.0.D0) then
      write(nout,104) brsbupstdow(2,1),3,ist1,icb,is,  'BR(~b_2 -> ~t_1 
     .     cb     s)'
      endif
      if(brsbupstdow(2,2).ne.0.D0) then
      write(nout,104) brsbupstdow(2,2),3,ist2,icb,is,  'BR(~b_2 -> ~t_2 
     .     cb     s)'
      endif
      if(brsbtaustnu(2,1).ne.0.D0) then
      write(nout,104) brsbtaustnu(2,1),3,ist1,itau,-intau,'BR(~b_2 -> ~t
     ._1      tau-   nu_taub)'
      endif
      if(brsbtaustnu(2,2).ne.0.D0) then
      write(nout,104) brsbtaustnu(2,2),3,ist2,itau,-intau,'BR(~b_2 -> ~t
     ._2      tau-   nu_taub)'
      endif
      if(brsbelstnu(2,1).ne.0.D0) then
      write(nout,104) brsbelstnu(2,1),3,ist1,ie,-ine,  'BR(~b_2 -> ~t_1
     .     e-     nu_eb)'
      endif
      if(brsbelstnu(2,2).ne.0.D0) then
      write(nout,104) brsbelstnu(2,2),3,ist1,ie,-ine,  'BR(~b_2 -> ~t_2
     .     e-     nu_eb)'
      endif
      if(brsbelstnu(2,1).ne.0.D0) then
      write(nout,104) brsbelstnu(2,1),3,ist1,imu,-inmu,'BR(~b_2 -> ~t_1
     .     mu-    nu_mub)'
      endif
      if(brsbelstnu(2,2).ne.0.D0) then
      write(nout,104) brsbelstnu(2,2),3,ist1,imu,-inmu,'BR(~b_2 -> ~t_2
     .     mu-    nu_mub)' 
      endif
      if(brsb2sb1bb.ne.0.D0) then
      write(nout,104) brsb2sb1bb,3,isb1,ib,ibb,        'BR(~b_2 -> ~b_1 
     .     b      bb)'
      endif
      if(brsb2sb1starbb.ne.0.D0) then
      write(nout,104) brsb2sb1starbb,3,-isb1,ib,ib,    'BR(~b_2 -> ~b_1*
     .     b      b)'
      endif
      if(brsb2sb1tt.ne.0.D0) then
      write(nout,104) brsb2sb1tt,3,isb1,it,itb,        'BR(~b_2 -> ~b_1 
     .     t      tb)'
      endif
      if(brsb2sb1uu.ne.0.D0) then
      write(nout,104) brsb2sb1uu,3,isb1,iu,iub,        'BR(~b_2 -> ~b_1 
     .     u      ub)'
      endif
      if(brsb2sb1dd.ne.0.D0) then
      write(nout,104) brsb2sb1dd,3,isb1,id,idb,        'BR(~b_2 -> ~b_1 
     .     d      db)'
      endif
      if(brsb2sb1uu.ne.0.D0) then
      write(nout,104) brsb2sb1uu,3,isb1,ic,icb,        'BR(~b_2 -> ~b_1 
     .     c      cb)'
      endif
      if(brsb2sb1dd.ne.0.D0) then
      write(nout,104) brsb2sb1dd,3,isb1,is,isb,        'BR(~b_2 -> ~b_1 
     .     s      sb)'
      endif
      if(brsb2sb1ee.ne.0.D0) then
      write(nout,104) brsb2sb1ee,3,isb1,ie,-ie,        'BR(~b_2 -> ~b_1 
     .     e-     e+)'
      write(nout,104) brsb2sb1ee,3,isb1,imu,-imu,      'BR(~b_2 -> ~b_1 
     .     mu-    mu+)'
      endif
      if(brsb2sb1tautau.ne.0.D0) then
      write(nout,104) brsb2sb1tautau,3,isb1,itau,-itau,'BR(~b_2 -> ~b_1 
     .     tau-   tau+)'
      endif
      if(brsb2sb1nunu.ne.0.D0) then
      write(nout,104) brsb2sb1nunu,3,isb1,ine,-ine,    'BR(~b_2 -> ~b_1 
     .     nu_e   nu_eb)'
      write(nout,104) brsb2sb1nunu,3,isb1,inmu,-inmu,  'BR(~b_2 -> ~b_1 
     .     nu_mu  nu_mub)'
      write(nout,104) brsb2sb1nunu,3,isb1,intau,-intau,'BR(~b_2 -> ~b_1 
     .     nu_tau nu_taub)'
      endif

      elseif(sbottot2(2).eq.0.D0) then
         write(nout,99)
         write(nout,100) 2000005,0.000000000E+00,'sbottom2 decays'
      endif 
      endif

c ------------ c
c Sup_L decays c
c ------------ c

      write(nout,105)

      if(supltot2.ne.0.D0) then
      write(nout,99)
      write(nout,100) 1000002,supltot2,'sup_L decays'

      write(nout,101)
      if(brsuplnup(1).ne.0.D0) then
      write(nout,102) brsuplnup(1),2,in1,iu   ,'BR(~u_L -> ~chi_10 u)'
      endif
      if(brsuplnup(2).ne.0.D0) then
      write(nout,102) brsuplnup(2),2,in2,iu   ,'BR(~u_L -> ~chi_20 u)'
      endif
      if(brsuplnup(3).ne.0.D0) then
      write(nout,102) brsuplnup(3),2,in3,iu   ,'BR(~u_L -> ~chi_30 u)'
      endif
      if(brsuplnup(4).ne.0.D0) then
      write(nout,102) brsuplnup(4),2,in4,iu   ,'BR(~u_L -> ~chi_40 u)'
      endif
      if(brsuplcdow(1).ne.0.D0) then
      write(nout,102) brsuplcdow(1),2,ic1,id  ,'BR(~u_L -> ~chi_1+ d)'
      endif
      if(brsuplcdow(2).ne.0.D0) then
      write(nout,102) brsuplcdow(2),2,ic2,id  ,'BR(~u_L -> ~chi_2+ d)'
      endif
      if(brsuplglui.ne.0.D0) then
      write(nout,102) brsuplglui,2,iglo,iu    ,'BR(~u_L -> ~g      u)'
      endif

      elseif(supltot2.eq.0.D0) then
      write(nout,99)
      write(nout,100) 1000002,0.000000000E+00,'sup_L decays'

      endif

c ------------ c
c Sup_R decays c
c ------------ c

      write(nout,105)

      if(suprtot2.ne.0.D0) then
      write(nout,99)
      write(nout,100) 2000002,suprtot2,'sup_R decays'

      write(nout,101)
      if(brsuprnup(1).ne.0.D0) then
      write(nout,102) brsuprnup(1),2,in1,iu   ,'BR(~u_R -> ~chi_10 u)'
      endif
      if(brsuprnup(2).ne.0.D0) then
      write(nout,102) brsuprnup(2),2,in2,iu   ,'BR(~u_R -> ~chi_20 u)'
      endif
      if(brsuprnup(3).ne.0.D0) then
      write(nout,102) brsuprnup(3),2,in3,iu   ,'BR(~u_R -> ~chi_30 u)'
      endif
      if(brsuprnup(4).ne.0.D0) then
      write(nout,102) brsuprnup(4),2,in4,iu   ,'BR(~u_R -> ~chi_40 u)'
      endif
      if(brsuprcdow(1).ne.0.D0) then
      write(nout,102) brsuprcdow(1),2,ic1,id  ,'BR(~u_R -> ~chi_1+ d)'
      endif
      if(brsuprcdow(2).ne.0.D0) then
      write(nout,102) brsuprcdow(2),2,ic2,id  ,'BR(~u_R -> ~chi_2+ d)'
      endif
      if(brsuprglui.ne.0.D0) then
      write(nout,102) brsuprglui,2,iglo,iu    ,'BR(~u_R -> ~g      u)'
      endif

      elseif(suprtot2.eq.0.D0) then
      write(nout,99)
      write(nout,100) 2000002,0.000000000E+00,'sup_R decays'

      endif

c -------------- c
c Sdown_L decays c
c -------------- c

      write(nout,105)

      if(sdowltot2.ne.0.D0) then
      write(nout,99)
      write(nout,100) 1000001,sdowltot2,'sdown_L decays'

      write(nout,101)
      
      if(brsdowlndow(1).ne.0.D0) then
      write(nout,102) brsdowlndow(1),2,in1,id  ,'BR(~d_L -> ~chi_10 d)'
      endif
      if(brsdowlndow(2).ne.0.D0) then
      write(nout,102) brsdowlndow(2),2,in2,id  ,'BR(~d_L -> ~chi_20 d)'
      endif
      if(brsdowlndow(3).ne.0.D0) then
      write(nout,102) brsdowlndow(3),2,in3,id  ,'BR(~d_L -> ~chi_30 d)'
      endif
      if(brsdowlndow(4).ne.0.D0) then
      write(nout,102) brsdowlndow(4),2,in4,id  ,'BR(~d_L -> ~chi_40 d)'
      endif
      if(brsdowlchup(1).ne.0.D0) then
      write(nout,102) brsdowlchup(1),2,-ic1,iu ,'BR(~d_L -> ~chi_1- u)'
      endif
      if(brsdowlchup(2).ne.0.D0) then
      write(nout,102) brsdowlchup(2),2,-ic2,iu ,'BR(~d_L -> ~chi_2- u)'
      endif
      if(brsdowlglui.ne.0.D0) then
      write(nout,102) brsdowlglui,2,iglo,id    ,'BR(~d_L -> ~g      d)'
      endif

      elseif(sdowltot2.eq.0.D0) then
      write(nout,99)
      write(nout,100) 1000001,0.000000000E+00,'sdown_L decays'

      endif

c -------------- c
c Sdown_R decays c
c -------------- c

      write(nout,105)

      if(sdowrtot2.ne.0.D0) then
      write(nout,99)
      write(nout,100) 2000001,sdowrtot2,'sdown_R decays'

      write(nout,101)
      if(brsdowrndow(1).ne.0.D0) then
      write(nout,102) brsdowrndow(1),2,in1,id  ,'BR(~d_R -> ~chi_10 d)'
      endif
      if(brsdowrndow(2).ne.0.D0) then
      write(nout,102) brsdowrndow(2),2,in2,id  ,'BR(~d_R -> ~chi_20 d)'
      endif
      if(brsdowrndow(3).ne.0.D0) then
      write(nout,102) brsdowrndow(3),2,in3,id  ,'BR(~d_R -> ~chi_30 d)'
      endif
      if(brsdowrndow(4).ne.0.D0) then
      write(nout,102) brsdowrndow(4),2,in4,id  ,'BR(~d_R -> ~chi_40 d)'
      endif
      if(brsdowrchup(1).ne.0.D0) then
      write(nout,102) brsdowrchup(1),2,-ic1,iu ,'BR(~d_R -> ~chi_1- u)'
      endif
      if(brsdowrchup(2).ne.0.D0) then
      write(nout,102) brsdowrchup(2),2,-ic2,iu ,'BR(~d_R -> ~chi_2- u)'
      endif
      if(brsdowrglui.ne.0.D0) then
      write(nout,102) brsdowrglui,2,iglo,id    ,'BR(~d_R -> ~g      d)'
      endif

      elseif(sdowrtot2.eq.0.D0) then
      write(nout,99)
      write(nout,100) 2000001,0.000000000E+00,'sdown_R decays'

      endif

c --------------- c
c Scharm_L decays c
c --------------- c

      write(nout,105)

      if(supltot2.ne.0.D0) then
      write(nout,99)
      write(nout,100) 1000004,supltot2,'scharm_L decays'

      write(nout,101)
      if(brsuplnup(1).ne.0.D0) then
      write(nout,102) brsuplnup(1),2,in1,ic   ,'BR(~c_L -> ~chi_10 c)'
      endif
      if(brsuplnup(2).ne.0.D0) then
      write(nout,102) brsuplnup(2),2,in2,ic   ,'BR(~c_L -> ~chi_20 c)'
      endif
      if(brsuplnup(3).ne.0.D0) then
      write(nout,102) brsuplnup(3),2,in3,ic   ,'BR(~c_L -> ~chi_30 c)'
      endif
      if(brsuplnup(4).ne.0.D0) then
      write(nout,102) brsuplnup(4),2,in4,ic   ,'BR(~c_L -> ~chi_40 c)'
      endif
      if(brsuplcdow(1).ne.0.D0) then
      write(nout,102) brsuplcdow(1),2,ic1,is  ,'BR(~c_L -> ~chi_1+ s)'
      endif
      if(brsuplcdow(2).ne.0.D0) then
      write(nout,102) brsuplcdow(2),2,ic2,is  ,'BR(~c_L -> ~chi_2+ s)'
      endif
      if(brsuplglui.ne.0.D0) then
      write(nout,102) brsuplglui,2,iglo,ic    ,'BR(~c_L -> ~g      c)'
      endif

      elseif(supltot2.eq.0.D0) then
      write(nout,99)
      write(nout,100) 1000004,0.000000000E+00,'scharm_L decays'

      endif

c --------------- c
c Scharm_R decays c
c --------------- c

      write(nout,105)

      if(suprtot2.ne.0.D0) then
      write(nout,99)
      write(nout,100) 2000004,suprtot2,'scharm_R decays'

      write(nout,101)
      if(brsuprnup(1).ne.0.D0) then
      write(nout,102) brsuprnup(1),2,in1,ic   ,'BR(~c_R -> ~chi_10 c)'
      endif
      if(brsuprnup(2).ne.0.D0) then
      write(nout,102) brsuprnup(2),2,in2,ic   ,'BR(~c_R -> ~chi_20 c)'
      endif
      if(brsuprnup(3).ne.0.D0) then      
      write(nout,102) brsuprnup(3),2,in3,ic   ,'BR(~c_R -> ~chi_30 c)'
      endif
      if(brsuprnup(4).ne.0.D0) then
      write(nout,102) brsuprnup(4),2,in4,ic   ,'BR(~c_R -> ~chi_40 c)'
      endif
      if(brsuprcdow(1).ne.0.D0) then
      write(nout,102) brsuprcdow(1),2,ic1,is  ,'BR(~c_R -> ~chi_1+ s)'
      endif
      if(brsuprcdow(2).ne.0.D0) then
      write(nout,102) brsuprcdow(2),2,ic2,is  ,'BR(~c_R -> ~chi_2+ s)'
      endif
      if(brsuprglui.ne.0.D0) then
      write(nout,102) brsuprglui,2,iglo,ic    ,'BR(~c_R -> ~g      c)'
      endif

      elseif(suprtot2.eq.0.D0) then
      write(nout,99)
      write(nout,100) 2000004,0.000000000E+00,'scharm_R decays'

      endif

c ----------------- c
c Sstrange_L decays c
c ----------------- c

      write(nout,105)

      if(sdowltot2.ne.0.D0) then
      write(nout,99)
      write(nout,100) 1000003,sdowltot2,'sstrange_L decays'

      write(nout,101)
      if(brsdowlndow(1).ne.0.D0) then
      write(nout,102) brsdowlndow(1),2,in1,is  ,'BR(~s_L -> ~chi_10 s)'
      endif
      if(brsdowlndow(2).ne.0.D0) then
      write(nout,102) brsdowlndow(2),2,in2,is  ,'BR(~s_L -> ~chi_20 s)'
      endif
      if(brsdowlndow(3).ne.0.D0) then
      write(nout,102) brsdowlndow(3),2,in3,is  ,'BR(~s_L -> ~chi_30 s)'
      endif
      if(brsdowlndow(4).ne.0.D0) then
      write(nout,102) brsdowlndow(4),2,in4,is  ,'BR(~s_L -> ~chi_40 s)'
      endif
      if(brsdowlchup(1).ne.0.D0) then
      write(nout,102) brsdowlchup(1),2,-ic1,ic ,'BR(~s_L -> ~chi_1- c)'
      endif
      if(brsdowlchup(2).ne.0.D0) then
      write(nout,102) brsdowlchup(2),2,-ic2,ic ,'BR(~s_L -> ~chi_2- c)'
      endif
      if(brsdowlglui.ne.0.D0) then
      write(nout,102) brsdowlglui,2,iglo,is    ,'BR(~s_L -> ~g      s)'
      endif

      elseif(sdowltot2.eq.0.D0) then
      write(nout,99)
      write(nout,100) 1000003,0.000000000E+00,'sstrange_L decays'

      endif

c ----------------- c
c Sstrange_R decays c
c ----------------- c

      write(nout,105)

      if(sdowrtot2.ne.0.D0) then
      write(nout,99)
      write(nout,100) 2000003,sdowrtot2,'sstrange_R decays'

      write(nout,101)
      if(brsdowrndow(1).ne.0.D0) then
      write(nout,102) brsdowrndow(1),2,in1,is  ,'BR(~s_R -> ~chi_10 s)'
      endif
      if(brsdowrndow(2).ne.0.D0) then
      write(nout,102) brsdowrndow(2),2,in2,is  ,'BR(~s_R -> ~chi_20 s)'
      endif
      if(brsdowrndow(3).ne.0.D0) then
      write(nout,102) brsdowrndow(3),2,in3,is  ,'BR(~s_R -> ~chi_30 s)'
      endif
      if(brsdowrndow(4).ne.0.D0) then
      write(nout,102) brsdowrndow(4),2,in4,is  ,'BR(~s_R -> ~chi_40 s)'
      endif
      if(brsdowrchup(1).ne.0.D0) then
      write(nout,102) brsdowrchup(1),2,-ic1,ic ,'BR(~s_R -> ~chi_1- c)'
      endif
      if(brsdowrchup(2).ne.0.D0) then
      write(nout,102) brsdowrchup(2),2,-ic2,ic ,'BR(~s_R -> ~chi_2- c)'
      endif
      if(brsdowrglui.ne.0.D0) then
      write(nout,102) brsdowrglui,2,iglo,is    ,'BR(~s_R -> ~g      s)'
      endif

      elseif(sdowrtot2.eq.0.D0) then
      write(nout,99)
      write(nout,100) 2000003,0.000000000E+00,'sstrange_R decays'

      endif

c ------------------ c
c Selectron_L decays c
c ------------------ c

      write(nout,105)

      if(selltot2.ne.0.D0) then
      write(nout,99)
      write(nout,100) 1000011,selltot2,'selectron_L decays'

      write(nout,101)
      if(brsellneute(1).ne.0.D0) then
      write(nout,102) brsellneute(1),2,in1,ie   ,'BR(~e_L -> ~chi_10 e-)
     .'
      endif
      if(brsellneute(2).ne.0.D0) then
      write(nout,102) brsellneute(2),2,in2,ie   ,'BR(~e_L -> ~chi_20 e-)
     .'
      endif
      if(brsellneute(3).ne.0.D0) then
      write(nout,102) brsellneute(3),2,in3,ie   ,'BR(~e_L -> ~chi_30 e-)
     .'
      endif
      if(brsellneute(4).ne.0.D0) then
      write(nout,102) brsellneute(4),2,in4,ie   ,'BR(~e_L -> ~chi_40 e-)
     .'
      endif
      if(brsellcharnue(1).ne.0.D0) then
      write(nout,102) brsellcharnue(1),2,-ic1,ine,'BR(~e_L -> ~chi_1- nu
     ._e)'
      endif
      if(brsellcharnue(2).ne.0.D0) then
      write(nout,102) brsellcharnue(2),2,-ic2,ine,'BR(~e_L -> ~chi_2- nu
     ._e)'
      endif

      elseif(selltot2.eq.0.D0) then
      write(nout,99)
      write(nout,100) 1000011,0.000000000E+00,'selectron_L decays'

      endif

c ------------------ c
c Selectron_R decays c
c ------------------ c

      write(nout,105)

      if(selrtot2.ne.0.D0) then
      write(nout,99)
      write(nout,100) 2000011,selrtot2,'selectron_R decays'

      write(nout,101)
      if(brselrneute(1).ne.0.D0) then
      write(nout,102) brselrneute(1),2,in1,ie   ,'BR(~e_R -> ~chi_10 e-)
     .'
      endif
      if(brselrneute(2).ne.0.D0) then
      write(nout,102) brselrneute(2),2,in2,ie   ,'BR(~e_R -> ~chi_20 e-)
     .'
      endif
      if(brselrneute(3).ne.0.D0) then
      write(nout,102) brselrneute(3),2,in3,ie   ,'BR(~e_R -> ~chi_30 e-)
     .'
      endif
      if(brselrneute(4).ne.0.D0) then
      write(nout,102) brselrneute(4),2,in4,ie   ,'BR(~e_R -> ~chi_40 e-)
     .'
      endif
      if(brselrcharnue(1).ne.0.D0) then
      write(nout,102) brselrcharnue(1),2,-ic1,ine,'BR(~e_R -> ~chi_1- nu
     ._e)'
      endif
      if(brselrcharnue(2).ne.0.D0) then
      write(nout,102) brselrcharnue(2),2,-ic2,ine,'BR(~e_R -> ~chi_2- nu
     ._e)'
      endif

      elseif(selrtot2.eq.0.D0) then
      write(nout,99)
      write(nout,100) 2000011,0.000000000E+00,'selectron_R decays'

      endif

c -------------- c
c Smuon_L decays c
c -------------- c

      write(nout,105)

      if(selltot2.ne.0.D0) then
      write(nout,99)
      write(nout,100) 1000013,selltot2,'smuon_L decays'

      write(nout,101)
      if(brsellneute(1).ne.0.D0) then
      write(nout,102) brsellneute(1),2,in1,imu,'BR(~mu_L -> ~chi_10 mu-)
     .'
      endif
      if(brsellneute(2).ne.0.D0) then
      write(nout,102) brsellneute(2),2,in2,imu,'BR(~mu_L -> ~chi_20 mu-)
     .'
      endif
      if(brsellneute(3).ne.0.D0) then
      write(nout,102) brsellneute(3),2,in3,imu,'BR(~mu_L -> ~chi_30 mu-)
     .'
      endif
      if(brsellneute(4).ne.0.D0) then
      write(nout,102) brsellneute(4),2,in4,imu,'BR(~mu_L -> ~chi_40 mu-)
     .'
      endif
      if(brsellcharnue(1).ne.0.D0) then
      write(nout,102) brsellcharnue(1),2,-ic1,inmu,'BR(~mu_L -> ~chi_1- 
     .nu_mu)'
      endif
      if(brsellcharnue(2).ne.0.D0) then
      write(nout,102) brsellcharnue(2),2,-ic2,inmu,'BR(~mu_L -> ~chi_2- 
     .nu_mu)'
      endif

      elseif(selltot2.eq.0.D0) then
      write(nout,99)
      write(nout,100) 1000013,0.000000000E+00,'smuon_L decays'

      endif

c ------------------ c
c Smuon_R decays c
c ------------------ c

      write(nout,105)

      if(selrtot2.ne.0.D0) then
      write(nout,99)
      write(nout,100) 2000013,selrtot2,'smuon_R decays'

      write(nout,101)
      if(brselrneute(1).ne.0.D0) then
      write(nout,102) brselrneute(1),2,in1,imu,'BR(~mu_R -> ~chi_10 mu-)
     .'
      endif
      if(brselrneute(2).ne.0.D0) then
      write(nout,102) brselrneute(2),2,in2,imu,'BR(~mu_R -> ~chi_20 mu-)
     .'
      endif
      if(brselrneute(3).ne.0.D0) then
      write(nout,102) brselrneute(3),2,in3,imu,'BR(~mu_R -> ~chi_30 mu-)
     .'
      endif
      if(brselrneute(4).ne.0.D0) then
      write(nout,102) brselrneute(4),2,in4,imu,'BR(~mu_R -> ~chi_40 mu-)
     .'
      endif
      if(brselrcharnue(1).ne.0.D0) then
      write(nout,102) brselrcharnue(1),2,-ic1,inmu,'BR(~mu_R -> ~chi_1- 
     .nu_mu)'
      endif
      if(brselrcharnue(2).ne.0.D0) then
      write(nout,102) brselrcharnue(2),2,-ic2,inmu,'BR(~mu_R -> ~chi_2- 
     .nu_mu)'
      endif

      elseif(selrtot2.eq.0.D0) then
      write(nout,99)
      write(nout,100) 2000013,0.000000000E+00,'smuon_R decays'

      endif

c ------------- c
c Stau_1 decays c
c ------------- c

      write(nout,105)

      if(stau1tot2.ne.0.D0) then
      write(nout,99)
      write(nout,100) 1000015,stau1tot2,'stau_1 decays'

      write(nout,101)
      if(brstau1neut(1).ne.0.D0) then
      write(nout,102) brstau1neut(1),2,in1,itau,  'BR(~tau_1 -> ~chi_10 
     . tau-)'
      endif
      if(brstau1neut(2).ne.0.D0) then
      write(nout,102) brstau1neut(2),2,in2,itau,  'BR(~tau_1 -> ~chi_20 
     . tau-)'
      endif
      if(brstau1neut(3).ne.0.D0) then
      write(nout,102) brstau1neut(3),2,in3,itau,  'BR(~tau_1 -> ~chi_30 
     . tau-)'
      endif
      if(brstau1neut(4).ne.0.D0) then
      write(nout,102) brstau1neut(4),2,in4,itau,  'BR(~tau_1 -> ~chi_40 
     . tau-)'
      endif
      if(brstau1char(1).ne.0.D0) then
      write(nout,102) brstau1char(1),2,-ic1,intau,'BR(~tau_1 -> ~chi_1- 
     . nu_tau)'
      endif
      if(brstau1char(2).ne.0.D0) then
      write(nout,102) brstau1char(2),2,-ic2,intau,'BR(~tau_1 -> ~chi_2- 
     . nu_tau)'
      endif
      if(brstau1hcsn(1).ne.0.D0) then
      write(nout,102) brstau1hcsn(1),2,intau1,-ihc,'BR(~tau_1 -> ~nu_tau
     .L H-)'
      endif
      if(brstau1wsn(1).ne.0.D0) then
      write(nout,102) brstau1wsn(1),2,intau1,-iwc,'BR(~tau_1 -> ~nu_tauL
     . W-)'
      endif
      if(flagnlspgmsb.eq.1.D0) then
         if(brstautaugrav.ne.0.D0) then
      write(nout,102) brstautaugrav,2,igrav,itau, 'BR(~tau_1 -> ~G      
     . tau-)'
      endif
      endif

      elseif(stau1tot2.eq.0.D0) then
      write(nout,99)
      write(nout,100) 1000015,0.000000000E+00,'stau_1 decays'

      endif

c ------------- c
c Stau_2 decays c
c ------------- c

      write(nout,105)

      if(stau2tot2.ne.0.D0) then
      write(nout,99)
      write(nout,100) 2000015,stau2tot2,'stau_2 decays'

      write(nout,101)
      if(brstau2neut(1).ne.0.D0) then
      write(nout,102) brstau2neut(1),2,in1,itau,  'BR(~tau_2 -> ~chi_10 
     . tau-)'
      endif
      if(brstau2neut(2).ne.0.D0) then
      write(nout,102) brstau2neut(2),2,in2,itau,  'BR(~tau_2 -> ~chi_20 
     . tau-)'
      endif
      if(brstau2neut(3).ne.0.D0) then
      write(nout,102) brstau2neut(3),2,in3,itau,  'BR(~tau_2 -> ~chi_30 
     . tau-)'
      endif
      if(brstau2neut(4).ne.0.D0) then
      write(nout,102) brstau2neut(4),2,in4,itau,  'BR(~tau_2 -> ~chi_40 
     . tau-)'
      endif
      if(brstau2char(1).ne.0.D0) then
      write(nout,102) brstau2char(1),2,-ic1,intau,'BR(~tau_2 -> ~chi_1- 
     . nu_tau)'
      endif
      if(brstau2char(2).ne.0.D0) then
      write(nout,102) brstau2char(2),2,-ic2,intau,'BR(~tau_2 -> ~chi_2- 
     . nu_tau)'
      endif
      if(brstau2hcsn(1).ne.0.D0) then
      write(nout,102) brstau2hcsn(1),2,intau1,-ihc,'BR(~tau_2 -> ~nu_tau
     .L H-)'
      endif
      if(brstau2wsn(1).ne.0.D0) then
      write(nout,102) brstau2wsn(1),2,intau1,-iwc,'BR(~tau_2 -> ~nu_tauL
     . W-)'
      endif
      if(brstau2hl.ne.0.D0) then
      write(nout,102) brstau2hl,2,istau1,ihl,     'BR(~tau_2 -> ~tau_1
     . h)'
      endif
      if(brstau2hh.ne.0.D0) then
      write(nout,102) brstau2hh,2,istau1,ihh,     'BR(~tau_2 -> ~tau_1
     . H)'
      endif
      if(brstau2ha.ne.0.D0) then
      write(nout,102) brstau2ha,2,istau1,iha,     'BR(~tau_2 -> ~tau_1
     . A)'
      endif
      if(brstau2ztau.ne.0.D0) then
      write(nout,102) brstau2ztau,2,istau1,iz,    'BR(~tau_2 -> ~tau_1
     . Z)'
      endif

      elseif(stau2tot2.eq.0.D0) then
      write(nout,99)
      write(nout,100) 2000015,0.000000000E+00,'stau_2 decays'

      endif

c -------------------- c
c Snu_electronL decays c
c -------------------- c

      write(nout,105)

      if(sneltot2.ne.0.D0) then
      write(nout,99)
      write(nout,100) 1000012,sneltot2,'snu_eL decays'

      write(nout,101)
      if(brsnellneut(1).ne.0.D0) then
      write(nout,102) brsnellneut(1),2,in1,ine, 'BR(~nu_eL -> ~chi_10 nu
     ._e)'
      endif
      if(brsnellneut(2).ne.0.D0) then
      write(nout,102) brsnellneut(2),2,in2,ine, 'BR(~nu_eL -> ~chi_20 nu
     ._e)'
      endif
      if(brsnellneut(3).ne.0.D0) then
      write(nout,102) brsnellneut(3),2,in3,ine, 'BR(~nu_eL -> ~chi_30 nu
     ._e)'
      endif
      if(brsnellneut(4).ne.0.D0) then
      write(nout,102) brsnellneut(4),2,in4,ine, 'BR(~nu_eL -> ~chi_40 nu
     ._e)'
      endif
      if(brsnellchar(1).ne.0.D0) then
      write(nout,102) brsnellchar(1),2,ic1,ie,  'BR(~nu_eL -> ~chi_1+ e-
     .)'
      endif
      if(brsnellchar(2).ne.0.D0) then
      write(nout,102) brsnellchar(2),2,ic2,ie,  'BR(~nu_eL -> ~chi_2+ e-
     .)'
      endif

      elseif(sneltot2.eq.0.D0) then
      write(nout,99)
      write(nout,100) 1000012,0.000000000E+00,'snu_eL decays'

      endif

c ---------------- c
c Snu_muonL decays c
c ---------------- c

      write(nout,105)

      if(sneltot2.ne.0.D0) then
      write(nout,99)
      write(nout,100) 1000014,sneltot2,'snu_muL decays'

      write(nout,101)
      if(brsnellneut(1).ne.0.D0) then
      write(nout,102) brsnellneut(1),2,in1,inmu, 'BR(~nu_muL -> ~chi_10 
     .nu_mu)'
      endif
      if(brsnellneut(2).ne.0.D0) then
      write(nout,102) brsnellneut(2),2,in2,inmu, 'BR(~nu_muL -> ~chi_20 
     .nu_mu)'
      endif
      if(brsnellneut(3).ne.0.D0) then
      write(nout,102) brsnellneut(3),2,in3,inmu, 'BR(~nu_muL -> ~chi_30 
     .nu_mu)'
      endif
      if(brsnellneut(4).ne.0.D0) then
      write(nout,102) brsnellneut(4),2,in4,inmu, 'BR(~nu_muL -> ~chi_40 
     .nu_mu)'
      endif
      if(brsnellchar(1).ne.0.D0) then
      write(nout,102) brsnellchar(1),2,ic1,imu,  'BR(~nu_muL -> ~chi_1+ 
     .mu-)'
      endif
      if(brsnellchar(2).ne.0.D0) then
      write(nout,102) brsnellchar(2),2,ic2,imu,  'BR(~nu_muL -> ~chi_2+ 
     .mu-)'
      endif

      elseif(sneltot2.eq.0.D0) then
      write(nout,99)
      write(nout,100) 1000014,0.000000000E+00,'snu_muL decays'

      endif

c --------------- c
c Snu_tauL decays c
c --------------- c

      write(nout,105)

      if(sntautot2.ne.0.D0) then
      write(nout,99)
      write(nout,100) 1000016,sntautot2,'snu_tauL decays'

      write(nout,101)
      if(brsntauneut(1).ne.0.D0) then
      write(nout,102) brsntauneut(1),2,in1,intau, 'BR(~nu_tauL -> ~chi_1
     .0 nu_tau)'
      endif
      if(brsntauneut(2).ne.0.D0) then
      write(nout,102) brsntauneut(2),2,in2,intau, 'BR(~nu_tauL -> ~chi_2
     .0 nu_tau)'
      endif
      if(brsntauneut(3).ne.0.D0) then
      write(nout,102) brsntauneut(3),2,in3,intau, 'BR(~nu_tauL -> ~chi_3
     .0 nu_tau)'
      endif
      if(brsntauneut(4).ne.0.D0) then
      write(nout,102) brsntauneut(4),2,in4,intau, 'BR(~nu_tauL -> ~chi_4
     .0 nu_tau)'
      endif
      if(brsntauchar(1).ne.0.D0) then
      write(nout,102) brsntauchar(1),2,ic1,itau,  'BR(~nu_tauL -> ~chi_1
     .+ tau-)'
      endif
      if(brsntauchar(2).ne.0.D0) then
      write(nout,102) brsntauchar(2),2,ic2,itau,  'BR(~nu_tauL -> ~chi_2
     .+ tau-)'
      endif
      if(brsntau1hcstau(1).ne.0.D0) then
      write(nout,102) brsntau1hcstau(1),2,-istau1,-ihc,'BR(~nu_tauL -> ~
     .tau_1+ H-)'
      endif
      if(brsntau1hcstau(2).ne.0.D0) then
      write(nout,102) brsntau1hcstau(2),2,-istau2,-ihc,'BR(~nu_tauL -> ~
     .tau_2+ H-)'
      endif
      if(brsntau1wstau(1).ne.0.D0) then
      write(nout,102) brsntau1wstau(1),2,-istau1,-iwc, 'BR(~nu_tauL -> ~
     .tau_1+ W-)'
      endif
      if(brsntau1wstau(2).ne.0.D0) then
      write(nout,102) brsntau1wstau(2),2,-istau2,-iwc, 'BR(~nu_tauL -> ~
     .tau_2+ W-)'
      endif

      elseif(sntautot2.eq.0.D0) then
      write(nout,99)
      write(nout,100) 1000016,0.000000000E+00,'snu_tauL decays'

      endif

c ---------------- c
c chargino1 decays c
c ---------------- c

      do i=1,2,1
         if(chartot2(i).eq.0.D0) then
            flagchartot2(i) = 10.D0
         elseif(chartot2(i).ne.0.D0) then
            flagchartot2(i) = 40.D0
         endif
         flagcondchar(i) = flagchartot2(i)+flagmulti
      end do

      write(nout,105)

      if(flagcondchar(1).eq.10.D0) then
         write(nout,99)
         write(nout,100) 1000024,0.000000000E+00,'chargino1+ decays'
      elseif(flagcondchar(1).eq.40.D0.or.flagcondchar(1).eq.41.D0) then
         write(nout,99)
         write(nout,100) 1000024,chartot2(1),'chargino1+ decays'

      write(nout,101)
      if(brcharsupl(1).ne.0.D0) then
      write(nout,102) brcharsupl(1),2,isul,idb,  'BR(~chi_1+ -> ~u_L  
     . db)'
      endif
      if(brcharsupr(1).ne.0.D0) then
      write(nout,102) brcharsupr(1),2,isur,idb,  'BR(~chi_1+ -> ~u_R  
     . db)'
      endif
      if(brcharsdownl(1).ne.0.D0) then
      write(nout,102) brcharsdownl(1),2,-isdl,iu,'BR(~chi_1+ -> ~d_L* 
     . u )'
      endif
      if(brcharsdownr(1).ne.0.D0) then
      write(nout,102) brcharsdownr(1),2,-isdr,iu,'BR(~chi_1+ -> ~d_R* 
     . u )'
      endif
      if(brcharsupl(1).ne.0.D0) then
      write(nout,102) brcharsupl(1),2,iscl,isb,  'BR(~chi_1+ -> ~c_L  
     . sb)'
      endif
      if(brcharsupr(1).ne.0.D0) then
      write(nout,102) brcharsupr(1),2,iscr,isb,  'BR(~chi_1+ -> ~c_R  
     . sb)'
      endif
      if(brcharsdownl(1).ne.0.D0) then
      write(nout,102) brcharsdownl(1),2,-issl,ic,'BR(~chi_1+ -> ~s_L* 
     . c )'
      endif
      if(brcharsdownr(1).ne.0.D0) then
      write(nout,102) brcharsdownr(1),2,-issr,ic,'BR(~chi_1+ -> ~s_R* 
     . c )'
      endif
      if(brcharst1(1).ne.0.D0) then
      write(nout,102) brcharst1(1),2,ist1,ibb,   'BR(~chi_1+ -> ~t_1  
     . bb)'
      endif
      if(brcharst2(1).ne.0.D0) then
      write(nout,102) brcharst2(1),2,ist2,ibb,   'BR(~chi_1+ -> ~t_2  
     . bb)'
      endif
      if(brcharsb1(1).ne.0.D0) then
      write(nout,102) brcharsb1(1),2,-isb1,it,   'BR(~chi_1+ -> ~b_1* 
     . t )'
      endif
      if(brcharsb2(1).ne.0.D0) then
      write(nout,102) brcharsb2(1),2,-isb2,it,   'BR(~chi_1+ -> ~b_2* 
     . t )'
      endif
      if(brcharsnel(1).ne.0.D0) then
      write(nout,102) brcharsnel(1),2,inel,-ie,  'BR(~chi_1+ -> ~nu_eL 
     . e+  )'
      write(nout,102) brcharsnel(1),2,inmul,-imu,'BR(~chi_1+ -> ~nu_muL 
     . mu+ )'
      endif
      if(brcharsn1(1).ne.0.D0) then
      write(nout,102) brcharsn1(1),2,intau1,-itau,'BR(~chi_1+ -> ~nu_tau
     .1 tau+)'
      endif
      if(brcharsell(1).ne.0.D0) then
      write(nout,102) brcharsell(1),2,-isell,ine,'BR(~chi_1+ -> ~e_L+   
     . nu_e)'
      endif
      if(brcharselr(1).ne.0.D0) then
      write(nout,102) brcharselr(1),2,-iselr,ine,'BR(~chi_1+ -> ~e_R+   
     . nu_e)'
      endif
      if(brcharsell(1).ne.0.D0) then
      write(nout,102) brcharsell(1),2,-ismul,inmu,'BR(~chi_1+ -> ~mu_L+ 
     .  nu_mu)'
      endif
      if(brcharselr(1).ne.0.D0) then
      write(nout,102) brcharselr(1),2,-ismur,inmu,'BR(~chi_1+ -> ~mu_R+ 
     .  nu_mu)'
      endif
      if(brcharstau1(1).ne.0.D0) then
      write(nout,102) brcharstau1(1),2,-istau1,intau,'BR(~chi_1+ -> ~tau
     ._1+  nu_tau)'
      endif
      if(brcharstau2(1).ne.0.D0) then
      write(nout,102) brcharstau2(1),2,-istau2,intau,'BR(~chi_1+ -> ~tau
     ._2+  nu_tau)'
      endif
      if(brcharwneut(1,1).ne.0.D0) then
      write(nout,102) brcharwneut(1,1),2,in1,iwc,    'BR(~chi_1+ -> ~chi
     ._10  W+)'
      endif
      if(brcharwneut(1,2).ne.0.D0) then
      write(nout,102) brcharwneut(1,2),2,in2,iwc,    'BR(~chi_1+ -> ~chi
     ._20  W+)'
      endif
      if(brcharwneut(1,3).ne.0.D0) then
      write(nout,102) brcharwneut(1,3),2,in3,iwc,    'BR(~chi_1+ -> ~chi
     ._30  W+)'
      endif
      if(brcharwneut(1,4).ne.0.D0) then
      write(nout,102) brcharwneut(1,4),2,in4,iwc,    'BR(~chi_1+ -> ~chi
     ._40  W+)'
      endif
      if(brcharhcneut(1,1).ne.0.D0) then
      write(nout,102) brcharhcneut(1,1),2,in1,ihc,   'BR(~chi_1+ -> ~chi
     ._10  H+)'
      endif
      if(brcharhcneut(1,2).ne.0.D0) then
      write(nout,102) brcharhcneut(1,2),2,in2,ihc,   'BR(~chi_1+ -> ~chi
     ._20  H+)'
      endif
      if(brcharhcneut(1,3).ne.0.D0) then
      write(nout,102) brcharhcneut(1,3),2,in3,ihc,   'BR(~chi_1+ -> ~chi
     ._30  H+)'
      endif
      if(brcharhcneut(1,4).ne.0.D0) then
      write(nout,102) brcharhcneut(1,4),2,in4,ihc,   'BR(~chi_1+ -> ~chi
     ._40  H+)'
      endif
      if(flagnlspgmsb.eq.1.D0) then
         if(brcharwgravitino(1).ne.0.D0) then
      write(nout,102) brcharwgravitino(1),2,igrav,iwc, 'BR(~chi_1+ -> ~G
     .       W+)'
      endif
         if(brcharhcgravitino(1).ne.0.D0) then
      write(nout,102) brcharhcgravitino(1),2,igrav,ihc,'BR(~chi_1+ -> ~G
     .       H+)'
      endif
      endif

      elseif(flagcondchar(1).eq.11.D0) then
         if(chartot(1).ne.0.D0) then
            write(nout,99)
            write(nout,100) 1000024,chartot(1),'chargino1+ decays'

c
      if(flagnlspgmsb.eq.1.D0) then
      write(nout,101)
         if(brcharwgravitino(1).ne.0.D0) then
      write(nout,102) brcharwgravitino(1),2,igrav,iwc, 'BR(~chi_1+ -> ~G
     .       W+)'
      endif
         if(brcharhcgravitino(1).ne.0.D0) then
      write(nout,102) brcharhcgravitino(1),2,igrav,ihc,'BR(~chi_1+ -> ~G
     .       H+)'
      endif
      endif
c
      if(flagchar3bod(1).eq.1.D0) then
         write(nout,103)
      endif
      if(brnupdb(1,1).ne.0.D0) then
      write(nout,104) brnupdb(1,1),3,in1,iu,idb,     'BR(~chi_1+ -> ~chi
     ._10 u    db)'
      endif
      if(brnupdb(1,2).ne.0.D0) then
      write(nout,104) brnupdb(1,2),3,in2,iu,idb,     'BR(~chi_1+ -> ~chi
     ._20 u    db)'
      endif
      if(brnupdb(1,3).ne.0.D0) then
      write(nout,104) brnupdb(1,3),3,in3,iu,idb,     'BR(~chi_1+ -> ~chi
     ._30 u    db)'
      endif
      if(brnupdb(1,4).ne.0.D0) then
      write(nout,104) brnupdb(1,4),3,in4,iu,idb,     'BR(~chi_1+ -> ~chi
     ._40 u    db)'
      endif
      if(brnupdb(1,1).ne.0.D0) then
      write(nout,104) brnupdb(1,1),3,in1,ic,isb,     'BR(~chi_1+ -> ~chi
     ._10 c    sb)'
      endif
      if(brnupdb(1,2).ne.0.D0) then
      write(nout,104) brnupdb(1,2),3,in2,ic,isb,     'BR(~chi_1+ -> ~chi
     ._20 c    sb)'
      endif
      if(brnupdb(1,3).ne.0.D0) then
      write(nout,104) brnupdb(1,3),3,in3,ic,isb,     'BR(~chi_1+ -> ~chi
     ._30 c    sb)'
      endif
      if(brnupdb(1,4).ne.0.D0) then
      write(nout,104) brnupdb(1,4),3,in4,ic,isb,     'BR(~chi_1+ -> ~chi
     ._40 c    sb)'
      endif
      if(brntopbb(1,1).ne.0.D0) then
      write(nout,104) brntopbb(1,1),3,in1,it,ibb,    'BR(~chi_1+ -> ~chi
     ._10 t    bb)'
      endif
      if(brntopbb(1,2).ne.0.D0) then
      write(nout,104) brntopbb(1,2),3,in2,it,ibb,    'BR(~chi_1+ -> ~chi
     ._20 t    bb)'
      endif
      if(brntopbb(1,3).ne.0.D0) then
      write(nout,104) brntopbb(1,3),3,in3,it,ibb,    'BR(~chi_1+ -> ~chi
     ._30 t    bb)'
      endif
      if(brntopbb(1,4).ne.0.D0) then
      write(nout,104) brntopbb(1,4),3,in4,it,ibb,    'BR(~chi_1+ -> ~chi
     ._40 t    bb)'
      endif
      if(brnelnue(1,1).ne.0.D0) then
      write(nout,104) brnelnue(1,1),3,in1,-ie,ine,   'BR(~chi_1+ -> ~chi
     ._10 e+   nu_e)'
      endif
      if(brnelnue(1,2).ne.0.D0) then
      write(nout,104) brnelnue(1,2),3,in2,-ie,ine,   'BR(~chi_1+ -> ~chi
     ._20 e+   nu_e)'
      endif
      if(brnelnue(1,3).ne.0.D0) then
      write(nout,104) brnelnue(1,3),3,in3,-ie,ine,   'BR(~chi_1+ -> ~chi
     ._30 e+   nu_e)'
      endif
      if(brnelnue(1,4).ne.0.D0) then
      write(nout,104) brnelnue(1,4),3,in4,-ie,ine,   'BR(~chi_1+ -> ~chi
     ._40 e+   nu_e)'
      endif
      if(brnmunumu(1,1).ne.0.D0) then
      write(nout,104) brnmunumu(1,1),3,in1,-imu,inmu,'BR(~chi_1+ -> ~chi
     ._10 mu+  nu_mu)'
      endif
      if(brnmunumu(1,2).ne.0.D0) then
      write(nout,104) brnmunumu(1,2),3,in2,-imu,inmu,'BR(~chi_1+ -> ~chi
     ._20 mu+  nu_mu)'
      endif
      if(brnmunumu(1,3).ne.0.D0) then
      write(nout,104) brnmunumu(1,3),3,in3,-imu,inmu,'BR(~chi_1+ -> ~chi
     ._30 mu+  nu_mu)'
      endif
      if(brnmunumu(1,4).ne.0.D0) then
      write(nout,104) brnmunumu(1,4),3,in4,-imu,inmu,'BR(~chi_1+ -> ~chi
     ._40 mu+  nu_mu)'
      endif
      if(brntaunut(1,1).ne.0.D0) then
      write(nout,104) brntaunut(1,1),3,in1,-itau,intau,'BR(~chi_1+ -> ~c
     .hi_10 tau+ nu_tau)'
      endif
      if(brntaunut(1,2).ne.0.D0) then
      write(nout,104) brntaunut(1,2),3,in2,-itau,intau,'BR(~chi_1+ -> ~c
     .hi_20 tau+ nu_tau)'
      endif
      if(brntaunut(1,3).ne.0.D0) then
      write(nout,104) brntaunut(1,3),3,in3,-itau,intau,'BR(~chi_1+ -> ~c
     .hi_30 tau+ nu_tau)'
      endif
      if(brntaunut(1,4).ne.0.D0) then
      write(nout,104) brntaunut(1,4),3,in4,-itau,intau,'BR(~chi_1+ -> ~c
     .hi_40 tau+ nu_tau)'
      endif
      if(brglupdb(1).ne.0.D0) then
      write(nout,104) brglupdb(1),3,iglo,iu,idb,       'BR(~chi_1+ -> ~g
     .      u    db)'
      endif
      if(brglchsb(1).ne.0.D0) then
      write(nout,104) brglchsb(1),3,iglo,ic,isb,       'BR(~chi_1+ -> ~g
     .      c    sb)'
      endif
      if(brgltopbb(1).ne.0.D0) then
      write(nout,104) brgltopbb(1),3,iglo,it,ibb,      'BR(~chi_1+ -> ~g
     .      t    bb)'
      endif

      elseif(chartot(1).eq.0.D0) then
      write(nout,99)
      write(nout,100) 1000024,0.000000000E+00,'chargino1+ decays'
      endif
      endif

c ---------------- c
c chargino2 decays c
c ---------------- c

      write(nout,105)

      if(flagcondchar(2).eq.10.D0) then
         write(nout,99)
         write(nout,100) 1000037,0.000000000E+00,'chargino2+ decays'
      elseif(flagcondchar(2).eq.40.D0.or.flagcondchar(2).eq.41.D0) then
         write(nout,99)
         write(nout,100) 1000037,chartot2(2),'chargino2+ decays'

      write(nout,101)
      if(brcharsupl(2).ne.0.D0) then
      write(nout,102) brcharsupl(2),2,isul,idb,  'BR(~chi_2+ -> ~u_L  
     . db)'
      endif
      if(brcharsupr(2).ne.0.D0) then
      write(nout,102) brcharsupr(2),2,isur,idb,  'BR(~chi_2+ -> ~u_R  
     . db)'
      endif
      if(brcharsdownl(2).ne.0.D0) then
      write(nout,102) brcharsdownl(2),2,-isdl,iu,'BR(~chi_2+ -> ~d_L* 
     . u )'
      endif
      if(brcharsdownr(2).ne.0.D0) then
      write(nout,102) brcharsdownr(2),2,-isdr,iu,'BR(~chi_2+ -> ~d_R* 
     . u )'
      endif
      if(brcharsupl(2).ne.0.D0) then
      write(nout,102) brcharsupl(2),2,iscl,isb,  'BR(~chi_2+ -> ~c_L  
     . sb)'
      endif
      if(brcharsupr(2).ne.0.D0) then
      write(nout,102) brcharsupr(2),2,iscr,isb,  'BR(~chi_2+ -> ~c_R  
     . sb)'
      endif
      if(brcharsdownl(2).ne.0.D0) then
      write(nout,102) brcharsdownl(2),2,-issl,ic,'BR(~chi_2+ -> ~s_L* 
     . c )'
      endif
      if(brcharsdownr(2).ne.0.D0) then
      write(nout,102) brcharsdownr(2),2,-issr,ic,'BR(~chi_2+ -> ~s_R* 
     . c )'
      endif
      if(brcharst1(2).ne.0.D0) then
      write(nout,102) brcharst1(2),2,ist1,ibb,   'BR(~chi_2+ -> ~t_1  
     . bb)'
      endif
      if(brcharst2(2).ne.0.D0) then
      write(nout,102) brcharst2(2),2,ist2,ibb,   'BR(~chi_2+ -> ~t_2  
     . bb)'
      endif
      if(brcharsb1(2).ne.0.D0) then
      write(nout,102) brcharsb1(2),2,-isb1,it,   'BR(~chi_2+ -> ~b_1* 
     . t )'
      endif
      if(brcharsb2(2).ne.0.D0) then
      write(nout,102) brcharsb2(2),2,-isb2,it,   'BR(~chi_2+ -> ~b_2* 
     . t )'
      endif
      if(brcharsnel(2).ne.0.D0) then
      write(nout,102) brcharsnel(2),2,inel,-ie,  'BR(~chi_2+ -> ~nu_eL 
     . e+  )'
      write(nout,102) brcharsnel(2),2,inmul,-imu,'BR(~chi_2+ -> ~nu_muL 
     . mu+ )'
      endif
      if(brcharsn1(2).ne.0.D0) then
      write(nout,102) brcharsn1(2),2,intau1,-itau,'BR(~chi_2+ -> ~nu_tau
     .1 tau+)'
      endif
      if(brcharsell(2).ne.0.D0) then
      write(nout,102) brcharsell(2),2,-isell,ine,'BR(~chi_2+ -> ~e_L+   
     . nu_e)'
      endif
      if(brcharselr(2).ne.0.D0) then
      write(nout,102) brcharselr(2),2,-iselr,ine,'BR(~chi_2+ -> ~e_R+   
     . nu_e)'
      endif
      if(brcharsell(2).ne.0.D0) then
      write(nout,102) brcharsell(2),2,-ismul,inmu,'BR(~chi_2+ -> ~mu_L+ 
     .  nu_mu)'
      endif
      if(brcharselr(2).ne.0.D0) then
      write(nout,102) brcharselr(2),2,-ismur,inmu,'BR(~chi_2+ -> ~mu_R+ 
     .  nu_mu)'
      endif
      if(brcharstau1(2).ne.0.D0) then
      write(nout,102) brcharstau1(2),2,-istau1,intau,'BR(~chi_2+ -> ~tau
     ._1+  nu_tau)'
      endif
      if(brcharstau2(2).ne.0.D0) then
      write(nout,102) brcharstau2(2),2,-istau2,intau,'BR(~chi_2+ -> ~tau
     ._2+  nu_tau)'
      endif
      if(brcharzchic.ne.0.D0) then
      write(nout,102) brcharzchic,2,ic1,iz          ,'BR(~chi_2+ -> ~chi
     ._1+  Z )' 
      endif
      if(brcharwneut(2,1).ne.0.D0) then
      write(nout,102) brcharwneut(2,1),2,in1,iwc,    'BR(~chi_2+ -> ~chi
     ._10  W+)'
      endif
      if(brcharwneut(2,2).ne.0.D0) then
      write(nout,102) brcharwneut(2,2),2,in2,iwc,    'BR(~chi_2+ -> ~chi
     ._20  W+)'
      endif
      if(brcharwneut(2,3).ne.0.D0) then
      write(nout,102) brcharwneut(2,3),2,in3,iwc,    'BR(~chi_2+ -> ~chi
     ._30  W+)'
      endif
      if(brcharwneut(2,4).ne.0.D0) then
      write(nout,102) brcharwneut(2,4),2,in4,iwc,    'BR(~chi_2+ -> ~chi
     ._40  W+)'
      endif
      if(brcharhlchic.ne.0.D0) then
      write(nout,102) brcharhlchic,2,ic1,ihl,        'BR(~chi_2+ -> ~chi
     ._1+  h )'
      endif
      if(brcharhhchic.ne.0.D0) then
      write(nout,102) brcharhhchic,2,ic1,ihh,        'BR(~chi_2+ -> ~chi
     ._1+  H )'
      endif
      if(brcharhachic.ne.0.D0) then
      write(nout,102) brcharhachic,2,ic1,iha,        'BR(~chi_2+ -> ~chi
     ._1+  A )'
      endif
      if(brcharhcneut(2,1).ne.0.D0) then
      write(nout,102) brcharhcneut(2,1),2,in1,ihc,   'BR(~chi_2+ -> ~chi
     ._10  H+)'
      endif
      if(brcharhcneut(2,2).ne.0.D0) then
      write(nout,102) brcharhcneut(2,2),2,in2,ihc,   'BR(~chi_2+ -> ~chi
     ._20  H+)'
      endif
      if(brcharhcneut(2,3).ne.0.D0) then
      write(nout,102) brcharhcneut(2,3),2,in3,ihc,   'BR(~chi_2+ -> ~chi
     ._30  H+)'
      endif
      if(brcharhcneut(2,4).ne.0.D0) then
      write(nout,102) brcharhcneut(2,4),2,in4,ihc,   'BR(~chi_2+ -> ~chi
     ._40  H+)'
      endif
      if(flagnlspgmsb.eq.1.D0) then
         if(brcharwgravitino(2).ne.0.D0) then
      write(nout,102) brcharwgravitino(2),2,igrav,iwc, 'BR(~chi_2+ -> ~G
     .       W+)'
      endif
         if(brcharhcgravitino(2).ne.0.D0) then
      write(nout,102) brcharhcgravitino(2),2,igrav,ihc,'BR(~chi_2+ -> ~G
     .       H+)'
      endif
      endif

      elseif(flagcondchar(2).eq.11.D0) then
         if(chartot(2).ne.0.D0) then
            write(nout,99)
            write(nout,100) 1000037,chartot(2),'chargino2+ decays'
c
      if(flagnlspgmsb.eq.1.D0) then
      write(nout,101)
         if(brcharwgravitino(2).ne.0.D0) then
      write(nout,102) brcharwgravitino(2),2,igrav,iwc, 'BR(~chi_2+ -> ~G
     .       W+)'
      endif
         if(brcharhcgravitino(2).ne.0.D0) then
      write(nout,102) brcharhcgravitino(2),2,igrav,ihc,'BR(~chi_2+ -> ~G
     .       H+)'
      endif
      endif
c
      if(flagchar3bod(2).eq.1.D0) then
         write(nout,103)
      endif
      if(brnupdb(2,1).ne.0.D0) then
      write(nout,104) brnupdb(2,1),3,in1,iu,idb,     'BR(~chi_2+ -> ~chi
     ._10 u    db)'
      endif
      if(brnupdb(2,2).ne.0.D0) then
      write(nout,104) brnupdb(2,2),3,in2,iu,idb,     'BR(~chi_2+ -> ~chi
     ._20 u    db)'
      endif
      if(brnupdb(2,3).ne.0.D0) then
      write(nout,104) brnupdb(2,3),3,in3,iu,idb,     'BR(~chi_2+ -> ~chi
     ._30 u    db)'
      endif
      if(brnupdb(2,4).ne.0.D0) then
      write(nout,104) brnupdb(2,4),3,in4,iu,idb,     'BR(~chi_2+ -> ~chi
     ._40 u    db)'
      endif
      if(brnupdb(2,1).ne.0.D0) then
      write(nout,104) brnupdb(2,1),3,in1,ic,isb,     'BR(~chi_2+ -> ~chi
     ._10 c    sb)'
      endif
      if(brnupdb(2,2).ne.0.D0) then
      write(nout,104) brnupdb(2,2),3,in2,ic,isb,     'BR(~chi_2+ -> ~chi
     ._20 c    sb)'
      endif
      if(brnupdb(2,3).ne.0.D0) then
      write(nout,104) brnupdb(2,3),3,in3,ic,isb,     'BR(~chi_2+ -> ~chi
     ._30 c    sb)'
      endif
      if(brnupdb(2,4).ne.0.D0) then
      write(nout,104) brnupdb(2,4),3,in4,ic,isb,     'BR(~chi_2+ -> ~chi
     ._40 c    sb)'
      endif
      if(brntopbb(2,1).ne.0.D0) then
      write(nout,104) brntopbb(2,1),3,in1,it,ibb,    'BR(~chi_2+ -> ~chi
     ._10 t    bb)'
      endif
      if(brntopbb(2,2).ne.0.D0) then
      write(nout,104) brntopbb(2,2),3,in2,it,ibb,    'BR(~chi_2+ -> ~chi
     ._20 t    bb)'
      endif
      if(brntopbb(2,3).ne.0.D0) then
      write(nout,104) brntopbb(2,3),3,in3,it,ibb,    'BR(~chi_2+ -> ~chi
     ._30 t    bb)'
      endif
      if(brntopbb(2,4).ne.0.D0) then
      write(nout,104) brntopbb(2,4),3,in4,it,ibb,    'BR(~chi_2+ -> ~chi
     ._40 t    bb)'
      endif
      if(brnelnue(2,1).ne.0.D0) then
      write(nout,104) brnelnue(2,1),3,in1,-ie,ine,   'BR(~chi_2+ -> ~chi
     ._10 e+   nu_e)'
      endif
      if(brnelnue(2,2).ne.0.D0) then
      write(nout,104) brnelnue(2,2),3,in2,-ie,ine,   'BR(~chi_2+ -> ~chi
     ._20 e+   nu_e)'
      endif
      if(brnelnue(2,3).ne.0.D0) then
      write(nout,104) brnelnue(2,3),3,in3,-ie,ine,   'BR(~chi_2+ -> ~chi
     ._30 e+   nu_e)'
      endif
      if(brnelnue(2,4).ne.0.D0) then
      write(nout,104) brnelnue(2,4),3,in4,-ie,ine,   'BR(~chi_2+ -> ~chi
     ._40 e+   nu_e)'
      endif
      if(brnmunumu(2,1).ne.0.D0) then
      write(nout,104) brnmunumu(2,1),3,in1,-imu,inmu,'BR(~chi_2+ -> ~chi
     ._10 mu+  nu_mu)'
      endif
      if(brnmunumu(2,2).ne.0.D0) then
      write(nout,104) brnmunumu(2,2),3,in2,-imu,inmu,'BR(~chi_2+ -> ~chi
     ._20 mu+  nu_mu)'
      endif
      if(brnmunumu(2,3).ne.0.D0) then
      write(nout,104) brnmunumu(2,3),3,in3,-imu,inmu,'BR(~chi_2+ -> ~chi
     ._30 mu+  nu_mu)'
      endif
      if(brnmunumu(2,4).ne.0.D0) then
      write(nout,104) brnmunumu(2,4),3,in4,-imu,inmu,'BR(~chi_2+ -> ~chi
     ._40 mu+  nu_mu)'
      endif
      if(brntaunut(2,1).ne.0.D0) then
      write(nout,104) brntaunut(2,1),3,in1,-itau,intau,'BR(~chi_2+ -> ~c
     .hi_10 tau+ nu_tau)'
      endif
      if(brntaunut(2,2).ne.0.D0) then
      write(nout,104) brntaunut(2,2),3,in2,-itau,intau,'BR(~chi_2+ -> ~c
     .hi_20 tau+ nu_tau)'
      endif
      if(brntaunut(2,3).ne.0.D0) then
      write(nout,104) brntaunut(2,3),3,in3,-itau,intau,'BR(~chi_2+ -> ~c
     .hi_30 tau+ nu_tau)'
      endif
      if(brntaunut(2,4).ne.0.D0) then
      write(nout,104) brntaunut(2,4),3,in4,-itau,intau,'BR(~chi_2+ -> ~c
     .hi_40 tau+ nu_tau)'
      endif
      if(brchupup.ne.0.D0) then
      write(nout,104) brchupup,3,ic1,iu,iub,           'BR(~chi_2+ -> ~c
     .hi_1+ u    ub)'
      endif
      if(brchdodo.ne.0.D0) then
      write(nout,104) brchdodo,3,ic1,id,idb,           'BR(~chi_2+ -> ~c
     .hi_1+ d    db)'
      endif
      if(brchchch.ne.0.D0) then
      write(nout,104) brchchch,3,ic1,ic,icb,           'BR(~chi_2+ -> ~c
     .hi_1+ c    cb)'
      endif
      if(brchstst.ne.0.D0) then
      write(nout,104) brchstst,3,ic1,is,isb,           'BR(~chi_2+ -> ~c
     .hi_1+ s    sb)'
      endif
      if(brchtoptop.ne.0.D0) then
      write(nout,104) brchtoptop,3,ic1,it,itb,         'BR(~chi_2+ -> ~c
     .hi_1+ t    tb)'
      endif
      if(brchbotbot.ne.0.D0) then
      write(nout,104) brchbotbot,3,ic1,ib,ibb,         'BR(~chi_2+ -> ~c
     .hi_1+ b    bb)'
      endif
      if(brchee.ne.0.D0) then
      write(nout,104) brchee,3,ic1,-ie,ie,             'BR(~chi_2+ -> ~c
     .hi_1+ e+   e-)'
      endif
      if(brchmumu.ne.0.D0) then
      write(nout,104) brchmumu,3,ic1,-imu,imu,         'BR(~chi_2+ -> ~c
     .hi_1+ mu+  mu-)'
      endif
      if(brchtautau.ne.0.D0) then
      write(nout,104) brchtautau,3,ic1,-itau,itau,     'BR(~chi_2+ -> ~c
     .hi_1+ tau+ tau-)'
      endif
      if(brchnene.ne.0.D0) then
      write(nout,104) brchnene,3,ic1,ine,-ine,         'BR(~chi_2+ -> ~c
     .hi_1+ nu_e   nu_eb)'
      endif
      if(brchnmunmu.ne.0.D0) then
      write(nout,104) brchnmunmu,3,ic1,inmu,-inmu,     'BR(~chi_2+ -> ~c
     .hi_1+ nu_mu  nu_mub)'
      endif
      if(brchntauntau.ne.0.D0) then
      write(nout,104) brchntauntau,3,ic1,intau,-intau, 'BR(~chi_2+ -> ~c
     .hi_1+ nu_tau nu_taub)'
      endif
      if(brglupdb(2).ne.0.D0) then
      write(nout,104) brglupdb(2),3,iglo,iu,idb,       'BR(~chi_2+ -> ~g
     .      u    db)'
      endif
      if(brglchsb(2).ne.0.D0) then
      write(nout,104) brglchsb(2),3,iglo,ic,isb,       'BR(~chi_2+ -> ~g
     .      c    sb)'
      endif
      if(brgltopbb(2).ne.0.D0) then
      write(nout,104) brgltopbb(2),3,iglo,it,ibb,      'BR(~chi_2+ -> ~g
     .      t    bb)'
      endif

      elseif(chartot(2).eq.0.D0) then
         write(nout,99)
         write(nout,100) 1000037,0.000000000E+00,'chargino2+ decays'
      endif
      endif

c ------------------ c
c neutralino1 decays c
c ------------------ c

      flagmultiloop = flagmulti+flagloop
      do i=1,4,1
         if(neuttot2(i).eq.0.D0) then
            flagneuttot2(i) = 10.D0
         elseif(neuttot2(i).ne.0.D0) then
            flagneuttot2(i) = 40.D0
         endif
         flagcondneut(i) = flagneuttot2(i)+flagmultiloop
      end do

      flagcondneut(1) = flagneuttot2(1)+flagmulti

      write(nout,105)

      if(flagcondneut(1).eq.10.D0) then
         write(nout,99)
         write(nout,100) 1000022,0.000000000E+00,'neutralino1 decays'
      elseif(flagcondneut(1).eq.40.D0.or.flagcondneut(1).eq.41.D0) then
         write(nout,99)
         write(nout,100) 1000022,neuttot2(1),'neutralino1 decays'

      write(nout,101)
      if(brneutwchar(1,1).ne.0.D0) then
      write(nout,102) brneutwchar(1,1),2,ic1,-iwc,     'BR(~chi_10 -> ~c
     .hi_1+   W-)'
      write(nout,102) brneutwchar(1,1),2,-ic1,iwc,     'BR(~chi_10 -> ~c
     .hi_1-   W+)'
      endif
      if(brneutwchar(1,2).ne.0.D0) then
      write(nout,102) brneutwchar(1,2),2,ic2,-iwc,     'BR(~chi_10 -> ~c
     .hi_2+   W-)'
      write(nout,102) brneutwchar(1,2),2,-ic2,iwc,     'BR(~chi_10 -> ~c
     .hi_2-   W+)'
      endif
      if(brneuthcchar(1,1).ne.0.D0) then
      write(nout,102) brneuthcchar(1,1),2,ic1,-ihc,    'BR(~chi_10 -> ~c
     .hi_1+   H-)'
      write(nout,102) brneuthcchar(1,1),2,-ic1,ihc,    'BR(~chi_10 -> ~c
     .hi_1-   H+)'
      endif
      if(brneuthcchar(1,2).ne.0.D0) then
      write(nout,102) brneuthcchar(1,2),2,ic2,-ihc,    'BR(~chi_10 -> ~c
     .hi_2+   H-)'
      write(nout,102) brneuthcchar(1,2),2,-ic2,ihc,    'BR(~chi_10 -> ~c
     .hi_2-   H+)'
      endif
      if(brneutsupl(1).ne.0.D0) then
      write(nout,102) brneutsupl(1),2,isul,iub,        'BR(~chi_10 -> ~u
     ._L      ub)'
      write(nout,102) brneutsupl(1),2,-isul,iu,        'BR(~chi_10 -> ~u
     ._L*     u )'
      endif
      if(brneutsupr(1).ne.0.D0) then
      write(nout,102) brneutsupr(1),2,isur,iub,        'BR(~chi_10 -> ~u
     ._R      ub)'
      write(nout,102) brneutsupr(1),2,-isur,iu,        'BR(~chi_10 -> ~u
     ._R*     u )'
      endif
      if(brneutsdownl(1).ne.0.D0) then
      write(nout,102) brneutsdownl(1),2,isdl,idb,      'BR(~chi_10 -> ~d
     ._L      db)'
      write(nout,102) brneutsdownl(1),2,-isdl,id,      'BR(~chi_10 -> ~d
     ._L*     d )'
      endif
      if(brneutsdownr(1).ne.0.D0) then
      write(nout,102) brneutsdownr(1),2,isdr,idb,      'BR(~chi_10 -> ~d
     ._R      db)'
      write(nout,102) brneutsdownr(1),2,-isdr,id,      'BR(~chi_10 -> ~d
     ._R*     d )'
      endif
      if(brneutsupl(1).ne.0.D0) then
      write(nout,102) brneutsupl(1),2,iscl,icb,        'BR(~chi_10 -> ~c
     ._L      cb)'
      write(nout,102) brneutsupl(1),2,-iscl,ic,        'BR(~chi_10 -> ~c
     ._L*     c )'
      endif
      if(brneutsupr(1).ne.0.D0) then
      write(nout,102) brneutsupr(1),2,iscr,icb,        'BR(~chi_10 -> ~c
     ._R      cb)'
      write(nout,102) brneutsupr(1),2,-iscr,ic,        'BR(~chi_10 -> ~c
     ._R*     c )'
      endif
      if(brneutsdownl(1).ne.0.D0) then
      write(nout,102) brneutsdownl(1),2,issl,isb,      'BR(~chi_10 -> ~s
     ._L      sb)'
      write(nout,102) brneutsdownl(1),2,-issl,is,      'BR(~chi_10 -> ~s
     ._L*     s )'
      endif
      if(brneutsdownr(1).ne.0.D0) then
      write(nout,102) brneutsdownr(1),2,issr,isb,      'BR(~chi_10 -> ~s
     ._R      sb)'
      write(nout,102) brneutsdownr(1),2,-issr,is,      'BR(~chi_10 -> ~s
     ._R*     s )'
      endif
      if(brneutst1(1).ne.0.D0) then
      write(nout,102) brneutst1(1),2,ist1,itb,         'BR(~chi_10 -> ~t
     ._1      tb)'
      write(nout,102) brneutst1(1),2,-ist1,it,         'BR(~chi_10 -> ~t
     ._1*     t )'
      endif
      if(brneutst2(1).ne.0.D0) then
      write(nout,102) brneutst2(1),2,ist2,itb,         'BR(~chi_10 -> ~t
     ._2      tb)'
      write(nout,102) brneutst2(1),2,-ist2,it,         'BR(~chi_10 -> ~t
     ._2*     t )'
      endif
      if(brneutsb1(1).ne.0.D0) then
      write(nout,102) brneutsb1(1),2,isb1,ibb,         'BR(~chi_10 -> ~b
     ._1      bb)'
      write(nout,102) brneutsb1(1),2,-isb1,ib,         'BR(~chi_10 -> ~b
     ._1*     b )'
      endif
      if(brneutsb2(1).ne.0.D0) then
      write(nout,102) brneutsb2(1),2,isb2,ibb,         'BR(~chi_10 -> ~b
     ._2      bb)'
      write(nout,102) brneutsb2(1),2,-isb2,ib,         'BR(~chi_10 -> ~b
     ._2*     b )'
      endif
      if(brneutsell(1).ne.0.D0) then
      write(nout,102) brneutsell(1),2,isell,-ie,       'BR(~chi_10 -> ~e
     ._L-     e+)'
      write(nout,102) brneutsell(1),2,-isell,ie,       'BR(~chi_10 -> ~e
     ._L+     e-)'
      endif
      if(brneutselr(1).ne.0.D0) then
      write(nout,102) brneutselr(1),2,iselr,-ie,       'BR(~chi_10 -> ~e
     ._R-     e+)'
      write(nout,102) brneutselr(1),2,-iselr,ie,       'BR(~chi_10 -> ~e
     ._R+     e-)'
      endif
      if(brneutsell(1).ne.0.D0) then
      write(nout,102) brneutsell(1),2,ismul,-imu,      'BR(~chi_10 -> ~m
     .u_L-    mu+)' 
      write(nout,102) brneutsell(1),2,-ismul,imu,      'BR(~chi_10 -> ~m
     .u_L+    mu-)' 
      endif
      if(brneutselr(1).ne.0.D0) then
      write(nout,102) brneutselr(1),2,ismur,-imu,      'BR(~chi_10 -> ~m
     .u_R-    mu+)' 
      write(nout,102) brneutselr(1),2,-ismur,imu,      'BR(~chi_10 -> ~m
     .u_R+    mu-)'
      endif
      if(brneutstau1(1).ne.0.D0) then
      write(nout,102) brneutstau1(1),2,istau1,-itau,   'BR(~chi_10 -> ~t
     .au_1-   tau+)'
      write(nout,102) brneutstau1(1),2,-istau1,itau,   'BR(~chi_10 -> ~t
     .au_1+   tau-)'
      endif
      if(brneutstau2(1).ne.0.D0) then
      write(nout,102) brneutstau2(1),2,istau2,-itau,   'BR(~chi_10 -> ~t
     .au_2-   tau+)'
      write(nout,102) brneutstau2(1),2,-istau2,itau,   'BR(~chi_10 -> ~t
     .au_2+   tau-)'
      endif
      if(brneutsnel(1).ne.0.D0) then
      write(nout,102) brneutsnel(1),2,inel,-ine,       'BR(~chi_10 -> ~n
     .u_eL    nu_eb)'
      write(nout,102) brneutsnel(1),2,-inel,ine,       'BR(~chi_10 -> ~n
     .u_eL*   nu_e )'
      write(nout,102) brneutsnel(1),2,inmul,-inmu,     'BR(~chi_10 -> ~n
     .u_muL   nu_mub)'
      write(nout,102) brneutsnel(1),2,-inmul,inmu,     'BR(~chi_10 -> ~n
     .u_muL*  nu_mu )'
      endif
      if(brneutsn1(1).ne.0.D0) then
      write(nout,102) brneutsn1(1),2,intau1,-intau,    'BR(~chi_10 -> ~n
     .u_tau1  nu_taub)'
      write(nout,102) brneutsn1(1),2,-intau1,intau,    'BR(~chi_10 -> ~n
     .u_tau1* nu_tau )'
      endif
      if(flagnlspgmsb.eq.1.D0) then
         if(brneutgamgrav(1).ne.0.D0) then
      write(nout,102) brneutgamgrav(1),2,igrav,iga,    'BR(~chi_10 -> ~G
     .        gam)'
      endif
      if(brneutzgrav(1).ne.0.D0) then
      write(nout,102) brneutzgrav(1),2,igrav,iz,       'BR(~chi_10 -> ~G
     .        Z)'
      endif
      if(brneuthlgrav(1).ne.0.D0) then
      write(nout,102) brneuthlgrav(1),2,igrav,ihl,     'BR(~chi_10 -> ~G
     .        h)'
      endif
      if(brneuthhgrav(1).ne.0.D0) then
      write(nout,102) brneuthhgrav(1),2,igrav,ihh,     'BR(~chi_10 -> ~G
     .        H)'
      endif
      if(brneuthagrav(1).ne.0.D0) then
      write(nout,102) brneuthagrav(1),2,igrav,iha,     'BR(~chi_10 -> ~G
     .        A)'
      endif
      endif

      elseif(flagcondneut(1).eq.11.D0) then
         if(neuttot(1).ne.0.D0) then
            write(nout,99)
            write(nout,100) 1000022,neuttot(1),'neutralino1 decays'
c
      if(flagnlspgmsb.eq.1.D0) then
      write(nout,101)
         if(brneutgamgrav(1).ne.0.D0) then
      write(nout,102) brneutgamgrav(1),2,igrav,iga,    'BR(~chi_10 -> ~G
     .        gam)'
      endif
      if(brneutzgrav(1).ne.0.D0) then
      write(nout,102) brneutzgrav(1),2,igrav,iz,       'BR(~chi_10 -> ~G
     .        Z)'
      endif
      if(brneuthlgrav(1).ne.0.D0) then
      write(nout,102) brneuthlgrav(1),2,igrav,ihl,     'BR(~chi_10 -> ~G
     .        h)'
      endif
      if(brneuthhgrav(1).ne.0.D0) then
      write(nout,102) brneuthhgrav(1),2,igrav,ihh,     'BR(~chi_10 -> ~G
     .        H)'
      endif
      if(brneuthagrav(1).ne.0.D0) then
      write(nout,102) brneuthagrav(1),2,igrav,iha,     'BR(~chi_10 -> ~G
     .        A)'
      endif
      endif
c
      if(flagneut3bod(1).eq.1.D0) then
         write(nout,103)
      endif
      if(brchubd(1,1).ne.0.D0) then
      write(nout,104) brchubd(1,1),3,ic1,iub,id,       'BR(~chi_10 -> ~c
     .hi_1+ ub      d)'
      write(nout,104) brchubd(1,1),3,-ic1,idb,iu,      'BR(~chi_10 -> ~c
     .hi_1- db      u)'
      endif
      if(brchubd(1,2).ne.0.D0) then      
      write(nout,104) brchubd(1,2),3,ic2,iub,id,       'BR(~chi_10 -> ~c
     .hi_2+ ub      d)'
      write(nout,104) brchubd(1,2),3,-ic2,idb,iu,      'BR(~chi_10 -> ~c
     .hi_2- db      u)'
      endif
      if(brchcbs(1,1).ne.0.D0) then
      write(nout,104) brchcbs(1,1),3,ic1,icb,is,       'BR(~chi_10 -> ~c
     .hi_1+ cb      s)'
      write(nout,104) brchcbs(1,1),3,-ic1,isb,ic,      'BR(~chi_10 -> ~c
     .hi_1- sb      c)'
      endif
      if(brchcbs(1,2).ne.0.D0) then
      write(nout,104) brchcbs(1,2),3,ic2,icb,is,       'BR(~chi_10 -> ~c
     .hi_2+ cb      s)'
      write(nout,104) brchcbs(1,2),3,-ic2,isb,ic,      'BR(~chi_10 -> ~c
     .hi_2- sb      c)'
      endif
      if(brchtbb(1,1).ne.0.D0) then
      write(nout,104) brchtbb(1,1),3,ic1,itb,ib,       'BR(~chi_10 -> ~c
     .hi_1+ tb      b)'
      write(nout,104) brchtbb(1,1),3,-ic1,ibb,it,      'BR(~chi_10 -> ~c
     .hi_1- bb      t)'
      endif
      if(brchtbb(1,2).ne.0.D0) then
      write(nout,104) brchtbb(1,2),3,ic2,itb,ib,       'BR(~chi_10 -> ~c
     .hi_2+ tb      b)'
      write(nout,104) brchtbb(1,2),3,-ic2,ibb,it,      'BR(~chi_10 -> ~c
     .hi_2- bb      t)'
      endif
      if(brchelne(1,1).ne.0.D0) then
      write(nout,104) brchelne(1,1),3,ic1,-ine,ie,     'BR(~chi_10 -> ~c
     .hi_1+ nu_eb   e-)'
      write(nout,104) brchelne(1,1),3,-ic1,ine,-ie,    'BR(~chi_10 -> ~c
     .hi_1- nu_e    e+)'
      endif
      if(brchelne(1,2).ne.0.D0) then
      write(nout,104) brchelne(1,2),3,ic2,-ine,ie,     'BR(~chi_10 -> ~c
     .hi_2+ nu_eb   e-)'
      write(nout,104) brchelne(1,2),3,-ic2,ine,-ie,    'BR(~chi_10 -> ~c
     .hi_2- nu_e    e+)'
      endif
      if(brchmunmu(1,1).ne.0.D0) then
      write(nout,104) brchmunmu(1,1),3,ic1,-inmu,imu,  'BR(~chi_10 -> ~c
     .hi_1+ nu_mub  mu-)'
      write(nout,104) brchmunmu(1,1),3,-ic1,inmu,-imu, 'BR(~chi_10 -> ~c
     .hi_1- nu_mu   mu+)'
      endif
      if(brchmunmu(1,2).ne.0.D0) then
      write(nout,104) brchmunmu(1,2),3,ic2,-inmu,imu,  'BR(~chi_10 -> ~c
     .hi_2+ nu_mub  mu-)'
      write(nout,104) brchmunmu(1,2),3,-ic2,inmu,-imu, 'BR(~chi_10 -> ~c
     .hi_2- nu_mu   mu+)'
      endif
      if(brchtauntau(1,1).ne.0.D0) then
      write(nout,104) brchtauntau(1,1),3,ic1,-intau,itau, 'BR(~chi_10 ->
     . ~chi_1+ nu_taub tau-)'
      write(nout,104) brchtauntau(1,1),3,-ic1,intau,-itau,'BR(~chi_10 ->
     . ~chi_1- nu_tau  tau+)'
      endif
      if(brchtauntau(1,2).ne.0.D0) then
      write(nout,104) brchtauntau(1,2),3,ic2,-intau,itau, 'BR(~chi_10 ->
     . ~chi_2+ nu_taub tau-)'
      write(nout,104) brchtauntau(1,2),3,-ic2,intau,-itau,'BR(~chi_10 ->
     . ~chi_2- nu_tau  tau+)'
      endif
      if(brglup(1).ne.0.D0) then
      write(nout,104) brglup(1),3,iglo,iub,iu,            'BR(~chi_10 ->
     . ~g      ub      u)'
      endif
      if(brgldo(1).ne.0.D0) then
      write(nout,104) brgldo(1),3,iglo,idb,id,            'BR(~chi_10 ->
     . ~g      db      d)'
      endif
      if(brglch(1).ne.0.D0) then
      write(nout,104) brglch(1),3,iglo,icb,ic,            'BR(~chi_10 ->
     . ~g      cb      c)'
      endif
      if(brglst(1).ne.0.D0) then
      write(nout,104) brglst(1),3,iglo,isb,is,            'BR(~chi_10 ->
     . ~g      sb      s)'
      endif
      if(brgltop(1).ne.0.D0) then
      write(nout,104) brgltop(1),3,iglo,itb,it,           'BR(~chi_10 ->
     . ~g      tb      t)'
      endif
      if(brglbot(1).ne.0.D0) then
      write(nout,104) brglbot(1),3,iglo,ibb,ib,           'BR(~chi_10 ->
     . ~g      bb      b)'
      endif

      elseif(neuttot(1).eq.0.D0) then
         write(nout,99)
         write(nout,100) 1000022,0.000000000E+00,'neutralino1 decays'
      endif
      endif

c ------------------ c
c neutralino2 decays c
c ------------------ c

      write(nout,105)

      if(flagcondneut(2).eq.10.D0) then
         write(nout,99)
         write(nout,100) 1000023,0.000000000E+00,'neutralino2 decays'
      elseif(flagcondneut(2).eq.40.D0.or.flagcondneut(2).eq.41.D0.or.
     .flagcondneut(2).eq.42.D0) then
      write(nout,99)
      write(nout,100) 1000023,neuttot2(2),'neutralino2 decays'

      write(nout,101)
      if(brneutzneut(2,1).ne.0.D0) then
      write(nout,102) brneutzneut(2,1),2,in1,iz,       'BR(~chi_20 -> ~c
     .hi_10   Z )'
      endif
      if(brneutwchar(2,1).ne.0.D0) then
      write(nout,102) brneutwchar(2,1),2,ic1,-iwc,     'BR(~chi_20 -> ~c
     .hi_1+   W-)'
      write(nout,102) brneutwchar(2,1),2,-ic1,iwc,     'BR(~chi_20 -> ~c
     .hi_1-   W+)'
      endif
      if(brneutwchar(2,2).ne.0.D0) then
      write(nout,102) brneutwchar(2,2),2,ic2,-iwc,     'BR(~chi_20 -> ~c
     .hi_2+   W-)'
      write(nout,102) brneutwchar(2,2),2,-ic2,iwc,     'BR(~chi_20 -> ~c
     .hi_2-   W+)'
      endif
      if(brneuthlneut(2,1).ne.0.D0) then
      write(nout,102) brneuthlneut(2,1),2,in1,ihl,     'BR(~chi_20 -> ~c
     .hi_10   h )'
      endif
      if(brneuthhneut(2,1).ne.0.D0) then
      write(nout,102) brneuthhneut(2,1),2,in1,ihh,     'BR(~chi_20 -> ~c
     .hi_10   H )'
      endif
      if(brneuthaneut(2,1).ne.0.D0) then
      write(nout,102) brneuthaneut(2,1),2,in1,iha,     'BR(~chi_20 -> ~c
     .hi_10   A )'
      endif
      if(brneuthcchar(2,1).ne.0.D0) then
      write(nout,102) brneuthcchar(2,1),2,ic1,-ihc,    'BR(~chi_20 -> ~c
     .hi_1+   H-)'
      write(nout,102) brneuthcchar(2,1),2,-ic1,ihc,    'BR(~chi_20 -> ~c
     .hi_1-   H+)'
      endif
      if(brneuthcchar(2,2).ne.0.D0) then
      write(nout,102) brneuthcchar(2,2),2,ic2,-ihc,    'BR(~chi_20 -> ~c
     .hi_2+   H-)'
      write(nout,102) brneuthcchar(2,2),2,-ic2,ihc,    'BR(~chi_20 -> ~c
     .hi_2-   H+)'
      endif
      if(brneutsupl(2).ne.0.D0) then
      write(nout,102) brneutsupl(2),2,isul,iub,        'BR(~chi_20 -> ~u
     ._L      ub)'
      write(nout,102) brneutsupl(2),2,-isul,iu,        'BR(~chi_20 -> ~u
     ._L*     u )'
      endif
      if(brneutsupr(2).ne.0.D0) then
      write(nout,102) brneutsupr(2),2,isur,iub,        'BR(~chi_20 -> ~u
     ._R      ub)'
      write(nout,102) brneutsupr(2),2,-isur,iu,        'BR(~chi_20 -> ~u
     ._R*     u )'
      endif
      if(brneutsdownl(2).ne.0.D0) then
      write(nout,102) brneutsdownl(2),2,isdl,idb,      'BR(~chi_20 -> ~d
     ._L      db)'
      write(nout,102) brneutsdownl(2),2,-isdl,id,      'BR(~chi_20 -> ~d
     ._L*     d )'
      endif
      if(brneutsdownr(2).ne.0.D0) then
      write(nout,102) brneutsdownr(2),2,isdr,idb,      'BR(~chi_20 -> ~d
     ._R      db)'
      write(nout,102) brneutsdownr(2),2,-isdr,id,      'BR(~chi_20 -> ~d
     ._R*     d )'
      endif
      if(brneutsupl(2).ne.0.D0) then
      write(nout,102) brneutsupl(2),2,iscl,icb,        'BR(~chi_20 -> ~c
     ._L      cb)'
      write(nout,102) brneutsupl(2),2,-iscl,ic,        'BR(~chi_20 -> ~c
     ._L*     c )'
      endif
      if(brneutsupr(2).ne.0.D0) then
      write(nout,102) brneutsupr(2),2,iscr,icb,        'BR(~chi_20 -> ~c
     ._R      cb)'
      write(nout,102) brneutsupr(2),2,-iscr,ic,        'BR(~chi_20 -> ~c
     ._R*     c )'
      endif
      if(brneutsdownl(2).ne.0.D0) then
      write(nout,102) brneutsdownl(2),2,issl,isb,      'BR(~chi_20 -> ~s
     ._L      sb)'
      write(nout,102) brneutsdownl(2),2,-issl,is,      'BR(~chi_20 -> ~s
     ._L*     s )'
      endif
      if(brneutsdownr(2).ne.0.D0) then
      write(nout,102) brneutsdownr(2),2,issr,isb,      'BR(~chi_20 -> ~s
     ._R      sb)'
      write(nout,102) brneutsdownr(2),2,-issr,is,      'BR(~chi_20 -> ~s
     ._R*     s )'
      endif
      if(brneutst1(2).ne.0.D0) then
      write(nout,102) brneutst1(2),2,ist1,itb,         'BR(~chi_20 -> ~t
     ._1      tb)'
      write(nout,102) brneutst1(2),2,-ist1,it,         'BR(~chi_20 -> ~t
     ._1*     t )'
      endif
      if(brneutst2(2).ne.0.D0) then
      write(nout,102) brneutst2(2),2,ist2,itb,         'BR(~chi_20 -> ~t
     ._2      tb)'
      write(nout,102) brneutst2(2),2,-ist2,it,         'BR(~chi_20 -> ~t
     ._2*     t )'
      endif
      if(brneutsb1(2).ne.0.D0) then
      write(nout,102) brneutsb1(2),2,isb1,ibb,         'BR(~chi_20 -> ~b
     ._1      bb)'
      write(nout,102) brneutsb1(2),2,-isb1,ib,         'BR(~chi_20 -> ~b
     ._1*     b )'
      endif
      if(brneutsb2(2).ne.0.D0) then
      write(nout,102) brneutsb2(2),2,isb2,ibb,         'BR(~chi_20 -> ~b
     ._2      bb)'
      write(nout,102) brneutsb2(2),2,-isb2,ib,         'BR(~chi_20 -> ~b
     ._2*     b )'
      endif
      if(brneutsell(2).ne.0.D0) then
      write(nout,102) brneutsell(2),2,isell,-ie,       'BR(~chi_20 -> ~e
     ._L-     e+)'
      write(nout,102) brneutsell(2),2,-isell,ie,       'BR(~chi_20 -> ~e
     ._L+     e-)'
      endif
      if(brneutselr(2).ne.0.D0) then
      write(nout,102) brneutselr(2),2,iselr,-ie,       'BR(~chi_20 -> ~e
     ._R-     e+)'
      write(nout,102) brneutselr(2),2,-iselr,ie,       'BR(~chi_20 -> ~e
     ._R+     e-)'
      endif
      if(brneutsell(2).ne.0.D0) then
      write(nout,102) brneutsell(2),2,ismul,-imu,      'BR(~chi_20 -> ~m
     .u_L-    mu+)' 
      write(nout,102) brneutsell(2),2,-ismul,imu,      'BR(~chi_20 -> ~m
     .u_L+    mu-)' 
      endif
      if(brneutselr(2).ne.0.D0) then
      write(nout,102) brneutselr(2),2,ismur,-imu,      'BR(~chi_20 -> ~m
     .u_R-    mu+)' 
      write(nout,102) brneutselr(2),2,-ismur,imu,      'BR(~chi_20 -> ~m
     .u_R+    mu-)'
      endif
      if(brneutstau1(2).ne.0.D0) then
      write(nout,102) brneutstau1(2),2,istau1,-itau,   'BR(~chi_20 -> ~t
     .au_1-   tau+)'
      write(nout,102) brneutstau1(2),2,-istau1,itau,   'BR(~chi_20 -> ~t
     .au_1+   tau-)'
      endif
      if(brneutstau2(2).ne.0.D0) then
      write(nout,102) brneutstau2(2),2,istau2,-itau,   'BR(~chi_20 -> ~t
     .au_2-   tau+)'
      write(nout,102) brneutstau2(2),2,-istau2,itau,   'BR(~chi_20 -> ~t
     .au_2+   tau-)'
      endif
      if(brneutsnel(2).ne.0.D0) then
      write(nout,102) brneutsnel(2),2,inel,-ine,       'BR(~chi_20 -> ~n
     .u_eL    nu_eb)'
      write(nout,102) brneutsnel(2),2,-inel,ine,       'BR(~chi_20 -> ~n
     .u_eL*   nu_e )'
      write(nout,102) brneutsnel(2),2,inmul,-inmu,     'BR(~chi_20 -> ~n
     .u_muL   nu_mub)'
      write(nout,102) brneutsnel(2),2,-inmul,inmu,     'BR(~chi_20 -> ~n
     .u_muL*  nu_mu )'
      endif
      if(brneutsn1(2).ne.0.D0) then
      write(nout,102) brneutsn1(2),2,intau1,-intau,    'BR(~chi_20 -> ~n
     .u_tau1  nu_taub)'
      write(nout,102) brneutsn1(2),2,-intau1,intau,    'BR(~chi_20 -> ~n
     .u_tau1* nu_tau )'
      endif
c
      if(flagnlspgmsb.eq.1.D0) then
         if(brneutgamgrav(2).ne.0.D0) then
      write(nout,102) brneutgamgrav(2),2,igrav,iga,    'BR(~chi_20 -> ~G
     .        gam)'
      endif
      if(brneutzgrav(2).ne.0.D0) then
      write(nout,102) brneutzgrav(2),2,igrav,iz,       'BR(~chi_20 -> ~G
     .        Z)'
      endif
      if(brneuthlgrav(2).ne.0.D0) then
      write(nout,102) brneuthlgrav(2),2,igrav,ihl,     'BR(~chi_20 -> ~G
     .        h)'
      endif
      if(brneuthhgrav(2).ne.0.D0) then
      write(nout,102) brneuthhgrav(2),2,igrav,ihh,     'BR(~chi_20 -> ~G
     .        H)'
      endif
      if(brneuthagrav(2).ne.0.D0) then
      write(nout,102) brneuthagrav(2),2,igrav,iha,     'BR(~chi_20 -> ~G
     .        A)'
      endif
      endif

      elseif(flagcondneut(2).eq.11.D0.or.flagcondneut(2).eq.12.D0) then
         if(neuttot(2).ne.0.D0) then
            write(nout,99)
            write(nout,100) 1000023,neuttot(2),'neutralino2 decays'
            if(flagloop.eq.1.D0) then
      write(nout,101)
      if(brnraddec(2,1).ne.0.D0) then
      write(nout,102) brnraddec(2,1),2,in1,iga,        'BR(~chi_20 -> ~c
     .hi_10 gam)'
      endif
            endif
c
       if(flagnlspgmsb.eq.1.D0) then
      write(nout,101)
        if(brneutgamgrav(2).ne.0.D0) then
      write(nout,102) brneutgamgrav(2),2,igrav,iga,    'BR(~chi_20 -> ~G
     .        gam)'
      endif
      if(brneutzgrav(2).ne.0.D0) then
      write(nout,102) brneutzgrav(2),2,igrav,iz,       'BR(~chi_20 -> ~G
     .        Z)'
      endif
      if(brneuthlgrav(2).ne.0.D0) then
      write(nout,102) brneuthlgrav(2),2,igrav,ihl,     'BR(~chi_20 -> ~G
     .        h)'
      endif
      if(brneuthhgrav(2).ne.0.D0) then
      write(nout,102) brneuthhgrav(2),2,igrav,ihh,     'BR(~chi_20 -> ~G
     .        H)'
      endif
      if(brneuthagrav(2).ne.0.D0) then
      write(nout,102) brneuthagrav(2),2,igrav,iha,     'BR(~chi_20 -> ~G
     .        A)'
      endif
      endif
c
            if(flagmulti.eq.1.D0) then
      if(flagneut3bod(2).eq.1.D0) then
      write(nout,103)
      endif
      if(brneutup(2,1).ne.0.D0) then
      write(nout,104) brneutup(2,1),3,in1,iub,iu,      'BR(~chi_20 -> ~c
     .hi_10 ub      u)'
      endif
      if(brneutdow(2,1).ne.0.D0) then
      write(nout,104) brneutdow(2,1),3,in1,idb,id,     'BR(~chi_20 -> ~c
     .hi_10 db      d)'
      endif
      if(brneutch(2,1).ne.0.D0) then
      write(nout,104) brneutch(2,1),3,in1,icb,ic,      'BR(~chi_20 -> ~c
     .hi_10 cb      c)'
      endif
      if(brneutst(2,1).ne.0.D0) then
      write(nout,104) brneutst(2,1),3,in1,isb,is,      'BR(~chi_20 -> ~c
     .hi_10 sb      s)'
      endif
      if(brneuttop(2,1).ne.0.D0) then
      write(nout,104) brneuttop(2,1),3,in1,itb,it,     'BR(~chi_20 -> ~c
     .hi_10 tb      t)'
      endif
      if(brneutbot(2,1).ne.0.D0) then
      write(nout,104) brneutbot(2,1),3,in1,ibb,ib,     'BR(~chi_20 -> ~c
     .hi_10 bb      b)'
      endif
      if(brneutel(2,1).ne.0.D0) then
      write(nout,104) brneutel(2,1),3,in1,-ie,ie,      'BR(~chi_20 -> ~c
     .hi_10 e+      e-)'
      endif
      if(brneutmu(2,1).ne.0.D0) then
      write(nout,104) brneutmu(2,1),3,in1,-imu,imu,    'BR(~chi_20 -> ~c
     .hi_10 mu+     mu-)'
      endif
      if(brneuttau(2,1).ne.0.D0) then
      write(nout,104) brneuttau(2,1),3,in1,-itau,itau, 'BR(~chi_20 -> ~c
     .hi_10 tau+    tau-)'
      endif
      if(brneutnue(2,1).ne.0.D0) then
      write(nout,104) brneutnue(2,1),3,in1,-ine,ine,   'BR(~chi_20 -> ~c
     .hi_10 nu_eb   nu_e)'
      endif
      if(brneutnumu(2,1).ne.0.D0) then
      write(nout,104) brneutnumu(2,1),3,in1,-inmu,inmu,'BR(~chi_20 -> ~c
     .hi_10 nu_mub  nu_mu)'
      endif
      if(brneutnutau(2,1).ne.0.D0) then
      write(nout,104) brneutnutau(2,1),3,in1,-intau,intau,'BR(~chi_20 ->
     . ~chi_10 nu_taub nu_tau)'
      endif
      if(brchubd(2,1).ne.0.D0) then
      write(nout,104) brchubd(2,1),3,ic1,iub,id,       'BR(~chi_20 -> ~c
     .hi_1+ ub      d)'
      write(nout,104) brchubd(2,1),3,-ic1,idb,iu,      'BR(~chi_20 -> ~c
     .hi_1- db      u)'
      endif
      if(brchubd(2,2).ne.0.D0) then
      write(nout,104) brchubd(2,2),3,ic2,iub,id,       'BR(~chi_20 -> ~c
     .hi_2+ ub      d)'
      write(nout,104) brchubd(2,2),3,-ic2,idb,iu,      'BR(~chi_20 -> ~c
     .hi_2- db      u)'
      endif
      if(brchcbs(2,1).ne.0.D0) then
      write(nout,104) brchcbs(2,1),3,ic1,icb,is,       'BR(~chi_20 -> ~c
     .hi_1+ cb      s)'
      write(nout,104) brchcbs(2,1),3,-ic1,isb,ic,      'BR(~chi_20 -> ~c
     .hi_1- sb      c)'
      endif
      if(brchcbs(2,2).ne.0.D0) then
      write(nout,104) brchcbs(2,2),3,ic2,icb,is,       'BR(~chi_20 -> ~c
     .hi_2+ cb      s)'
      write(nout,104) brchcbs(2,2),3,-ic2,isb,ic,      'BR(~chi_20 -> ~c
     .hi_2- sb      c)'
      endif
      if(brchtbb(2,1).ne.0.D0) then
      write(nout,104) brchtbb(2,1),3,ic1,itb,ib,       'BR(~chi_20 -> ~c
     .hi_1+ tb      b)'
      write(nout,104) brchtbb(2,1),3,-ic1,ibb,it,      'BR(~chi_20 -> ~c
     .hi_1- bb      t)'
      endif
      if(brchtbb(2,2).ne.0.D0) then
      write(nout,104) brchtbb(2,2),3,ic2,itb,ib,       'BR(~chi_20 -> ~c
     .hi_2+ tb      b)'
      write(nout,104) brchtbb(2,2),3,-ic2,ibb,it,      'BR(~chi_20 -> ~c
     .hi_2- bb      t)'
      endif
      if(brchelne(2,1).ne.0.D0) then
      write(nout,104) brchelne(2,1),3,ic1,-ine,ie,     'BR(~chi_20 -> ~c
     .hi_1+ nu_eb   e-)'
      write(nout,104) brchelne(2,1),3,-ic1,ine,-ie,    'BR(~chi_20 -> ~c
     .hi_1- nu_e    e+)'
      endif
      if(brchelne(2,2).ne.0.D0) then
      write(nout,104) brchelne(2,2),3,ic2,-ine,ie,     'BR(~chi_20 -> ~c
     .hi_2+ nu_eb   e-)'
      write(nout,104) brchelne(2,2),3,-ic2,ine,-ie,    'BR(~chi_20 -> ~c
     .hi_2- nu_e    e+)'
      endif
      if(brchmunmu(2,1).ne.0.D0) then
      write(nout,104) brchmunmu(2,1),3,ic1,-inmu,imu,  'BR(~chi_20 -> ~c
     .hi_1+ nu_mub  mu-)'
      write(nout,104) brchmunmu(2,1),3,-ic1,inmu,-imu, 'BR(~chi_20 -> ~c
     .hi_1- nu_mu   mu+)'
      endif
      if(brchmunmu(2,2).ne.0.D0) then
      write(nout,104) brchmunmu(2,2),3,ic2,-inmu,imu,  'BR(~chi_20 -> ~c
     .hi_2+ nu_mub  mu-)'
      write(nout,104) brchmunmu(2,2),3,-ic2,inmu,-imu, 'BR(~chi_20 -> ~c
     .hi_2- nu_mu   mu+)'
      endif
      if(brchtauntau(2,1).ne.0.D0) then
      write(nout,104) brchtauntau(2,1),3,ic1,-intau,itau, 'BR(~chi_20 ->
     . ~chi_1+ nu_taub tau-)'
      write(nout,104) brchtauntau(2,1),3,-ic1,intau,-itau,'BR(~chi_20 ->
     . ~chi_1- nu_tau  tau+)'
      endif
      if(brchtauntau(2,2).ne.0.D0) then
      write(nout,104) brchtauntau(2,2),3,ic2,-intau,itau, 'BR(~chi_20 ->
     . ~chi_2+ nu_taub tau-)'
      write(nout,104) brchtauntau(2,2),3,-ic2,intau,-itau,'BR(~chi_20 ->
     . ~chi_2- nu_tau  tau+)'
      endif
      if(brglup(2).ne.0.D0) then
      write(nout,104) brglup(2),3,iglo,iub,iu,            'BR(~chi_20 ->
     . ~g      ub      u)'
      endif
      if(brgldo(2).ne.0.D0) then
      write(nout,104) brgldo(2),3,iglo,idb,id,            'BR(~chi_20 ->
     . ~g      db      d)'
      endif
      if(brglch(2).ne.0.D0) then
      write(nout,104) brglch(2),3,iglo,icb,ic,            'BR(~chi_20 ->
     . ~g      cb      c)'
      endif
      if(brglst(2).ne.0.D0) then
      write(nout,104) brglst(2),3,iglo,isb,is,            'BR(~chi_20 ->
     . ~g      sb      s)'
      endif
      if(brgltop(2).ne.0.D0) then
      write(nout,104) brgltop(2),3,iglo,itb,it,           'BR(~chi_20 ->
     . ~g      tb      t)'
      endif
      if(brglbot(2).ne.0.D0) then
      write(nout,104) brglbot(2),3,iglo,ibb,ib,           'BR(~chi_20 ->
     . ~g      bb      b)'
      endif
      endif
      elseif(neuttot(2).eq.0.D0) then
         write(nout,99)
         write(nout,100) 1000023,0.000000000E+00,'neutralino2 decays'
      endif
      endif

c ------------------ c
c neutralino3 decays c
c ------------------ c

      write(nout,105)

      if(flagcondneut(3).eq.10.D0) then
         write(nout,99)
         write(nout,100) 1000025,0.000000000E+00,'neutralino3 decays'
      elseif(flagcondneut(3).eq.40.D0.or.flagcondneut(3).eq.41.D0.or.
     .flagcondneut(3).eq.42.D0) then
      write(nout,99)
      write(nout,100) 1000025,neuttot2(3),'neutralino3 decays'

      write(nout,101)
      if(brneutzneut(3,1).ne.0.D0) then
      write(nout,102) brneutzneut(3,1),2,in1,iz,       'BR(~chi_30 -> ~c
     .hi_10   Z )'
      endif
      if(brneutzneut(3,2).ne.0.D0) then
      write(nout,102) brneutzneut(3,2),2,in2,iz,       'BR(~chi_30 -> ~c
     .hi_20   Z )'
      endif
      if(brneutwchar(3,1).ne.0.D0) then
      write(nout,102) brneutwchar(3,1),2,ic1,-iwc,     'BR(~chi_30 -> ~c
     .hi_1+   W-)'
      write(nout,102) brneutwchar(3,1),2,-ic1,iwc,     'BR(~chi_30 -> ~c
     .hi_1-   W+)'
      endif
      if(brneutwchar(3,2).ne.0.D0) then
      write(nout,102) brneutwchar(3,2),2,ic2,-iwc,     'BR(~chi_30 -> ~c
     .hi_2+   W-)'
      write(nout,102) brneutwchar(3,2),2,-ic2,iwc,     'BR(~chi_30 -> ~c
     .hi_2-   W+)'
      endif
      if(brneuthlneut(3,1).ne.0.D0) then
      write(nout,102) brneuthlneut(3,1),2,in1,ihl,     'BR(~chi_30 -> ~c
     .hi_10   h )'
      endif
      if(brneuthhneut(3,1).ne.0.D0) then
      write(nout,102) brneuthhneut(3,1),2,in1,ihh,     'BR(~chi_30 -> ~c
     .hi_10   H )'
      endif
      if(brneuthaneut(3,1).ne.0.D0) then
      write(nout,102) brneuthaneut(3,1),2,in1,iha,     'BR(~chi_30 -> ~c
     .hi_10   A )'
      endif
      if(brneuthlneut(3,2).ne.0.D0) then
      write(nout,102) brneuthlneut(3,2),2,in2,ihl,     'BR(~chi_30 -> ~c
     .hi_20   h )'
      endif
      if(brneuthhneut(3,2).ne.0.D0) then
      write(nout,102) brneuthhneut(3,2),2,in2,ihh,     'BR(~chi_30 -> ~c
     .hi_20   H )'
      endif
      if(brneuthaneut(3,2).ne.0.D0) then
      write(nout,102) brneuthaneut(3,2),2,in2,iha,     'BR(~chi_30 -> ~c
     .hi_20   A )'
      endif
      if(brneuthcchar(3,1).ne.0.D0) then
      write(nout,102) brneuthcchar(3,1),2,ic1,-ihc,    'BR(~chi_30 -> ~c
     .hi_1+   H-)'
      write(nout,102) brneuthcchar(3,1),2,-ic1,ihc,    'BR(~chi_30 -> ~c
     .hi_1-   H+)'
      endif
      if(brneuthcchar(3,2).ne.0.D0) then
      write(nout,102) brneuthcchar(3,2),2,ic2,-ihc,    'BR(~chi_30 -> ~c
     .hi_2+   H-)'
      write(nout,102) brneuthcchar(3,2),2,-ic2,ihc,    'BR(~chi_30 -> ~c
     .hi_2-   H+)'
      endif
      if(brneutsupl(3).ne.0.D0) then
      write(nout,102) brneutsupl(3),2,isul,iub,        'BR(~chi_30 -> ~u
     ._L      ub)'
      write(nout,102) brneutsupl(3),2,-isul,iu,        'BR(~chi_30 -> ~u
     ._L*     u )'
      endif
      if(brneutsupr(3).ne.0.D0) then
      write(nout,102) brneutsupr(3),2,isur,iub,        'BR(~chi_30 -> ~u
     ._R      ub)'
      write(nout,102) brneutsupr(3),2,-isur,iu,        'BR(~chi_30 -> ~u
     ._R*     u )'
      endif
      if(brneutsdownl(3).ne.0.D0) then
      write(nout,102) brneutsdownl(3),2,isdl,idb,      'BR(~chi_30 -> ~d
     ._L      db)'
      write(nout,102) brneutsdownl(3),2,-isdl,id,      'BR(~chi_30 -> ~d
     ._L*     d )'
      endif
      if(brneutsdownr(3).ne.0.D0) then
      write(nout,102) brneutsdownr(3),2,isdr,idb,      'BR(~chi_30 -> ~d
     ._R      db)'
      write(nout,102) brneutsdownr(3),2,-isdr,id,      'BR(~chi_30 -> ~d
     ._R*     d )'
      endif
      if(brneutsupl(3).ne.0.D0) then
      write(nout,102) brneutsupl(3),2,iscl,icb,        'BR(~chi_30 -> ~c
     ._L      cb)'
      write(nout,102) brneutsupl(3),2,-iscl,ic,        'BR(~chi_30 -> ~c
     ._L*     c )'
      endif
      if(brneutsupr(3).ne.0.D0) then
      write(nout,102) brneutsupr(3),2,iscr,icb,        'BR(~chi_30 -> ~c
     ._R      cb)'
      write(nout,102) brneutsupr(3),2,-iscr,ic,        'BR(~chi_30 -> ~c
     ._R*     c )'
      endif
      if(brneutsdownl(3).ne.0.D0) then
      write(nout,102) brneutsdownl(3),2,issl,isb,      'BR(~chi_30 -> ~s
     ._L      sb)'
      write(nout,102) brneutsdownl(3),2,-issl,is,      'BR(~chi_30 -> ~s
     ._L*     s )'
      endif
      if(brneutsdownr(3).ne.0.D0) then
      write(nout,102) brneutsdownr(3),2,issr,isb,      'BR(~chi_30 -> ~s
     ._R      sb)'
      write(nout,102) brneutsdownr(3),2,-issr,is,      'BR(~chi_30 -> ~s
     ._R*     s )'
      endif
      if(brneutst1(3).ne.0.D0) then
      write(nout,102) brneutst1(3),2,ist1,itb,         'BR(~chi_30 -> ~t
     ._1      tb)'
      write(nout,102) brneutst1(3),2,-ist1,it,         'BR(~chi_30 -> ~t
     ._1*     t )'
      endif
      if(brneutst2(3).ne.0.D0) then
      write(nout,102) brneutst2(3),2,ist2,itb,         'BR(~chi_30 -> ~t
     ._2      tb)'
      write(nout,102) brneutst2(3),2,-ist2,it,         'BR(~chi_30 -> ~t
     ._2*     t )'
      endif
      if(brneutsb1(3).ne.0.D0) then
      write(nout,102) brneutsb1(3),2,isb1,ibb,         'BR(~chi_30 -> ~b
     ._1      bb)'
      write(nout,102) brneutsb1(3),2,-isb1,ib,         'BR(~chi_30 -> ~b
     ._1*     b )'
      endif
      if(brneutsb2(3).ne.0.D0) then
      write(nout,102) brneutsb2(3),2,isb2,ibb,         'BR(~chi_30 -> ~b
     ._2      bb)'
      write(nout,102) brneutsb2(3),2,-isb2,ib,         'BR(~chi_30 -> ~b
     ._2*     b )'
      endif
      if(brneutsell(3).ne.0.D0) then
      write(nout,102) brneutsell(3),2,isell,-ie,       'BR(~chi_30 -> ~e
     ._L-     e+)'
      write(nout,102) brneutsell(3),2,-isell,ie,       'BR(~chi_30 -> ~e
     ._L+     e-)'
      endif
      if(brneutselr(3).ne.0.D0) then
      write(nout,102) brneutselr(3),2,iselr,-ie,       'BR(~chi_30 -> ~e
     ._R-     e+)'
      write(nout,102) brneutselr(3),2,-iselr,ie,       'BR(~chi_30 -> ~e
     ._R+     e-)'
      endif
      if(brneutsell(3).ne.0.D0) then
      write(nout,102) brneutsell(3),2,ismul,-imu,      'BR(~chi_30 -> ~m
     .u_L-    mu+)' 
      write(nout,102) brneutsell(3),2,-ismul,imu,      'BR(~chi_30 -> ~m
     .u_L+    mu-)' 
      endif
      if(brneutselr(3).ne.0.D0) then
      write(nout,102) brneutselr(3),2,ismur,-imu,      'BR(~chi_30 -> ~m
     .u_R-    mu+)' 
      write(nout,102) brneutselr(3),2,-ismur,imu,      'BR(~chi_30 -> ~m
     .u_R+    mu-)'
      endif
      if(brneutstau1(3).ne.0.D0) then
      write(nout,102) brneutstau1(3),2,istau1,-itau,   'BR(~chi_30 -> ~t
     .au_1-   tau+)'
      write(nout,102) brneutstau1(3),2,-istau1,itau,   'BR(~chi_30 -> ~t
     .au_1+   tau-)'
      endif
      if(brneutstau2(3).ne.0.D0) then
      write(nout,102) brneutstau2(3),2,istau2,-itau,   'BR(~chi_30 -> ~t
     .au_2-   tau+)'
      write(nout,102) brneutstau2(3),2,-istau2,itau,   'BR(~chi_30 -> ~t
     .au_2+   tau-)'
      endif
      if(brneutsnel(3).ne.0.D0) then
      write(nout,102) brneutsnel(3),2,inel,-ine,       'BR(~chi_30 -> ~n
     .u_eL    nu_eb)'
      write(nout,102) brneutsnel(3),2,-inel,ine,       'BR(~chi_30 -> ~n
     .u_eL*   nu_e )'
      write(nout,102) brneutsnel(3),2,inmul,-inmu,     'BR(~chi_30 -> ~n
     .u_muL   nu_mub)'
      write(nout,102) brneutsnel(3),2,-inmul,inmu,     'BR(~chi_30 -> ~n
     .u_muL*  nu_mu )'
      endif
      if(brneutsn1(3).ne.0.D0) then
      write(nout,102) brneutsn1(3),2,intau1,-intau,    'BR(~chi_30 -> ~n
     .u_tau1  nu_taub)'
      write(nout,102) brneutsn1(3),2,-intau1,intau,    'BR(~chi_30 -> ~n
     .u_tau1* nu_tau )'
      endif
      if(flagnlspgmsb.eq.1.D0) then
         if(brneutgamgrav(3).ne.0.D0) then
      write(nout,102) brneutgamgrav(3),2,igrav,iga,    'BR(~chi_30 -> ~G
     .        gam)'
      endif
      if(brneutzgrav(3).ne.0.D0) then
      write(nout,102) brneutzgrav(3),2,igrav,iz,       'BR(~chi_30 -> ~G
     .        Z)'
      endif
      if(brneuthlgrav(3).ne.0.D0) then
      write(nout,102) brneuthlgrav(3),2,igrav,ihl,     'BR(~chi_30 -> ~G
     .        h)'
      endif
      if(brneuthhgrav(3).ne.0.D0) then
      write(nout,102) brneuthhgrav(3),2,igrav,ihh,     'BR(~chi_30 -> ~G
     .        H)'
      endif
      if(brneuthagrav(3).ne.0.D0) then
      write(nout,102) brneuthagrav(3),2,igrav,iha,     'BR(~chi_30 -> ~G
     .        A)'
      endif
      endif

      elseif(flagcondneut(3).eq.11.D0.or.flagcondneut(3).eq.12.D0) then
         if(neuttot(3).ne.0.D0) then
            write(nout,99)
            write(nout,100) 1000025,neuttot(3),'neutralino3 decays'
            if(flagloop.eq.1.D0) then
      write(nout,101)
      if(brnraddec(3,1).ne.0.D0) then
      write(nout,102) brnraddec(3,1),2,in1,iga,        'BR(~chi_30 -> ~c
     .hi_10 gam)'
      endif
      if(brnraddec(3,2).ne.0.D0) then
      write(nout,102) brnraddec(3,2),2,in2,iga,        'BR(~chi_30 -> ~c
     .hi_20 gam)'
      endif
            endif
c
      if(flagnlspgmsb.eq.1.D0) then
      write(nout,101)
         if(brneutgamgrav(3).ne.0.D0) then
      write(nout,102) brneutgamgrav(3),2,igrav,iga,    'BR(~chi_30 -> ~G
     .        gam)'
      endif
      if(brneutzgrav(3).ne.0.D0) then
      write(nout,102) brneutzgrav(3),2,igrav,iz,       'BR(~chi_30 -> ~G
     .        Z)'
      endif
      if(brneuthlgrav(3).ne.0.D0) then
      write(nout,102) brneuthlgrav(3),2,igrav,ihl,     'BR(~chi_30 -> ~G
     .        h)'
      endif
      if(brneuthhgrav(3).ne.0.D0) then
      write(nout,102) brneuthhgrav(3),2,igrav,ihh,     'BR(~chi_30 -> ~G
     .        H)'
      endif
      if(brneuthagrav(3).ne.0.D0) then
      write(nout,102) brneuthagrav(3),2,igrav,iha,     'BR(~chi_30 -> ~G
     .        A)'
      endif
      endif
c
            if(flagmulti.eq.1.D0) then
      if(flagneut3bod(3).eq.1.D0) then
      write(nout,103)
      endif
      if(brneutup(3,1).ne.0.D0) then
      write(nout,104) brneutup(3,1),3,in1,iub,iu,      'BR(~chi_30 -> ~c
     .hi_10 ub      u)'
      endif
      if(brneutdow(3,1).ne.0.D0) then
      write(nout,104) brneutdow(3,1),3,in1,idb,id,     'BR(~chi_30 -> ~c
     .hi_10 db      d)'
      endif
      if(brneutch(3,1).ne.0.D0) then
      write(nout,104) brneutch(3,1),3,in1,icb,ic,      'BR(~chi_30 -> ~c
     .hi_10 cb      c)'
      endif
      if(brneutst(3,1).ne.0.D0) then
      write(nout,104) brneutst(3,1),3,in1,isb,is,      'BR(~chi_30 -> ~c
     .hi_10 sb      s)'
      endif
      if(brneuttop(3,1).ne.0.D0) then
      write(nout,104) brneuttop(3,1),3,in1,itb,it,     'BR(~chi_30 -> ~c
     .hi_10 tb      t)'
      endif
      if(brneutbot(3,1).ne.0.D0) then
      write(nout,104) brneutbot(3,1),3,in1,ibb,ib,     'BR(~chi_30 -> ~c
     .hi_10 bb      b)'
      endif
      if(brneutel(3,1).ne.0.D0) then
      write(nout,104) brneutel(3,1),3,in1,-ie,ie,      'BR(~chi_30 -> ~c
     .hi_10 e+      e-)'
      endif
      if(brneutmu(3,1).ne.0.D0) then
      write(nout,104) brneutmu(3,1),3,in1,-imu,imu,    'BR(~chi_30 -> ~c
     .hi_10 mu+     mu-)'
      endif
      if(brneuttau(3,1).ne.0.D0) then
      write(nout,104) brneuttau(3,1),3,in1,-itau,itau, 'BR(~chi_30 -> ~c
     .hi_10 tau+    tau-)'
      endif
      if(brneutnue(3,1).ne.0.D0) then
      write(nout,104) brneutnue(3,1),3,in1,-ine,ine,   'BR(~chi_30 -> ~c
     .hi_10 nu_eb   nu_e)'
      endif
      if(brneutnumu(3,1).ne.0.D0) then
      write(nout,104) brneutnumu(3,1),3,in1,-inmu,inmu,'BR(~chi_30 -> ~c
     .hi_10 nu_mub  nu_mu)'
      endif
      if(brneutnutau(3,1).ne.0.D0) then
      write(nout,104) brneutnutau(3,1),3,in1,-intau,intau,'BR(~chi_30 ->
     . ~chi_10 nu_taub nu_tau)'
      endif
      if(brneutup(3,2).ne.0.D0) then
      write(nout,104) brneutup(3,2),3,in2,iub,iu,      'BR(~chi_30 -> ~c
     .hi_20 ub      u)'
      endif
      if(brneutdow(3,2).ne.0.D0) then
      write(nout,104) brneutdow(3,2),3,in2,idb,id,     'BR(~chi_30 -> ~c
     .hi_20 db      d)'
      endif
      if(brneutch(3,2).ne.0.D0) then
      write(nout,104) brneutch(3,2),3,in2,icb,ic,      'BR(~chi_30 -> ~c
     .hi_20 cb      c)'
      endif
      if(brneutst(3,2).ne.0.D0) then
      write(nout,104) brneutst(3,2),3,in2,isb,is,      'BR(~chi_30 -> ~c
     .hi_20 sb      s)'
      endif
      if(brneuttop(3,2).ne.0.D0) then
      write(nout,104) brneuttop(3,2),3,in2,itb,it,     'BR(~chi_30 -> ~c
     .hi_20 tb      t)'
      endif
      if(brneutbot(3,2).ne.0.D0) then
      write(nout,104) brneutbot(3,2),3,in2,ibb,ib,     'BR(~chi_30 -> ~c
     .hi_20 bb      b)'
      endif
      if(brneutel(3,2).ne.0.D0) then
      write(nout,104) brneutel(3,2),3,in2,-ie,ie,      'BR(~chi_30 -> ~c
     .hi_20 e+      e-)'
      endif
      if(brneutmu(3,2).ne.0.D0) then
      write(nout,104) brneutmu(3,2),3,in2,-imu,imu,    'BR(~chi_30 -> ~c
     .hi_20 mu+     mu-)'
      endif
      if(brneuttau(3,2).ne.0.D0) then
      write(nout,104) brneuttau(3,2),3,in2,-itau,itau, 'BR(~chi_30 -> ~c
     .hi_20 tau+    tau-)'
      endif
      if(brneutnue(3,2).ne.0.D0) then
      write(nout,104) brneutnue(3,2),3,in2,-ine,ine,   'BR(~chi_30 -> ~c
     .hi_20 nu_eb   nu_e)'
      endif
      if(brneutnumu(3,2).ne.0.D0) then
      write(nout,104) brneutnumu(3,2),3,in2,-inmu,inmu,'BR(~chi_30 -> ~c
     .hi_20 nu_mub  nu_mu)'
      endif
      if(brneutnutau(3,2).ne.0.D0) then
      write(nout,104) brneutnutau(3,2),3,in2,-intau,intau,'BR(~chi_30 ->
     . ~chi_20 nu_taub nu_tau)'
      endif
      if(brchubd(3,1).ne.0.D0) then
      write(nout,104) brchubd(3,1),3,ic1,iub,id,       'BR(~chi_30 -> ~c
     .hi_1+ ub      d)'
      write(nout,104) brchubd(3,1),3,-ic1,idb,iu,      'BR(~chi_30 -> ~c
     .hi_1- db      u)'
      endif
      if(brchubd(3,2).ne.0.D0) then
      write(nout,104) brchubd(3,2),3,ic2,iub,id,       'BR(~chi_30 -> ~c
     .hi_2+ ub      d)'
      write(nout,104) brchubd(3,2),3,-ic2,idb,iu,      'BR(~chi_30 -> ~c
     .hi_2- db      u)'
      endif
      if(brchcbs(3,1).ne.0.D0) then
      write(nout,104) brchcbs(3,1),3,ic1,icb,is,       'BR(~chi_30 -> ~c
     .hi_1+ cb      s)'
      write(nout,104) brchcbs(3,1),3,-ic1,isb,ic,      'BR(~chi_30 -> ~c
     .hi_1- sb      c)'
      endif
      if(brchcbs(3,2).ne.0.D0) then
      write(nout,104) brchcbs(3,2),3,ic2,icb,is,       'BR(~chi_30 -> ~c
     .hi_2+ cb      s)'
      write(nout,104) brchcbs(3,2),3,-ic2,isb,ic,      'BR(~chi_30 -> ~c
     .hi_2- sb      c)'
      endif
      if(brchtbb(3,1).ne.0.D0) then
      write(nout,104) brchtbb(3,1),3,ic1,itb,ib,       'BR(~chi_30 -> ~c
     .hi_1+ tb      b)'
      write(nout,104) brchtbb(3,1),3,-ic1,ibb,it,      'BR(~chi_30 -> ~c
     .hi_1- bb      t)'
      endif
      if(brchtbb(3,2).ne.0.D0) then
      write(nout,104) brchtbb(3,2),3,ic2,itb,ib,       'BR(~chi_30 -> ~c
     .hi_2+ tb      b)'
      write(nout,104) brchtbb(3,2),3,-ic2,ibb,it,      'BR(~chi_30 -> ~c
     .hi_2- bb      t)'
      endif
      if(brchelne(3,1).ne.0.D0) then
      write(nout,104) brchelne(3,1),3,ic1,-ine,ie,     'BR(~chi_30 -> ~c
     .hi_1+ nu_eb   e-)'
      write(nout,104) brchelne(3,1),3,-ic1,ine,-ie,    'BR(~chi_30 -> ~c
     .hi_1- nu_e    e+)'
      endif
      if(brchelne(3,2).ne.0.D0) then
      write(nout,104) brchelne(3,2),3,ic2,-ine,ie,     'BR(~chi_30 -> ~c
     .hi_2+ nu_eb   e-)'
      write(nout,104) brchelne(3,2),3,-ic2,ine,-ie,    'BR(~chi_30 -> ~c
     .hi_2- nu_e    e+)'
      endif
      if(brchmunmu(3,1).ne.0.D0) then
      write(nout,104) brchmunmu(3,1),3,ic1,-inmu,imu,  'BR(~chi_30 -> ~c
     .hi_1+ nu_mub  mu-)'
      write(nout,104) brchmunmu(3,1),3,-ic1,inmu,-imu, 'BR(~chi_30 -> ~c
     .hi_1- nu_mu   mu+)'
      endif
      if(brchmunmu(3,2).ne.0.D0) then
      write(nout,104) brchmunmu(3,2),3,ic2,-inmu,imu,  'BR(~chi_30 -> ~c
     .hi_2+ nu_mub  mu-)'
      write(nout,104) brchmunmu(3,2),3,-ic2,inmu,-imu, 'BR(~chi_30 -> ~c
     .hi_2- nu_mu   mu+)'
      endif
      if(brchtauntau(3,1).ne.0.D0) then
      write(nout,104) brchtauntau(3,1),3,ic1,-intau,itau, 'BR(~chi_30 ->
     . ~chi_1+ nu_taub tau-)'
      write(nout,104) brchtauntau(3,1),3,-ic1,intau,-itau,'BR(~chi_30 ->
     . ~chi_1- nu_tau  tau+)'
      endif
      if(brchtauntau(3,2).ne.0.D0) then
      write(nout,104) brchtauntau(3,2),3,ic2,-intau,itau, 'BR(~chi_30 ->
     . ~chi_2+ nu_taub tau-)'
      write(nout,104) brchtauntau(3,2),3,-ic2,intau,-itau,'BR(~chi_30 ->
     . ~chi_2- nu_tau  tau+)'
      endif
      if(brglup(3).ne.0.D0) then
      write(nout,104) brglup(3),3,iglo,iub,iu,            'BR(~chi_30 ->
     . ~g      ub      u)'
      endif
      if(brgldo(3).ne.0.D0) then
      write(nout,104) brgldo(3),3,iglo,idb,id,            'BR(~chi_30 ->
     . ~g      db      d)'
      endif
      if(brglch(3).ne.0.D0) then
      write(nout,104) brglch(3),3,iglo,icb,ic,            'BR(~chi_30 ->
     . ~g      cb      c)'
      endif
      if(brglst(3).ne.0.D0) then
      write(nout,104) brglst(3),3,iglo,isb,is,            'BR(~chi_30 ->
     . ~g      sb      s)'
      endif
      if(brgltop(3).ne.0.D0) then
      write(nout,104) brgltop(3),3,iglo,itb,it,           'BR(~chi_30 ->
     . ~g      tb      t)'
      endif
      if(brglbot(3).ne.0.D0) then
      write(nout,104) brglbot(3),3,iglo,ibb,ib,           'BR(~chi_30 ->
     . ~g      bb      b)'
      endif
      endif
      elseif(neuttot(3).eq.0.D0) then
         write(nout,99)
         write(nout,100) 1000025,0.000000000E+00,'neutralino3 decays'
      endif
      endif

c ------------------ c
c neutralino4 decays c
c ------------------ c

      write(nout,105)

      if(flagcondneut(4).eq.10.D0) then
         write(nout,99)
         write(nout,100) 1000035,0.000000000E+00,'neutralino4 decays'
      elseif(flagcondneut(4).eq.40.D0.or.flagcondneut(4).eq.41.D0.or.
     .flagcondneut(4).eq.42.D0) then
      write(nout,99)
      write(nout,100) 1000035,neuttot2(4),'neutralino4 decays'

      write(nout,101)
      if(brneutzneut(4,1).ne.0.D0) then
      write(nout,102) brneutzneut(4,1),2,in1,iz,       'BR(~chi_40 -> ~c
     .hi_10   Z )'
      endif
      if(brneutzneut(4,2).ne.0.D0) then
      write(nout,102) brneutzneut(4,2),2,in2,iz,       'BR(~chi_40 -> ~c
     .hi_20   Z )'
      endif
      if(brneutzneut(4,3).ne.0.D0) then
      write(nout,102) brneutzneut(4,3),2,in3,iz,       'BR(~chi_40 -> ~c
     .hi_30   Z )'
      endif
      if(brneutwchar(4,1).ne.0.D0) then
      write(nout,102) brneutwchar(4,1),2,ic1,-iwc,     'BR(~chi_40 -> ~c
     .hi_1+   W-)'
      write(nout,102) brneutwchar(4,1),2,-ic1,iwc,     'BR(~chi_40 -> ~c
     .hi_1-   W+)'
      endif
      if(brneutwchar(4,2).ne.0.D0) then
      write(nout,102) brneutwchar(4,2),2,ic2,-iwc,     'BR(~chi_40 -> ~c
     .hi_2+   W-)'
      write(nout,102) brneutwchar(4,2),2,-ic2,iwc,     'BR(~chi_40 -> ~c
     .hi_2-   W+)'
      endif
      if(brneuthlneut(4,1).ne.0.D0) then
      write(nout,102) brneuthlneut(4,1),2,in1,ihl,     'BR(~chi_40 -> ~c
     .hi_10   h )'
      endif
      if(brneuthhneut(4,1).ne.0.D0) then
      write(nout,102) brneuthhneut(4,1),2,in1,ihh,     'BR(~chi_40 -> ~c
     .hi_10   H )'
      endif
      if(brneuthaneut(4,1).ne.0.D0) then
      write(nout,102) brneuthaneut(4,1),2,in1,iha,     'BR(~chi_40 -> ~c
     .hi_10   A )'
      endif
      if(brneuthlneut(4,2).ne.0.D0) then
      write(nout,102) brneuthlneut(4,2),2,in2,ihl,     'BR(~chi_40 -> ~c
     .hi_20   h )'
      endif
      if(brneuthhneut(4,2).ne.0.D0) then
      write(nout,102) brneuthhneut(4,2),2,in2,ihh,     'BR(~chi_40 -> ~c
     .hi_20   H )'
      endif
      if(brneuthaneut(4,2).ne.0.D0) then
      write(nout,102) brneuthaneut(4,2),2,in2,iha,     'BR(~chi_40 -> ~c
     .hi_20   A )'
      endif
      if(brneuthlneut(4,3).ne.0.D0) then
      write(nout,102) brneuthlneut(4,3),2,in3,ihl,     'BR(~chi_40 -> ~c
     .hi_30   h )'
      endif
      if(brneuthhneut(4,3).ne.0.D0) then
      write(nout,102) brneuthhneut(4,3),2,in3,ihh,     'BR(~chi_40 -> ~c
     .hi_30   H )'
      endif
      if(brneuthaneut(4,3).ne.0.D0) then
      write(nout,102) brneuthaneut(4,3),2,in3,iha,     'BR(~chi_40 -> ~c
     .hi_30   A )'
      endif
      if(brneuthcchar(4,1).ne.0.D0) then
      write(nout,102) brneuthcchar(4,1),2,ic1,-ihc,    'BR(~chi_40 -> ~c
     .hi_1+   H-)'
      write(nout,102) brneuthcchar(4,1),2,-ic1,ihc,    'BR(~chi_40 -> ~c
     .hi_1-   H+)'
      endif
      if(brneuthcchar(4,2).ne.0.D0) then
      write(nout,102) brneuthcchar(4,2),2,ic2,-ihc,    'BR(~chi_40 -> ~c
     .hi_2+   H-)'
      write(nout,102) brneuthcchar(4,2),2,-ic2,ihc,    'BR(~chi_40 -> ~c
     .hi_2-   H+)'
      endif
      if(brneutsupl(4).ne.0.D0) then
      write(nout,102) brneutsupl(4),2,isul,iub,        'BR(~chi_40 -> ~u
     ._L      ub)'
      write(nout,102) brneutsupl(4),2,-isul,iu,        'BR(~chi_40 -> ~u
     ._L*     u )'
      endif
      if(brneutsupr(4).ne.0.D0) then
      write(nout,102) brneutsupr(4),2,isur,iub,        'BR(~chi_40 -> ~u
     ._R      ub)'
      write(nout,102) brneutsupr(4),2,-isur,iu,        'BR(~chi_40 -> ~u
     ._R*     u )'
      endif
      if(brneutsdownl(4).ne.0.D0) then
      write(nout,102) brneutsdownl(4),2,isdl,idb,      'BR(~chi_40 -> ~d
     ._L      db)'
      write(nout,102) brneutsdownl(4),2,-isdl,id,      'BR(~chi_40 -> ~d
     ._L*     d )'
      endif
      if(brneutsdownr(4).ne.0.D0) then
      write(nout,102) brneutsdownr(4),2,isdr,idb,      'BR(~chi_40 -> ~d
     ._R      db)'
      write(nout,102) brneutsdownr(4),2,-isdr,id,      'BR(~chi_40 -> ~d
     ._R*     d )'
      endif
      if(brneutsupl(4).ne.0.D0) then
      write(nout,102) brneutsupl(4),2,iscl,icb,        'BR(~chi_40 -> ~c
     ._L      cb)'
      write(nout,102) brneutsupl(4),2,-iscl,ic,        'BR(~chi_40 -> ~c
     ._L*     c )'
      endif
      if(brneutsupr(4).ne.0.D0) then
      write(nout,102) brneutsupr(4),2,iscr,icb,        'BR(~chi_40 -> ~c
     ._R      cb)'
      write(nout,102) brneutsupr(4),2,-iscr,ic,        'BR(~chi_40 -> ~c
     ._R*     c )'
      endif
      if(brneutsdownl(4).ne.0.D0) then
      write(nout,102) brneutsdownl(4),2,issl,isb,      'BR(~chi_40 -> ~s
     ._L      sb)'
      write(nout,102) brneutsdownl(4),2,-issl,is,      'BR(~chi_40 -> ~s
     ._L*     s )'
      endif
      if(brneutsdownr(4).ne.0.D0) then
      write(nout,102) brneutsdownr(4),2,issr,isb,      'BR(~chi_40 -> ~s
     ._R      sb)'
      write(nout,102) brneutsdownr(4),2,-issr,is,      'BR(~chi_40 -> ~s
     ._R*     s )'
      endif
      if(brneutst1(4).ne.0.D0) then
      write(nout,102) brneutst1(4),2,ist1,itb,         'BR(~chi_40 -> ~t
     ._1      tb)'
      write(nout,102) brneutst1(4),2,-ist1,it,         'BR(~chi_40 -> ~t
     ._1*     t )'
      endif
      if(brneutst2(4).ne.0.D0) then
      write(nout,102) brneutst2(4),2,ist2,itb,         'BR(~chi_40 -> ~t
     ._2      tb)'
      write(nout,102) brneutst2(4),2,-ist2,it,         'BR(~chi_40 -> ~t
     ._2*     t )'
      endif
      if(brneutsb1(4).ne.0.D0) then
      write(nout,102) brneutsb1(4),2,isb1,ibb,         'BR(~chi_40 -> ~b
     ._1      bb)'
      write(nout,102) brneutsb1(4),2,-isb1,ib,         'BR(~chi_40 -> ~b
     ._1*     b )'
      endif
      if(brneutsb2(4).ne.0.D0) then
      write(nout,102) brneutsb2(4),2,isb2,ibb,         'BR(~chi_40 -> ~b
     ._2      bb)'
      write(nout,102) brneutsb2(4),2,-isb2,ib,         'BR(~chi_40 -> ~b
     ._2*     b )'
      endif
      if(brneutsell(4).ne.0.D0) then
      write(nout,102) brneutsell(4),2,isell,-ie,       'BR(~chi_40 -> ~e
     ._L-     e+)'
      write(nout,102) brneutsell(4),2,-isell,ie,       'BR(~chi_40 -> ~e
     ._L+     e-)'
      endif
      if(brneutselr(4).ne.0.D0) then
      write(nout,102) brneutselr(4),2,iselr,-ie,       'BR(~chi_40 -> ~e
     ._R-     e+)'
      write(nout,102) brneutselr(4),2,-iselr,ie,       'BR(~chi_40 -> ~e
     ._R+     e-)'
      endif
      if(brneutsell(4).ne.0.D0) then
      write(nout,102) brneutsell(4),2,ismul,-imu,      'BR(~chi_40 -> ~m
     .u_L-    mu+)' 
      write(nout,102) brneutsell(4),2,-ismul,imu,      'BR(~chi_40 -> ~m
     .u_L+    mu-)' 
      endif
      if(brneutselr(4).ne.0.D0) then      
      write(nout,102) brneutselr(4),2,ismur,-imu,      'BR(~chi_40 -> ~m
     .u_R-    mu+)' 
      write(nout,102) brneutselr(4),2,-ismur,imu,      'BR(~chi_40 -> ~m
     .u_R+    mu-)'
      endif
      if(brneutstau1(4).ne.0.D0) then
      write(nout,102) brneutstau1(4),2,istau1,-itau,   'BR(~chi_40 -> ~t
     .au_1-   tau+)'
      write(nout,102) brneutstau1(4),2,-istau1,itau,   'BR(~chi_40 -> ~t
     .au_1+   tau-)'
      endif
      if(brneutstau2(4).ne.0.D0) then
      write(nout,102) brneutstau2(4),2,istau2,-itau,   'BR(~chi_40 -> ~t
     .au_2-   tau+)'
      write(nout,102) brneutstau2(4),2,-istau2,itau,   'BR(~chi_40 -> ~t
     .au_2+   tau-)'
      endif
      if(brneutsnel(4).ne.0.D0) then
      write(nout,102) brneutsnel(4),2,inel,-ine,       'BR(~chi_40 -> ~n
     .u_eL    nu_eb)'
      write(nout,102) brneutsnel(4),2,-inel,ine,       'BR(~chi_40 -> ~n
     .u_eL*   nu_e )'
      write(nout,102) brneutsnel(4),2,inmul,-inmu,     'BR(~chi_40 -> ~n
     .u_muL   nu_mub)'
      write(nout,102) brneutsnel(4),2,-inmul,inmu,     'BR(~chi_40 -> ~n
     .u_muL*  nu_mu )'
      endif
      if(brneutsn1(4).ne.0.D0) then
      write(nout,102) brneutsn1(4),2,intau1,-intau,    'BR(~chi_40 -> ~n
     .u_tau1  nu_taub)'
      write(nout,102) brneutsn1(4),2,-intau1,intau,    'BR(~chi_40 -> ~n
     .u_tau1* nu_tau )'
      endif
      if(flagnlspgmsb.eq.1.D0) then
         if(brneutgamgrav(4).ne.0.D0) then
      write(nout,102) brneutgamgrav(4),2,igrav,iga,    'BR(~chi_40 -> ~G
     .        gam)'
      endif
      if(brneutzgrav(4).ne.0.D0) then
      write(nout,102) brneutzgrav(4),2,igrav,iz,       'BR(~chi_40 -> ~G
     .        Z)'
      endif
      if(brneuthlgrav(4).ne.0.D0) then
      write(nout,102) brneuthlgrav(4),2,igrav,ihl,     'BR(~chi_40 -> ~G
     .        h)'
      endif
      if(brneuthhgrav(4).ne.0.D0) then
      write(nout,102) brneuthhgrav(4),2,igrav,ihh,     'BR(~chi_40 -> ~G
     .        H)'
      endif
      if(brneuthagrav(4).ne.0.D0) then
      write(nout,102) brneuthagrav(4),2,igrav,iha,     'BR(~chi_40 -> ~G
     .        A)'
      endif
      endif

      elseif(flagcondneut(4).eq.11.D0.or.flagcondneut(4).eq.12.D0) then
         if(neuttot(4).ne.0.D0) then
            write(nout,99)
            write(nout,100) 1000035,neuttot(4),'neutralino4 decays'
            if(flagloop.eq.1.D0) then
      write(nout,101)
      if(brnraddec(4,1).ne.0.D0) then
      write(nout,102) brnraddec(4,1),2,in1,iga,        'BR(~chi_40 -> ~c
     .hi_10 gam)'
      endif
      if(brnraddec(4,2).ne.0.D0) then
      write(nout,102) brnraddec(4,2),2,in2,iga,        'BR(~chi_40 -> ~c
     .hi_20 gam)'
      endif
      if(brnraddec(4,3).ne.0.D0) then
      write(nout,102) brnraddec(4,3),2,in3,iga,        'BR(~chi_40 -> ~c
     .hi_30 gam)'
      endif
            endif
c
      if(flagnlspgmsb.eq.1.D0) then
      write(nout,101)
         if(brneutgamgrav(4).ne.0.D0) then
      write(nout,102) brneutgamgrav(4),2,igrav,iga,    'BR(~chi_40 -> ~G
     .        gam)'
      endif
      if(brneutzgrav(4).ne.0.D0) then
      write(nout,102) brneutzgrav(4),2,igrav,iz,       'BR(~chi_40 -> ~G
     .        Z)'
      endif
      if(brneuthlgrav(4).ne.0.D0) then
      write(nout,102) brneuthlgrav(4),2,igrav,ihl,     'BR(~chi_40 -> ~G
     .        h)'
      endif
      if(brneuthhgrav(4).ne.0.D0) then
      write(nout,102) brneuthhgrav(4),2,igrav,ihh,     'BR(~chi_40 -> ~G
     .        H)'
      endif
      if(brneuthagrav(4).ne.0.D0) then
      write(nout,102) brneuthagrav(4),2,igrav,iha,     'BR(~chi_40 -> ~G
     .        A)'
      endif
      endif
c
            if(flagmulti.eq.1.D0) then
      if(flagneut3bod(4).eq.1.D0) then
      write(nout,103) 
      endif
      if(brneutup(4,1).ne.0.D0) then
      write(nout,104) brneutup(4,1),3,in1,iub,iu,      'BR(~chi_40 -> ~c
     .hi_10 ub      u)'
      endif
      if(brneutdow(4,1).ne.0.D0) then
      write(nout,104) brneutdow(4,1),3,in1,idb,id,     'BR(~chi_40 -> ~c
     .hi_10 db      d)'
      endif
      if(brneutch(4,1).ne.0.D0) then
      write(nout,104) brneutch(4,1),3,in1,icb,ic,      'BR(~chi_40 -> ~c
     .hi_10 cb      c)'
      endif
      if(brneutst(4,1).ne.0.D0) then
      write(nout,104) brneutst(4,1),3,in1,isb,is,      'BR(~chi_40 -> ~c
     .hi_10 sb      s)'
      endif
      if(brneuttop(4,1).ne.0.D0) then
      write(nout,104) brneuttop(4,1),3,in1,itb,it,     'BR(~chi_40 -> ~c
     .hi_10 tb      t)'
      endif
      if(brneutbot(4,1).ne.0.D0) then
      write(nout,104) brneutbot(4,1),3,in1,ibb,ib,     'BR(~chi_40 -> ~c
     .hi_10 bb      b)'
      endif
      if(brneutel(4,1).ne.0.D0) then
      write(nout,104) brneutel(4,1),3,in1,-ie,ie,      'BR(~chi_40 -> ~c
     .hi_10 e+      e-)'
      endif
      if(brneutmu(4,1).ne.0.D0) then
      write(nout,104) brneutmu(4,1),3,in1,-imu,imu,    'BR(~chi_40 -> ~c
     .hi_10 mu+     mu-)'
      endif
      if(brneuttau(4,1).ne.0.D0) then
      write(nout,104) brneuttau(4,1),3,in1,-itau,itau, 'BR(~chi_40 -> ~c
     .hi_10 tau+    tau-)'
      endif
      if(brneutnue(4,1).ne.0.D0) then
      write(nout,104) brneutnue(4,1),3,in1,-ine,ine,   'BR(~chi_40 -> ~c
     .hi_10 nu_eb   nu_e)'
      endif
      if(brneutnumu(4,1).ne.0.D0) then
      write(nout,104) brneutnumu(4,1),3,in1,-inmu,inmu,'BR(~chi_40 -> ~c
     .hi_10 nu_mub  nu_mu)'
      endif
      if(brneutnutau(4,1).ne.0.D0) then
      write(nout,104) brneutnutau(4,1),3,in1,-intau,intau,'BR(~chi_40 ->
     . ~chi_10 nu_taub nu_tau)'
      endif
      if(brneutup(4,2).ne.0.D0) then
      write(nout,104) brneutup(4,2),3,in2,iub,iu,      'BR(~chi_40 -> ~c
     .hi_20 ub      u)'
      endif
      if(brneutdow(4,2).ne.0.D0) then
      write(nout,104) brneutdow(4,2),3,in2,idb,id,     'BR(~chi_40 -> ~c
     .hi_20 db      d)'
      endif
      if(brneutch(4,2).ne.0.D0) then
      write(nout,104) brneutch(4,2),3,in2,icb,ic,      'BR(~chi_40 -> ~c
     .hi_20 cb      c)'
      endif
      if(brneutst(4,2).ne.0.D0) then
      write(nout,104) brneutst(4,2),3,in2,isb,is,      'BR(~chi_40 -> ~c
     .hi_20 sb      s)'
      endif
      if(brneuttop(4,2).ne.0.D0) then
      write(nout,104) brneuttop(4,2),3,in2,itb,it,     'BR(~chi_40 -> ~c
     .hi_20 tb      t)'
      endif
      if(brneutbot(4,2).ne.0.D0) then
      write(nout,104) brneutbot(4,2),3,in2,ibb,ib,     'BR(~chi_40 -> ~c
     .hi_20 bb      b)'
      endif
      if(brneutel(4,2).ne.0.D0) then
      write(nout,104) brneutel(4,2),3,in2,-ie,ie,      'BR(~chi_40 -> ~c
     .hi_20 e+      e-)'
      endif
      if(brneutmu(4,2).ne.0.D0) then
      write(nout,104) brneutmu(4,2),3,in2,-imu,imu,    'BR(~chi_40 -> ~c
     .hi_20 mu+     mu-)'
      endif
      if(brneuttau(4,2).ne.0.D0) then
      write(nout,104) brneuttau(4,2),3,in2,-itau,itau, 'BR(~chi_40 -> ~c
     .hi_20 tau+    tau-)'
      endif
      if(brneutnue(4,2).ne.0.D0) then
      write(nout,104) brneutnue(4,2),3,in2,-ine,ine,   'BR(~chi_40 -> ~c
     .hi_20 nu_eb   nu_e)'
      endif
      if(brneutnumu(4,2).ne.0.D0) then
      write(nout,104) brneutnumu(4,2),3,in2,-inmu,inmu,'BR(~chi_40 -> ~c
     .hi_20 nu_mub  nu_mu)'
      endif
      if(brneutnutau(4,2).ne.0.D0) then
      write(nout,104) brneutnutau(4,2),3,in2,-intau,intau,'BR(~chi_40 ->
     . ~chi_20 nu_taub nu_tau)'
      endif
      if(brneutup(4,3).ne.0.D0) then
      write(nout,104) brneutup(4,3),3,in3,iub,iu,      'BR(~chi_40 -> ~c
     .hi_30 ub      u)'
      endif
      if(brneutdow(4,3).ne.0.D0) then
      write(nout,104) brneutdow(4,3),3,in3,idb,id,     'BR(~chi_40 -> ~c
     .hi_30 db      d)'
      endif
      if(brneutch(4,3).ne.0.D0) then
      write(nout,104) brneutch(4,3),3,in3,icb,ic,      'BR(~chi_40 -> ~c
     .hi_30 cb      c)'
      endif
      if(brneutst(4,3).ne.0.D0) then
      write(nout,104) brneutst(4,3),3,in3,isb,is,      'BR(~chi_40 -> ~c
     .hi_30 sb      s)'
      endif
      if(brneuttop(4,3).ne.0.D0) then
      write(nout,104) brneuttop(4,3),3,in3,itb,it,     'BR(~chi_40 -> ~c
     .hi_30 tb      t)'
      endif
      if(brneutbot(4,3).ne.0.D0) then
      write(nout,104) brneutbot(4,3),3,in3,ibb,ib,     'BR(~chi_40 -> ~c
     .hi_30 bb      b)'
      endif
      if(brneutel(4,3).ne.0.D0) then
      write(nout,104) brneutel(4,3),3,in3,-ie,ie,      'BR(~chi_40 -> ~c
     .hi_30 e+      e-)'
      endif
      if(brneutmu(4,3).ne.0.D0) then
      write(nout,104) brneutmu(4,3),3,in3,-imu,imu,    'BR(~chi_40 -> ~c
     .hi_30 mu+     mu-)'
      endif
      if(brneuttau(4,3).ne.0.D0) then
      write(nout,104) brneuttau(4,3),3,in3,-itau,itau, 'BR(~chi_40 -> ~c
     .hi_30 tau+    tau-)'
      endif
      if(brneutnue(4,3).ne.0.D0) then
      write(nout,104) brneutnue(4,3),3,in3,-ine,ine,   'BR(~chi_40 -> ~c
     .hi_30 nu_eb   nu_e)'
      endif
      if(brneutnumu(4,3).ne.0.D0) then
      write(nout,104) brneutnumu(4,3),3,in3,-inmu,inmu,'BR(~chi_40 -> ~c
     .hi_30 nu_mub  nu_mu)'
      endif
      if(brneutnutau(4,3).ne.0.D0) then
      write(nout,104) brneutnutau(4,3),3,in3,-intau,intau,'BR(~chi_40 ->
     . ~chi_30 nu_taub nu_tau)'
      endif
      if(brchubd(4,1).ne.0.D0) then
      write(nout,104) brchubd(4,1),3,ic1,iub,id,       'BR(~chi_40 -> ~c
     .hi_1+ ub      d)'
      write(nout,104) brchubd(4,1),3,-ic1,idb,iu,      'BR(~chi_40 -> ~c
     .hi_1- db      u)'
      endif
      if(brchubd(4,2).ne.0.D0) then
      write(nout,104) brchubd(4,2),3,ic2,iub,id,       'BR(~chi_40 -> ~c
     .hi_2+ ub      d)'
      write(nout,104) brchubd(4,2),3,-ic2,idb,iu,      'BR(~chi_40 -> ~c
     .hi_2- db      u)'
      endif
      if(brchcbs(4,1).ne.0.D0) then
      write(nout,104) brchcbs(4,1),3,ic1,icb,is,       'BR(~chi_40 -> ~c
     .hi_1+ cb      s)'
      write(nout,104) brchcbs(4,1),3,-ic1,isb,ic,      'BR(~chi_40 -> ~c
     .hi_1- sb      c)'
      endif
      if(brchcbs(4,2).ne.0.D0) then
      write(nout,104) brchcbs(4,2),3,ic2,icb,is,       'BR(~chi_40 -> ~c
     .hi_2+ cb      s)'
      write(nout,104) brchcbs(4,2),3,-ic2,isb,ic,      'BR(~chi_40 -> ~c
     .hi_2- sb      c)'
      endif
      if(brchtbb(4,1).ne.0.D0) then
      write(nout,104) brchtbb(4,1),3,ic1,itb,ib,       'BR(~chi_40 -> ~c
     .hi_1+ tb      b)'
      write(nout,104) brchtbb(4,1),3,-ic1,ibb,it,      'BR(~chi_40 -> ~c
     .hi_1- bb      t)'
      endif
      if(brchtbb(4,2).ne.0.D0) then
      write(nout,104) brchtbb(4,2),3,ic2,itb,ib,       'BR(~chi_40 -> ~c
     .hi_2+ tb      b)'
      write(nout,104) brchtbb(4,2),3,-ic2,ibb,it,      'BR(~chi_40 -> ~c
     .hi_2- bb      t)'
      endif
      if(brchelne(4,1).ne.0.D0) then
      write(nout,104) brchelne(4,1),3,ic1,-ine,ie,     'BR(~chi_40 -> ~c
     .hi_1+ nu_eb   e-)'
      write(nout,104) brchelne(4,1),3,-ic1,ine,-ie,    'BR(~chi_40 -> ~c
     .hi_1- nu_e    e+)'
      endif
      if(brchelne(4,2).ne.0.D0) then
      write(nout,104) brchelne(4,2),3,ic2,-ine,ie,     'BR(~chi_40 -> ~c
     .hi_2+ nu_eb   e-)'
      write(nout,104) brchelne(4,2),3,-ic2,ine,-ie,    'BR(~chi_40 -> ~c
     .hi_2- nu_e    e+)'
      endif
      if(brchmunmu(4,1).ne.0.D0) then
      write(nout,104) brchmunmu(4,1),3,ic1,-inmu,imu,  'BR(~chi_40 -> ~c
     .hi_1+ nu_mub  mu-)'
      write(nout,104) brchmunmu(4,1),3,-ic1,inmu,-imu, 'BR(~chi_40 -> ~c
     .hi_1- nu_mu   mu+)'
      endif
      if(brchmunmu(4,2).ne.0.D0) then
      write(nout,104) brchmunmu(4,2),3,ic2,-inmu,imu,  'BR(~chi_40 -> ~c
     .hi_2+ nu_mub  mu-)'
      write(nout,104) brchmunmu(4,2),3,-ic2,inmu,-imu, 'BR(~chi_40 -> ~c
     .hi_2- nu_mu   mu+)'
      endif
      if(brchtauntau(4,1).ne.0.D0) then
      write(nout,104) brchtauntau(4,1),3,ic1,-intau,itau, 'BR(~chi_40 ->
     . ~chi_1+ nu_taub tau-)'
      write(nout,104) brchtauntau(4,1),3,-ic1,intau,-itau,'BR(~chi_40 ->
     . ~chi_1- nu_tau  tau+)'
      endif
      if(brchtauntau(4,2).ne.0.D0) then
      write(nout,104) brchtauntau(4,2),3,ic2,-intau,itau, 'BR(~chi_40 ->
     . ~chi_2+ nu_taub tau-)'
      write(nout,104) brchtauntau(4,2),3,-ic2,intau,-itau,'BR(~chi_40 ->
     . ~chi_2- nu_tau  tau+)'
      endif
      if(brglup(4).ne.0.D0) then
      write(nout,104) brglup(4),3,iglo,iub,iu,            'BR(~chi_40 ->
     . ~g      ub      u)'
      endif
      if(brgldo(4).ne.0.D0) then
      write(nout,104) brgldo(4),3,iglo,idb,id,            'BR(~chi_40 ->
     . ~g      db      d)'
      endif
      if(brglch(4).ne.0.D0) then
      write(nout,104) brglch(4),3,iglo,icb,ic,            'BR(~chi_40 ->
     . ~g      cb      c)'
      endif
      if(brglst(4).ne.0.D0) then
      write(nout,104) brglst(4),3,iglo,isb,is,            'BR(~chi_40 ->
     . ~g      sb      s)'
      endif
      if(brgltop(4).ne.0.D0) then
      write(nout,104) brgltop(4),3,iglo,itb,it,           'BR(~chi_40 ->
     . ~g      tb      t)'
      endif
      if(brglbot(4).ne.0.D0)  then
      write(nout,104) brglbot(4),3,iglo,ibb,ib,           'BR(~chi_40 ->
     . ~g      bb      b)'
      endif
      endif
      elseif(neuttot(4).eq.0.D0) then
      write(nout,99)
      write(nout,100) 1000035,0.000000000E+00,'neutralino4 decays'
      endif
      endif

c ---------------- output not a la Les Houches accord ---------------- c

      else

      write(21,*)
      write(21,*) "                               ====================="
      write(21,*) "                               | THE SDECAY OUTPUT |"
      write(21,*) "                               ==================== "
      write(21,*)
      write(21,*)

      write(21,*)'SDECAY 1.3'
      write(21,*)'Authors: M.Muhlleitner, A.Djouadi and Y.Mambrini'
      write(21,*)'Comput.Phys.Commun.168(2005)46 [hep-ph/0311167]'
      write(21,*)'In case of problems please send an email to'
      write(21,*)'muehlleitner@lapp.in2p3.fr' 
      write(21,*)'djouadi@mail.cern.ch'
      write(21,*)'yann.mambrini@th.u-psud.fr'
      write(21,*)
      write(21,*)'If not stated otherwise all couplings and masses'
      write(21,*)'are given at the scale of the electroweak symmetry' 
      write(21,*)'breaking Q=',scaleofewsb
      write(21,*)
      write(21,*)

      write(21,*) " Notation: " 
      write(21,*) " --------- "

      write(21,*) " bosons: gm = gamma, gl = gluon, G = Gravitino" 
      write(21,*) 

      write(21,*) " fermions: up   = up,         ub   = up_bar,     dn =
     . down,    db = down_bar, " 
      write(21,*) "           ch   = charm,      cb   = charm_bar,  st =
     . strange, sb = strange_bar," 
      write(21,*) "           bt   = bottom,     bb   = bottom_bar, tp =
     . top,     tb = top_bar, "
      write(21,*) "           e+   = positron,   e-   = electron,   mu+=
     . muon_+,  mu-= muon_-   "
      write(21,*) "           tau+ = tau_+,      tau- = tau_- "
      write(21,*) "           nue  = neutrino_electron, num = neutrino_m
     .uon,"
      write(21,*) "           nueb = neutrino_el_bar,   numb = neutrino_
     .muon_bar,"
      write(21,*) "           nut  = neutrino_tau,      nutb = neutrino_
     .tau_bar"

      write(21,*)
      write(21,*) " sfermions: supl/r   = sup_L/R,       subl/r   = sup_
     .L/R_bar, "
      write(21,*) "            sdnl/r   = sdown_L/R_bar, sdbl/r   = sdow
     .n_L/R_bar, "
      write(21,*) "            schl/r   = scharm_L/R,    scbl/r   = scha
     .rm_L/R_bar, "
      write(21,*) "            sstl/r   = sstrange_L/R,  ssbl/r   = sstr
     .ange_L/R_bar, " 
      write(21,*) "            stop1/2  = stop_1/2,      stop1/2b = stop
     ._1/2_bar, " 
      write(21,*) "            sbot1/2  = sbottom_1/2,   sbot1/2b = sbot
     .tom_1/2_bar,"
      write(21,*) "            sel+/-   = selectronL+/-, ser+/-   = sele
     .ctronR+/-, "
      write(21,*) "            smul+/-  = smuonL+/-,     smur+/-  = smuo
     .nR+/-, "     
      write(21,*) "            stau1+/- = stau_1+/-,     stau2+/- = stau
     ._2+/-, "
      write(21,*) "            snuel = sneutrino_el_L,   snuml  = sneutr
     .ino_muon_L, "
      write(21,*) "            snut1 = sneutrino_tau_1,  snuelb = sneutr
     .ino_el_L_bar "
      write(21,*) "            snumlb= sneutrino_mu_L_bar, snut1b = sneu
     .trino_tau_1_bar "  

      write(21,*) 
      write(21,*) " gauginos: chi0_1/2/3/4 = neutralino1/2/3/4, chi+_1/2
     . = chargino_1/2_+ "

c -------------------------------------------------------------------- c

      unlikely = -123456789D0

      if(check(2).ne.1) then
         write(nout,105)
         write(nout,50)'WARNING: The Block SMINPUTS has not been given.'
         write(nout,50)'At least mb(mb)_MSbar is needed in SDECAY 
     .however.'
      endif

      if(check(3).ne.1.and.check(4).ne.1) then
         write(nout,105)
         write(nout,50)'WARNING: Neither Block EXTPAR nor Block MINPAR h
     .as been given.'
         write(nout,50)'For SDECAY necessary parameters might miss.'
      endif

      if(check(4).ne.1.and.check(15).ne.1) then
         write(nout,105)
         write(nout,50)'WARNING: The soft SUSY breaking masses have not
     .been given.'
      endif

      if(check(4).ne.1.and.check(16).ne.1) then
         write(nout,105)
         write(nout,50)'WARNING: AU has not been given. It is needed in 
     .SDECAY however.'
      endif

      if(check(4).ne.1.and.check(17).ne.1) then
         write(nout,105)
         write(nout,50)'WARNING: AD has not been given. It is needed in 
     .SDECAY however.'
      endif

      if(check(4).ne.1.and.check(18).ne.1) then
         write(nout,105)
         write(nout,50)'WARNING: AE has not been given. It is needed in 
     .SDECAY however.'
      endif

      if(check(5).ne.1) then
         write(nout,105)
         write(nout,50)'WARNING: The Block MASS has not been given. It i
     .s needed in SDECAY however.'
      endif

      if(check(6).ne.1) then
         write(nout,105)
         write(nout,50)'WARNING: The Block NMIX has not been given. It i
     .s needed in SDECAY however.'
      endif

      if(check(7).ne.1) then
         write(nout,105)
         write(nout,50)'WARNING: The Block UMIX has not been given. It i
     .s needed in SDECAY however.'
      endif

      if(check(8).ne.1) then
         write(nout,105)
         write(nout,50)'WARNING: The Block VMIX has not been given. It i
     .s needed in SDECAY however.'
      endif

      if(check(9).ne.1) then
         write(nout,105)
         write(nout,50)'WARNING: The Block STOPMIX has not been given. I
     .t is needed in SDECAY however.'
      endif

      if(check(10).ne.1) then
         write(nout,105)
         write(nout,50)'WARNING: The Block SBOTMIX has not been given. I
     .t is needed in SDECAY however.'
      endif

      if(check(11).ne.1) then
         write(nout,105)
         write(nout,50)'WARNING: The Block STAUMIX has not been given. I
     .t is needed in SDECAY however.'
      endif

      if(check(12).ne.1) then
         write(nout,105)
         write(nout,50)'WARNING: The Block ALPHA has not been given. It 
     .is needed in SDECAY however.'
      endif

      if(check(13).ne.1) then
         write(nout,105)
         write(nout,50)'WARHNING: The Block HMIX has not been given.'
         write(nout,50)'It is needed for a consistent calculation howeve
     .r'
      endif

      if(check(14).ne.1) then
         write(nout,105)
         write(nout,50)'WARHNING: The Block GAUGE has not been given.'
         write(nout,50)'It is needed for a consistent calculation howeve
     .r'
      endif

      if(check(19).ne.1) then
         write(nout,105)
         write(nout,50)'WARNING: The Block YU has not been given. It is 
     .needed in SDECAY however.'
      endif

      if(check(20).ne.1) then
         write(nout,105)
         write(nout,50)'WARNING: The Block YD has not been given. It is 
     .needed in SDECAY however.'
      endif

      if(check(21).ne.1) then
         write(nout,105)
         write(nout,50)'WARNING: The Block YE has not been given. It is 
     .needed in SDECAY however.'
      endif

      if(hmixval(3).eq.unlikely) then
         write(nout,105)
         write(nout,50)'WARNING: The DRbar value for the VEV at the scal
     .e Q has not been given.'
         write(nout,50)'Instead v=246 GeV has been chosen.'
         write(nout,50)'However, the QCD corrections to the decays canno
     .t be calculated consistently'
         write(nout,50)'in this case.'
      endif

      if(warning(1).eq.1.D0) then
         write(nout,105)
         write(nout,50)'WARNING: No scale Q has been given.'
      endif

      if(warning(2).eq.1.D0) then
         write(nout,105)
         write(nout,50)'WARNING: For the gauge couplings g1 and g2 the 
     .DRbar values at the scale Q are not given.'
         write(nout,50)'They are calculated instead from alpha_ew_MSbar 
     .at M_Z.'
         write(nout,50)'The decay widths and the QCD corrections cannot
     .be calculated consistently.'
      endif

      if(warning(3).eq.1.D0) then
         write(nout,105)
         write(nout,50)'WARNING: No DRbar value for tanbeta has been giv
     .en at the scale Q.'
         write(nout,50)'tanbeta at the scale M_input is taken instead.'
      endif

      if(warning(4).eq.1.D0) then
         write(nout,105)
         write(nout,50)'WARNING: No DRbar value for tanbeta has been giv
     .en at the scale Q.'
         write(nout,50)'tanbeta at the scale M_Z is taken instead.'
      endif

      if(warning(5).eq.1.D0) then
         write(nout,105)
         write(nout,50)'WARNING: No value for tanbeta has been given.'
         write(nout,50)'It is needed in SDECAY however.'
      endif

c ----------------------------------- c
c Information about the decay program c
c ----------------------------------- c

      write(21,*)
      write(21,*)
      write(21,*) " Decay Program information"
      write(21,*) " -------------------------"
      write(21,*) " SDECAY      decay calculator"
      write(21,*) " 1.3         version number"

c ----------------------------------------------------------------- c
c The program information: Which spectrum calculator has been used. c
c ----------------------------------------------------------------- c

      write(21,*)
      write(21,*) " Spectrum calculator information"
      write(21,*) " -------------------------------"
      write(nout,661) spinfo1(1:50)
      write(nout,661) spinfo2(1:50)

c ------------------------------------------------ c
c Information on the model which has been selected c
c ------------------------------------------------ c

      write(21,*)
      write(21,*) " Model selection"
      write(21,*) " ---------------"
      write(nout,662) modselval(1:50)

c ----------------------- c
c The SM input parameters c
c ----------------------- c

      if(check(2).eq.1) then
         write(21,*)
         write(21,*) " Standard Model inputs"
         write(21,*) " ---------------------"
         write(nout,552) 1.D0/salpha_MS,'alpha_em^-1(M_Z)^MSbar'
         write(nout,552) sdgf,'G_F [GeV^-2]'
         write(nout,552) alphasmzms,'alpha_S(M_Z)^MSbar'
         write(nout,552) amzp,'M_Z pole mass'
         write(nout,552) mbmsbar,'mb(mb)^MSbar'
         write(nout,552) samt,'mt pole mass'
         write(nout,552) samtau,'mtau pole mass'
      endif

c ------------------------------------------------------------------- c
c The input parameters for the minimal/default SUSY model given above c
c ------------------------------------------------------------------- c

      if(check(3).eq.1) then
         write(21,*)
         write(21,*) " Input parameters - minimal models"
         write(21,*) " ---------------------------------"
         unlikely = -123456789D0
         do ii=1,20,1
            if(minval(ii).ne.unlikely) then
               write(nout,552) minval(ii),mincom(ii)
            endif
         end do
      endif

c -------------------------------------------------------------------- c

c ---------------------------- c
c Non-minimal input parameters c
c ---------------------------- c

      if(check(15).eq.1) then
      write(21,*)
      write(21,*) "Input parameters - non-minimal models"
      write(21,*) "-------------------------------------"

      unlikely = -123456789D0
      do ii=1,100,1
         if(extval(ii-1).ne.unlikely) then
            write(nout,552) extval(ii-1),extcom(ii-1)
         endif
      end do

      endif

c ----------------------- c
c The W+ and b-quark mass c
c ----------------------- c

      write(21,*)
      write(21,*) " The W+ and b-quark mass"
      write(21,*) " -----------------------"
      write(nout,552) amwp,'W+'
      write(nout,552) samb,'b-quark pole mass calculated from mb(mb)_Msb
     .ar'

c -------------------------------------------------------------------- c

      write(21,*)
      write(21,*) " Higgs and SUSY particle mass spectrum"
      write(21,*) " -------------------------------------"
      write(21,*) "    h            H            A            H+"
      write(21,*) aml,amh,ama,amch
      write(21,*)
      write(21,*) "   chi+_1      chi+_2"
      write(21,*) amchar(1),amchar(2)
      write(21,*)
      write(21,*) "   chi0_1      chi0_2      chi0_3      chi0_4"
      write(21,*) xmneut(1),xmneut(2),xmneut(3),xmneut(4)
      write(21,*)
      write(21,*) "   gluino"
      write(21,*) mgluino
      write(21,*)
      write(21,*) "   supl         supr       sdnl        sdnr"  
      write(21,*) asup1,asup2,asdown1,asdown2
      write(21,*)
      write(21,*) "   schl         schr       sstl        sstr"
      write(21,*) asup1,asup2,asdown1,asdown2
      write(21,*)
      write(21,*) "   stop1        stop2      sbot1       sbot2"
      write(21,*) ast1,ast2,asb1,asb2
      write(21,*)
      write(21,*) "   sel          ser        smul        smur"
      write(21,*) ase1,ase2,ase1,ase2
      write(21,*)
      write(21,*) "   stau1        stau2"
      write(21,*) astau1,astau2
      write(21,*)
      write(21,*) "   snuel        snuml      snut1"
      write(21,*) asne1,asne1,asntau1
      if(mgravitino.ne.unlikely) then
      write(21,*)
      write(21,*) "   gravitino"
      write(21,*) mgravitino
      endif

      write(21,*) 
      write(21,*)
      write(21,*) " Mass matrices and mixing angles"
      write(21,*) " -------------------------------"
      write(21,*) " Q =",scaleofewsb
      if(check(12).eq.1) then
         write(21,*)
         write(21,*) "  alpha(h,H)"
         write(21,*) alp_mssm
      endif
      if(check(9).eq.1.and.check(10).eq.1.and.check(11).eq.1) then
         write(21,*)
         write(21,*) "  theta_t      theta_b    theta_tau"
         write(21,*) sdthet,sdtheb,sdthel 
      endif
      if(check(6).eq.1) then
         write(21,*)
         write(21,*) " N(i,j) Neutralino mixing matrix"
         write(21,202) " i=1 ",zz(1,1),zz(1,2),zz(1,3),zz(1,4)
         write(21,202) " i=2 ",zz(2,1),zz(2,2),zz(2,3),zz(2,4)
         write(21,202) " i=3 ",zz(3,1),zz(3,2),zz(3,3),zz(3,4)
         write(21,202) " i=4 ",zz(4,1),zz(4,2),zz(4,3),zz(4,4)
      endif
      if(check(7).eq.1) then
         write(21,*)
         write(21,*) " U(i,j) Chargino mixing matrix U"
         write(21,204) " i=1 ",uu(1,1),uu(1,2)
         write(21,204) " i=2 ",uu(2,1),uu(2,2)
      endif
      if(check(8).eq.1) then
         write(21,*)
         write(21,*) " V(i,j) Chargino mixing matrix V"
         write(21,204) " i=1 ",vv(1,1),vv(1,2)
         write(21,204) " i=2 ",vv(2,1),vv(2,2)
      endif

      if(check(13).eq.1) then
         write(21,*)
         write(21,*)
         write(21,*) " DRbar Higgs parameters at the scale Q"
         write(21,*) " -------------------------------------"
         unlikely = -123456789D0
         do ii=1,10,1
            if(hmixval(ii).ne.unlikely) then
               write(nout,552) hmixval(ii),hmixcom(ii)
            endif
         end do
      endif

      write(21,*)
      write(21,*)
      write(21,*) " The gauge couplings at the scale Q"
      write(21,*) " ----------------------------------"
      write(21,*) " Q =",scaleofewsb
      write(21,*) " gprime DRbar =",g1ew
      write(21,*) " g DRbar      =",g2ew
      write(21,*)
      if(scalechoice.eq.1.D0) then
         write(21,*) " Q =",scaleofewsb
      elseif(scalechoice.eq.2.D0) then
         if(idrbar.eq.1) then
            write(21,*) " Q = mass of the decaying particle"
         elseif(idrbar.eq.0) then
            write(21,*) " Q = mass of the decaying particle"
         endif
      elseif(scalechoice.eq.3.D0) then
         if(idrbar.eq.1) then
            write(21,*) " Q =",scaleofcoupling
         elseif(idrbar.eq.0) then
            write(21,*) " Q =",scaleofcoupling
         endif
      endif 
      if(scalechoice.eq.1.D0) then 
         write(21,*) " alpha_s DRbar   =",alsew
      elseif(scalechoice.eq.2.D0) then
         if(idrbar.eq.1) then
            write(21,*) " alpha_s DRbar   = depends on the decaying part
     .icle"
         elseif(idrbar.eq.0) then
            write(21,*) " alpha_s MSbar   = depends on the decaying part
     .icle"
         endif
      elseif(scalechoice.eq.3.D0) then
         if(idrbar.eq.1) then
            write(21,*) " alpha_s DRbar   =",
     .           SD_alphascall(scaleofcoupling,inumloop)
         elseif(idrbar.eq.0) then
            write(21,*) " alpha_s MSbar   =",
     .           SD_alphascall(scaleofcoupling,inumloop)
         endif
      endif

      if(check(16).eq.1.and.check(17).eq.1.and.check(18).eq.1) then
      write(21,*)
      write(21,*)
      write(21,*) " The trilinear couplings AU, AD, AE at the scale Q"
      write(21,*) " -------------------------------------------------"
      write(21,*) " Q =",scaleofewsb
      write(21,*)
      write(21,*) " 1,1 A_u   DRbar =",auval(1,1)
      write(21,*) " 1,1 A_d   DRbar =",adval(1,1)
      write(21,*) " 1,1 A_e   DRbar =",aeval(1,1)
      write(21,*) " 2,2 A_c   DRbar =",auval(2,2)
      write(21,*) " 2,2 A_s   DRbar =",adval(2,2)
      write(21,*) " 2,2 A_mu  DRbar =",aeval(2,2)
      write(21,*) " 3,3 A_t   DRbar =",auval(3,3)
      write(21,*) " 3,3 A_b   DRbar =",adval(3,3)
      write(21,*) " 3,3 A_tau DRbar =",aeval(3,3)
      endif

      if(check(20).eq.1) then
      write(21,*)
      write(21,*)
      write(21,*) " The Yukawa couplings at the scale Q"
      write(21,*) " -----------------------------------"
      if(scalechoice.eq.1.D0) then
         write(21,*) " Q =",scaleofewsb
      elseif(scalechoice.eq.2.D0) then
         if(idrbar.eq.1) then
            write(21,*) " Q = mass of the decaying particle"
         elseif(idrbar.eq.0) then
            write(21,*) " Q = mass of the decaying particle"
         endif
      elseif(scalechoice.eq.3.D0) then
         if(idrbar.eq.1) then
            write(21,*) " Q =",scaleofcoupling
         elseif(idrbar.eq.0) then
            write(21,*) " Q =",scaleofcoupling
         endif
      endif 
      write(21,*)
      write(21,*) " y_tau DRbar =",ytau
      if(scalechoice.eq.1.D0) then 
         write(21,*) " y_t DRbar   =",yt
         write(21,*) " y_b DRbar   =",yb
      elseif(scalechoice.eq.2.D0) then
         if(idrbar.eq.1) then
            write(21,*)" y_t DRbar   = depends on the decaying particle"
            write(21,*)" y_b DRbar   = depends on the decaying particle"
         elseif(idrbar.eq.0) then
            write(21,*)" y_t MSbar   = depends on the decaying particle"
            write(21,*)" y_b MSbar   = depends on the decaying particle"
         endif
      elseif(scalechoice.eq.3.D0) then
         call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
         if(idrbar.eq.1) then
            write(21,*) " y_t/g^2 DRbar   =",SD_yuk(1,runmt)
            write(21,*) " y_b/g^2 DRbar   =",SD_yuk(2,runmb)
         elseif(idrbar.eq.0) then
            write(21,*) " y_t/g^2 MSbar   =",SD_yuk(1,runmt)
            write(21,*) " y_b/g^2 MSbar   =",SD_yuk(2,runmb)
         endif
      endif
      endif

c -------------------------------------------------------------------- c

c ----------------------------- c
c The soft SUSY breaking masses c
c ----------------------------- c

      if(check(15).eq.1) then
      write(21,*)
      write(nout,554) 'MSOFT Q=',scaleofewsb,'The soft SUSY breaking mas
     .ses at the scale Q'
      write(21,*) " ----------------------------------------------------
     .-------------------"

      unlikely = -123456789D0
      do ii=1,99,1
         if(m_softval(ii).ne.unlikely) then
            if(ii.ne.11.and.ii.ne.12.and.ii.ne.13.and.ii.ne.23.and.
     .           ii.ne.24.and.ii.ne.25.and.ii.ne.26) then
               write(nout,552) m_softval(ii),m_softcom(ii)
            endif
         endif
      end do

      endif


c ---------------------------- c
c Inclusion of QCD corrections c
c ---------------------------- c

      write(21,*) 
      write(21,*)
      write(21,*) "==================="
      write(21,*) "| The decay table |"
      write(21,*) "==================="
      write(21,*)

      if(flagqcd.eq.1.D0) then
         write(nout,*) ' The QCD corrections to the decays gluino -> squ
     .ark  + quark'
         write(nout,*) '                                   squark -> gau
     .gino + quark_prime'
         write(nout,*) '                                   squark -> squ
     .ark_prime + Higgs'
         write(nout,*) '                                   squark -> glu
     .ino  + quark'
         write(nout,*) ' are included.'
         write(21,*) 
      endif

      if(flagmulti.eq.1.D0) then
         write(nout,*) ' The multi-body decays for the inos, stops and s
     .bottoms are included.'
         write(21,*)
      endif

      if(flagloop.eq.1.D0) then
         write(nout,*) ' The loop induced decays for the gluino, neutral
     .inos and stops'
         write(nout,*) ' are included.'
         write(21,*)
      endif

      if(flagsusytop.eq.1.D0) then
         write(nout,*) ' The SUSY decays of the top quark are included.'
         write(21,*)
      endif

      if(flagnlspgmsb.eq.1.D0) then
         write(nout,*) ' Possible decays of the NLSP in GMSB models are 
     .included.'
         write(21,*)
      endif

      write(21,*)
      write(21,*)
      write(21,*) " Decaying particle + total width"
      write(21,*) " Parent --> Daughters        Width      Branching Rat
     .io"

c ---------- c
c Top decays c
c ---------- c

      if(flagsusytop.eq.1.D0) then
      if(toptot2.ne.0.D0) then
      write(21,*)
      write(21,*) " TOP DECAYS ",toptot2
      write(21,*) " ---------- "
      write(21,201) " top --> bottom W+    ",topbw,brtopbw
      write(21,201) " top --> bottom H+    ",topbh,brtopbh
      write(21,201) " top --> stop1  chi0_1",topneutrstop(1,1),
     .                                       brtopneutrstop(1,1)
      write(21,201) " top --> stop1  chi0_2",topneutrstop(2,1),
     .                                       brtopneutrstop(2,1)
      write(21,201) " top --> stop1  chi0_3",topneutrstop(3,1),
     .                                       brtopneutrstop(3,1)
      write(21,201) " top --> stop1  chi0_4",topneutrstop(4,1),
     .                                       brtopneutrstop(4,1)
      write(21,201) " top --> stop2  chi0_1",topneutrstop(1,2),
     .                                       brtopneutrstop(1,2)
      write(21,201) " top --> stop2  chi0_2",topneutrstop(2,2),
     .                                       brtopneutrstop(2,2)
      write(21,201) " top --> stop2  chi0_3",topneutrstop(3,2),
     .                                       brtopneutrstop(3,2)
      write(21,201) " top --> stop2  chi0_4",topneutrstop(4,2),
     .                                       brtopneutrstop(4,2)
      else
            write(21,*)
            write(21,*) " THE TOP 2-BODY DECAYS ARE 0"
            write(21,*) " ---------------------------"
      endif
      endif
      
c ------------- c
c Gluino decays c
c ------------- c

      flagmultiloop = flagmulti+flagloop

      if(gluitot2.eq.0.D0) then
         flaggluitot2 = 10.D0
      elseif(gluitot2.ne.0.D0) then
         flaggluitot2 = 40.D0
      endif
      flagcondglui = flaggluitot2+flagmultiloop


      if(flagcondglui.eq.10.D0) then
         write(21,*)
         write(21,*) " GLUINO STABLE "
         write(21,*) " ------------- "
      elseif(flagcondglui.eq.40.D0.or.flagcondglui.eq.41.D0.or.
     .flagcondglui.eq.42) then
         write(21,*)
         write(21,*) " GLUINO DECAYS ",gluitot
         write(21,*) " ------------- "
      write(21,201) " gluino --> supl   ub",gsupl,brgsupl
      write(21,201) " gluino --> subl   up",gsupl,brgsupl
      write(21,201) " gluino --> supr   ub",gsupr,brgsupr
      write(21,201) " gluino --> subr   up",gsupr,brgsupr
      write(21,201) " gluino --> sdnl   db",gsdownl,brgsdownl
      write(21,201) " gluino --> sdbl   dn",gsdownl,brgsdownl
      write(21,201) " gluino --> sdnr   db",gsdownr,brgsdownr
      write(21,201) " gluino --> sdbr   dn",gsdownr,brgsdownr
      write(21,201) " gluino --> schl   cb",gsupl,brgsupl
      write(21,201) " gluino --> scbl   ch",gsupl,brgsupl
      write(21,201) " gluino --> schr   cb",gsupr,brgsupr
      write(21,201) " gluino --> scbr   ch",gsupr,brgsupr
      write(21,201) " gluino --> sstl   sb",gsdownl,brgsdownl
      write(21,201) " gluino --> ssbl   st",gsdownl,brgsdownl
      write(21,201) " gluino --> sstr   sb",gsdownr,brgsdownr
      write(21,201) " gluino --> ssbr   st",gsdownr,brgsdownr
      write(21,201) " gluino --> stop1  tb",gst1,brgst1
      write(21,201) " gluino --> stop1b tp",gst1,brgst1
      write(21,201) " gluino --> stop2  tb",gst2,brgst2
      write(21,201) " gluino --> stop2b tp",gst2,brgst2
      write(21,201) " gluino --> sbot1  bb",gsb1,brgsb1
      write(21,201) " gluino --> sbot1b bt",gsb1,brgsb1
      write(21,201) " gluino --> sbot2  bb",gsb2,brgsb2
      write(21,201) " gluino --> sbot2b bt",gsb2,brgsb2
      if(flagnlspgmsb.eq.1.D0.and.brggravgl.ne.0.D0) then
      write(21,201) " gluino --> G      gluon",ggravgl,brggravgl
      endif

      elseif(flagcondglui.eq.11.D0.or.flagcondglui.eq.12.D0) then
         if(gluitot.ne.0.D0) then
            write(21,*)
            write(21,*) " GLUINO DECAYS ",gluitot
            write(21,*) " ------------- "
            if(flagloop.eq.1.D0) then
      write(21,201) " gluino --> chi0_1 gl       ",glnjgluon(1),
     .                                             brglnjgluon(1)
      write(21,201) " gluino --> chi0_2 gl       ",glnjgluon(2),
     .                                             brglnjgluon(2)
      write(21,201) " gluino --> chi0_3 gl       ",glnjgluon(3),
     .                                             brglnjgluon(3)
      write(21,201) " gluino --> chi0_4 gl       ",glnjgluon(4),
     .                                             brglnjgluon(4)
            endif
      if(flagnlspgmsb.eq.1.D0.and.brggravgl.ne.0.D0) then
      write(21,201) " gluino --> G      gluon",ggravgl,brggravgl
      endif
            if(flagmulti.eq.1.D0) then
      write(21,201) " gluino --> chi0_1 up     ub",xintegoup(1),brgoup(
     .1)
      write(21,201) " gluino --> chi0_2 up     ub",xintegoup(2),brgoup(
     .2)
      write(21,201) " gluino --> chi0_3 up     ub",xintegoup(3),brgoup(
     .3)
      write(21,201) " gluino --> chi0_4 up     ub",xintegoup(4),brgoup(
     .4)
      write(21,201) " gluino --> chi0_1 dn     db",xintegodn(1),brgodn(
     .1)
      write(21,201) " gluino --> chi0_2 dn     db",xintegodn(2),brgodn(
     .2)
      write(21,201) " gluino --> chi0_3 dn     db",xintegodn(3),brgodn(
     .3)
      write(21,201) " gluino --> chi0_4 dn     db",xintegodn(4),brgodn(
     .4)
      write(21,201) " gluino --> chi0_1 ch     cb",xintegoup(1),brgoup(
     .1)
      write(21,201) " gluino --> chi0_2 ch     cb",xintegoup(2),brgoup(
     .2)
      write(21,201) " gluino --> chi0_3 ch     cb",xintegoup(3),brgoup(
     .3)
      write(21,201) " gluino --> chi0_4 ch     cb",xintegoup(4),brgoup(
     .4)
      write(21,201) " gluino --> chi0_1 st     sb",xintegodn(1),brgodn(
     .1)
      write(21,201) " gluino --> chi0_2 st     sb",xintegodn(2),brgodn(
     .2)
      write(21,201) " gluino --> chi0_3 st     sb",xintegodn(3),brgodn(
     .3)
      write(21,201) " gluino --> chi0_4 st     sb",xintegodn(4),brgodn(
     .4)
      write(21,201) " gluino --> chi0_1 tp     tb",xintegotp(1),brgotp(
     .1)
      write(21,201) " gluino --> chi0_2 tp     tb",xintegotp(2),brgotp(
     .2)
      write(21,201) " gluino --> chi0_3 tp     tb",xintegotp(3),brgotp(
     .3)
      write(21,201) " gluino --> chi0_4 tp     tb",xintegotp(4),brgotp(
     .4)
      write(21,201) " gluino --> chi0_1 bt     bb",xintegobt(1),brgobt(
     .1)
      write(21,201) " gluino --> chi0_2 bt     bb",xintegobt(2),brgobt(
     .2)
      write(21,201) " gluino --> chi0_3 bt     bb",xintegobt(3),brgobt(
     .3)
      write(21,201) " gluino --> chi0_4 bt     bb",xintegobt(4),brgobt(
     .4)
      write(21,201) " gluino --> chi-_1 up     db",xintegoud(1),brgoud(
     .1)
      write(21,201) " gluino --> chi+_1 ub     dn",xintegoud(1),brgoud(
     .1)
      write(21,201) " gluino --> chi-_2 up     db",xintegoud(2),brgoud(
     .2)
      write(21,201) " gluino --> chi+_2 ub     dn",xintegoud(2),brgoud(
     .2)
      write(21,201) " gluino --> chi-_1 ch     sb",xintegoud(1),brgoud(
     .1)
      write(21,201) " gluino --> chi+_1 cb     st",xintegoud(1),brgoud(
     .1)
      write(21,201) " gluino --> chi-_2 ch     sb",xintegoud(2),brgoud(
     .2)
      write(21,201) " gluino --> chi+_2 cb     st",xintegoud(2),brgoud(
     .2)
      write(21,201) " gluino --> chi-_1 tp     bb",xintegotb(1),brgotb(
     .1)
      write(21,201) " gluino --> chi+_1 tb     bt",xintegotb(1),brgotb(
     .1)
      write(21,201) " gluino --> chi-_2 tp     bb",xintegotb(2),brgotb(
     .2)
      write(21,201) " gluino --> chi+_2 tb     bt",xintegotb(2),brgotb(
     .2)
      write(21,201) " gluino --> H+     stop1b bt",xinteghcst1b,
     .                                             brhcst1b
      write(21,201) " gluino --> H-     stop1  bb",xinteghcst1b,
     .                                             brhcst1b
      write(21,201) " gluino --> W+     stop1b bt",xintegwst1b,brwst1b
      write(21,201) " gluino --> W+     stop1  bb",xintegwst1b,brwst1b
      endif

      elseif(gluitot.eq.0.D0) then
         write(21,*)
         write(21,*) " GLUINO STABLE "
         write(21,*) " ------------- "
      endif
      endif

c ------------ c
c Stop1 decays c
c ------------ c

      flagmultiloop = flagmulti+flagloop
      do i=1,2,1
         if(stoptot2(i).eq.0.D0) then
            flagstoptot2(i) = 10.D0
         elseif(stoptot2(i).ne.0.D0) then
            flagstoptot2(i) = 40.D0
         endif
      end do

      flagcondstop(1) = flagstoptot2(1)+flagmultiloop
      flagcondstop(2) = flagstoptot2(2)+flagmulti

      if(flagcondstop(1).eq.10.D0) then
         write(21,*)
         write(21,*) " STOP1 STABLE "
         write(21,*) " ------------ "
      elseif(flagcondstop(1).eq.40.D0.or.flagcondstop(1).eq.41.D0.or.
     .flagcondstop(1).eq.42.D0) then

      write(21,*)
      write(21,*) " STOP1 DECAYS ",stoptot2(1)
      write(21,*) " ------------ "
      write(21,201) " stop1 --> chi0_1 tp",st1neutt(1),brst1neutt(1)
      write(21,201) " stop1 --> chi0_2 tp",st1neutt(2),brst1neutt(2)
      write(21,201) " stop1 --> chi0_3 tp",st1neutt(3),brst1neutt(3)
      write(21,201) " stop1 --> chi0_4 tp",st1neutt(4),brst1neutt(4)
      write(21,201) " stop1 --> chi+_1 bt",st1charb(1),brst1charb(1)
      write(21,201) " stop1 --> chi+_2 bt",st1charb(2),brst1charb(2)
      write(21,201) " stop1 --> gluino tp",st1glui,brst1glui
      write(21,201) " stop1 --> sbot1  H+",st1hcsb(1),brst1hcsb(1)
      write(21,201) " stop1 --> sbot2  H+",st1hcsb(2),brst1hcsb(2)
      write(21,201) " stop1 --> sbot1  W+",st1wsb(1),brst1wsb(1)
      write(21,201) " stop1 --> sbot2  W+",st1wsb(2),brst1wsb(2)

      elseif(flagcondstop(1).eq.11.D0.or.flagcondstop(1).eq.12.D0) then
         if(stoptot(1).ne.0.D0) then
            write(21,*)
            write(21,*) " STOP1 DECAYS ",stoptot(1)
            write(21,*) " ------------ "
            if(flagloop.eq.1.D0) then
      write(21,201) " stop1 --> chi0_1 ch       ",gamma,brgamma
      write(21,201) " stop1 --> chi0_1 up       ",gammaup,brgammaup
      write(21,201) " stop1 --> gluino ch       ",gammagluino,
     .                                            brgammagluino
            endif
            if(flagmulti.eq.1.D0) then
               if(stoptotmulti(1).ne.0.D0) then
      write(21,201) " stop1 --> chi0_1 bt   W+  ",xintegstopw(1,1),
     .                                             brstopw(1,1)
      write(21,201) " stop1 --> chi0_2 bt   W+  ",xintegstopw(1,2),
     .                                             brstopw(1,2)
      write(21,201) " stop1 --> chi0_3 bt   W+  ",xintegstopw(1,3),
     .                                             brstopw(1,3)
      write(21,201) " stop1 --> chi0_4 bt   W+  ",xintegstopw(1,4),
     .                                             brstopw(1,4)
      write(21,201) " stop1 --> chi0_1 bt   H+  ",xintegstoph(1,1),
     .                                             brstoph(1,1)
      write(21,201) " stop1 --> chi0_2 bt   H+  ",xintegstoph(1,2),
     .                                             brstoph(1,2)
      write(21,201) " stop1 --> chi0_3 bt   H+  ",xintegstoph(1,3),
     .                                             brstoph(1,3)
      write(21,201) " stop1 --> chi0_4 bt   H+  ",xintegstoph(1,4),
     .                                             brstoph(1,4)
      write(21,201) " stop1 --> snut1  bt   tau+",xintegstsntau(1,1),
     .                                             brstsntau(1,1)
      write(21,201) " stop1 --> snuel  bt   e+  ",xintegstsnel(1),
     .                                             brstsnel(1)
      write(21,201) " stop1 --> snuml  bt   mu+ ",xintegstsnel(1),
     .                                             brstsnel(1)
      write(21,201) " stop1 --> stau1+ bt   nut ",xintegststau(1,1),
     .                                             brststau(1,1)
      write(21,201) " stop1 --> stau2+ bt   nut ",xintegststau(1,2),
     .                                             brststau(1,2)
      write(21,201) " stop1 --> sel+   bt   nue ",xintegstsel(1,1),
     .                                             brstsel(1,1)
      write(21,201) " stop1 --> ser+   bt   nue ",xintegstsel(1,2),
     .                                             brstsel(1,2)
      write(21,201) " stop1 --> smul+  bt   num ",xintegstsel(1,1),
     .                                             brstsel(1,1)
      write(21,201) " stop1 --> smur+  bt   num ",xintegstsel(1,2),
     .                                             brstsel(1,2)
      write(21,201) " stop1 --> sbot1b bt   tp  ",xintegstbsbst(1,1),
     .                                             brstbsbst(1,1)
      write(21,201) " stop1 --> sbot2b bt   tp  ",xintegstbsbst(1,2),
     .                                             brstbsbst(1,2)
      write(21,201) " stop1 --> sbot1  bb   tp  ",xintegstbbsbt(1,1),
     .                                             brstbbsbt(1,1)
      write(21,201) " stop1 --> sbot2  bb   tp  ",xintegstbbsbt(1,2),
     .                                             brstbbsbt(1,2)
      write(21,201) " stop1 --> sbot1  up   db  ",xintegstupsbdow(1,1),
     .                                             brstupsbdow(1,1)
      write(21,201) " stop1 --> sbot2  up   db  ",xintegstupsbdow(1,2),
     .                                             brstupsbdow(1,2)
      write(21,201) " stop1 --> sbot1  ch   sb  ",xintegstupsbdow(1,1),
     .                                             brstupsbdow(1,1)
      write(21,201) " stop1 --> sbot2  ch   sb  ",xintegstupsbdow(1,2),
     .                                             brstupsbdow(1,2)
      write(21,201) " stop1 --> sbot1  tau+ nut ",xintegsttausbnu(1,1),
     .                                             brsttausbnu(1,1)
      write(21,201) " stop1 --> sbot2  tau+ nut ",xintegsttausbnu(1,2),
     .                                             brsttausbnu(1,2)
      write(21,201) " stop1 --> sbot1  e+   nue ",xintegstelsbnu(1,1),
     .                                             brstelsbnu(1,1)
      write(21,201) " stop1 --> sbot2  e+   nue ",xintegstelsbnu(1,2),
     .                                             brstelsbnu(1,2)
      write(21,201) " stop1 --> sbot1  mu+  num ",xintegstelsbnu(1,1),
     .                                             brstelsbnu(1,1)
      write(21,201) " stop1 --> sbot2  mu+  num ",xintegstelsbnu(1,2),
     .                                             brstelsbnu(1,2)
      else
         if(stoptot4.ne.0.D0) then
            write(21,201) " stop1 --> chi0_1 bt f fbarprime",
     .                     sigma4bodtot,br4bodoffshelltau
         endif
      endif
      endif
      elseif(stoptot(1).eq.0.D0) then
         write(21,*)
         write(21,*) " STOP1 STABLE "
         write(21,*) " ------------ "
      endif
      endif

c ------------ c
c Stop2 decays c
c ------------ c

      if(flagcondstop(2).eq.10.D0) then
         write(21,*)
         write(21,*) " STOP2 STABLE "
         write(21,*) " ------------ "
      elseif(flagcondstop(2).eq.40.D0.or.flagcondstop(2).eq.41.D0) then
         write(21,*)
         write(21,*) " STOP2 DECAYS ",stoptot2(2)
         write(21,*) " ------------ "
      write(21,201) " stop2 --> chi0_1 tp",st2neutt(1),brst2neutt(1)
      write(21,201) " stop2 --> chi0_2 tp",st2neutt(2),brst2neutt(2)
      write(21,201) " stop2 --> chi0_3 tp",st2neutt(3),brst2neutt(3)
      write(21,201) " stop2 --> chi0_4 tp",st2neutt(4),brst2neutt(4)
      write(21,201) " stop2 --> chi+_1 bt",st2charb(1),brst2charb(1)
      write(21,201) " stop2 --> chi+_2 bt",st2charb(2),brst2charb(2)
      write(21,201) " stop2 --> gluino tp",st2glui,brst2glui
      write(21,201) " stop2 --> stop1  h ",st2hl,brst2hl
      write(21,201) " stop2 --> stop1  H ",st2hh,brst2hh
      write(21,201) " stop2 --> stop1  A ",st2ha,brst2ha
      write(21,201) " stop2 --> sbot1  H+",st2hcsb(1),brst2hcsb(1)
      write(21,201) " stop2 --> sbot2  H+",st2hcsb(2),brst2hcsb(2)
      write(21,201) " stop2 --> stop1  Z ",st2ztop,brst2ztop
      write(21,201) " stop2 --> sbot1  W+",st2wsb(1),brst2wsb(1)
      write(21,201) " stop2 --> sbot2  W+",st2wsb(2),brst2wsb(2)

      elseif(flagcondstop(2).eq.11.D0) then
         if(stoptot(2).ne.0.D0) then
            write(21,*)
            write(21,*) " STOP2 DECAYS ",stoptot(2)
            write(21,*) " ------------ "
      write(21,201) " stop2 --> chi0_1 bt   W+  ",xintegstopw(2,1),
     .                                            brstopw(2,1)
      write(21,201) " stop2 --> chi0_2 bt   W+  ",xintegstopw(2,2),
     .                                            brstopw(2,2)
      write(21,201) " stop2 --> chi0_3 bt   W+  ",xintegstopw(2,3),
     .                                            brstopw(2,3)
      write(21,201) " stop2 --> chi0_4 bt   W+  ",xintegstopw(2,4),
     .                                            brstopw(2,4)
      write(21,201) " stop2 --> chi0_1 bt   H+  ",xintegstoph(2,1),
     .                                            brstoph(2,1)
      write(21,201) " stop2 --> chi0_2 bt   H+  ",xintegstoph(2,2),
     .                                            brstoph(2,2)
      write(21,201) " stop2 --> chi0_3 bt   H+  ",xintegstoph(2,3),
     .                                            brstoph(2,3)
      write(21,201) " stop2 --> chi0_4 bt   H+  ",xintegstoph(2,4),
     .                                            brstoph(2,4)
      write(21,201) " stop2 --> snut1  bt   tau+",xintegstsntau(2,1),
     .                                            brstsntau(2,1)
      write(21,201) " stop2 --> snuel  bt   e+  ",xintegstsnel(2),
     .                                            brstsnel(2)
      write(21,201) " stop2 --> snuml  bt   mu+ ",xintegstsnel(2),
     .                                            brstsnel(2)
      write(21,201) " stop2 --> stau1+ bt   nut ",xintegststau(2,1),
     .                                            brststau(2,1)
      write(21,201) " stop2 --> stau2+ bt   nut ",xintegststau(2,2),
     .                                            brststau(2,2)
      write(21,201) " stop2 --> sel+   bt   nue ",xintegstsel(2,1),
     .                                            brstsel(2,1)
      write(21,201) " stop2 --> ser+   bt   nue ",xintegstsel(2,2),
     .                                            brstsel(2,2)
      write(21,201) " stop2 --> smul+  bt   num ",xintegstsel(2,1),
     .                                            brstsel(2,1)
      write(21,201) " stop2 --> smur+  bt   num ",xintegstsel(2,2),
     .                                            brstsel(2,2)
      write(21,201) " stop2 --> sbot1b bt   tp  ",xintegstbsbst(2,1),
     .                                            brstbsbst(2,1)
      write(21,201) " stop2 --> sbot2b bt   tp  ",xintegstbsbst(2,2),
     .                                            brstbsbst(2,2)
      write(21,201) " stop2 --> sbot1  bb   tp  ",xintegstbbsbt(2,1),
     .                                            brstbbsbt(2,1)
      write(21,201) " stop2 --> sbot2  bb   tp  ",xintegstbbsbt(2,2),
     .                                            brstbbsbt(2,2)
      write(21,201) " stop2 --> sbot1  up   db  ",xintegstupsbdow(2,1),
     .                                            brstupsbdow(2,1)
      write(21,201) " stop2 --> sbot2  up   db  ",xintegstupsbdow(2,2),
     .                                            brstupsbdow(2,2)
      write(21,201) " stop2 --> sbot1  ch   sb  ",xintegstupsbdow(2,1),
     .                                            brstupsbdow(2,1)
      write(21,201) " stop2 --> sbot2  ch   sb  ",xintegstupsbdow(2,2),
     .                                            brstupsbdow(2,2)
      write(21,201) " stop2 --> sbot1  tau+ nut ",xintegsttausbnu(2,1),
     .                                            brsttausbnu(2,1)
      write(21,201) " stop2 --> sbot2  tau+ nut ",xintegsttausbnu(2,2),
     .                                            brsttausbnu(2,2)
      write(21,201) " stop2 --> sbot1  e+   nue ",xintegstelsbnu(2,1),
     .                                            brstelsbnu(2,1)
      write(21,201) " stop2 --> sbot2  e+   nue ",xintegstelsbnu(2,2),
     .                                            brstelsbnu(2,2)
      write(21,201) " stop2 --> sbot1  mu+  num ",xintegstelsbnu(2,1),
     .                                            brstelsbnu(2,1)
      write(21,201) " stop2 --> sbot2  mu+  num ",xintegstelsbnu(2,2),
     .                                            brstelsbnu(2,2)
      write(21,201) " stop2 --> stop1  tp   tb  ",xintegst2st1tt,
     .                                            brst2st1tt
      write(21,201) " stop2 --> stop1b tp   tp ",xintegst2st1startt,
     .                                            brst2st1startt
      write(21,201) " stop2 --> stop1  bt   bb  ",xintegst2st1bb,
     .                                            brst2st1bb
      write(21,201) " stop2 --> stop1  up   ub  ",xintegst2st1uu,
     .                                            brst2st1uu
      write(21,201) " stop2 --> stop1  ch   cb  ",xintegst2st1uu,
     .                                            brst2st1uu
      write(21,201) " stop2 --> stop1  dn   db  ",xintegst2st1dd,
     .                                            brst2st1dd
      write(21,201) " stop2 --> stop1  st   sb  ",xintegst2st1dd,
     .                                            brst2st1dd
      write(21,201) " stop2 --> stop1  tau+ tau-",xintegst2st1tautau,
     .                                            brst2st1tautau
      write(21,201) " stop2 --> stop1  e+   e-  ",xintegst2st1ee,
     .                                            brst2st1ee
      write(21,201) " stop2 --> stop1  mu+  mu- ",xintegst2st1ee,
     .                                            brst2st1ee
      write(21,201) " stop2 --> stop1  nue  nueb",xintegst2st1nunu,
     .                                            brst2st1nunu
      write(21,201) " stop2 --> stop1  num  numb",xintegst2st1nunu,
     .                                            brst2st1nunu
      write(21,201) " stop2 --> stop1  nut  nutb",xintegst2st1nunu,
     .                                            brst2st1nunu

      elseif(stoptot(2).eq.0.D0) then
         write(21,*)
         write(21,*) " STOP2 STABLE "
         write(21,*) " ------------ "
      endif
      endif

c --------------- c
c Sbottom1 decays c
c --------------- c

      do i=1,2,1
         if(sbottot2(i).eq.0.D0) then
            flagsbottot2(i) = 10.D0
         elseif(sbottot2(i).ne.0.D0) then
            flagsbottot2(i) = 40.D0
         endif
         flagcondsbot(i) = flagsbottot2(i)+flagmulti
      end do

      if(flagcondsbot(1).eq.10.D0) then
         write(21,*)
         write(21,*) " SBOTTOM1 STABLE "
         write(21,*) " --------------- "
      elseif(flagcondsbot(1).eq.40.D0.or.flagcondsbot(1).eq.41.D0) then
         write(21,*)
         write(21,*) " SBOTTOM1 DECAYS ",sbottot2(1)
         write(21,*) " --------------- "
      write(21,201) " sbot1 --> chi0_1 bt",sb1neutt(1),brsb1neutt(1)
      write(21,201) " sbot1 --> chi0_2 bt",sb1neutt(2),brsb1neutt(2)
      write(21,201) " sbot1 --> chi0_3 bt",sb1neutt(3),brsb1neutt(3)
      write(21,201) " sbot1 --> chi0_4 bt",sb1neutt(4),brsb1neutt(4)
      write(21,201) " sbot1 --> chi-_1 tp",sb1chart(1),brsb1chart(1)
      write(21,201) " sbot1 --> chi-_2 tp",sb1chart(2),brsb1chart(2)
      write(21,201) " sbot1 --> gluino bt",sb1glui,brsb1glui
      write(21,201) " sbot1 --> stop1  H-",sb1hcst(1),brsb1hcst(1)
      write(21,201) " sbot1 --> stop2  H-",sb1hcst(2),brsb1hcst(2)
      write(21,201) " sbot1 --> stop1  W-",sb1wst(1),brsb1wst(1)
      write(21,201) " sbot1 --> stop2  W-",sb1wst(2),brsb1wst(2)

      elseif(flagcondsbot(1).eq.11.D0) then
         if(sbottot(1).ne.0.D0) then
            write(21,*)
            write(21,*) " SBOTTOM1 DECAYS ",sbottot(1)
            write(21,*) " --------------- "
      write(21,201) " sbot1 --> snut1b tp   tau-",xintegsbsntau(1,1),
     .                                            brsbsntau(1,1)
      write(21,201) " sbot1 --> snuelb tp   e-  ",xintegsbsnel(1),
     .                                            brsbsnel(1)
      write(21,201) " sbot1 --> snumlb tp   mu- ",xintegsbsnel(1),
     .                                            brsbsnel(1)
      write(21,201) " sbot1 --> stau1- tp   nutb",xintegsbstau(1,1),
     .                                            brsbstau(1,1)
      write(21,201) " sbot1 --> stau2- tp   nutb",xintegsbstau(1,2),
     .                                            brsbstau(1,2)
      write(21,201) " sbot1 --> sel-   tp   nueb",xintegsbsel(1,1),
     .                                            brsbsel(1,1)
      write(21,201) " sbot1 --> ser-   tp   nueb",xintegsbsel(1,2),
     .                                            brsbsel(1,2)
      write(21,201) " sbot1 --> smul-  tp   numb",xintegsbsel(1,1),
     .                                            brsbsel(1,1)
      write(21,201) " sbot1 --> smur-  tp   numb",xintegsbsel(1,2),
     .                                            brsbsel(1,2)
      write(21,201) " sbot1 --> stop1b tp   bt  ",xintegsbtstsb(1,1),
     .                                            brsbtstsb(1,1)
      write(21,201) " sbot1 --> stop2b tp   bt  ",xintegsbtstsb(1,2),
     .                                            brsbtstsb(1,2)
      write(21,201) " sbot1 --> stop1  tb   bt  ",xintegsbtbstb(1,1),
     .                                            brsbtbstb(1,1)
      write(21,201) " sbot1 --> stop2  tb   bt  ",xintegsbtbstb(1,2),
     .                                            brsbtbstb(1,2)
      write(21,201) " sbot1 --> stop1  ub   dn  ",xintegsbupstdow(1,1),
     .                                            brsbupstdow(1,1)
      write(21,201) " sbot1 --> stop2  ub   dn  ",xintegsbupstdow(1,2),
     .                                            brsbupstdow(1,2)
      write(21,201) " sbot1 --> stop1  cb   st  ",xintegsbupstdow(1,1),
     .                                            brsbupstdow(1,1)
      write(21,201) " sbot1 --> stop2  cb   st  ",xintegsbupstdow(1,2),
     .                                            brsbupstdow(1,2)
      write(21,201) " sbot1 --> stop1  tau- nutb",xintegsbtaustnu(1,1),
     .                                            brsbtaustnu(1,1)
      write(21,201) " sbot1 --> stop2  tau- nutb",xintegsbtaustnu(1,2),
     .                                            brsbtaustnu(1,2)
      write(21,201) " sbot1 --> stop1  e-   nueb",xintegsbelstnu(1,1),
     .                                            brsbelstnu(1,1)
      write(21,201) " sbot1 --> stop2  e-   nueb",xintegsbelstnu(1,2),
     .                                            brsbelstnu(1,2)
      write(21,201) " sbot1 --> stop1  mu-  numb",xintegsbelstnu(1,1),
     .                                            brsbelstnu(1,1)
      write(21,201) " sbot1 --> stop2  mu-  numb",xintegsbelstnu(1,2),
     .                                            brsbelstnu(1,2)

      elseif(sbottot(1).eq.0.D0) then
         write(21,*)
         write(21,*) " SBOTTOM1 STABLE "
         write(21,*) " --------------- "
      endif
      endif

c --------------- c
c Sbottom2 decays c
c --------------- c

      if(flagcondsbot(2).eq.10.D0) then
         write(21,*)
         write(21,*) " SBOTTOM2 STABLE "
         write(21,*) " --------------- "
      elseif(flagcondsbot(2).eq.40.D0.or.flagcondsbot(2).eq.41.D0) then
         write(21,*)
         write(21,*) " SBOTTOM2 DECAYS ",sbottot2(2)
         write(21,*) " --------------- "
      write(21,201) " sbot2 --> chi0_1 bt",sb2neutt(1),brsb2neutt(1)
      write(21,201) " sbot2 --> chi0_2 bt",sb2neutt(2),brsb2neutt(2)
      write(21,201) " sbot2 --> chi0_3 bt",sb2neutt(3),brsb2neutt(3)
      write(21,201) " sbot2 --> chi0_4 bt",sb2neutt(4),brsb2neutt(4)
      write(21,201) " sbot2 --> chi-_1 tp",sb2chart(1),brsb2chart(1)
      write(21,201) " sbot2 --> chi-_2 tp",sb2chart(2),brsb2chart(2)
      write(21,201) " sbot2 --> gluino bt",sb2glui,brsb2glui
      write(21,201) " sbot2 --> sbot1  h ",sb2hl,brsb2hl
      write(21,201) " sbot2 --> sbot1  H ",sb2hh,brsb2hh
      write(21,201) " sbot2 --> sbot1  A ",sb2ha,brsb2ha
      write(21,201) " sbot2 --> stop1  H-",sb2hcst(1),brsb2hcst(1)
      write(21,201) " sbot2 --> stop2  H-",sb2hcst(2),brsb2hcst(2)
      write(21,201) " sbot2 --> stop1  W-",sb2wst(1),brsb2wst(1)
      write(21,201) " sbot2 --> stop2  W-",sb2wst(2),brsb2wst(2)
      write(21,201) " sbot2 --> sbot1  Z0",sb2zbot,brsb2zbot

      elseif(flagcondsbot(2).eq.11.D0) then
         if(sbottot(2).ne.0.D0) then
            write(21,*)
            write(21,*) " SBOTTOM2 DECAYS ",sbottot(2)
            write(21,*) " --------------- "
      write(21,201) " sbot2 --> snut1b tp   tau-",xintegsbsntau(2,1),
     .                                            brsbsntau(2,1)
      write(21,201) " sbot2 --> snuelb tp   e-  ",xintegsbsnel(2),
     .                                            brsbsnel(2)
      write(21,201) " sbot2 --> snumlb tp   mu- ",xintegsbsnel(2),
     .                                            brsbsnel(2)
      write(21,201) " sbot2 --> stau1- tp   nutb",xintegsbstau(2,1),
     .                                            brsbstau(2,1)
      write(21,201) " sbot2 --> stau2- tp   nutb",xintegsbstau(2,2),
     .                                            brsbstau(2,2)
      write(21,201) " sbot2 --> sel-   tp   nueb",xintegsbsel(2,1),
     .                                            brsbsel(2,1)
      write(21,201) " sbot2 --> ser-   tp   nueb",xintegsbsel(2,2),
     .                                            brsbsel(2,2)
      write(21,201) " sbot2 --> smul-  tp   numb",xintegsbsel(2,1),
     .                                            brsbsel(2,1)
      write(21,201) " sbot2 --> smur-  tp   numb",xintegsbsel(2,2),
     .                                            brsbsel(2,2)
      write(21,201) " sbot2 --> stop1b tp   bt  ",xintegsbtstsb(2,1),
     .                                            brsbtstsb(2,1)
      write(21,201) " sbot2 --> stop2b tp   bt  ",xintegsbtstsb(2,2),
     .                                            brsbtstsb(2,2)
      write(21,201) " sbot2 --> stop1  tb   bt  ",xintegsbtbstb(2,1),
     .                                            brsbtbstb(2,1)
      write(21,201) " sbot2 --> stop2  tb   bt  ",xintegsbtbstb(2,2),
     .                                            brsbtbstb(2,2)
      write(21,201) " sbot2 --> stop1  ub   dn  ",xintegsbupstdow(2,1),
     .                                            brsbupstdow(2,1)
      write(21,201) " sbot2 --> stop2  ub   dn  ",xintegsbupstdow(2,2),
     .                                            brsbupstdow(2,2)
      write(21,201) " sbot2 --> stop1  cb   st  ",xintegsbupstdow(2,1),
     .                                            brsbupstdow(2,1)
      write(21,201) " sbot2 --> stop2  cb   st  ",xintegsbupstdow(2,2),
     .                                            brsbupstdow(2,2)
      write(21,201) " sbot2 --> stop1  tau- nutb",xintegsbtaustnu(2,1),
     .                                            brsbtaustnu(2,1)
      write(21,201) " sbot2 --> stop2  tau- nutb",xintegsbtaustnu(2,2),
     .                                            brsbtaustnu(2,2)
      write(21,201) " sbot2 --> stop1  e-   nueb",xintegsbelstnu(2,1),
     .                                            brsbelstnu(2,1)
      write(21,201) " sbot2 --> stop2  e-   nueb",xintegsbelstnu(2,2),
     .                                            brsbelstnu(2,2)
      write(21,201) " sbot2 --> stop1  mu-  numb",xintegsbelstnu(2,1),
     .                                            brsbelstnu(2,1)
      write(21,201) " sbot2 --> stop2  mu-  numb",xintegsbelstnu(2,2),
     .                                            brsbelstnu(2,2)
      write(21,201) " sbot2 --> sbot1  bt   bb  ",xintegsb2sb1bb,
     .                                            brsb2sb1bb
      write(21,201) " sbot2 --> sbot1b bt   bt  ",xintegsb2sb1starbb,
     .                                            brsb2sb1starbb
      write(21,201) " sbot2 --> sbot1  tp   tb  ",xintegsb2sb1tt,
     .                                            brsb2sb1tt
      write(21,201) " sbot2 --> sbot1  up   ub  ",xintegsb2sb1uu,
     .                                            brsb2sb1uu
      write(21,201) " sbot2 --> sbot1  dn   db  ",xintegsb2sb1dd,
     .                                            brsb2sb1dd
      write(21,201) " sbot2 --> sbot1  ch   cb  ",xintegsb2sb1uu,
     .                                            brsb2sb1uu
      write(21,201) " sbot2 --> sbot1  st   sb  ",xintegsb2sb1dd,
     .                                            brsb2sb1dd
      write(21,201) " sbot2 --> sbot1  e-   e+  ",xintegsb2sb1ee,
     .                                            brsb2sb1ee
      write(21,201) " sbot2 --> sbot1  mu-  mu+ ",xintegsb2sb1ee,
     .                                            brsb2sb1ee
      write(21,201) " sbot2 --> sbot1  tau- tau+",xintegsb2sb1tautau,
     .                                            brsb2sb1tautau
      write(21,201) " sbot2 --> sbot1  nue  nueb",xintegsb2sb1nunu,
     .                                            brsb2sb1nunu
      write(21,201) " sbot2 --> sbot1  num  numb",xintegsb2sb1nunu,
     .                                            brsb2sb1nunu
      write(21,201) " sbot2 --> sbot1  nut  nutb",xintegsb2sb1nunu,
     .                                            brsb2sb1nunu

      elseif(sbottot2(2).eq.0.D0) then
         write(21,*)
         write(21,*) " SBOTTOM2 STABLE "
         write(21,*) " --------------- "
      endif
      endif

c ------------ c
c Sup_L decays c
c ------------ c

      if(supltot2.ne.0.D0) then
      write(21,*)
      write(21,*) " SUPL DECAYS ",supltot2
      write(21,*) " ----------- "
      write(21,201) " supl --> chi0_1 up",suplneutup(1),
     .                                    brsuplnup(1)
      write(21,201) " supl --> chi0_2 up",suplneutup(2),
     .                                    brsuplnup(2)
      write(21,201) " supl --> chi0_3 up",suplneutup(3),
     .                                    brsuplnup(3)
      write(21,201) " supl --> chi0_4 up",suplneutup(4),
     .                                    brsuplnup(4)
      write(21,201) " supl --> chi+_1 dn",suplchardow(1),
     .                                    brsuplcdow(1)
      write(21,201) " supl --> chi+_2 dn",suplchardow(2),
     .                                    brsuplcdow(2)
      write(21,201) " supl --> gluino up",suplglui,brsuplglui

      elseif(supltot2.eq.0.D0) then
      write(21,*)
      write(21,*) " SUPL STABLE "
      write(21,*) " ----------- "

      endif

c ------------ c
c Sup_R decays c
c ------------ c

      if(suprtot2.ne.0.D0) then
      write(21,*)
      write(21,*) " SUPR DECAYS ",suprtot2
      write(21,*) " ----------- "
      write(21,201) " supr --> chi0_1 up",suprneutup(1),
     .                                    brsuprnup(1)
      write(21,201) " supr --> chi0_2 up",suprneutup(2),
     .                                    brsuprnup(2)
      write(21,201) " supr --> chi0_3 up",suprneutup(3),
     .                                    brsuprnup(3)
      write(21,201) " supr --> chi0_4 up",suprneutup(4),
     .                                    brsuprnup(4)
      write(21,201) " supr --> chi+_1 dn",suprchardow(1),
     .                                    brsuprcdow(1)
      write(21,201) " supr --> chi+_2 dn",suprchardow(2),
     .                                    brsuprcdow(2)
      write(21,201) " supr --> gluino up",suprglui,brsuprglui

      elseif(suprtot2.eq.0.D0) then
      write(21,*)
      write(21,*) " SUPR STABLE "
      write(21,*) " ----------- "

      endif

c -------------- c
c Sdown_L decays c
c -------------- c

      if(sdowltot2.ne.0.D0) then
      write(21,*)
      write(21,*) " SDOWNL DECAYS ",sdowltot2
      write(21,*) " ------------- "
      write(21,201) " sdnl --> chi0_1 dn",sdowlneutdow(1),
     .                                    brsdowlndow(1)
      write(21,201) " sdnl --> chi0_2 dn",sdowlneutdow(2),
     .                                    brsdowlndow(2)
      write(21,201) " sdnl --> chi0_3 dn",sdowlneutdow(3),
     .                                    brsdowlndow(3)
      write(21,201) " sdnl --> chi0_4 dn",sdowlneutdow(4),
     .                                    brsdowlndow(4)
      write(21,201) " sdnl --> chi-_1 up",sdowlcharup(1),
     .                                    brsdowlchup(1)
      write(21,201) " sdnl --> chi-_2 up",sdowlcharup(2),
     .                                    brsdowlchup(2)
      write(21,201) " sdnl --> gluino dn",sdowlglui,brsdowlglui

      elseif(sdowltot2.eq.0.D0) then
      write(21,*)
      write(21,*) " SDOWNL STABLE "
      write(21,*) " ------------- "

      endif 

c -------------- c
c Sdown_R decays c
c -------------- c

      if(sdowrtot2.ne.0.D0) then
      write(21,*)
      write(21,*) " SDOWNR DECAYS ",sdowrtot2
      write(21,*) " ------------- "
      write(21,201) " sdnr --> chi0_1 dn",sdowrneutdow(1),
     .                                    brsdowrndow(1)
      write(21,201) " sdnr --> chi0_2 dn",sdowrneutdow(2),
     .                                    brsdowrndow(2)
      write(21,201) " sdnr --> chi0_3 dn",sdowrneutdow(3),
     .                                    brsdowrndow(3)
      write(21,201) " sdnr --> chi0_4 dn",sdowrneutdow(4),
     .                                    brsdowrndow(4)
      write(21,201) " sdnr --> chi-_1 up",sdowrcharup(1),
     .                                    brsdowrchup(1)
      write(21,201) " sdnr --> chi-_2 up",sdowrcharup(2),
     .                                    brsdowrchup(2)
      write(21,201) " sdnr --> gluino dn",sdowrglui,brsdowrglui

      elseif(sdowrtot2.eq.0.D0) then
      write(21,*)
      write(21,*) " SDOWNR STABLE "
      write(21,*) " ------------- "

      endif

c --------------- c
c Scharm_L decays c
c --------------- c

      if(supltot2.ne.0.D0) then
      write(21,*)
      write(21,*) " SCHARML DECAYS ",supltot2
      write(21,*) " -------------- "
      write(21,201) " schl --> chi0_1 ch",suplneutup(1),
     .                                    brsuplnup(1)
      write(21,201) " schl --> chi0_2 ch",suplneutup(2),
     .                                    brsuplnup(2)
      write(21,201) " schl --> chi0_3 ch",suplneutup(3),
     .                                    brsuplnup(3)
      write(21,201) " schl --> chi0_4 ch",suplneutup(4),
     .                                    brsuplnup(4)
      write(21,201) " schl --> chi+_1 st",suplchardow(1),
     .                                    brsuplcdow(1)
      write(21,201) " schl --> chi+_2 st",suplchardow(2),
     .                                    brsuplcdow(2)
      write(21,201) " schl --> gluino ch",suplglui,brsuplglui

      elseif(supltot2.eq.0.D0) then
      write(21,*)
      write(21,*) " SCHARML STABLE "
      write(21,*) " -------------- "

      endif

c --------------- c
c Scharm_R decays c
c --------------- c

      if(suprtot2.ne.0.D0) then
      write(21,*)
      write(21,*) " SCHARMR DECAYS ",suprtot2
      write(21,*) " -------------- "
      write(21,201) " schr --> chi0_1 ch",suprneutup(1),
     .                                    brsuprnup(1)
      write(21,201) " schr --> chi0_2 ch",suprneutup(2),
     .                                    brsuprnup(2)
      write(21,201) " schr --> chi0_3 ch",suprneutup(3),
     .                                    brsuprnup(3)
      write(21,201) " schr --> chi0_4 ch",suprneutup(4),
     .                                    brsuprnup(4)
      write(21,201) " schr --> chi+_1 st",suprchardow(1),
     .                                    brsuprcdow(1)
      write(21,201) " schr --> chi+_2 st",suprchardow(2),
     .                                    brsuprcdow(2)
      write(21,201) " schr --> gluino ch",suprglui,brsuprglui

      elseif(suprtot2.eq.0.D0) then
      write(21,*)
      write(21,*) " SCHARMR STABLE "
      write(21,*) " -------------- "

      endif

c ----------------- c
c Sstrange_L decays c
c ----------------- c

      if(sdowltot2.ne.0.D0) then
      write(21,*)
      write(21,*) " STRANGEL DECAYS ",sdowltot2
      write(21,*) " --------------- "
      write(21,201) " sstl --> chi0_1 st",sdowlneutdow(1),
     .                                    brsdowlndow(1)
      write(21,201) " sstl --> chi0_2 st",sdowlneutdow(2),
     .                                    brsdowlndow(2)
      write(21,201) " sstl --> chi0_3 st",sdowlneutdow(3),
     .                                    brsdowlndow(3)
      write(21,201) " sstl --> chi0_4 st",sdowlneutdow(4),
     .                                    brsdowlndow(4)
      write(21,201) " sstl --> chi-_1 ch",sdowlcharup(1),
     .                                    brsdowlchup(1)
      write(21,201) " sstl --> chi-_2 ch",sdowlcharup(2),
     .                                    brsdowlchup(2)
      write(21,201) " sstl --> gluino st",sdowlglui,brsdowlglui

      elseif(sdowltot2.eq.0.D0) then
      write(21,*)
      write(21,*) " STRANGEL STABLE "
      write(21,*) " --------------- "

      endif

c ----------------- c
c Sstrange_R decays c
c ----------------- c

      if(sdowrtot2.ne.0.D0) then
      write(21,*)
      write(21,*) " STRANGER DECAYS ",sdowrtot2
      write(21,*) " --------------- "
      write(21,201) " sstr --> chi0_1 st",sdowrneutdow(1),
     .                                    brsdowrndow(1)
      write(21,201) " sstr --> chi0_2 st",sdowrneutdow(2),
     .                                    brsdowrndow(2)
      write(21,201) " sstr --> chi0_3 st",sdowrneutdow(3),
     .                                    brsdowrndow(3)
      write(21,201) " sstr --> chi0_4 st",sdowrneutdow(4),
     .                                    brsdowrndow(4)
      write(21,201) " sstr --> chi-_1 ch",sdowrcharup(1),
     .                                    brsdowrchup(1)
      write(21,201) " sstr --> chi-_2 ch",sdowrcharup(2),
     .                                    brsdowrchup(2)
      write(21,201) " sstr --> gluino st",sdowrglui,brsdowrglui

      elseif(sdowrtot2.eq.0.D0) then
      write(21,*)
      write(21,*) " STRANGER STABLE "
      write(21,*) " --------------- "

      endif

c ------------------ c
c Selectron_L decays c
c ------------------ c

      if(selltot2.ne.0.D0) then
      write(21,*)
      write(21,*) " SELECTRONL DECAYS ",selltot2
      write(21,*) " ----------------- "
      write(21,201) " sel- --> chi0_1 e- ",sellneute(1),
     .                                     brsellneute(1)
      write(21,201) " sel- --> chi0_2 e- ",sellneute(2),
     .                                     brsellneute(2)
      write(21,201) " sel- --> chi0_3 e- ",sellneute(3),
     .                                     brsellneute(3)
      write(21,201) " sel- --> chi0_4 e- ",sellneute(4),
     .                                     brsellneute(4)
      write(21,201) " sel- --> chi-_1 nue",sellcharnue(1),
     .                                     brsellcharnue(1)
      write(21,201) " sel- --> chi-_2 nue",sellcharnue(2),
     .                                     brsellcharnue(2)

      elseif(selltot2.eq.0.D0) then
      write(21,*)
      write(21,*) " SELECTRONL STABLE "
      write(21,*) " ----------------- "

      endif

c ------------------ c
c Selectron_R decays c
c ------------------ c

      if(selrtot2.ne.0.D0) then
      write(21,*)		
      write(21,*) " SELECTRONR DECAYS ",selrtot2
      write(21,*) " ----------------- "
      write(21,201) " ser- --> chi0_1 e- ",selrneute(1),
     .                                     brselrneute(1)
      write(21,201) " ser- --> chi0_2 e- ",selrneute(2),
     .                                     brselrneute(2)
      write(21,201) " ser- --> chi0_3 e- ",selrneute(3),
     .                                     brselrneute(3)
      write(21,201) " ser- --> chi0_4 e- ",selrneute(4),
     .                                     brselrneute(4)
      write(21,201) " ser- --> chi-_1 nue",selrcharnue(1),
     .                                     brselrcharnue(1)
      write(21,201) " ser- --> chi-_2 nue",selrcharnue(2),
     .                                     brselrcharnue(2)

      elseif(selrtot2.eq.0.D0) then
      write(21,*)
      write(21,*) " SELECTRONR STABLE "
      write(21,*) " ----------------- "

      endif

c -------------- c
c Smuon_L decays c
c -------------- c

      if(selltot2.ne.0.D0) then
      write(21,*)
      write(21,*) " SMUONL DECAYS ",selltot2
      write(21,*) " ------------- "
      write(21,201) " smul- --> chi0_1 mu-",sellneute(1),
     .                                      brsellneute(1)
      write(21,201) " smul- --> chi0_2 mu-",sellneute(2),
     .                                      brsellneute(2)
      write(21,201) " smul- --> chi0_3 mu-",sellneute(3),
     .                                      brsellneute(3)
      write(21,201) " smul- --> chi0_4 mu-",sellneute(4),
     .                                      brsellneute(4)
      write(21,201) " smul- --> chi-_1 num",sellcharnue(1),
     .                                      brsellcharnue(1)
      write(21,201) " smul- --> chi-_2 num",sellcharnue(2),
     .                                      brsellcharnue(2)

      elseif(selltot2.eq.0.D0) then
      write(21,*)
      write(21,*) " SMUONL STABLE "
      write(21,*) " ------------- "

      endif

c ------------------ c
c Smuon_R decays c
c ------------------ c

      if(selrtot2.ne.0.D0) then
      write(21,*)
      write(21,*) " SMUONR DECAYS ",selrtot2
      write(21,*) " ------------- "
      write(21,201) " smur- --> chi0_1 mu-",selrneute(1),
     .                                      brselrneute(1)
      write(21,201) " smur- --> chi0_2 mu-",selrneute(2),
     .                                      brselrneute(2)
      write(21,201) " smur- --> chi0_3 mu-",selrneute(3),
     .                                      brselrneute(3)
      write(21,201) " smur- --> chi0_4 mu-",selrneute(4),
     .                                      brselrneute(4)
      write(21,201) " smur- --> chi-_1 num",selrcharnue(1),
     .                                      brselrcharnue(1)
      write(21,201) " smur- --> chi-_2 num",selrcharnue(2),
     .                                      brselrcharnue(2)

      elseif(selrtot2.eq.0.D0) then
      write(21,*)
      write(21,*) " SMUONR STABLE "
      write(21,*) " ------------- "

      endif

c ------------- c
c Stau_1 decays c
c ------------- c

      if(stau1tot2.ne.0.D0) then
      write(21,*)			
      write(21,*) " STAU1 DECAYS ",stau1tot2
      write(21,*) " ------------ "
      write(21,201) " stau1 --> chi0_1 tau-",stau1neut(1),
     .                                       brstau1neut(1)
      write(21,201) " stau1 --> chi0_2 tau-",stau1neut(2),
     .                                       brstau1neut(2)
      write(21,201) " stau1 --> chi0_3 tau-",stau1neut(3),
     .                                       brstau1neut(3)
      write(21,201) " stau1 --> chi0_4 tau-",stau1neut(4),
     .                                       brstau1neut(4)
      write(21,201) " stau1 --> chi-_1 nut ",stau1char(1),
     .                                       brstau1char(1)
      write(21,201) " stau1 --> chi-_2 nut ",stau1char(2),
     .                                       brstau1char(2)
      write(21,201) " stau1 --> snut1  H-  ",stau1hcsn(1),
     .                                       brstau1hcsn(1)
      write(21,201) " stau1 --> snut1  W-  ",stau1wsn(1),
     .                                       brstau1wsn(1)
      if(flagnlspgmsb.eq.1.D0) then
      write(21,201) " stau1 --> G      tau-",stautaugravitino,
     .                                       brstautaugrav
      endif

      elseif(stau1tot2.eq.0.D0) then
      write(21,*)
      write(21,*) " STAU1 STABLE "
      write(21,*) " ------------ "

      endif

c ------------- c
c Stau_2 decays c
c ------------- c

      if(stau2tot2.ne.0.D0) then
      write(21,*)
      write(21,*) " STAU2 DECAYS ",stau2tot2
      write(21,*) " ------------ "
      write(21,201) " stau2 --> chi0_1 tau-",stau2neut(1),
     .                                       brstau2neut(1)
      write(21,201) " stau2 --> chi0_2 tau-",stau2neut(2),
     .                                       brstau2neut(2)
      write(21,201) " stau2 --> chi0_3 tau-",stau2neut(3),
     .                                       brstau2neut(3)
      write(21,201) " stau2 --> chi0_4 tau-",stau2neut(4),
     .                                       brstau2neut(4)
      write(21,201) " stau2 --> chi-_1 nut ",stau2char(1),
     .                                       brstau2char(1)
      write(21,201) " stau2 --> chi-_2 nut ",stau2char(2),
     .                                       brstau2char(2)
      write(21,201) " stau2 --> snut1  H-  ",stau2hcsn(1),
     .                                       brstau2hcsn(1)
      write(21,201) " stau2 --> snut1  W-  ",stau2wsn(1),
     .                                       brstau2wsn(1)
      write(21,201) " stau2 --> stau1  h   ",stau2hl,
     .                                       brstau2hl
      write(21,201) " stau2 --> stau1  H   ",stau2hh,
     .                                       brstau2hh
      write(21,201) " stau2 --> stau1  A   ",stau2ha,
     .                                       brstau2ha
      write(21,201) " stau2 --> stau1  Z   ",stau2ztau,
     .                                       brstau2ztau

      elseif(stau2tot2.eq.0.D0) then
      write(21,*)
      write(21,*) " STAU2 STABLE "
      write(21,*) " ------------ "

      endif

c -------------------- c
c Snu_electronL decays c
c -------------------- c

      if(sneltot2.ne.0.D0) then
      write(21,*)
      write(21,*) " SNEUTRINO_EL DECAYS ",sneltot2
      write(21,*) " ------------------- "
      write(21,201) " snuel --> chi0_1 nue",snellneut(1),
     .                                      brsnellneut(1)
      write(21,201) " snuel --> chi0_2 nue",snellneut(2),
     .                                      brsnellneut(2)
      write(21,201) " snuel --> chi0_3 nue",snellneut(3),
     .                                      brsnellneut(3)
      write(21,201) " snuel --> chi0_4 nue",snellneut(4),
     .                                      brsnellneut(4)
      write(21,201) " snuel --> chi+_1 e- ",snellchar(1),
     .                                      brsnellchar(1)
      write(21,201) " snuel --> chi+_2 e- ",snellchar(2),
     .                                      brsnellchar(2)

      elseif(sneltot2.eq.0.D0) then
      write(21,*)
      write(21,*) " SNEUTRINO_EL STABLE "
      write(21,*) " ------------------- "

      endif

c ---------------- c
c Snu_muonL decays c
c ---------------- c

      if(sneltot2.ne.0.D0) then
      write(21,*)
      write(21,*) " SNEUTRINO_MUL DECAYS ",sneltot2
      write(21,*) " -------------------- "
      write(21,201) " snuml --> chi0_1 num",snellneut(1),
     .                                      brsnellneut(1)
      write(21,201) " snuml --> chi0_2 num",snellneut(2),
     .                                      brsnellneut(2)
      write(21,201) " snuml --> chi0_3 num",snellneut(3),
     .                                      brsnellneut(3)
      write(21,201) " snuml --> chi0_4 num",snellneut(4),
     .                                      brsnellneut(4)
      write(21,201) " snuml --> chi+_1 mu-",snellchar(1),
     .                                      brsnellchar(1)
      write(21,201) " snuml --> chi+_2 mu-",snellchar(2),
     .                                      brsnellchar(2)

      elseif(sneltot2.eq.0.D0) then
      write(21,*)
      write(21,*) " SNEUTRINO_MUL STABLE "
      write(21,*) " -------------------- "

      endif

c --------------- c
c Snu_tauL decays c
c --------------- c

      if(sntautot2.ne.0.D0) then
      write(21,*)
      write(21,*) " SNEUTRINO_TAU1 DECAYS ",sntautot2
      write(21,*) " --------------------- "
      write(21,201) " snut1 --> chi0_1 nut ",sntauneut(1),
     .                                       brsntauneut(1)
      write(21,201) " snut1 --> chi0_2 nut ",sntauneut(2),
     .                                       brsntauneut(2)
      write(21,201) " snut1 --> chi0_3 nut ",sntauneut(3),
     .                                       brsntauneut(3)
      write(21,201) " snut1 --> chi0_4 nut ",sntauneut(4),
     .                                       brsntauneut(4)
      write(21,201) " snut1 --> chi+_1 tau-",sntauchar(1),
     .                                       brsntauchar(1)
      write(21,201) " snut1 --> chi+_2 tau-",sntauchar(2),
     .                                       brsntauchar(2)
      write(21,201) " snut1 --> stau1+ H-  ",sntau1hcstau(1),
     .                                       brsntau1hcstau(1)
      write(21,201) " snut1 --> stau2+ H-  ",sntau1hcstau(2),
     .                                       brsntau1hcstau(2)
      write(21,201) " snut1 --> stau1+ W-  ",sntau1wstau(1),
     .                                       brsntau1wstau(1)
      write(21,201) " snut1 --> stau2+ W-  ",sntau1wstau(2),
     .                                       brsntau1wstau(2)

      elseif(sntautot2.eq.0.D0) then
      write(21,*)
      write(21,*) " SNEUTRINO_TAU1 STABLE "
      write(21,*) " --------------------- "

      endif

c ---------------- c
c chargino1 decays c
c ---------------- c

      do i=1,2,1
         if(chartot2(i).eq.0.D0) then
            flagchartot2(i) = 10.D0
         elseif(chartot2(i).ne.0.D0) then
            flagchartot2(i) = 40.D0
         endif
         flagcondchar(i) = flagchartot2(i)+flagmulti
      end do

      if(flagcondchar(1).eq.10.D0) then
         write(21,*)
         write(21,*) " CHARGINO1 STABLE "
         write(21,*) " ---------------- "
      elseif(flagcondchar(1).eq.40.D0.or.flagcondchar(1).eq.41.D0) then
         write(21,*)
         write(21,*) " CHARGINO1 DECAYS ",chartot2(1)
         write(21,*) " ---------------- "
      write(21,201) " chi+_1 --> supl   db   ",charsupl(1),brcharsupl(1)
      write(21,201) " chi+_1 --> supr   db   ",charsupr(1),brcharsupr(1)
      write(21,201) " chi+_1 --> sdbl   up   ",charsdownl(1),
     .                                         brcharsdownl(1)
      write(21,201) " chi+_1 --> sdbr   up   ",charsdownr(1),
     .                                         brcharsdownr(1)
      write(21,201) " chi+_1 --> schl   sb   ",charsupl(1),brcharsupl(1)
      write(21,201) " chi+_1 --> schr   sb   ",charsupr(1),brcharsupr(1)
      write(21,201) " chi+_1 --> ssbl   ch   ",charsdownl(1),
     .                                         brcharsdownl(1)
      write(21,201) " chi+_1 --> ssbr   ch   ",charsdownr(1),
     .                                         brcharsdownr(1)
      write(21,201) " chi+_1 --> stop1  bb   ",charst1(1),brcharst1(1)
      write(21,201) " chi+_1 --> stop2  bb   ",charst2(1),brcharst2(1)
      write(21,201) " chi+_1 --> sbot1b tp   ",charsb1(1),brcharsb1(1)
      write(21,201) " chi+_1 --> sbot2b tp   ",charsb2(1),brcharsb2(1)
      write(21,201) " chi+_1 --> snuel  e+   ",charsnel(1),brcharsnel(1)
      write(21,201) " chi+_1 --> snuml  mu+  ",charsnel(1),brcharsnel(1)
      write(21,201) " chi+_1 --> snut1  tau+ ",charsn1(1),brcharsn1(1)
      write(21,201) " chi+_1 --> sel+   nue  ",charsell(1),brcharsell(1)
      write(21,201) " chi+_1 --> ser+   nue  ",charselr(1),brcharselr(1)
      write(21,201) " chi+_1 --> smul+  num  ",charsell(1),brcharsell(1)
      write(21,201) " chi+_1 --> smur+  num  ",charselr(1),brcharselr(1)
      write(21,201) " chi+_1 --> stau1+ nut  ",charstau1(1),
     .                                         brcharstau1(1)
      write(21,201) " chi+_1 --> stau2+ nut  ",charstau2(1),
     .                                         brcharstau2(1)
      write(21,201) " chi+_1 --> chi0_1 W+   ",charwneut(1,1),
     .                                         brcharwneut(1,1)
      write(21,201) " chi+_1 --> chi0_2 W+   ",charwneut(1,2),
     .                                         brcharwneut(1,2)
      write(21,201) " chi+_1 --> chi0_3 W+   ",charwneut(1,3),
     .                                         brcharwneut(1,3)
      write(21,201) " chi+_1 --> chi0_4 W+   ",charwneut(1,4),
     .                                         brcharwneut(1,4)
      write(21,201) " chi+_1 --> chi0_1 H+   ",charhcneut(1,1),
     .                                         brcharhcneut(1,1)
      write(21,201) " chi+_1 --> chi0_2 H+   ",charhcneut(1,2),
     .                                         brcharhcneut(1,2)
      write(21,201) " chi+_1 --> chi0_3 H+   ",charhcneut(1,3),
     .                                         brcharhcneut(1,3)
      write(21,201) " chi+_1 --> chi0_4 H+   ",charhcneut(1,4),
     .                                         brcharhcneut(1,4)

      elseif(flagcondchar(1).eq.11.D0) then
         if(chartot(1).ne.0.D0) then
            write(21,*)
            write(21,*) " CHARGINO1 DECAYS ",chartot(1)
            write(21,*) " ---------------- "
      write(21,201) " chi+_1 --> chi0_1 up   db ",xchiup(1,1),
     .                                            brnupdb(1,1)
      write(21,201) " chi+_1 --> chi0_2 up   db ",xchiup(1,2),
     .                                            brnupdb(1,2)
      write(21,201) " chi+_1 --> chi0_3 up   db ",xchiup(1,3),
     .                                            brnupdb(1,3)
      write(21,201) " chi+_1 --> chi0_4 up   db ",xchiup(1,4),
     .                                            brnupdb(1,4)
      write(21,201) " chi+_1 --> chi0_1 ch   sb ",xchiup(1,1),
     .                                            brnupdb(1,1)
      write(21,201) " chi+_1 --> chi0_2 ch   sb ",xchiup(1,2),
     .                                            brnupdb(1,2)
      write(21,201) " chi+_1 --> chi0_3 ch   sb ",xchiup(1,3),
     .                                            brnupdb(1,3)
      write(21,201) " chi+_1 --> chi0_4 ch   sb ",xchiup(1,4),
     .                                            brnupdb(1,4)
      write(21,201) " chi+_1 --> chi0_1 tp   bb ",xchitop(1,1),
     .                                            brntopbb(1,1)
      write(21,201) " chi+_1 --> chi0_2 tp   bb ",xchitop(1,2),
     .                                            brntopbb(1,2)
      write(21,201) " chi+_1 --> chi0_3 tp   bb ",xchitop(1,3),
     .                                            brntopbb(1,3)
      write(21,201) " chi+_1 --> chi0_4 tp   bb ",xchitop(1,4),
     .                                            brntopbb(1,4)
      write(21,201) " chi+_1 --> chi0_1 e+   nue",xchiel(1,1),
     .                                            brnelnue(1,1)
      write(21,201) " chi+_1 --> chi0_2 e+   nue",xchiel(1,2),
     .                                            brnelnue(1,2)
      write(21,201) " chi+_1 --> chi0_3 e+   nue",xchiel(1,3),
     .                                            brnelnue(1,3)
      write(21,201) " chi+_1 --> chi0_4 e+   nue",xchiel(1,4),
     .                                            brnelnue(1,4)
      write(21,201) " chi+_1 --> chi0_1 mu+  num",xchimu(1,1),
     .                                            brnmunumu(1,1)
      write(21,201) " chi+_1 --> chi0_2 mu+  num",xchimu(1,2),
     .                                            brnmunumu(1,2)
      write(21,201) " chi+_1 --> chi0_3 mu+  num",xchimu(1,3),
     .                                            brnmunumu(1,3)
      write(21,201) " chi+_1 --> chi0_4 mu+  num",xchimu(1,4),
     .                                            brnmunumu(1,4)
      write(21,201) " chi+_1 --> chi0_1 tau+ nut",xchitau(1,1),
     .                                            brntaunut(1,1)
      write(21,201) " chi+_1 --> chi0_2 tau+ nut",xchitau(1,2),
     .                                            brntaunut(1,2)
      write(21,201) " chi+_1 --> chi0_3 tau+ nut",xchitau(1,3),
     .                                            brntaunut(1,3)
      write(21,201) " chi+_1 --> chi0_4 tau+ nut",xchitau(1,4),
     .                                            brntaunut(1,4)
      write(21,201) " chi+_1 --> gluino up   db ",xgluiupdb(1),
     .                                            brglupdb(1)
      write(21,201) " chi+_1 --> gluino ch   sb ",xgluichsb(1),
     .                                            brglchsb(1)
      write(21,201) " chi+_1 --> gluino tp   bb ",xgluitopbb(1),
     .                                            brgltopbb(1)

      elseif(chartot(1).eq.0.D0) then
         write(21,*)
         write(21,*) " CHARGINO1 STABLE "
         write(21,*) " ---------------- "
      endif
      endif

c ---------------- c
c chargino2 decays c
c ---------------- c

      if(flagcondchar(2).eq.10.D0) then
         write(21,*)
         write(21,*) " CHARGINO2 STABLE "
         write(21,*) " ---------------- "
      elseif(flagcondchar(2).eq.40.D0.or.flagcondchar(2).eq.41.D0) then
         write(21,*)
         write(21,*) " CHARGINO2 DECAYS ",chartot2(2)
         write(21,*) " ---------------- "
      write(21,201) " chi+_2 --> supl   db   ",charsupl(2),brcharsupl(2)
      write(21,201) " chi+_2 --> supr   db   ",charsupr(2),brcharsupr(2)
      write(21,201) " chi+_2 --> sdbl   up   ",charsdownl(2),
     .                                         brcharsdownl(2)
      write(21,201) " chi+_2 --> sdbr   up   ",charsdownr(2),
     .                                         brcharsdownr(2)
      write(21,201) " chi+_2 --> schl   sb   ",charsupl(2),brcharsupl(2)
      write(21,201) " chi+_2 --> schr   sb   ",charsupr(2),brcharsupr(2)
      write(21,201) " chi+_2 --> ssbl   ch   ",charsdownl(2),
     .                                         brcharsdownl(2)
      write(21,201) " chi+_2 --> ssbr   ch   ",charsdownr(2),
     .                                         brcharsdownr(2)
      write(21,201) " chi+_2 --> stop1  bb   ",charst1(2),brcharst1(2)
      write(21,201) " chi+_2 --> stop2  bb   ",charst2(2),brcharst2(2)
      write(21,201) " chi+_2 --> sbot1b tp   ",charsb1(2),brcharsb1(2)
      write(21,201) " chi+_2 --> sbot2b tp   ",charsb2(2),brcharsb2(2)
      write(21,201) " chi+_2 --> snuel  e+   ",charsnel(2),brcharsnel(2)
      write(21,201) " chi+_2 --> snuml  mu+  ",charsnel(2),brcharsnel(2)
      write(21,201) " chi+_2 --> snut1  tau+ ",charsn1(2),brcharsn1(2)
      write(21,201) " chi+_2 --> sel+   nue  ",charsell(2),brcharsell(2)
      write(21,201) " chi+_2 --> ser+   nue  ",charselr(2),brcharselr(2)
      write(21,201) " chi+_2 --> smul+  num  ",charsell(2),brcharsell(2)
      write(21,201) " chi+_2 --> smur+  num  ",charselr(2),brcharselr(2)
      write(21,201) " chi+_2 --> stau1+ nut  ",charstau1(2),
     .                                         brcharstau1(2)
      write(21,201) " chi+_2 --> stau2+ nut  ",charstau2(2),
     .                                         brcharstau2(2)
      write(21,201) " chi+_2 --> chi+_1 Z    ",char2zchic1,brcharzchic
      write(21,201) " chi+_2 --> chi0_1 W+   ",charwneut(2,1),
     .                                         brcharwneut(2,1)
      write(21,201) " chi+_2 --> chi0_2 W+   ",charwneut(2,2),
     .                                         brcharwneut(2,2)
      write(21,201) " chi+_2 --> chi0_3 W+   ",charwneut(2,3),
     .                                         brcharwneut(2,3)
      write(21,201) " chi+_2 --> chi0_4 W+   ",charwneut(2,4),
     .                                         brcharwneut(2,4)
      write(21,201) " chi+_2 --> chi+_1 h    ",char2hlchic1,brcharhlchic
      write(21,201) " chi+_2 --> chi+_1 H    ",char2hhchic1,brcharhhchic
      write(21,201) " chi+_2 --> chi+_1 A    ",char2hachic1,brcharhachic
      write(21,201) " chi+_2 --> chi0_1 H+   ",charhcneut(2,1),
     .                                         brcharhcneut(2,1)
      write(21,201) " chi+_2 --> chi0_2 H+   ",charhcneut(2,2),
     .                                         brcharhcneut(2,2)
      write(21,201) " chi+_2 --> chi0_3 H+   ",charhcneut(2,3),
     .                                         brcharhcneut(2,3)
      write(21,201) " chi+_2 --> chi0_4 H+   ",charhcneut(2,4),
     .                                         brcharhcneut(2,4)

      elseif(flagcondchar(2).eq.11.D0) then
         if(chartot(2).ne.0.D0) then
            write(21,*)
            write(21,*) " CHARGINO2 DECAYS ",chartot(2)
            write(21,*) " ---------------- "
      write(21,201) " chi+_2 --> chi0_1 up   db  ",xchiup(2,1),
     .                                             brnupdb(2,1)
      write(21,201) " chi+_2 --> chi0_2 up   db  ",xchiup(2,2),
     .                                             brnupdb(2,2)
      write(21,201) " chi+_2 --> chi0_3 up   db  ",xchiup(2,3),
     .                                             brnupdb(2,3)
      write(21,201) " chi+_2 --> chi0_4 up   db  ",xchiup(2,4),
     .                                             brnupdb(2,4)
      write(21,201) " chi+_2 --> chi0_1 ch   sb  ",xchiup(2,1),
     .                                             brnupdb(2,1)
      write(21,201) " chi+_2 --> chi0_2 ch   sb  ",xchiup(2,2),
     .                                             brnupdb(2,2)
      write(21,201) " chi+_2 --> chi0_3 ch   sb  ",xchiup(2,3),
     .                                             brnupdb(2,3)
      write(21,201) " chi+_2 --> chi0_4 ch   sb  ",xchiup(2,4),
     .                                             brnupdb(2,4)
      write(21,201) " chi+_2 --> chi0_1 tp   bb  ",xchitop(2,1),
     .                                             brntopbb(2,1)
      write(21,201) " chi+_2 --> chi0_2 tp   bb  ",xchitop(2,2),
     .                                             brntopbb(2,2)
      write(21,201) " chi+_2 --> chi0_3 tp   bb  ",xchitop(2,3),
     .                                             brntopbb(2,3)
      write(21,201) " chi+_2 --> chi0_4 tp   bb  ",xchitop(2,4),
     .                                             brntopbb(2,4)
      write(21,201) " chi+_2 --> chi0_1 e+   nue ",xchiel(2,1),
     .                                             brnelnue(2,1)
      write(21,201) " chi+_2 --> chi0_2 e+   nue ",xchiel(2,2),
     .                                             brnelnue(2,2)
      write(21,201) " chi+_2 --> chi0_3 e+   nue ",xchiel(2,3),
     .                                             brnelnue(2,3)
      write(21,201) " chi+_2 --> chi0_4 e+   nue ",xchiel(2,4),
     .                                             brnelnue(2,4)
      write(21,201) " chi+_2 --> chi0_1 mu+  num ",xchimu(2,1),
     .                                             brnmunumu(2,1)
      write(21,201) " chi+_2 --> chi0_2 mu+  num ",xchimu(2,2),
     .                                             brnmunumu(2,2)
      write(21,201) " chi+_2 --> chi0_3 mu+  num ",xchimu(2,3),
     .                                             brnmunumu(2,3)
      write(21,201) " chi+_2 --> chi0_4 mu+  num ",xchimu(2,4),
     .                                             brnmunumu(2,4)
      write(21,201) " chi+_2 --> chi0_1 tau+ nut ",xchitau(2,1),
     .                                             brntaunut(2,1)
      write(21,201) " chi+_2 --> chi0_2 tau+ nut ",xchitau(2,2),
     .                                             brntaunut(2,2)
      write(21,201) " chi+_2 --> chi0_3 tau+ nut ",xchitau(2,3),
     .                                             brntaunut(2,3)
      write(21,201) " chi+_2 --> chi0_4 tau+ nut ",xchitau(2,4),
     .                                             brntaunut(2,4)
      write(21,201) " chi+_2 --> chi+_1 up   ub  ",xchar1up,brchupup
      write(21,201) " chi+_2 --> chi+_1 dn   db  ",xchar1dow,brchdodo
      write(21,201) " chi+_2 --> chi+_1 ch   cb  ",xchar1ch,brchchch
      write(21,201) " chi+_2 --> chi+_1 st   sb  ",xchar1str,brchstst
      write(21,201) " chi+_2 --> chi+_1 tp   tb  ",xchar1top,brchtoptop
      write(21,201) " chi+_2 --> chi+_1 bt   bb  ",xchar1bot,brchbotbot
      write(21,201) " chi+_2 --> chi+_1 e+   e-  ",xchar1el,brchee
      write(21,201) " chi+_2 --> chi+_1 mu+  mu- ",xchar1mu,brchmumu
      write(21,201) " chi+_2 --> chi+_1 tau+ tau-",xchar1tau,brchtautau
      write(21,201) " chi+_2 --> chi+_1 nue  nueb",xchar1nue,brchnene
      write(21,201) " chi+_2 --> chi+_1 num  numb",xchar1numu,brchnmunmu
      write(21,201) " chi+_2 --> chi+_1 nut  nutb",xchar1nutau,
     .                                             brchntauntau
      write(21,201) " chi+_2 --> gluino up   db  ",xgluiupdb(2),
     .                                             brglupdb(2)
      write(21,201) " chi+_2 --> gluino ch   sb  ",xgluichsb(2),
     .                                             brglchsb(2)
      write(21,201) " chi+_2 --> gluino tp   bb  ",xgluitopbb(2),
     .                                             brgltopbb(2)

      elseif(chartot(2).eq.0.D0) then
         write(21,*)
         write(21,*) " CHARGINO2 STABLE "
         write(21,*) " ---------------- "
      endif
      endif

c ------------------ c
c neutralino1 decays c
c ------------------ c

      flagmultiloop = flagmulti+flagloop
      do i=1,4,1
         if(neuttot2(i).eq.0.D0) then
            flagneuttot2(i) = 10.D0
         elseif(neuttot2(i).ne.0.D0) then
            flagneuttot2(i) = 40.D0
         endif
         flagcondneut(i) = flagneuttot2(i)+flagmultiloop
      end do

      flagcondneut(1) = flagneuttot2(1)+flagmulti

      if(flagcondneut(1).eq.10.D0) then
         write(21,*)
         write(21,*) " NEUTRALINO1 STABLE "
         write(21,*) " ------------------ "
      elseif(flagcondneut(1).eq.40.D0.or.flagcondneut(1).eq.41.D0) then
         write(21,*)
         write(21,*) " NEUTRALINO1 DECAYS ",neuttot2(1)
         write(21,*) " ------------------ "
      write(21,201) " chi0_1 --> chi+_1 W-  ",neutwchar(1,1),
     .                                        brneutwchar(1,1)
      write(21,201) " chi0_1 --> chi-_1 W+  ",neutwchar(1,1),
     .                                        brneutwchar(1,1)
      write(21,201) " chi0_1 --> chi+_2 W-  ",neutwchar(1,2),
     .                                        brneutwchar(1,2)
      write(21,201) " chi0_1 --> chi-_2 W+  ",neutwchar(1,2),
     .                                        brneutwchar(1,2)
      write(21,201) " chi0_1 --> chi+_1 H-  ",neuthcchar(1,1),
     .                                        brneuthcchar(1,1)
      write(21,201) " chi0_1 --> chi-_1 H+  ",neuthcchar(1,1),
     .                                        brneuthcchar(1,1)
      write(21,201) " chi0_1 --> chi+_2 H-  ",neuthcchar(1,2),
     .                                        brneuthcchar(1,2)
      write(21,201) " chi0_1 --> chi-_2 H+  ",neuthcchar(1,2),
     .                                        brneuthcchar(1,2)
      write(21,201) " chi0_1 --> supl   ub  ",neutsupl(1),brneutsupl(1)
      write(21,201) " chi0_1 --> subl   up  ",neutsupl(1),brneutsupl(1)
      write(21,201) " chi0_1 --> supr   ub  ",neutsupr(1),brneutsupr(1)
      write(21,201) " chi0_1 --> subr   up  ",neutsupr(1),brneutsupr(1)
      write(21,201) " chi0_1 --> sdnl   db  ",neutsdownl(1),
     .                                        brneutsdownl(1)
      write(21,201) " chi0_1 --> sdbl   dn  ",neutsdownl(1),
     .                                        brneutsdownl(1)
      write(21,201) " chi0_1 --> sdnr   db  ",neutsdownr(1),
     .                                        brneutsdownr(1)
      write(21,201) " chi0_1 --> sdbr   dn  ",neutsdownr(1),
     .                                        brneutsdownr(1)
      write(21,201) " chi0_1 --> schl   cb  ",neutsupl(1),brneutsupl(1)
      write(21,201) " chi0_1 --> scbl   ch  ",neutsupl(1),brneutsupl(1)
      write(21,201) " chi0_1 --> schr   cb  ",neutsupr(1),brneutsupr(1)
      write(21,201) " chi0_1 --> scbr   ch  ",neutsupr(1),brneutsupr(1)
      write(21,201) " chi0_1 --> sstl   sb  ",neutsdownl(1),
     .                                        brneutsdownl(1)
      write(21,201) " chi0_1 --> ssbl   st  ",neutsdownl(1),
     .                                        brneutsdownl(1)
      write(21,201) " chi0_1 --> sstr   sb  ",neutsdownr(1),
     .                                        brneutsdownr(1)
      write(21,201) " chi0_1 --> ssbr   st  ",neutsdownr(1),
     .                                        brneutsdownr(1)
      write(21,201) " chi0_1 --> stop1  tb  ",neutst1(1),brneutst1(1)
      write(21,201) " chi0_1 --> stop1b tp  ",neutst1(1),brneutst1(1)
      write(21,201) " chi0_1 --> stop2  tb  ",neutst2(1),brneutst2(1)
      write(21,201) " chi0_1 --> stop2b tp  ",neutst2(1),brneutst2(1)
      write(21,201) " chi0_1 --> sbot1  bb  ",neutsb1(1),brneutsb1(1)
      write(21,201) " chi0_1 --> sbot1b bt  ",neutsb1(1),brneutsb1(1)
      write(21,201) " chi0_1 --> sbot2  bb  ",neutsb2(1),brneutsb2(1)
      write(21,201) " chi0_1 --> sbot2b bt  ",neutsb2(1),brneutsb2(1)
      write(21,201) " chi0_1 --> sel-   e+  ",neutsell(1),brneutsell(1)
      write(21,201) " chi0_1 --> sel+   e-  ",neutsell(1),brneutsell(1)
      write(21,201) " chi0_1 --> ser-   e+  ",neutselr(1),brneutselr(1)
      write(21,201) " chi0_1 --> ser+   e-  ",neutselr(1),brneutselr(1)
      write(21,201) " chi0_1 --> smul-  mu+ ",neutsell(1),brneutsell(1)
      write(21,201) " chi0_1 --> smul+  mu- ",neutsell(1),brneutsell(1)
      write(21,201) " chi0_1 --> smur-  mu+ ",neutselr(1),brneutselr(1)
      write(21,201) " chi0_1 --> smur+  mu- ",neutselr(1),brneutselr(1)
      write(21,201) " chi0_1 --> stau1- tau+",neutstau1(1),
     .                                        brneutstau1(1)
      write(21,201) " chi0_1 --> stau1+ tau-",neutstau1(1),
     .                                        brneutstau1(1)
      write(21,201) " chi0_1 --> stau2- tau+",neutstau2(1),
     .                                        brneutstau2(1)
      write(21,201) " chi0_1 --> stau2+ tau-",neutstau2(1),
     .                                        brneutstau2(1)
      write(21,201) " chi0_1 --> snuel  nueb",neutsnel(1),brneutsnel(1)
      write(21,201) " chi0_1 --> snuelb nue ",neutsnel(1),brneutsnel(1)
      write(21,201) " chi0_1 --> snuml  numb",neutsnel(1),brneutsnel(1)
      write(21,201) " chi0_1 --> snumlb num ",neutsnel(1),brneutsnel(1)
      write(21,201) " chi0_1 --> snut1  nutb",neutsn1(1),brneutsn1(1)
      write(21,201) " chi0_1 --> snut1b nut ",neutsn1(1),brneutsn1(1)
      if(flagnlspgmsb.eq.1.D0) then
         write(21,201) " chi0_1 --> G      gm  ",neutgammagravitino(1),
     .                                           brneutgamgrav(1)
         write(21,201) " chi0_1 --> G      Z   ",neutZgravitino(1),
     .                                           brneutzgrav(1)
         write(21,201) " chi0_1 --> G      h   ",neuthlgravitino(1),
     .                                           brneuthlgrav(1)
         write(21,201) " chi0_1 --> G      H   ",neuthhgravitino(1),
     .                                           brneuthhgrav(1)
         write(21,201) " chi0_1 --> G      A   ",neuthagravitino(1),
     .                                           brneuthagrav(1)
      endif

      elseif(flagcondneut(1).eq.11.D0) then
         if(neuttot(1).ne.0.D0) then
            write(21,*)
            write(21,*) " NEUTRALINO1 DECAYS ",neuttot(1)
            write(21,*) " ------------------ "
c
      if(flagnlspgmsb.eq.1.D0) then
         write(21,201) " chi0_1 --> G      gm  ",neutgammagravitino(1),
     .                                           brneutgamgrav(1)
         write(21,201) " chi0_1 --> G      Z   ",neutZgravitino(1),
     .                                           brneutzgrav(1)
         write(21,201) " chi0_1 --> G      h   ",neuthlgravitino(1),
     .                                           brneuthlgrav(1)
         write(21,201) " chi0_1 --> G      H   ",neuthhgravitino(1),
     .                                           brneuthhgrav(1)
         write(21,201) " chi0_1 --> G      A   ",neuthagravitino(1),
     .                                           brneuthagrav(1)
      endif
c
      write(21,201) " chi0_1 --> chi+_1 ub   dn  ",xchubdow(1,1),
     .                                             brchubd(1,1)
      write(21,201) " chi0_1 --> chi-_1 up   db  ",xchubdow(1,1),
     .                                             brchubd(1,1)
      write(21,201) " chi0_1 --> chi+_2 ub   dn  ",xchubdow(1,2),
     .                                             brchubd(1,2)
      write(21,201) " chi0_1 --> chi-_2 up   db  ",xchubdow(1,2),
     .                                             brchubd(1,2)
      write(21,201) " chi0_1 --> chi+_1 cb   st  ",xchcbs(1,1),
     .                                             brchcbs(1,1)
      write(21,201) " chi0_1 --> chi-_1 ch   sb  ",xchcbs(1,1),
     .                                             brchcbs(1,1)
      write(21,201) " chi0_1 --> chi+_2 cb   st  ",xchcbs(1,2),
     .                                             brchcbs(1,2)
      write(21,201) " chi0_1 --> chi-_2 ch   sb  ",xchcbs(1,2),
     .                                             brchcbs(1,2)
      write(21,201) " chi0_1 --> chi+_1 tb   bt  ",xchtbb(1,1),
     .                                             brchtbb(1,1)
      write(21,201) " chi0_1 --> chi-_1 tp   bb  ",xchtbb(1,1),
     .                                             brchtbb(1,1)
      write(21,201) " chi0_1 --> chi+_2 tb   bt  ",xchtbb(1,2),
     .                                             brchtbb(1,2)
      write(21,201) " chi0_1 --> chi-_2 tp   bb  ",xchtbb(1,2),
     .                                             brchtbb(1,2)
      write(21,201) " chi0_1 --> chi+_1 e-   nueb",xchelne(1,1),
     .                                             brchelne(1,1)
      write(21,201) " chi0_1 --> chi-_1 e+   nue ",xchelne(1,1),
     .                                             brchelne(1,1)
      write(21,201) " chi0_1 --> chi+_2 e-   nueb",xchelne(1,2),
     .                                             brchelne(1,2)
      write(21,201) " chi0_1 --> chi-_2 e+   nue ",xchelne(1,2),
     .                                             brchelne(1,2)
      write(21,201) " chi0_1 --> chi+_1 mu-  numb",xchmunmu(1,1),
     .                                             brchmunmu(1,1)
      write(21,201) " chi0_1 --> chi-_1 mu+  num ",xchmunmu(1,1),
     .                                             brchmunmu(1,1)
      write(21,201) " chi0_1 --> chi+_2 mu-  numb",xchmunmu(1,2),
     .                                             brchmunmu(1,2)
      write(21,201) " chi0_1 --> chi-_2 mu+  num ",xchmunmu(1,2),
     .                                             brchmunmu(1,2)
      write(21,201) " chi0_1 --> chi+_1 tau- nutb",xchtauntau(1,1),
     .                                             brchtauntau(1,1)
      write(21,201) " chi0_1 --> chi-_1 tau+ nut ",xchtauntau(1,1),
     .                                             brchtauntau(1,1)
      write(21,201) " chi0_1 --> chi+_2 tau- nutb",xchtauntau(1,2),
     .                                             brchtauntau(1,2)
      write(21,201) " chi0_1 --> chi-_2 tau+ nut ",xchtauntau(1,2),
     .                                             brchtauntau(1,2)
      write(21,201) " chi0_1 --> gluino up   ub  ",xgluinoup(1),
     .                                             brglup(1)
      write(21,201) " chi0_1 --> gluino dn   db  ",xgluinodo(1),
     .                                             brgldo(1)
      write(21,201) " chi0_1 --> gluino ch   cb  ",xgluinoch(1),
     .                                             brglch(1)
      write(21,201) " chi0_1 --> gluino st   sb  ",xgluinost(1),
     .                                             brglst(1)
      write(21,201) " chi0_1 --> gluino tp   tb  ",xgluinotop(1),
     .                                             brgltop(1)
      write(21,201) " chi0_1 --> gluino bt   bb  ",xgluinobot(1),
     .                                             brglbot(1)

      elseif(neuttot(1).eq.0.D0) then
         write(21,*)
         write(21,*) " NEUTRALINO1 STABLE "
         write(21,*) " ------------------ "
      endif
      endif

c ------------------ c
c neutralino2 decays c
c ------------------ c

      if(flagcondneut(2).eq.10.D0) then
         write(21,*)
         write(21,*) " NEUTRALINO2 STABLE "
         write(21,*) " ------------------ "
      elseif(flagcondneut(2).eq.40.D0.or.flagcondneut(2).eq.41.D0.or.
     .flagcondneut(2).eq.42.D0) then
         write(21,*)
         write(21,*) " NEUTRALINO2 DECAYS ",neuttot2(2)
         write(21,*) " ------------------ "
      write(21,201) " chi0_2 --> chi0_1 Z   ",neutzneut(2,1),
     .                                        brneutzneut(2,1)
      write(21,201) " chi0_2 --> chi+_1 W-  ",neutwchar(2,1),
     .                                        brneutwchar(2,1)
      write(21,201) " chi0_2 --> chi-_1 W+  ",neutwchar(2,1),
     .                                        brneutwchar(2,1)
      write(21,201) " chi0_2 --> chi+_2 W-  ",neutwchar(2,2),
     .                                        brneutwchar(2,2)
      write(21,201) " chi0_2 --> chi-_2 W+  ",neutwchar(2,2),
     .                                        brneutwchar(2,2)
      write(21,201) " chi0_2 --> chi0_1 h   ",neuthlneut(2,1),
     .                                        brneuthlneut(2,1)
      write(21,201) " chi0_2 --> chi0_1 H   ",neuthhneut(2,1),
     .                                        brneuthhneut(2,1)
      write(21,201) " chi0_2 --> chi0_1 A   ",neuthaneut(2,1),
     .                                        brneuthaneut(2,1)
      write(21,201) " chi0_2 --> chi+_1 H-  ",neuthcchar(2,1),
     .                                        brneuthcchar(2,1)
      write(21,201) " chi0_2 --> chi-_1 H+  ",neuthcchar(2,1),
     .                                        brneuthcchar(2,1)
      write(21,201) " chi0_2 --> chi+_2 H-  ",neuthcchar(2,2),
     .                                        brneuthcchar(2,2)
      write(21,201) " chi0_2 --> chi-_2 H+  ",neuthcchar(2,2),
     .                                        brneuthcchar(2,2)
      write(21,201) " chi0_2 --> supl   ub  ",neutsupl(2),brneutsupl(2)
      write(21,201) " chi0_2 --> subl   up  ",neutsupl(2),brneutsupl(2)
      write(21,201) " chi0_2 --> supr   ub  ",neutsupr(2),brneutsupr(2)
      write(21,201) " chi0_2 --> subr   up  ",neutsupr(2),brneutsupr(2)
      write(21,201) " chi0_2 --> sdnl   db  ",neutsdownl(2),
     .                                        brneutsdownl(2)
      write(21,201) " chi0_2 --> sdbl   dn  ",neutsdownl(2),
     .                                        brneutsdownl(2)
      write(21,201) " chi0_2 --> sdnr   db  ",neutsdownr(2),
     .                                        brneutsdownr(2)
      write(21,201) " chi0_2 --> sdbr   dn  ",neutsdownr(2),
     .                                        brneutsdownr(2)
      write(21,201) " chi0_2 --> schl   cb  ",neutsupl(2),brneutsupl(2)
      write(21,201) " chi0_2 --> scbl   ch  ",neutsupl(2),brneutsupl(2)
      write(21,201) " chi0_2 --> schr   cb  ",neutsupr(2),brneutsupr(2)
      write(21,201) " chi0_2 --> scbr   ch  ",neutsupr(2),brneutsupr(2)
      write(21,201) " chi0_2 --> sstl   sb  ",neutsdownl(2),
     .                                        brneutsdownl(2)
      write(21,201) " chi0_2 --> ssbl   st  ",neutsdownl(2),
     .                                         brneutsdownl(2)
      write(21,201) " chi0_2 --> sstr   sb  ",neutsdownr(2),
     .                                        brneutsdownr(2)
      write(21,201) " chi0_2 --> ssbr   st  ",neutsdownr(2),
     .                                        brneutsdownr(2)
      write(21,201) " chi0_2 --> stop1  tb  ",neutst1(2),brneutst1(2)
      write(21,201) " chi0_2 --> stop1b tp  ",neutst1(2),brneutst1(2)
      write(21,201) " chi0_2 --> stop2  tb  ",neutst2(2),brneutst2(2)
      write(21,201) " chi0_2 --> stop2b tp  ",neutst2(2),brneutst2(2)
      write(21,201) " chi0_2 --> sbot1  bb  ",neutsb1(2),brneutsb1(2)
      write(21,201) " chi0_2 --> sbot1b bt  ",neutsb1(2),brneutsb1(2)
      write(21,201) " chi0_2 --> sbot2  bb  ",neutsb2(2),brneutsb2(2)
      write(21,201) " chi0_2 --> sbot2b bt  ",neutsb2(2),brneutsb2(2)
      write(21,201) " chi0_2 --> sel-   e+  ",neutsell(2),brneutsell(2)
      write(21,201) " chi0_2 --> sel+   e-  ",neutsell(2),brneutsell(2)
      write(21,201) " chi0_2 --> ser-   e+  ",neutselr(2),brneutselr(2)
      write(21,201) " chi0_2 --> ser+   e-  ",neutselr(2),brneutselr(2)
      write(21,201) " chi0_2 --> smul-  mu+ ",neutsell(2),brneutsell(2)
      write(21,201) " chi0_2 --> smul+  mu- ",neutsell(2),brneutsell(2)
      write(21,201) " chi0_2 --> smur-  mu+ ",neutselr(2),brneutselr(2)
      write(21,201) " chi0_2 --> smur+  mu- ",neutselr(2),brneutselr(2)
      write(21,201) " chi0_2 --> stau1- tau+",neutstau1(2),
     .                                        brneutstau1(2)
      write(21,201) " chi0_2 --> stau1+ tau-",neutstau1(2),
     .                                        brneutstau1(2)
      write(21,201) " chi0_2 --> stau2- tau+",neutstau2(2),
     .                                        brneutstau2(2)
      write(21,201) " chi0_2 --> stau2+ tau-",neutstau2(2),
     .                                        brneutstau2(2)
      write(21,201) " chi0_2 --> snuel  nueb",neutsnel(2),brneutsnel(2)
      write(21,201) " chi0_2 --> snuelb nue ",neutsnel(2),brneutsnel(2)
      write(21,201) " chi0_2 --> snuml  numb",neutsnel(2),brneutsnel(2)
      write(21,201) " chi0_2 --> snumlb num ",neutsnel(2),brneutsnel(2)
      write(21,201) " chi0_2 --> snut1  nutb",neutsn1(2),brneutsn1(2)
      write(21,201) " chi0_2 --> snut1b nut ",neutsn1(2),brneutsn1(2)

      elseif(flagcondneut(2).eq.11.D0.or.flagcondneut(2).eq.12.D0) then
         if(neuttot(2).ne.0.D0) then
            write(21,*)
            write(21,*) " NEUTRALINO2 DECAYS ",neuttot(2)
            write(21,*) " ------------------ "
            if(flagloop.eq.1.D0) then
      write(21,201) " chi0_2 --> chi0_1 gm       ",nraddec(2,1),
     .                                             brnraddec(2,1)
            endif
            if(flagmulti.eq.1.D0) then
      write(21,201) " chi0_2 --> chi0_1 up   ub  ",xneutup(2,1),
     .                                             brneutup(2,1)
      write(21,201) " chi0_2 --> chi0_1 dn   db  ",xneutdow(2,1),
     .                                             brneutdow(2,1)
      write(21,201) " chi0_2 --> chi0_1 ch   cb  ",xneutch(2,1),
     .                                             brneutch(2,1)
      write(21,201) " chi0_2 --> chi0_1 st   sb  ",xneutst(2,1),
     .                                             brneutst(2,1)
      write(21,201) " chi0_2 --> chi0_1 tp   tb  ",xneuttop(2,1),
     .                                             brneuttop(2,1)      
      write(21,201) " chi0_2 --> chi0_1 bt   bb  ",xneutbot(2,1),
     .                                             brneutbot(2,1)
      write(21,201) " chi0_2 --> chi0_1 e+   e-  ",xneutel(2,1),
     .                                             brneutel(2,1)
      write(21,201) " chi0_2 --> chi0_1 mu+  mu- ",xneutmu(2,1),
     .                                             brneutmu(2,1)
      write(21,201) " chi0_2 --> chi0_1 tau+ tau-",xneuttau(2,1),
     .                                             brneuttau(2,1)
      write(21,201) " chi0_2 --> chi0_1 nue  nueb",xneutnue(2,1),
     .                                             brneutnue(2,1)
      write(21,201) " chi0_2 --> chi0_1 num  numb",xneutnumu(2,1),
     .                                             brneutnumu(2,1)
      write(21,201) " chi0_2 --> chi0_1 nut  nutb",xneutnutau(2,1),
     .                                             brneutnutau(2,1)
      write(21,201) " chi0_2 --> chi+_1 ub   dn  ",xchubdow(2,1),
     .                                             brchubd(2,1)
      write(21,201) " chi0_2 --> chi-_1 up   db  ",xchubdow(2,1),
     .                                             brchubd(2,1)
      write(21,201) " chi0_2 --> chi+_2 ub   dn  ",xchubdow(2,2),
     .                                             brchubd(2,2)
      write(21,201) " chi0_2 --> chi-_2 up   db  ",xchubdow(2,2),
     .                                             brchubd(2,2)
      write(21,201) " chi0_2 --> chi+_1 cb   st  ",xchcbs(2,1),
     .                                             brchcbs(2,1)
      write(21,201) " chi0_2 --> chi-_1 ch   sb  ",xchcbs(2,1),
     .                                             brchcbs(2,1)
      write(21,201) " chi0_2 --> chi+_2 cb   st  ",xchcbs(2,2),
     .                                             brchcbs(2,2)
      write(21,201) " chi0_2 --> chi-_2 ch   sb  ",xchcbs(2,2),
     .                                             brchcbs(2,2)
      write(21,201) " chi0_2 --> chi+_1 tb   bt  ",xchtbb(2,1),
     .                                             brchtbb(2,1)
      write(21,201) " chi0_2 --> chi-_1 tp   bb  ",xchtbb(2,1),
     .                                             brchtbb(2,1)
      write(21,201) " chi0_2 --> chi+_2 tb   bt  ",xchtbb(2,2),
     .                                             brchtbb(2,2)
      write(21,201) " chi0_2 --> chi-_2 tp   bb  ",xchtbb(2,2),
     .                                             brchtbb(2,2)
      write(21,201) " chi0_2 --> chi+_1 e-   nueb",xchelne(2,1),
     .                                             brchelne(2,1)
      write(21,201) " chi0_2 --> chi-_1 e+   nue ",xchelne(2,1),
     .                                             brchelne(2,1)
      write(21,201) " chi0_2 --> chi+_2 e-   nueb",xchelne(2,2),
     .                                             brchelne(2,2)
      write(21,201) " chi0_2 --> chi-_2 e+   nue ",xchelne(2,2),
     .                                             brchelne(2,2)
      write(21,201) " chi0_2 --> chi+_1 mu-  numb",xchmunmu(2,1),
     .                                             brchmunmu(2,1)
      write(21,201) " chi0_2 --> chi-_1 mu+  num ",xchmunmu(2,1),
     .                                             brchmunmu(2,1)
      write(21,201) " chi0_2 --> chi+_2 mu-  numb",xchmunmu(2,2),
     .                                             brchmunmu(2,2)
      write(21,201) " chi0_2 --> chi-_2 mu+  num ",xchmunmu(2,2),
     .                                             brchmunmu(2,2)
      write(21,201) " chi0_2 --> chi+_1 tau- nutb",xchtauntau(2,1),
     .                                             brchtauntau(2,1)
      write(21,201) " chi0_2 --> chi-_1 tau+ nut ",xchtauntau(2,1),
     .                                             brchtauntau(2,1)
      write(21,201) " chi0_2 --> chi+_2 tau- nutb",xchtauntau(2,2),
     .                                             brchtauntau(2,2)
      write(21,201) " chi0_2 --> chi-_2 tau+ nut ",xchtauntau(2,2),
     .                                             brchtauntau(2,2)
      write(21,201) " chi0_2 --> gluino up   ub  ",xgluinoup(2),
     .                                             brglup(2)
      write(21,201) " chi0_2 --> gluino dn   db  ",xgluinodo(2),
     .                                             brgldo(2)
      write(21,201) " chi0_2 --> gluino ch   cb  ",xgluinoch(2),
     .                                             brglch(2)
      write(21,201) " chi0_2 --> gluino st   sb  ",xgluinost(2),
     .                                             brglst(2)
      write(21,201) " chi0_2 --> gluino tp   tb  ",xgluinotop(2),
     .                                             brgltop(2)
      write(21,201) " chi0_2 --> gluino bt   bb  ",xgluinobot(2),
     .                                             brglbot(2)
      endif
      elseif(neuttot(2).eq.0.D0) then
      write(21,*)
      write(21,*) " NEUTRALINO2 STABLE "
      write(21,*) " ------------------ "
      endif
      endif

c ------------------ c
c neutralino3 decays c
c ------------------ c

      if(flagcondneut(3).eq.10.D0) then
         write(21,*)
         write(21,*) " NEUTRALINO3 STABLE "
         write(21,*) " ------------------ "
      elseif(flagcondneut(3).eq.40.D0.or.flagcondneut(3).eq.41.D0.or.
     .flagcondneut(3).eq.42.D0) then
         write(21,*)
         write(21,*) " NEUTRALINO3 DECAYS ",neuttot2(3)
         write(21,*) " ------------------ "
      write(21,201) " chi0_3 --> chi0_1 Z   ",neutzneut(3,1),
     .                                        brneutzneut(3,1)
      write(21,201) " chi0_3 --> chi0_2 Z   ",neutzneut(3,2),
     .                                        brneutzneut(3,2)
      write(21,201) " chi0_3 --> chi+_1 W-  ",neutwchar(3,1),
     .                                        brneutwchar(3,1)
      write(21,201) " chi0_3 --> chi-_1 W+  ",neutwchar(3,1),
     .                                        brneutwchar(3,1)
      write(21,201) " chi0_3 --> chi+_2 W-  ",neutwchar(3,2),
     .                                        brneutwchar(3,2)
      write(21,201) " chi0_3 --> chi-_2 W+  ",neutwchar(3,2),
     .                                        brneutwchar(3,2)
      write(21,201) " chi0_3 --> chi0_1 h   ",neuthlneut(3,1),
     .                                        brneuthlneut(3,1)
      write(21,201) " chi0_3 --> chi0_1 H   ",neuthhneut(3,1),
     .                                        brneuthhneut(3,1)
      write(21,201) " chi0_3 --> chi0_1 A   ",neuthaneut(3,1),
     .                                        brneuthaneut(3,1)
      write(21,201) " chi0_3 --> chi0_2 h   ",neuthlneut(3,2),
     .                                        brneuthlneut(3,2)
      write(21,201) " chi0_3 --> chi0_2 H   ",neuthhneut(3,2),
     .                                        brneuthhneut(3,2)
      write(21,201) " chi0_3 --> chi0_2 A   ",neuthaneut(3,2),
     .                                        brneuthaneut(3,2)
      write(21,201) " chi0_3 --> chi+_1 H-  ",neuthcchar(3,1),
     .                                        brneuthcchar(3,1)
      write(21,201) " chi0_3 --> chi-_1 H+  ",neuthcchar(3,1),
     .                                        brneuthcchar(3,1)
      write(21,201) " chi0_3 --> chi+_2 H-  ",neuthcchar(3,2),
     .                                        brneuthcchar(3,2)
      write(21,201) " chi0_3 --> chi-_2 H+  ",neuthcchar(3,2),
     .                                        brneuthcchar(3,2)
      write(21,201) " chi0_3 --> supl   ub  ",neutsupl(3),brneutsupl(3)
      write(21,201) " chi0_3 --> subl   up  ",neutsupl(3),brneutsupl(3)
      write(21,201) " chi0_3 --> supr   ub  ",neutsupr(3),brneutsupr(3)
      write(21,201) " chi0_3 --> subr   up  ",neutsupr(3),brneutsupr(3)
      write(21,201) " chi0_3 --> sdnl   db  ",neutsdownl(3),
     .                                        brneutsdownl(3)
      write(21,201) " chi0_3 --> sdbl   dn  ",neutsdownl(3),
     .                                        brneutsdownl(3)
      write(21,201) " chi0_3 --> sdnr   db  ",neutsdownr(3),
     .                                        brneutsdownr(3)
      write(21,201) " chi0_3 --> sdbr   dn  ",neutsdownr(3),
     .                                        brneutsdownr(3)
      write(21,201) " chi0_3 --> schl   cb  ",neutsupl(3),brneutsupl(3)
      write(21,201) " chi0_3 --> scbl   ch  ",neutsupl(3),brneutsupl(3)
      write(21,201) " chi0_3 --> schr   cb  ",neutsupr(3),brneutsupr(3)
      write(21,201) " chi0_3 --> scbr   ch  ",neutsupr(3),brneutsupr(3)
      write(21,201) " chi0_3 --> sstl   sb  ",neutsdownl(3),
     .                                        brneutsdownl(3)
      write(21,201) " chi0_3 --> ssbl   st  ",neutsdownl(3),
     .                                        brneutsdownl(3)
      write(21,201) " chi0_3 --> sstr   sb  ",neutsdownr(3),
     .                                        brneutsdownr(3)
      write(21,201) " chi0_3 --> ssbr   st  ",neutsdownr(3),
     .                                        brneutsdownr(3)
      write(21,201) " chi0_3 --> stop1  tb  ",neutst1(3),brneutst1(3)
      write(21,201) " chi0_3 --> stop1b tp  ",neutst1(3),brneutst1(3)
      write(21,201) " chi0_3 --> stop2  tb  ",neutst2(3),brneutst2(3)
      write(21,201) " chi0_3 --> stop2b tp  ",neutst2(3),brneutst2(3)
      write(21,201) " chi0_3 --> sbot1  bb  ",neutsb1(3),brneutsb1(3)
      write(21,201) " chi0_3 --> sbot1b bt  ",neutsb1(3),brneutsb1(3)
      write(21,201) " chi0_3 --> sbot2  bb  ",neutsb2(3),brneutsb2(3)
      write(21,201) " chi0_3 --> sbot2b bt  ",neutsb2(3),brneutsb2(3)
      write(21,201) " chi0_3 --> sel-   e+  ",neutsell(3),brneutsell(3)
      write(21,201) " chi0_3 --> sel+   e-  ",neutsell(3),brneutsell(3)
      write(21,201) " chi0_3 --> ser-   e+  ",neutselr(3),brneutselr(3)
      write(21,201) " chi0_3 --> ser+   e-  ",neutselr(3),brneutselr(3)
      write(21,201) " chi0_3 --> smul-  mu+ ",neutsell(3),brneutsell(3)
      write(21,201) " chi0_3 --> smul+  mu- ",neutsell(3),brneutsell(3)
      write(21,201) " chi0_3 --> smur-  mu+ ",neutselr(3),brneutselr(3)
      write(21,201) " chi0_3 --> smur+  mu- ",neutselr(3),brneutselr(3)
      write(21,201) " chi0_3 --> stau1- tau+",neutstau1(3),
     .                                        brneutstau1(3)
      write(21,201) " chi0_3 --> stau1+ tau-",neutstau1(3),
     .                                        brneutstau1(3)
      write(21,201) " chi0_3 --> stau2- tau+",neutstau2(3),
     .                                        brneutstau2(3)
      write(21,201) " chi0_3 --> stau2+ tau-",neutstau2(3),
     .                                        brneutstau2(3)
      write(21,201) " chi0_3 --> snuel  nueb",neutsnel(3),brneutsnel(3)
      write(21,201) " chi0_3 --> snuelb nue ",neutsnel(3),brneutsnel(3)
      write(21,201) " chi0_3 --> snuml  numb",neutsnel(3),brneutsnel(3)
      write(21,201) " chi0_3 --> snumlb num ",neutsnel(3),brneutsnel(3)
      write(21,201) " chi0_3 --> snut1  nutb",neutsn1(3),brneutsn1(3)
      write(21,201) " chi0_3 --> snut1b nut ",neutsn1(3),brneutsn1(3)

      elseif(flagcondneut(3).eq.11.D0.or.flagcondneut(3).eq.12.D0) then
         if(neuttot(3).ne.0.D0) then
            write(21,*)
            write(21,*) " NEUTRALINO3 DECAYS ",neuttot(3)
            write(21,*) " ------------------ "
            if(flagloop.eq.1.D0) then
      write(21,201) " chi0_3 --> chi0_1 gm       ",nraddec(3,1),
     .                                             brnraddec(3,1)
      write(21,201) " chi0_3 --> chi0_2 gm       ",nraddec(3,2),
     .                                             brnraddec(3,2)
            endif
            if(flagmulti.eq.1.D0) then
      write(21,201) " chi0_3 --> chi0_1 up   ub  ",xneutup(3,1),
     .                                             brneutup(3,1)
      write(21,201) " chi0_3 --> chi0_1 dn   db  ",xneutdow(3,1),
     .                                             brneutdow(3,1)
      write(21,201) " chi0_3 --> chi0_1 ch   cb  ",xneutch(3,1),
     .                                             brneutch(3,1)
      write(21,201) " chi0_3 --> chi0_1 st   sb  ",xneutst(3,1),
     .                                             brneutst(3,1)
      write(21,201) " chi0_3 --> chi0_1 tp   tb  ",xneuttop(3,1),
     .                                             brneuttop(3,1)      
      write(21,201) " chi0_3 --> chi0_1 bt   bb  ",xneutbot(3,1),
     .                                             brneutbot(3,1)
      write(21,201) " chi0_3 --> chi0_1 e+   e-  ",xneutel(3,1),
     .                                             brneutel(3,1)
      write(21,201) " chi0_3 --> chi0_1 mu+  mu- ",xneutmu(3,1),
     .                                             brneutmu(3,1)
      write(21,201) " chi0_3 --> chi0_1 tau+ tau-",xneuttau(3,1),
     .                                             brneuttau(3,1)
      write(21,201) " chi0_3 --> chi0_1 nue  nueb",xneutnue(3,1),
     .                                             brneutnue(3,1)
      write(21,201) " chi0_3 --> chi0_1 num  numb",xneutnumu(3,1),
     .                                             brneutnumu(3,1)
      write(21,201) " chi0_3 --> chi0_1 nut  nutb",xneutnutau(3,1),
     .                                             brneutnutau(3,1)
      write(21,201) " chi0_3 --> chi0_2 up   ub  ",xneutup(3,2),
     .                                             brneutup(3,2)
      write(21,201) " chi0_3 --> chi0_2 dn   db  ",xneutdow(3,2),
     .                                             brneutdow(3,2)
      write(21,201) " chi0_3 --> chi0_2 ch   cb  ",xneutch(3,2),
     .                                             brneutch(3,2)
      write(21,201) " chi0_3 --> chi0_2 st   sb  ",xneutst(3,2),
     .                                             brneutst(3,2)
      write(21,201) " chi0_3 --> chi0_2 tp   tb  ",xneuttop(3,2),
     .                                             brneuttop(3,2)      
      write(21,201) " chi0_3 --> chi0_2 bt   bb  ",xneutbot(3,2),
     .                                             brneutbot(3,2)
      write(21,201) " chi0_3 --> chi0_2 e+   e-  ",xneutel(3,2),
     .                                             brneutel(3,2)
      write(21,201) " chi0_3 --> chi0_2 mu+  mu- ",xneutmu(3,2),
     .                                             brneutmu(3,2)
      write(21,201) " chi0_3 --> chi0_2 tau+ tau-",xneuttau(3,2),
     .                                             brneuttau(3,2)
      write(21,201) " chi0_3 --> chi0_2 nue  nueb",xneutnue(3,2),
     .                                             brneutnue(3,2)
      write(21,201) " chi0_3 --> chi0_2 num  numb",xneutnumu(3,2),
     .                                             brneutnumu(3,2)
      write(21,201) " chi0_3 --> chi0_2 nut  nutb",xneutnutau(3,2),
     .                                             brneutnutau(3,2)
      write(21,201) " chi0_3 --> chi+_1 ub   dn  ",xchubdow(3,1),
     .                                             brchubd(3,1)
      write(21,201) " chi0_3 --> chi-_1 up   db  ",xchubdow(3,1),
     .                                             brchubd(3,1)
      write(21,201) " chi0_3 --> chi+_2 ub   dn  ",xchubdow(3,2),
     .                                             brchubd(3,2)
      write(21,201) " chi0_3 --> chi-_2 up   db  ",xchubdow(3,2),
     .                                             brchubd(3,2)
      write(21,201) " chi0_3 --> chi+_1 cb   st  ",xchcbs(3,1),
     .                                             brchcbs(3,1)
      write(21,201) " chi0_3 --> chi-_1 ch   sb  ",xchcbs(3,1),
     .                                             brchcbs(3,1)
      write(21,201) " chi0_3 --> chi+_2 cb   st  ",xchcbs(3,2),
     .                                             brchcbs(3,2)
      write(21,201) " chi0_3 --> chi-_2 ch   sb  ",xchcbs(3,2),
     .                                             brchcbs(3,2)
      write(21,201) " chi0_3 --> chi+_1 tb   bt  ",xchtbb(3,1),
     .                                             brchtbb(3,1)
      write(21,201) " chi0_3 --> chi-_1 tp   bb  ",xchtbb(3,1),
     .                                             brchtbb(3,1)
      write(21,201) " chi0_3 --> chi+_2 tb   bt  ",xchtbb(3,2),
     .                                             brchtbb(3,2)
      write(21,201) " chi0_3 --> chi-_2 tp   bb  ",xchtbb(3,2),
     .                                             brchtbb(3,2)
      write(21,201) " chi0_3 --> chi+_1 e-   nueb",xchelne(3,1),
     .                                             brchelne(3,1)
      write(21,201) " chi0_3 --> chi-_1 e+   nue ",xchelne(3,1),
     .                                             brchelne(3,1)
      write(21,201) " chi0_3 --> chi+_2 e-   nueb",xchelne(3,2),
     .                                             brchelne(3,2)
      write(21,201) " chi0_3 --> chi-_2 e+   nue ",xchelne(3,2),
     .                                             brchelne(3,2)
      write(21,201) " chi0_3 --> chi+_1 mu-  numb",xchmunmu(3,1),
     .                                             brchmunmu(3,1)
      write(21,201) " chi0_3 --> chi-_1 mu+  num ",xchmunmu(3,1),
     .                                             brchmunmu(3,1)
      write(21,201) " chi0_3 --> chi+_2 mu-  numb",xchmunmu(3,2),
     .                                             brchmunmu(3,2)
      write(21,201) " chi0_3 --> chi-_2 mu+  num ",xchmunmu(3,2),
     .                                             brchmunmu(3,2)
      write(21,201) " chi0_3 --> chi+_1 tau- nutb",xchtauntau(3,1),
     .                                             brchtauntau(3,1)
      write(21,201) " chi0_3 --> chi-_1 tau+ nut ",xchtauntau(3,1),
     .                                             brchtauntau(3,1)
      write(21,201) " chi0_3 --> chi+_2 tau- nutb",xchtauntau(3,2),
     .                                             brchtauntau(3,2)
      write(21,201) " chi0_3 --> chi-_2 tau+ nut ",xchtauntau(3,2),
     .                                             brchtauntau(3,2)
      write(21,201) " chi0_3 --> gluino up   ub  ",xgluinoup(3),
     .                                             brglup(3)
      write(21,201) " chi0_3 --> gluino dn   db  ",xgluinodo(3),
     .                                             brgldo(3)
      write(21,201) " chi0_3 --> gluino ch   cb  ",xgluinoch(3),
     .                                             brglch(3)
      write(21,201) " chi0_3 --> gluino st   sb  ",xgluinost(3),
     .                                             brglst(3)
      write(21,201) " chi0_3 --> gluino tp   tb  ",xgluinotop(3),
     .                                             brgltop(3)
      write(21,201) " chi0_3 --> gluino bt   bb  ",xgluinobot(3),
     .                                             brglbot(3)
      endif
      elseif(neuttot(3).eq.0.D0) then
      write(21,*)
      write(21,*) " NEUTRALINO3 STABLE "
      write(21,*) " ------------------ "
      endif
      endif

c ------------------ c
c neutralino4 decays c
c ------------------ c

      if(flagcondneut(4).eq.10.D0) then
         write(21,*)
         write(21,*) " NEUTRALINO4 STABLE "
         write(21,*) " ------------------ "
      elseif(flagcondneut(4).eq.40.D0.or.flagcondneut(4).eq.41.D0.or.
     .flagcondneut(4).eq.42.D0) then
         write(21,*)
         write(21,*) " NEUTRALINO4 DECAYS ",neuttot2(4)
         write(21,*) " ------------------ "
      write(21,201) " chi0_4 --> chi0_1 Z   ",neutzneut(4,1),
     .                                        brneutzneut(4,1)
      write(21,201) " chi0_4 --> chi0_2 Z   ",neutzneut(4,2),
     .                                        brneutzneut(4,2)
      write(21,201) " chi0_4 --> chi0_3 Z   ",neutzneut(4,3),
     .                                        brneutzneut(4,3)
      write(21,201) " chi0_4 --> chi+_1 W-  ",neutwchar(4,1),
     .                                        brneutwchar(4,1)
      write(21,201) " chi0_4 --> chi-_1 W+  ",neutwchar(4,1),
     .                                        brneutwchar(4,1)
      write(21,201) " chi0_4 --> chi+_2 W-  ",neutwchar(4,2),
     .                                        brneutwchar(4,2)
      write(21,201) " chi0_4 --> chi-_2 W+  ",neutwchar(4,2),
     .                                        brneutwchar(4,2)
      write(21,201) " chi0_4 --> chi0_1 h   ",neuthlneut(4,1),
     .                                        brneuthlneut(4,1)
      write(21,201) " chi0_4 --> chi0_1 H   ",neuthhneut(4,1),
     .                                        brneuthhneut(4,1)
      write(21,201) " chi0_4 --> chi0_1 A   ",neuthaneut(4,1),
     .                                        brneuthaneut(4,1)
      write(21,201) " chi0_4 --> chi0_2 h   ",neuthlneut(4,2),
     .                                        brneuthlneut(4,2)
      write(21,201) " chi0_4 --> chi0_2 H   ",neuthhneut(4,2),
     .                                        brneuthhneut(4,2)
      write(21,201) " chi0_4 --> chi0_2 A   ",neuthaneut(4,2),
     .                                        brneuthaneut(4,2)
      write(21,201) " chi0_4 --> chi0_3 h   ",neuthlneut(4,3),
     .                                        brneuthlneut(4,3)
      write(21,201) " chi0_4 --> chi0_3 H   ",neuthhneut(4,3),
     .                                        brneuthhneut(4,3)
      write(21,201) " chi0_4 --> chi0_3 A   ",neuthaneut(4,3),
     .                                        brneuthaneut(4,3)
      write(21,201) " chi0_4 --> chi+_1 H-  ",neuthcchar(4,1),
     .                                        brneuthcchar(4,1)
      write(21,201) " chi0_4 --> chi-_1 H+  ",neuthcchar(4,1),
     .                                        brneuthcchar(4,1)
      write(21,201) " chi0_4 --> chi+_2 H-  ",neuthcchar(4,2),
     .                                        brneuthcchar(4,2)
      write(21,201) " chi0_4 --> chi-_2 H+  ",neuthcchar(4,2),
     .                                        brneuthcchar(4,2)
      write(21,201) " chi0_4 --> supl   ub  ",neutsupl(4),brneutsupl(4)
      write(21,201) " chi0_4 --> subl   up  ",neutsupl(4),brneutsupl(4)
      write(21,201) " chi0_4 --> supr   ub  ",neutsupr(4),brneutsupr(4)
      write(21,201) " chi0_4 --> subr   up  ",neutsupr(4),brneutsupr(4)
      write(21,201) " chi0_4 --> sdnl   db  ",neutsdownl(4),
     .                                        brneutsdownl(4)
      write(21,201) " chi0_4 --> sdbl   dn  ",neutsdownl(4),
     .                                        brneutsdownl(4)
      write(21,201) " chi0_4 --> sdnr   db  ",neutsdownr(4),
     .                                        brneutsdownr(4)
      write(21,201) " chi0_4 --> sdbr   dn  ",neutsdownr(4),
     .                                        brneutsdownr(4)
      write(21,201) " chi0_4 --> schl   cb  ",neutsupl(4),brneutsupl(4)
      write(21,201) " chi0_4 --> scbl   ch  ",neutsupl(4),brneutsupl(4)
      write(21,201) " chi0_4 --> schr   cb  ",neutsupr(4),brneutsupr(4)
      write(21,201) " chi0_4 --> scbr   ch  ",neutsupr(4),brneutsupr(4)
      write(21,201) " chi0_4 --> ssbl   st  ",neutsdownl(4),
     .                                        brneutsdownl(4)
      write(21,201) " chi0_4 --> sstl   sb  ",neutsdownl(4),
     .                                        brneutsdownl(4)
      write(21,201) " chi0_4 --> ssbr   st  ",neutsdownr(4),
     .                                        brneutsdownr(4)
      write(21,201) " chi0_4 --> sstr   sb  ",neutsdownr(4),
     .                                        brneutsdownr(4)
      write(21,201) " chi0_4 --> stop1  tb  ",neutst1(4),brneutst1(4)
      write(21,201) " chi0_4 --> stop1b tp  ",neutst1(4),brneutst1(4)
      write(21,201) " chi0_4 --> stop2  tb  ",neutst2(4),brneutst2(4)
      write(21,201) " chi0_4 --> stop2b tp  ",neutst2(4),brneutst2(4)
      write(21,201) " chi0_4 --> sbot1  bb  ",neutsb1(4),brneutsb1(4)
      write(21,201) " chi0_4 --> sbot1b bt  ",neutsb1(4),brneutsb1(4)
      write(21,201) " chi0_4 --> sbot2  bb  ",neutsb2(4),brneutsb2(4)
      write(21,201) " chi0_4 --> sbot2b bt  ",neutsb2(4),brneutsb2(4)
      write(21,201) " chi0_4 --> sel-   e+  ",neutsell(4),brneutsell(4)
      write(21,201) " chi0_4 --> sel+   e-  ",neutsell(4),brneutsell(4)
      write(21,201) " chi0_4 --> ser-   e+  ",neutselr(4),brneutselr(4)
      write(21,201) " chi0_4 --> ser+   e-  ",neutselr(4),brneutselr(4)
      write(21,201) " chi0_4 --> smul-  mu+ ",neutsell(4),brneutsell(4)
      write(21,201) " chi0_4 --> smul+  mu- ",neutsell(4),brneutsell(4)
      write(21,201) " chi0_4 --> smur-  mu+ ",neutselr(4),brneutselr(4)
      write(21,201) " chi0_4 --> smur+  mu- ",neutselr(4),brneutselr(4)
      write(21,201) " chi0_4 --> stau1- tau+",neutstau1(4),
     .                                        brneutstau1(4)
      write(21,201) " chi0_4 --> stau1+ tau-",neutstau1(4),
     .                                        brneutstau1(4)
      write(21,201) " chi0_4 --> stau2- tau+",neutstau2(4),
     .                                        brneutstau2(4)
      write(21,201) " chi0_4 --> stau2+ tau-",neutstau2(4),
     .                                        brneutstau2(4)
      write(21,201) " chi0_4 --> snuel  nueb",neutsnel(4),brneutsnel(4)
      write(21,201) " chi0_4 --> snuelb nue ",neutsnel(4),brneutsnel(4)
      write(21,201) " chi0_4 --> snuml  numb",neutsnel(4),brneutsnel(4)
      write(21,201) " chi0_4 --> snumlb num ",neutsnel(4),brneutsnel(4)
      write(21,201) " chi0_4 --> snut1  nutb",neutsn1(4),brneutsn1(4)
      write(21,201) " chi0_4 --> snut1b nut ",neutsn1(4),brneutsn1(4)

      elseif(flagcondneut(4).eq.11.D0.or.flagcondneut(4).eq.12.D0) then
         if(neuttot(4).ne.0.D0) then
            write(21,*)
            write(21,*) " NEUTRALINO4 DECAYS ",neuttot(4)
            write(21,*) " ------------------ "
            if(flagloop.eq.1.D0) then
      write(21,201) " chi0_4 --> chi0_1 gm       ",nraddec(4,1),
     .                                             brnraddec(4,1)
      write(21,201) " chi0_4 --> chi0_2 gm       ",nraddec(4,2),
     .                                             brnraddec(4,2)
      write(21,201) " chi0_4 --> chi0_3 gm       ",nraddec(4,3),
     .                                             brnraddec(4,3)
            endif
            if(flagmulti.eq.1.D0) then
      write(21,201) " chi0_4 --> chi0_1 up   ub  ",xneutup(4,1),
     .                                             brneutup(4,1)
      write(21,201) " chi0_4 --> chi0_1 dn   db  ",xneutdow(4,1),
     .                                             brneutdow(4,1)
      write(21,201) " chi0_4 --> chi0_1 ch   cb  ",xneutch(4,1),
     .                                             brneutch(4,1)
      write(21,201) " chi0_4 --> chi0_1 st   sb  ",xneutst(4,1),
     .                                             brneutst(4,1)
      write(21,201) " chi0_4 --> chi0_1 tp   tb  ",xneuttop(4,1),
     .                                             brneuttop(4,1)      
      write(21,201) " chi0_4 --> chi0_1 bt   bb  ",xneutbot(4,1),
     .                                             brneutbot(4,1)
      write(21,201) " chi0_4 --> chi0_1 e+   e-  ",xneutel(4,1),
     .                                             brneutel(4,1)
      write(21,201) " chi0_4 --> chi0_1 mu+  mu- ",xneutmu(4,1),
     .                                             brneutmu(4,1)
      write(21,201) " chi0_4 --> chi0_1 tau+ tau-",xneuttau(4,1),
     .                                             brneuttau(4,1)
      write(21,201) " chi0_4 --> chi0_1 nue  nueb",xneutnue(4,1),
     .                                             brneutnue(4,1)
      write(21,201) " chi0_4 --> chi0_1 num  numb",xneutnumu(4,1),
     .                                             brneutnumu(4,1)
      write(21,201) " chi0_4 --> chi0_1 nut  nutb",xneutnutau(4,1),
     .                                             brneutnutau(4,1)
      write(21,201) " chi0_4 --> chi0_2 up   ub  ",xneutup(4,2),
     .                                             brneutup(4,2)
      write(21,201) " chi0_4 --> chi0_2 dn   db  ",xneutdow(4,2),
     .                                             brneutdow(4,2)
      write(21,201) " chi0_4 --> chi0_2 ch   cb  ",xneutch(4,2),
     .                                             brneutch(4,2)
      write(21,201) " chi0_4 --> chi0_2 st   sb  ",xneutst(4,2),
     .                                             brneutst(4,2)
      write(21,201) " chi0_4 --> chi0_2 tp   tb  ",xneuttop(4,2),
     .                                             brneuttop(4,2)      
      write(21,201) " chi0_4 --> chi0_2 bt   bb  ",xneutbot(4,2),
     .                                             brneutbot(4,2)
      write(21,201) " chi0_4 --> chi0_2 e+   e-  ",xneutel(4,2),
     .                                             brneutel(4,2)
      write(21,201) " chi0_4 --> chi0_2 mu+  mu- ",xneutmu(4,2),
     .                                             brneutmu(4,2)
      write(21,201) " chi0_4 --> chi0_2 tau+ tau-",xneuttau(4,2),
     .                                             brneuttau(4,2)
      write(21,201) " chi0_4 --> chi0_2 nue  nueb",xneutnue(4,2),
     .                                             brneutnue(4,2)
      write(21,201) " chi0_4 --> chi0_2 num  numb",xneutnumu(4,2),
     .                                             brneutnumu(4,2)
      write(21,201) " chi0_4 --> chi0_2 nut  nutb",xneutnutau(4,2),
     .                                             brneutnutau(4,2)
      write(21,201) " chi0_4 --> chi0_3 up   ub  ",xneutup(4,3),
     .                                             brneutup(4,3)
      write(21,201) " chi0_4 --> chi0_3 dn   db  ",xneutdow(4,3),
     .                                             brneutdow(4,3)
      write(21,201) " chi0_4 --> chi0_3 ch   cb  ",xneutch(4,3),
     .                                             brneutch(4,3)
      write(21,201) " chi0_4 --> chi0_3 st   sb  ",xneutst(4,3),
     .                                             brneutst(4,3)
      write(21,201) " chi0_4 --> chi0_3 tp   tb  ",xneuttop(4,3),
     .                                             brneuttop(4,3)      
      write(21,201) " chi0_4 --> chi0_3 bt   bb  ",xneutbot(4,3),
     .                                             brneutbot(4,3)
      write(21,201) " chi0_4 --> chi0_3 e+   e-  ",xneutel(4,3),
     .                                             brneutel(4,3)
      write(21,201) " chi0_4 --> chi0_3 mu+  mu- ",xneutmu(4,3),
     .                                             brneutmu(4,3)
      write(21,201) " chi0_4 --> chi0_3 tau+ tau-",xneuttau(4,3),
     .                                             brneuttau(4,3)
      write(21,201) " chi0_4 --> chi0_3 nue  nueb",xneutnue(4,3),
     .                                             brneutnue(4,3)
      write(21,201) " chi0_4 --> chi0_3 num  numb",xneutnumu(4,3),
     .                                             brneutnumu(4,3)
      write(21,201) " chi0_4 --> chi0_3 nut  nutb",xneutnutau(4,3),
     .                                             brneutnutau(4,3)
      write(21,201) " chi0_4 --> chi+_1 ub   dn  ",xchubdow(4,1),
     .                                             brchubd(4,1)
      write(21,201) " chi0_4 --> chi-_1 up   db  ",xchubdow(4,1),
     .                                             brchubd(4,1)
      write(21,201) " chi0_4 --> chi+_2 ub   dn  ",xchubdow(4,2),
     .                                             brchubd(4,2)
      write(21,201) " chi0_4 --> chi-_2 up   db  ",xchubdow(4,2),
     .                                             brchubd(4,2)
      write(21,201) " chi0_4 --> chi+_1 cb   st  ",xchcbs(4,1),
     .                                             brchcbs(4,1)
      write(21,201) " chi0_4 --> chi-_1 ch   sb  ",xchcbs(4,1),
     .                                             brchcbs(4,1)
      write(21,201) " chi0_4 --> chi+_2 cb   st  ",xchcbs(4,2),
     .                                             brchcbs(4,2)
      write(21,201) " chi0_4 --> chi+_2 ch   sb  ",xchcbs(4,2),
     .                                             brchcbs(4,2)
      write(21,201) " chi0_4 --> chi+_1 tb   bt  ",xchtbb(4,1),
     .                                             brchtbb(4,1)
      write(21,201) " chi0_4 --> chi-_1 tp   bb  ",xchtbb(4,1),
     .                                             brchtbb(4,1)
      write(21,201) " chi0_4 --> chi+_2 tb   bt  ",xchtbb(4,2),
     .                                             brchtbb(4,2)
      write(21,201) " chi0_4 --> chi-_2 tp   bb  ",xchtbb(4,2),
     .                                             brchtbb(4,2)
      write(21,201) " chi0_4 --> chi+_1 e-   nueb",xchelne(4,1),
     .                                             brchelne(4,1)
      write(21,201) " chi0_4 --> chi-_1 e+   nue ",xchelne(4,1),
     .                                             brchelne(4,1)
      write(21,201) " chi0_4 --> chi+_2 e-   nueb",xchelne(4,2),
     .                                             brchelne(4,2)
      write(21,201) " chi0_4 --> chi-_2 e+   nue ",xchelne(4,2),
     .                                             brchelne(4,2)
      write(21,201) " chi0_4 --> chi+_1 mu-  numb",xchmunmu(4,1),
     .                                             brchmunmu(4,1)
      write(21,201) " chi0_4 --> chi-_1 mu+  num ",xchmunmu(4,1),
     .                                             brchmunmu(4,1)
      write(21,201) " chi0_4 --> chi+_2 mu-  numb",xchmunmu(4,2),
     .                                             brchmunmu(4,2)
      write(21,201) " chi0_4 --> chi-_2 mu+  num ",xchmunmu(4,2),
     .                                             brchmunmu(4,2)
      write(21,201) " chi0_4 --> chi+_1 tau- nutb",xchtauntau(4,1),
     .                                             brchtauntau(4,1)
      write(21,201) " chi0_4 --> chi-_1 tau+ nut ",xchtauntau(4,1),
     .                                             brchtauntau(4,1)
      write(21,201) " chi0_4 --> chi+_2 tau- nutb",xchtauntau(4,2),
     .                                             brchtauntau(4,2)
      write(21,201) " chi0_4 --> chi-_2 tau+ nut ",xchtauntau(4,2),
     .                                             brchtauntau(4,2)
      write(21,201) " chi0_4 --> gluino up   ub  ",xgluinoup(4),
     .                                             brglup(4)
      write(21,201) " chi0_4 --> gluino dn   db  ",xgluinodo(4),
     .                                             brgldo(4)
      write(21,201) " chi0_4 --> gluino ch   cb  ",xgluinoch(4),
     .                                             brglch(4)
      write(21,201) " chi0_4 --> gluino st   sb  ",xgluinost(4),
     .                                             brglst(4)
      write(21,201) " chi0_4 --> gluino tp   tb  ",xgluinotop(4),
     .                                             brgltop(4)
      write(21,201) " chi0_4 --> gluino bt   bb  ",xgluinobot(4),
     .                                             brglbot(4)
      endif
      elseif(neuttot(4).eq.0.D0) then
         write(21,*)
         write(21,*) " NEUTRALINO4 STABLE "
         write(21,*) " ------------------ "
      endif
      endif

      endif

c ==================================================================== c
c                       end of the output file                          
c ==================================================================== c

 49   format('#',1x,A,E16.8)
 50   format('#',1x,A)
 51   format('BLOCK',1x,A,2x,'#',1x,A)
 551  format(1x,A,2x,'#',1x,A)
 52   format(1x,I9,3x,1P,E16.8,0P,3x,'#',1x,A)
 552  format(2x,E16.8,0P,3x,A)
 53   format(1x,I2,1x,I2,3x,1P,E16.8,0P,3x,'#',1x,A)
 54   format('BLOCK',1x,A,1P,E16.8,2x,'#',1x,A)
 554  format(2x,A,1P,E16.8,2x,1x,A)
 55   format(1x,I5,3x,1P,E16.8,0P,3x,'#',1x,A)
 56   format(1x,I4,3x,'#',1x,A,E16.8)
 57   format(1x,I5,3x,1P,E16.8,0P,3x,'#',1x,A,E16.8)
 58   format(1x,I2,1x,I2,3x,'#',1x,A)
 59   format(1x,I2,1x,I2,3x,1P,E16.8,0P,3x,'#',1x,A,E16.8)
 60   format(9x,1P,E16.8,0P,3x,'#',1x,A)
 61   format(1x,I5,3x,A)
 661  format(2x,A)
 62   format(1x,I5,1x,I5,3x,'#',1x,A)
 662  format(2x,A)
 63   format(1x,I5,3x,A,1x,'#',1x,A)

 99   format('#',9x,'PDG',12x,'Width')
 100  format('DECAY',1x,I9,3x,1P,E16.8,0P,3x,'#',1x,A)
 101  format('#',10x,'BR',9x,'NDA',6x,'ID1',7x,'ID2')
 102  format(3x,1P,E16.8,0P,3x,I2,3x,(I9,1x),(I9,1x),2x,'#',1x,A)
 103  format('#',11x,'BR',9x,'NDA',6x,'ID1',7x,'ID2',7x,'ID3')
 107  format('#',11x,'BR',9x,'NDA',6x,'ID1',7x,'ID2',7x,'ID3',7x,'ID4')
 104  format(3x,1P,E16.8,0P,3x,I2,3x,(I9,1x),(I9,1x),(I9,1x),2x,'#',
     .1x,A)
 106  format(3x,1P,E16.8,0P,3x,I2,3x,(I9,1x),(I9,1x),(I9,1x),(I9,1x),
     .2x,'#',1x,A)
 105  format('#') 

 201  format(1x,A,1x,E16.9,1x,E16.9)
 202  format(1x,A,1x,E18.6,1x,E18.6,1x,E18.6,1x,E18.6)
 203  format(E18.6,2x,E18.6)
 204  format(1x,A,1x,E18.6,1x,E18.6)
 205  format(E18.6,2x,E18.6,2x,E18.6)

      end

c -------------------------------------------------------------------- c
c ---------- Setting of the parameters given by suspect2.f ----------- c
c -------------------------------------------------------------------- c

      subroutine SD_common_ini

      implicit double precision (a-h,m,o-z)
      double precision minval(1:20),smval(1:20),massval(1:50),
     .                 nmixval(4,4),umixval(2,2),vmixval(2,2),
     .                 stopmixval(2,2),sbotmixval(2,2),staumixval(2,2),
     .                 hmixval(1:10),gaugeval(1:3),msoftval(1:100),
     .                 auval(3,3),adval(3,3),aeval(3,3),yuval(3,3),
     .                 ydval(3,3),yeval(3,3),qvalue(1:20),extval(0:100),
     .                 m_softval(1:100)
c      double precision nl,nq
      integer imod(1:2)
      integer check(1:22)
      character spinfo1*100,spinfo2*100,modselval*100,mincom(1:20)*20,
     .          extcom(0:100)*20,softcom(1:100)*20,m_softcom(1:100)*20,
     .          hmixcom(1:10)*20
      dimension ichoice(11),errmess(10),warning(1:10)
      dimension u(2,2),v(2,2),z(4,4),dxmn(4)
      dimension amneut(4),xmneut(4),amchar(2)
      dimension uu(2,2),vv(2,2),zz(4,4),zp(4,4)

c -- common blocks for the suspect2 input read in in the main program --
      COMMON/SU_SMPAR/dalfinv,dsw2,dalphas,dmt,dmb,dmc,dmtau
      COMMON/SU_RGSCAL/dqewsb,dehigh,delow
      COMMON/SU_MSSMHPAR/dmhu2,dmhd2,dma,dmu
      COMMON/SU_MSSMGPAR/dm1,dm2,dm3 
      COMMON/SU_MSSMSLEP/dmsl,dmtaur,dmel,dmer
      COMMON/SU_MSSMSQUA/dmsq,dmtr,dmbr,dmuq,dmur,dmdr
      COMMON/SU_ATRI3/dal,dau,dad
      COMMON/SU_ATRI12/dal1,dau1,dad1
      COMMON/SU_MSUGRA/m0,mhalf,a0
      COMMON/SU_RADEWSB/sgnmu0,tgbeta
c      COMMON/SU_GMSB/mgmmess,mgmsusy,nl,nq
      COMMON/SU_AMSB/m32,am0,cq,cu,cd,cl,ce,chu,chd
      COMMON/SU_PASS/ichoice
c -------------- common block given by SD_read_leshouches ------------ c
      COMMON/SD_leshouches1/spinfo1,spinfo2,modselval,mincom,extcom,
     .                      softcom,hmixcom
      COMMON/SD_leshouches2/minval,extval,smval,massval,nmixval,umixval,
     .                      vmixval,stopmixval,sbotmixval,staumixval,
     .                      hmixval,gaugeval,msoftval,auval,adval,
     .                      aeval,yuval,ydval,yeval,alphaval,qvalue,imod
      COMMON/SD_checkval/check
c ----------------- common blocks needed in sdecay ------------------- c
c -- first common block is given by suspect --
c      COMMON/SD_flagmixang/flagcu,flagcd,flagce
      COMMON/SD_input/flaginput,ninlha
      COMMON/SD_param/sdgf,sdmz,sdmw,pi,g2
      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2
      COMMON/SD_squarkud/asup1,asup2,asdown1,asdown2
      COMMON/SD_sfermionetau/ase1,ase2,astau1,astau2
      COMMON/SD_sneutrino/asne1,asne2,asntau1,asntau2
      COMMON/SD_gluino/mgluino
      COMMON/SD_hmass/ama,aml,amh,amch,amar
      COMMON/SD_mixang/alp_mssm,tanbeta
      COMMON/SD_mixmat/uu,vv,zz,zp
      COMMON/SD_weinberg/sw,cw
      COMMON/SD_sfmixang/sdthet,sdtheb,sdthel,cum,sum,cdm,sdm,cem,sem
      COMMON/SD_fermion/samt,samb,samtau
      COMMON/SD_strangecharm/sams,samc
      COMMON/SD_break/sdatop,sdabot,sdatau,sdmu
      COMMON/SD_break1/sdaup,sdadown,sdael
      COMMON/SD_break2/sd_m1,sd_m2,sd_m3
      COMMON/SD_break3/sd_mel,sd_mer,sd_muq,sd_mur,sd_mdr
      COMMON/SD_break4/sd_msl,sd_mtaur,sd_msq,sd_mtr,sd_mbr
      COMMON/SD_break6/m_softval,m_softcom
      COMMON/SD_yukawa/yt,yb,ytau
      COMMON/SD_coupewsb/alsew,g2ew,g1ew
      COMMON/SD_runmcalc/rmtc,rmbc,rmtauc
      COMMON/SD_refscale/amuref
      COMMON/SD_hikasakob/sdmuq,sdmhd2
      COMMON/SD_hikasakob02/sdmsq,sdmbr,sdmdr
      COMMON/SD_runcoupscale/scalechoice,scaleofcoupling,inumloop
      COMMON/SD_mwmzpole/amwp,amzp
      COMMON/SD_ewsbv/vewsb
      COMMON/SD_alspar/iparals
      COMMON/SD_scaleofewsb/scaleofewsb
      COMMON/SD_gmsb/sd_mgmsusy,sd_mgmmess
      COMMON/SD_massgrav/mgravitino
c --------- some additional common blocks for the output file -------- c
      COMMON/SD_outparam/salpha_MS,alphasmzms
      COMMON/SD_break5/sd_mel1,sd_mel2,sd_mer1,sd_mer2,sd_muq1,sd_muq2,
     .                 sd_mur1,sd_mur2,sd_mdr1,sd_mdr2
      COMMON/SD_warning/warning
c ---- needed for the calc. of the mb pole mass from mb(mb)_MSbar ---- c
      COMMON/SD_mbmb/sd_mbmb,i_sd_mbmb
      COMMON/SD_mbmsbar/mbmsbar

      external SD_runmbmb,SD_alphascall

      if(flaginput.eq.1) then

c -- Parameter setting by file in the SUSY Les Houches Accord format - c

         call SD_read_leshouches(ninlha)

c maggie changed 25/2/2005
c- Parameter setting by SuSpect in the SUSY Les Houches Accord format- c
      elseif(flaginput.eq.0) then

         call suspect2(1,1,ICHOICE,ERRMESS)
         open(ninlha,file='suspect2_lha.out',status='unknown')
         call SD_read_leshouches(ninlha)

      endif
c end maggie changed 25/2/2005

c ------------ setting of the parameters needed in sdecay ------------ c

      do i=1,10,1
         warning(i) = 0.D0
      end do
      iparals = 0

      unlikely = -123456789D0

c -- pi --
         pi = 4.D0*datan(1.D0)

c -- alpha_ew_MSbar at M_Z --
         if(smval(1).ne.0.D0) then
            salpha_MS = 1.D0/smval(1)
         else
            salpha_MS = 1.D0/127.934D0
         endif

c -- G_F --
         if(smval(2).ne.0.D0) then
            sdgf = smval(2)
         else
            sdgf = 1.16639D-5
         endif

c -- the strong coupling constant alphas_MS at the scale MZ --
         if(smval(3).ne.0.D0) then
            alphasmzms = smval(3)
         else
            alphasmzms = 0.1172D0
         endif

c -- Z pole mass --
         if(smval(4).ne.0.D0) then
            amzp = smval(4)
         else
            amzp = 91.187D0
         endif

c -- calculation of sin_thetaW from alpha_ew_MSbar and the Z pole mass
         sw2calc = 1.D0/2.D0 - 
     .        dsqrt(1.D0/4.D0-pi*salpha_MS/dsqrt(2.D0)/sdgf/amzp**2)
         swcalc  = dsqrt(sw2calc)

c -- W pole mass --
         if(massval(1).ne.0.D0) then
            amwp = massval(1)
         else
            amwp = dsqrt(amzp**2*(1.D0-sw2calc))
         endif

c -- v at the scale Q --         
         if(hmixval(3).eq.unlikely) then
            vewsb = 1.D0/dsqrt(dsqrt(2.D0)*sdgf)
         else
            vewsb = hmixval(3)
         endif

c -- the scale Q at which the couplings are given --
c maggie changed 19 Aug 2014
c            if(extval(0).ne.unlikely.and.extval(0).ne.-1.D0) then
c               scaleofewsb = extval(0)
c               ewsbscale = scaleofewsb
c            else
            if
c end maggie changed 19 Aug 2014
               qvalsum = 0.D0
               isum    = 0
               do i=1,20,1
                  qvalsum = qvalsum + qvalue(i)
                  if(qvalue(i).ne.0.D0) then
                     isum = isum + 1
                  endif
               end do
               
               if(isum.ne.0) then
                  scaleofewsb = qvalsum/dble(isum)
               else
                  warning(1) = 1.D0
               endif
               ewsbscale   = scaleofewsb
            endif

c -- the DRbar couplings g1,g2,alpha_s at the scale Q --
         if(gaugeval(3).ne.0.D0) then
            alsew = gaugeval(3)**2/4.D0/pi
         elseif(gaugeval(3).eq.0.D0) then
            iparals = 1
            alsew = SD_alphascall(scaleofewsb,inumloop)
         endif

         if(gaugeval(1).ne.0.D0) then
            g1ew  = gaugeval(1)
         endif

         if(gaugeval(2).ne.0.D0) then
            g2ew  = gaugeval(2)
c -- g**2 at the scale Q --
            g2    = gaugeval(2)**2     
         endif

c -- in case the gauge couplings are not given at the scale Q --

         if(gaugeval(1).eq.0.D0.or.gaugeval(2).eq.0.D0) then
            g1ew = dsqrt(4.D0*pi*salpha_MS/(1.D0-sw2calc))
            g2ew = dsqrt(4.D0*pi*salpha_MS)/swcalc
c -- g**2  --
            g2   = g2ew**2
            warning(2) = 1.D0
         endif

c -- Z and W mass at the scale Q if g1ew and g2ew are given --
         if(gaugeval(1).ne.0.D0.and.gaugeval(2).ne.0.D0) then
            sdmz = dsqrt(1.D0/4.D0*(gaugeval(1)**2+gaugeval(2)**2)*
     .           vewsb**2)
            sdmw = dsqrt(1.D0/4.D0*gaugeval(2)**2*vewsb**2)
         else
            sdmz = amzp
            sdmw = amwp
         endif

c -- the value for sw calculated from g, gprime given in the DRbar 
c -- scheme at the scale Q if g1ew and g2ew are given
         if(gaugeval(1).ne.0.D0.and.gaugeval(2).ne.0.D0) then
            tw = gaugeval(1)/gaugeval(2)
            sw = dsqrt(tw**2/(1.D0+tw**2))
            cw = dsqrt(1.D0/(1.D0+tw**2))
         else
            sw = swcalc
            cw = dsqrt(1.D0-sw2calc)
            tw = sw/cw
         endif

c -- This scale is important for the calculation of the higher     --- c
c -- order corrections. It is the scale at which the couplings are --- c
c -- taken. Other possibilities are initiated in the subroutines   --- c
         amuref = ewsbscale

c -- neutralino and chargino masses --      

         amneut(1)=dabs(massval(28))
         amneut(2)=dabs(massval(29))
         amneut(3)=dabs(massval(30))
         amneut(4)=dabs(massval(31))
         xmneut(1)=massval(28)
         xmneut(2)=massval(29)
         xmneut(3)=massval(30)
         xmneut(4)=massval(31)
         amchar(1)=massval(32)
         amchar(2)=massval(33)

c -- the chargino and neutralino mixing matrix elements --

      do i=1,2,1
         do j=1,2,1
            uu(i,j)=umixval(i,j)
            vv(i,j)=vmixval(i,j)
         end do
      end do
      do i=1,4,1
         do j=1,4,1
            zz(i,j)=nmixval(i,j)
         end do
      end do

      do k=1,4
         zp(k,1) =  zz(k,1)*cw+zz(k,2)*sw
         zp(k,2) = -zz(k,1)*sw+zz(k,2)*cw
         zp(k,3) = zz(k,3)
         zp(k,4) = zz(k,4)
      enddo

c -- sfermion masses --

      ast1 = massval(16)
      ast2 = massval(17)
      asb1 = massval(14)
      asb2 = massval(15)

      asup1   = massval(8)
      asup2   = massval(9)
      asdown1 = massval(10)
      asdown2 = massval(11)

      ase1   = massval(18)
      ase2   = massval(19)
      astau1 = massval(24)
      astau2 = massval(25)

      asne1   = massval(20)
      asne2   = 1.D15
      asntau1 = massval(26)
      asntau2 = 1.D15

c -- the gluino mass --

      mgluino = massval(27)

c -- the gravitino mass --

      mgravitino = massval(35)

c -- the Higgs masses --

      aml  = massval(2)
      amh  = massval(3)
      amch = massval(5)

      if(massval(4).ne.0.D0) then
         ama = massval(4)
      elseif(extval(26).ne.unlikely) then
         ama = extval(26)
      elseif(extval(24).ne.unlikely) then
         ama = dsqrt(extval(24))
      endif
      amar = ama

c -- the fermion pole masses --

      if(smval(6).ne.0.D0) then
         samt = smval(6)
      else
         samt = 172.5D0
      endif
      if(smval(7).ne.0.D0) then
         samtau = smval(7)
      else
         samtau = 1.7771D0
      endif
      sams = 0.190D0
      samc = 1.40D0

c -- the mass mb(mb)_MSbar --
      if(smval(5).ne.0.D0) then
         sd_mbmb = smval(5)
      endif

      mbmsbar = sd_mbmb

c -- calculation of the mb pole mass (called samb here) from        --
c -- mb(mb)_MSbar value just used for the very first initialization --
      if(i_sd_mbmb.eq.0) then
c -- first guess value for amb_pole --
         samb = 4.9D0
c -- mb(mb)_MSbar --
         call SD_runmbmb(amzp,runmbz)
      endif

      if(flaginput.eq.0.D0) then
         samb = massval(34)
      endif

c -- the MSSM mixing angle alpha in the Higgs sector --
c -- Attention: It might be that alphaval is not the DRbar value at
c -- the scale Q.
      alp_mssm = alphaval

c -- DRbar value of tanbeta at the scale Q --
      if(hmixval(2).ne.unlikely) then
         tanbeta = hmixval(2)
      endif
c -- If no DRbar value at the scale Q has been given for tanbeta --
      if(hmixval(2).eq.unlikely) then
         if(extval(25).ne.0.D0.and.extval(25).ne.unlikely) then
            warning(3) = 1.D0
            tanbeta = extval(25)
         elseif(minval(3).ne.0.D0.and.minval(3).ne.unlikely) then
            warning(4) = 1.D0
            tanbeta = minval(3)
         else
            warning(5) = 1.D0
         endif
      endif

c -- tanbeta at the scale M_Z --
      if(minval(3).ne.0.D0.and.minval(3).ne.unlikely) then
         tanbeta_Z = minval(3)
      endif

c -- This is for GMSB models --
      if(imod(1).eq.1.and.imod(2).eq.2) then
         if(minval(1).ne.unlikely) then
            sd_mgmsusy = minval(1)
         endif
         if(minval(2).ne.unlikely) then
            sd_mgmmess = minval(2)
         endif
      endif

c -- the sfermion mixing angles --

      sdthet=dacos(stopmixval(1,1))
      sdtheb=dacos(sbotmixval(1,1))
      sdthel=dacos(staumixval(1,1))

      if(stopmixval(1,2).le.0.D0) then
         if(sdthet.ge.0.D0) then
            sdthet = -1.D0*sdthet
         endif
      endif

      if(sbotmixval(1,2).le.0.D0) then
         if(sdtheb.ge.0.D0) then
            sdtheb = -1.D0*sdtheb
         endif
      endif

      if(staumixval(1,2).le.0.D0) then
         if(sdthel.ge.0.D0) then
            sdthel = -1.D0*sdthel
         endif
      endif

      cum = 1.D0
      sum = 0.D0
      cdm = 1.D0
      sdm = 0.D0
      cem = 1.D0
      sem = 0.D0

c -- SUSY breaking parameters: DRbar values at the scale Q --

      do i=1,100,1
         m_softval(i) = unlikely
      end do

      do i=1,99,1
         if(msoftval(i).ne.unlikely) then
            m_softval(i) = msoftval(i)
            m_softcom(i) = softcom(i)
         elseif(extval(i).ne.unlikely) then
            m_softval(i) = extval(i)
            m_softcom(i) = extcom(i)
         endif
      end do

      sdatop=auval(3,3)
      sdabot=adval(3,3)
      sdatau=aeval(3,3)

      sdaup   = auval(1,1)
      sdadown = adval(1,1)
      sdael   = aeval(1,1)

      sdmu = hmixval(1)

      sd_m1 = m_softval(1)
      sd_m2 = m_softval(2)
      sd_m3 = m_softval(3)

      sdmhd2 = m_softval(21)
      sdmhu2 = m_softval(22)

      sdmbr = m_softval(49)

      if(m_softval(47).ne.unlikely.and.m_softval(48).ne.unlikely) then
         if(m_softval(47).ne.0.D0.and.m_softval(48).ne.0.D0) then
            sdmdr = (m_softval(47)+m_softval(48))/2.D0
         elseif(m_softval(47).ne.0.D0) then
            sdmdr = m_softval(47)
         elseif(m_softval(48).ne.0.D0) then
            sdmdr = m_softval(48)
         else
            sdmdr = 0.D0
         endif
      elseif(m_softval(47).ne.unlikely) then
         sdmdr = m_softval(47)
      elseif(m_softval(48).ne.unlikely) then
         sdmdr = m_softval(48)
      endif

      if(m_softval(41).ne.unlikely.and.m_softval(42).ne.unlikely) then
         if(m_softval(41).ne.0.D0.and.m_softval(42).ne.0.D0) then
            sdmuq = (m_softval(41)+m_softval(42))/2.D0
         elseif(m_softval(41).ne.0.D0) then
            sdmuq = m_softval(41)
         elseif(m_softval(42).ne.0.D0) then
            sdmuq = m_softval(42)
         else
            sdmuq = 0.D0
         endif
      elseif(m_softval(41).ne.unlikely) then
         sdmuq = m_softval(41)
      elseif(m_softval(42).ne.unlikely) then
         sdmuq = m_softval(42)
      endif

      sdmsq = m_softval(43)

      if(m_softval(31).ne.unlikely.and.m_softval(32).ne.unlikely) then
         if(m_softval(31).ne.0.D0.and.m_softval(32).ne.0.D0) then
            sd_mel = (m_softval(31)+m_softval(32))/2.D0
         elseif(m_softval(31).ne.0.D0) then
            sd_mel = m_softval(31)
         elseif(m_softval(32).ne.0.D0) then
            sd_mel = m_softval(32)
         else
            sd_mel = 0.D0
         endif
      elseif(m_softval(31).ne.unlikely) then
         sd_mel = m_softval(31)
      elseif(m_softval(32).ne.unlikely) then
         sd_mel = m_softval(32)
      endif

      if(m_softval(34).ne.unlikely.and.m_softval(35).ne.unlikely) then
         if(m_softval(34).ne.0.D0.and.m_softval(35).ne.0.D0) then
            sd_mer = (m_softval(34)+m_softval(35))/2.D0
         elseif(m_softval(34).ne.0.D0) then
            sd_mer = m_softval(34)
         elseif(m_softval(35).ne.0.D0) then
            sd_mer = m_softval(35)
         else
            sd_mer = 0.D0
         endif
      elseif(m_softval(34).ne.unlikely) then
         sd_mer = m_softval(34)
      elseif(m_softval(35).ne.unlikely) then
         sd_mer = m_softval(35)
      endif

      if(m_softval(44).ne.unlikely.and.m_softval(45).ne.unlikely) then
         if(m_softval(44).ne.0.D0.and.m_softval(45).ne.0.D0) then
            sd_mur = (m_softval(44)+m_softval(45))/2.D0
         elseif(m_softval(44).ne.0.D0) then
            sd_mur = m_softval(44)
         elseif(m_softval(45).ne.0.D0) then
            sd_mur = m_softval(45)
         else
            sd_mur = 0.D0
         endif
      elseif(m_softval(44).ne.unlikely) then
         sd_mur = m_softval(44)
      elseif(m_softval(45).ne.unlikely) then
         sd_mur = m_softval(45)
      endif

      sd_mel1 = m_softval(31)
      sd_mel2 = m_softval(32)
      sd_mer1 = m_softval(34)
      sd_mer2 = m_softval(35)
      sd_muq1 = m_softval(41)
      sd_muq2 = m_softval(42)
      sd_mur1 = m_softval(44)
      sd_mur2 = m_softval(45)
      sd_mdr1 = m_softval(47)
      sd_mdr2 = m_softval(48)

      sd_msl   = m_softval(33)
      sd_mtaur = m_softval(36)
      sd_mtr   = m_softval(46)

      sd_muq = sdmuq
      sd_mdr = sdmdr
      sd_msq = sdmsq
      sd_mbr = sdmbr

c ---- the DRbar Yukawa couplings at the scale Q ---- c
c -- (yt   = g*mt/(sqrt(2)*mw*sin\beta)   --
c -- (yb   = g*mb/(sqrt(2)*mw*cos\beta)   --
c -- (ytau = g*mtau/(sqrt(2)*mw*cos\beta) --

      yt   = yuval(3,3)
      yb   = ydval(3,3)
      ytau = yeval(3,3)

      ytewsb   = yuval(3,3)
      ybewsb   = ydval(3,3)
      ytauewsb = yeval(3,3)

c -- Here the running mt,mb,mtau masses are calculated from yt,yb, --- c
c -- ytau given at the scale Q - needed for the QCD corrections    --- c

      rmtc   = dsqrt(2.D0)*sdmw*dsin(datan(tanbeta))*yt/dsqrt(g2)
      rmbc   = dsqrt(2.D0)*sdmw*dcos(datan(tanbeta))*yb/dsqrt(g2)
      rmtauc = dsqrt(2.D0)*sdmw*dcos(datan(tanbeta))*ytau/dsqrt(g2)

      end

c -------------------------------------------------------------------- c
c ------ This and the following subroutines read in the spectrum ----- c
c ------ file given in the SUSY Les Houches Accord format        ----- c
c ------ hep-ph/0311123.                                         ----- c
c ------ Thanks to Tilman Plehn for the first version which has  ----- c
c ------ been expanded and changed here.                         ----- c
c -------------------------------------------------------------------- c

      subroutine SD_read_leshouches(ninlha)

      implicit double precision (a-h,m,o-z)
      double precision minval(1:20),smval(1:20),massval(1:50),
     .                 nmixval(4,4),umixval(2,2),vmixval(2,2),
     .                 stopmixval(2,2),sbotmixval(2,2),staumixval(2,2),
     .                 hmixval(1:10),gaugeval(1:3),msoftval(1:100),
     .                 auval(3,3),adval(3,3),aeval(3,3),yuval(3,3),
     .                 ydval(3,3),yeval(3,3),qvalue(1:20),extval(0:100)
      integer check(1:22),check_final,imod(1:2)
      character line1*6,line2*100,
     .          spinfo1*100,spinfo2*100,modselval*100,mincom(1:20)*20,
     .          extcom(0:100)*20,softcom(1:100)*20,hmixcom(1:10)*20
      logical done

      COMMON/SD_leshouches1/spinfo1,spinfo2,modselval,mincom,extcom,
     .                      softcom,hmixcom
      COMMON/SD_leshouches2/minval,extval,smval,massval,nmixval,umixval,
     .                      vmixval,stopmixval,sbotmixval,staumixval,
     .                      hmixval,gaugeval,msoftval,auval,adval,
     .                      aeval,yuval,ydval,yeval,alphaval,qvalue,imod
      COMMON/SD_mbmb/sd_mbmb,i_sd_mbmb
      COMMON/SD_checkval/check

c -- i_sd_mbmb = 0 ensures that the routine is called which calulates --
c -- the mbpole mass from mb(mb)_MSbar = smval(5)                 --
      i_sd_mbmb = 0

c -- start from the beginning of the file SD_leshouches.in --
      rewind(ninlha)

c -- initialization of the check array --
      do i1=1,22,1
         check(i1) = 0
      end do

c -- the scale Q -- 
      do i=1,20,1
         qvalue(i) = 0.D0
      end do

c a trick to jump over undefined parameters in subsequent writings
      unlikely = -123456789D0
      do i=1,100,1
         extval(i-1) = unlikely
      end do
      do i=1,20,1
         minval(i) = unlikely
      end do
      do i=1,10,1
         hmixval(i) = unlikely
      end do
      do i=1,100,1
         msoftval(i) = unlikely
      end do

c ------------------------------------------------------------------- c
      do i=1,10000,1

c -- check if routine can be left --
         check_final = 1
         do i1=1,22,1
            check_final = check_final*check(i1)
         end do
         if(check_final.eq.1) then
            return
         endif

c -- read in new line --
         line1=' '
         read(ninlha,'(a6,a100)',end=9900) line1,line2
         
c -- rewrite line1(1:6) and line2(1:20) to upper case --
         do j1=1,6,1
            if(line1(j1:j1).ne.'#') then
               do j2=97,122,1
                  if(line1(j1:j1).eq.char(j2)) line1(j1:j1)=char(j2-32)
               end do
            endif
         end do

         do j1=1,20,1
            if(line2(j1:j1).ne.'#') then
               do j2=97,122,1
                  if(line2(j1:j1).eq.char(j2)) line2(j1:j1)=char(j2-32)
               end do
            endif
         end do

c -- looks for blocks and reads them in one after the other --
         if(line1(1:1).eq.'B') then

c -- look for Block MODSEL --
            if(line2(1:6).eq.'MODSEL') then
               call SD_READ_MODSEL(ninlha,modselval,imod,done)
               if (done) then
                  check(1) = 1
                  goto 1111
               else
                  print*,'SD_read_leshouches: problem in MODSEL'
               endif

c -- look for Block SMINPUTS --
            elseif(line2(1:8).eq.'SMINPUTS') then
               call SD_READ_SMINPUTS(ninlha,smval,done)
               if (done) then
                  check(2) = 1
                  goto 1111
               else
                  print*,'SD_read_leshouches: problem in SMINPUTS'
               endif

c -- look for Block MINPAR --
            elseif(line2(1:6).eq.'MINPAR') then
               call SD_READ_MINPAR(ninlha,minval,mincom,done)
               if (done) then
                  check(3) = 1
                  goto 1111
               else
                  print*,'SD_read_leshouches: problem in MINPAR'
               endif

c -- look for Block EXTPAR --
            elseif(line2(1:6).eq.'EXTPAR') then
               call SD_READ_EXTPAR(ninlha,extval,extcom,done)
               if (done) then
                  check(4) = 1
                  goto 1111
               else
                  print*,'SD_read_leshouches: problem in EXTPAR'
               endif

c -- look for Block MASS --
            elseif(line2(1:4).eq.'MASS') then
               call SD_READ_MASS(ninlha,massval,done)
               if (done) then
                  check(5) = 1
                  goto 1111
               else
                  print*,'SD_read_leshouches: problem in MASS'
               endif

c -- look for Block NMIX --
            elseif(line2(1:4).eq.'NMIX') then
               call SD_READ_NMIX(ninlha,nmixval,done)
               if (done) then
                  check(6) = 1
                  goto 1111
               else
                  print*,'SD_read_leshouches: problem in NMIX'
               endif

c -- look for Block UMIX --
            elseif(line2(1:4).eq.'UMIX') then
               call SD_READ_UMIX(ninlha,umixval,done)
               if (done) then
                  check(7) = 1
                  goto 1111
               else
                  print*,'SD_read_leshouches: problem in UMIX'
               endif

c -- look for Block VMIX --
            elseif(line2(1:4).eq.'VMIX') then
               call SD_READ_VMIX(ninlha,vmixval,done)
               if (done) then
                  check(8) = 1
                  goto 1111
               else
                  print*,'SD_read_leshouches: problem in VMIX'
               endif

c -- look for Block STOPMIX --
            elseif(line2(1:7).eq.'STOPMIX') then
               call SD_READ_STOPMIX(ninlha,stopmixval,done)
               if (done) then
                  check(9) = 1
                  goto 1111
               else
                  print*,'SD_read_leshouches: problem in STOPMIX' 
               endif

c -- look for Block SBOTMIX --
            elseif(line2(1:7).eq.'SBOTMIX') then
               call SD_READ_SBOTMIX(ninlha,sbotmixval,done)
               if (done) then
                  check(10) = 1
                  goto 1111
               else
                  print*,'SD_read_leshouches: problem in SBOTMIX' 
               endif

c -- look for Block STAUMIX --
            elseif(line2(1:7).eq.'STAUMIX') then
               call SD_READ_STAUMIX(ninlha,staumixval,done)
               if (done) then
                  check(11) = 1
                  goto 1111
               else
                  print*,'SD_read_leshouches: problem in STAUMIX' 
               endif

c -- look for Block ALPHA --
            elseif(line2(1:5).eq.'ALPHA') then
               call SD_READ_ALPHA(ninlha,alphaval,done)
               if (done) then
                  check(12) = 1
                  goto 1111
               else
                  print*,'SD_read_leshouches: problem in ALPHA'
               endif

c -- look for Block HMIX --
            elseif(line2(1:4).eq.'HMIX') then
               backspace ninlha
               read(ninlha,'(13x,E16.8)') Qval
               qvalue(1) = Qval
               call SD_READ_HMIX(ninlha,hmixval,hmixcom,done)
               if (done) then
                  check(13) = 1
                  goto 1111
               else
                  print*,'SD_read_leshouches: problem in HMIX'
               endif

c -- look for Block GAUGE --
            elseif(line2(1:5).eq.'GAUGE') then
               backspace ninlha
               read(ninlha,'(14x,E16.8)') Qval
               qvalue(2) = Qval
               call SD_READ_GAUGE(ninlha,gaugeval,done)
               if (done) then
                  check(14) = 1
                  goto 1111
               else
                  print*,'SD_read_leshouches: problem in GAUGE'
               endif

c -- look for Block MSOFT --
            elseif(line2(1:5).eq.'MSOFT') then
               backspace ninlha
               read(ninlha,'(14x,E16.8)') Qval
               qvalue(3) = Qval
               call SD_READ_MSOFT(ninlha,msoftval,softcom,done)
               if (done) then
                  check(15) = 1
                  goto 1111
               else
                  print*,'SD_read_leshouches: problem in MSOFT'
               endif

c -- look for Block AU --
            elseif(line2(1:2).eq.'AU') then
               backspace ninlha
               read(ninlha,'(11x,E16.8)') Qval
               qvalue(4) = Qval
               call SD_READ_AU(ninlha,auval,done)
               if (done) then
                  check(16) = 1
                  goto 1111
               else
                  print*,'SD_read_leshouches: problem in AU'
               endif

c -- look for Block AD --
            elseif(line2(1:2).eq.'AD') then
               backspace ninlha
               read(ninlha,'(11x,E16.8)') Qval
               qvalue(5) = Qval
               call SD_READ_AD(ninlha,adval,done)
               if (done) then
                  check(17) = 1
                  goto 1111
               else
                  print*,'SD_read_leshouches: problem in AD'
               endif

c -- look for Block AE --
            elseif(line2(1:2).eq.'AE') then
               backspace ninlha
               read(ninlha,'(11x,E16.8)') Qval
               qvalue(6) = Qval
               call SD_READ_AE(ninlha,aeval,done)
               if (done) then
                  check(18) = 1
                  goto 1111
               else
                  print*,'SD_read_leshouches: problem in AE'
               endif

c -- look for Block YU --
            elseif(line2(1:2).eq.'YU') then
               backspace ninlha
               read(ninlha,'(11x,E16.8)') Qval
               qvalue(7) = Qval
               call SD_READ_YU(ninlha,yuval,done)
               if (done) then
                  check(19) = 1
                  goto 1111
               else
                  print*,'SD_read_leshouches: problem in YU'
               endif

c -- look for Block YD --
            elseif(line2(1:2).eq.'YD') then
               backspace ninlha
               read(ninlha,'(11x,E16.8)') Qval
               qvalue(8) = Qval
               call SD_READ_YD(ninlha,ydval,done)
               if (done) then
                  check(20) = 1
                  goto 1111
               else
                  print*,'SD_read_leshouches: problem in YD'
               endif

c -- look for Block YE --
            elseif(line2(1:2).eq.'YE') then
               backspace ninlha
               read(ninlha,'(11x,E16.8)') Qval
               qvalue(9) = Qval
               call SD_READ_YE(ninlha,yeval,done)
               if (done) then
                  check(21) = 1
                  goto 1111
               else
                  print*,'SD_read_leshouches: problem in YE'
               endif

c -- look for Block SPINFO --
            elseif(line2(1:6).eq.'SPINFO') then
               call SD_READ_SPINFO(ninlha,spinfo1,spinfo2,done)
               if (done) then
                  check(22) = 1
                  goto 1111
               else
                  print*,'SD_read_leshouches: problem in SPINFO'
               endif

c -- continue if the Block is not interesting --
            else
               goto 1111
            endif

c -- continue if it is not a Block statement --
         else
            goto 1111
         endif

c -- maximum number of lines exhausted --
 1111    continue
      end do

 9900 print*,'SD_read_leshouches: end of file'

      return
      end

c -------------------------------------------------------------------- c

      subroutine SD_READ_MODSEL(ninlha,modselval,imod,done)

      implicit double precision (a-h,m,o-z)
      integer imod(1:2)
      character line1*1,line2*1,line3*100,modselval*100
      logical done

      done=.false.

      modselval = ' '

      do i=1,200,1
         read(ninlha,'(a1)',end=9900) line1

c -- decide what it is and read the line if anything of interest --
         if (line1.eq.' ') then
            backspace ninlha
            read(ninlha,'(1x,i5,1x,i5,3x,a100)') idum1,idum2,line3

            if(idum1.eq.1) then
               imod(1) = idum1
               imod(2) = idum2
               modselval = line3
            endif

         elseif(line1.eq.'#') then
            go to 1111
         elseif(line1.eq.'b'.or.line1.eq.'B'.or.line1.eq.'d'.or.line1.eq
     ..'D') then
            backspace ninlha
            done =.true.
            return
         endif

 1111    continue
      end do

 9900 print*,'SD_read_leshouches: end of file'
      done = .true.

      end

c -------------------------------------------------------------------- c

      subroutine SD_READ_SMINPUTS(ninlha,smval,done)

      implicit double precision (a-h,m,o-z)
      double precision smval(20)
      character line1*1
      logical done

      done=.false.

      do i=1,20,1
         smval(i) = 0.D0
      end do

      do i=1,200,1
         read(ninlha,'(a1)',end=9900) line1

c -- decide what it is and read the line if anything of interest --
         if (line1.eq.' ') then
            backspace ninlha
            read(ninlha,*) idum,val

c -- inverse EM coupling at the Z pole in the MS_bar scheme (with --
c -- five active flavours) --
            if(idum.eq.1) then
               smval(1) = val
c -- G_F, Fermi constant (in units of GeV^-2)
            elseif(idum.eq.2) then
               smval(2) = val
c -- Strong coupling at the Z pole in the MS_bar scheme (with five --
c -- active flavours) --
            elseif(idum.eq.3) then
               smval(3) = val
c -- M_Z, pole mass --
            elseif(idum.eq.4) then
               smval(4) = val
c -- mb(mb)^MS_bar. b quark running mass in the MS_bar scheme --
            elseif(idum.eq.5) then
               smval(5) = val
c -- mt, pole mass --
            elseif(idum.eq.6) then
               smval(6) = val
c -- mtau, pole mass --
            elseif(idum.eq.7) then
               smval(7) = val
            endif
            
         elseif(line1.eq.'#') then
            go to 1111
         elseif(line1.eq.'b'.or.line1.eq.'B'.or.line1.eq.'d'.or.line1.eq
     ..'D') then
            backspace ninlha
            done =.true.
            return
         endif

 1111    continue
      end do

 9900 print*,'SD_read_leshouches: end of file'
      done = .true.

      end

c -------------------------------------------------------------------- c

      subroutine SD_READ_MINPAR(ninlha,minval,mincom,done)

      implicit double precision (a-h,m,o-z)
      double precision minval(20)
      character line1*1,line2*1,line3*20,mincom(1:20)*20
      logical done

      done= .false.

      do i=1,20,1
         mincom(i) = ' '
      end do

      do i=1,200,1
         read(ninlha,'(a1)',end=9900) line1

c -- decide what it is and read the line if anything of interest --
         if (line1.eq.' ') then
            backspace ninlha
            read(ninlha,*) idum,val,line2,line3

            do ii=1,6,1
               if(idum.eq.ii) then
                  minval(ii) = val
                  mincom(ii) = line3
               endif
            end do

c -- i=3: value for tanbeta(MZ) --
            
         elseif(line1.eq.'#') then
            goto 1111
         elseif(line1.eq.'b'.or.line1.eq.'B'.or.line1.eq.'d'.or.line1.eq
     ..'D') then
            backspace ninlha
            done = .true.
            return
         endif

 1111    continue
      end do

 9900 print*,'SD_read_leshouches: end of file'
      done = .true.

      end

c -------------------------------------------------------------------- c

      subroutine SD_READ_EXTPAR(ninlha,extval,extcom,done)

      implicit double precision (a-h,m,o-z)
      double precision extval(0:100)
      character line1*1,line2*1,line3*20,extcom(0:100)*20
      logical done

      done= .false.

      do i=1,100,1
         extcom(i-1) = ' '
      end do

      do i=1,200,1
         read(ninlha,'(a1)',end=9900) line1

c -- decide what it is and read the line if anything of interest --
         if (line1.eq.' ') then
            backspace ninlha
            read(ninlha,*) idum,val,line2,line3

            do ii=1,54,1
               if(idum.eq.(ii-1)) then
                  extval(ii-1) = val
                  extcom(ii-1) = line3
               endif
            end do

         elseif(line1.eq.'#') then
            goto 1111
         elseif(line1.eq.'b'.or.line1.eq.'B'.or.line1.eq.'d'.or.line1.eq
     ..'D') then
            backspace ninlha
            done = .true.
            return
         endif

 1111    continue
      end do

 9900 print*,'SD_read_leshouches: end of file'
      done = .true.

      end

c -------------------------------------------------------------------- c

      subroutine SD_READ_MASS(ninlha,massval,done)

      implicit double precision (a-h,m,o-z)
      double precision massval(50)
      character line1*1
      logical done

      done= .false.

      do i=1,50,1
         massval(i) = 0.D0
      end do

c a trick to jump over an undefined gravitino mass
      unlikely = -123456789D0
      massval(35) = unlikely

      do i=1,200,1
         read(ninlha,'(a1)',end=9900) line1

c -- decide what it is and read the line if anything of interest --
         if (line1.eq.' ') then
            backspace ninlha
            read(ninlha,*) idum,val

c -- value for M_W --
            if(idum.eq.24) then
               massval(1) = val
c -- value for M_h --
            elseif(idum.eq.25) then
               massval(2) = val
c -- value for M_H --
            elseif(idum.eq.35) then
               massval(3) = val
c -- value for M_A --
            elseif(idum.eq.36) then
               massval(4) = val
c -- value for M_H+/- --
            elseif(idum.eq.37) then
               massval(5) = val
c -- value for ~d_L --
            elseif(idum.eq.1000001) then
               massval(6) = val
c -- value for ~d_R --
            elseif(idum.eq.2000001) then
               massval(7) = val
c -- value for ~u_L --
            elseif(idum.eq.1000002) then
               massval(8) = val
c -- value for ~u_R --
            elseif(idum.eq.2000002) then
               massval(9) = val
c -- value for ~s_L --
            elseif(idum.eq.1000003) then
               massval(10) = val
c -- value for ~s_R --
            elseif(idum.eq.2000003) then
               massval(11) = val
c -- value for ~c_L --
            elseif(idum.eq.1000004) then
               massval(12) = val
c -- value for ~c_R --
            elseif(idum.eq.2000004) then
               massval(13) = val
c -- value for ~b_1 --
            elseif(idum.eq.1000005) then
               massval(14) = val
c -- value for ~b_2 --
            elseif(idum.eq.2000005) then
               massval(15) = val
c -- value for ~t_1 --
            elseif(idum.eq.1000006) then
               massval(16) = val
c -- value for ~t_2 --
            elseif(idum.eq.2000006) then
               massval(17) = val
c -- value for ~e_L --
            elseif(idum.eq.1000011) then
               massval(18) = val
c -- value for ~e_R --
            elseif(idum.eq.2000011) then
               massval(19) = val
c -- value for ~nu_eL --
            elseif(idum.eq.1000012) then
               massval(20) = val
c -- value for ~mu_L --
            elseif(idum.eq.1000013) then
               massval(21) = val
c -- value for ~mu_R --
            elseif(idum.eq.2000013) then
               massval(22) = val
c -- value for ~nu_muL --
            elseif(idum.eq.1000014) then
               massval(23) = val
c -- value for ~tau_1 --
            elseif(idum.eq.1000015) then
               massval(24) = val
c -- value for ~tau_2 --
            elseif(idum.eq.2000015) then
               massval(25) = val
c -- value for ~nu_tauL --
            elseif(idum.eq.1000016) then
               massval(26) = val
c -- value for ~g --
            elseif(idum.eq.1000021) then
               massval(27) = val
c -- value for ~chi_10 --
            elseif(idum.eq.1000022) then
               massval(28) = val
c -- value for ~chi_20 --
            elseif(idum.eq.1000023) then
               massval(29) = val
c -- value for ~chi_30 --
            elseif(idum.eq.1000025) then
               massval(30) = val
c -- value for ~chi_40 --
            elseif(idum.eq.1000035) then
               massval(31) = val
c -- value for ~chi_1+ --
            elseif(idum.eq.1000024) then
               massval(32) = val
c -- value for ~chi_2+ --
            elseif(idum.eq.1000037) then
               massval(33) = val
c -- value for m_b pole mass --
            elseif(idum.eq.5) then
               massval(34) = val
c -- value for the gravitino mass --
            elseif(idum.eq.1000039) then
               massval(35) = val  
            endif
            
         elseif(line1.eq.'#') then
            goto 1111
         elseif(line1.eq.'b'.or.line1.eq.'B'.or.line1.eq.'d'.or.line1.eq
     ..'D') then
            backspace ninlha
            done = .true.
            return
         endif

 1111    continue
      end do

 9900 print*,'SD_read_leshouches: end of file'
      done = .true.

      end

c -------------------------------------------------------------------- c

      subroutine SD_READ_NMIX(ninlha,nmixval,done)

      implicit double precision (a-h,m,o-z)
      double precision nmixval(4,4)
      character line1*1
      logical done

      done= .false.

      do i=1,4,1
         do j=1,4,1
            nmixval(i,j) = 0.D0
         end do
      end do

      do i=1,200,1
         read(ninlha,'(a1)',end=9900) line1

c -- decide what it is and read the line if anything of interest --
         if (line1.eq.' ') then
            backspace ninlha
            read(ninlha,*) idum1,idum2,val

c -- the values for the neutralino mixing matrix --
            if(idum1.eq.1.and.idum2.eq.1) then
               nmixval(1,1) = val
            elseif(idum1.eq.1.and.idum2.eq.2) then
               nmixval(1,2) = val
            elseif(idum1.eq.1.and.idum2.eq.3) then
               nmixval(1,3) = val
            elseif(idum1.eq.1.and.idum2.eq.4) then
               nmixval(1,4) = val
            elseif(idum1.eq.2.and.idum2.eq.1) then
               nmixval(2,1) = val
            elseif(idum1.eq.2.and.idum2.eq.2) then
               nmixval(2,2) = val
            elseif(idum1.eq.2.and.idum2.eq.3) then
               nmixval(2,3) = val
            elseif(idum1.eq.2.and.idum2.eq.4) then
               nmixval(2,4) = val
            elseif(idum1.eq.3.and.idum2.eq.1) then
               nmixval(3,1) = val
            elseif(idum1.eq.3.and.idum2.eq.2) then
               nmixval(3,2) = val
            elseif(idum1.eq.3.and.idum2.eq.3) then
               nmixval(3,3) = val
            elseif(idum1.eq.3.and.idum2.eq.4) then
               nmixval(3,4) = val
            elseif(idum1.eq.4.and.idum2.eq.1) then
               nmixval(4,1) = val
            elseif(idum1.eq.4.and.idum2.eq.2) then
               nmixval(4,2) = val
            elseif(idum1.eq.4.and.idum2.eq.3) then
               nmixval(4,3) = val
            elseif(idum1.eq.4.and.idum2.eq.4) then
               nmixval(4,4) = val
            endif
            
         elseif(line1.eq.'#') then
            goto 1111
         elseif(line1.eq.'b'.or.line1.eq.'B'.or.line1.eq.'d'.or.line1.eq
     ..'D') then
            backspace ninlha
            done = .true.
            return
         endif

 1111    continue
      end do

 9900 print*,'SD_read_leshouches: end of file'
      done = .true.

      end

c -------------------------------------------------------------------- c

      subroutine SD_READ_UMIX(ninlha,umixval,done)

      implicit double precision (a-h,m,o-z)
      double precision umixval(2,2)
      character line1*1
      logical done

      done= .false.

      do i=1,2,1
         do j=1,2,1
            umixval(i,j) = 0.D0
         end do
      end do

      do i=1,200,1
         read(ninlha,'(a1)',end=9900) line1

c -- decide what it is and read the line if anything of interest --
         if (line1.eq.' ') then
            backspace ninlha
            read(ninlha,*) idum1,idum2,val

c -- the values for the chargino mixing matrix U --
            if(idum1.eq.1.and.idum2.eq.1) then
               umixval(1,1) = val
            elseif(idum1.eq.1.and.idum2.eq.2) then
               umixval(1,2) = val
            elseif(idum1.eq.2.and.idum2.eq.1) then
               umixval(2,1) = val
            elseif(idum1.eq.2.and.idum2.eq.2) then
               umixval(2,2) = val
            endif
            
         elseif(line1.eq.'#') then
            goto 1111
         elseif(line1.eq.'b'.or.line1.eq.'B'.or.line1.eq.'d'.or.line1.eq
     ..'D') then
            backspace ninlha
            done = .true.
            return
         endif

 1111    continue
      end do

 9900 print*,'SD_read_leshouches: end of file'
      done = .true.

      end

c -------------------------------------------------------------------- c

      subroutine SD_READ_VMIX(ninlha,vmixval,done)

      implicit double precision (a-h,m,o-z)
      double precision vmixval(2,2)
      character line1*1
      logical done

      done= .false.

      do i=1,2,1
         do j=1,2,1
            vmixval(i,j) = 0.D0
         end do
      end do

      do i=1,200,1
         read(ninlha,'(a1)',end=9900) line1

c -- decide what it is and read the line if anything of interest --
         if (line1.eq.' ') then
            backspace ninlha
            read(ninlha,*) idum1,idum2,val

c -- the values for the chargino mixing matrix V --
            if(idum1.eq.1.and.idum2.eq.1) then
               vmixval(1,1) = val
            elseif(idum1.eq.1.and.idum2.eq.2) then
               vmixval(1,2) = val
            elseif(idum1.eq.2.and.idum2.eq.1) then
               vmixval(2,1) = val
            elseif(idum1.eq.2.and.idum2.eq.2) then
               vmixval(2,2) = val
            endif
            
         elseif(line1.eq.'#') then
            goto 1111
         elseif(line1.eq.'b'.or.line1.eq.'B'.or.line1.eq.'d'.or.line1.eq
     ..'D') then
            backspace ninlha
            done = .true.
            return
         endif

 1111    continue
      end do

 9900 print*,'SD_read_leshouches: end of file'
      done = .true.

      end

c -------------------------------------------------------------------- c

      subroutine SD_READ_STOPMIX(ninlha,stopmixval,done)

      implicit double precision (a-h,m,o-z)
      double precision stopmixval(2,2)
      character line1*1
      logical done

      done= .false.

      do i=1,2,1
         do j=1,2,1
            stopmixval(i,j) = 0.D0
         end do
      end do

      do i=1,200,1
         read(ninlha,'(a1)',end=9900) line1

c -- decide what it is and read the line if anything of interest --
         if (line1.eq.' ') then
            backspace ninlha
            read(ninlha,*) idum1,idum2,val

c -- the values for the stop mixing matrix: m(1,1) = cos(theta),     --
c -- m(1,2) = sin(theta), m(2,1) = -sin(theta), m(2,2) = cos(theta). --
            if(idum1.eq.1.and.idum2.eq.1) then
               stopmixval(1,1) = val
            elseif(idum1.eq.1.and.idum2.eq.2) then
               stopmixval(1,2) = val
            elseif(idum1.eq.2.and.idum2.eq.1) then
               stopmixval(2,1) = val
            elseif(idum1.eq.2.and.idum2.eq.2) then
               stopmixval(2,2) = val
            endif
            
         elseif(line1.eq.'#') then
            goto 1111
         elseif(line1.eq.'b'.or.line1.eq.'B'.or.line1.eq.'d'.or.line1.eq
     ..'D') then
            backspace ninlha
            done = .true.
            return
         endif

 1111    continue
      end do

 9900 print*,'SD_read_leshouches: end of file'
      done = .true.

      end

c -------------------------------------------------------------------- c

      subroutine SD_READ_SBOTMIX(ninlha,sbotmixval,done)

      implicit double precision (a-h,m,o-z)
      double precision sbotmixval(2,2)
      character line1*1
      logical done

      done= .false.

      do i=1,2,1
         do j=1,2,1
            sbotmixval(i,j) = 0.D0
         end do
      end do

      do i=1,200,1
         read(ninlha,'(a1)',end=9900) line1

c -- decide what it is and read the line if anything of interest --
         if (line1.eq.' ') then
            backspace ninlha
            read(ninlha,*) idum1,idum2,val

c -- the values for the sbottom mixing matrix: m(1,1) = cos(theta),  --
c -- m(1,2) = sin(theta), m(2,1) = -sin(theta), m(2,2) = cos(theta). --
            if(idum1.eq.1.and.idum2.eq.1) then
               sbotmixval(1,1) = val
            elseif(idum1.eq.1.and.idum2.eq.2) then
               sbotmixval(1,2) = val
            elseif(idum1.eq.2.and.idum2.eq.1) then
               sbotmixval(2,1) = val
            elseif(idum1.eq.2.and.idum2.eq.2) then
               sbotmixval(2,2) = val
            endif
            
         elseif(line1.eq.'#') then
            goto 1111
         elseif(line1.eq.'b'.or.line1.eq.'B'.or.line1.eq.'d'.or.line1.eq
     ..'D') then
            backspace ninlha
            done = .true.
            return
         endif

 1111    continue
      end do

 9900 print*,'SD_read_leshouches: end of file'
      done = .true.

      end

c -------------------------------------------------------------------- c

      subroutine SD_READ_STAUMIX(ninlha,staumixval,done)

      implicit double precision (a-h,m,o-z)
      double precision staumixval(2,2)
      character line1*1
      logical done

      done= .false.

      do i=1,2,1
         do j=1,2,1
            staumixval(i,j) = 0.D0
         end do
      end do

      do i=1,200,1
         read(ninlha,'(a1)',end=9900) line1

c -- decide what it is and read the line if anything of interest --
         if (line1.eq.' ') then
            backspace ninlha
            read(ninlha,*) idum1,idum2,val

c -- the values for the stau mixing matrix: m(1,1) = cos(theta),     --
c -- m(1,2) = sin(theta), m(2,1) = -sin(theta), m(2,2) = cos(theta). --
            if(idum1.eq.1.and.idum2.eq.1) then
               staumixval(1,1) = val
            elseif(idum1.eq.1.and.idum2.eq.2) then
               staumixval(1,2) = val
            elseif(idum1.eq.2.and.idum2.eq.1) then
               staumixval(2,1) = val
            elseif(idum1.eq.2.and.idum2.eq.2) then
               staumixval(2,2) = val
            endif
            
         elseif(line1.eq.'#') then
            goto 1111
         elseif(line1.eq.'b'.or.line1.eq.'B'.or.line1.eq.'d'.or.line1.eq
     ..'D') then
            backspace ninlha
            done = .true.
            return
         endif

 1111    continue
      end do

 9900 print*,'SD_read_leshouches: end of file'
      done = .true.

      end

c -------------------------------------------------------------------- c

      subroutine SD_READ_ALPHA(ninlha,alphaval,done)

      implicit double precision (a-h,m,o-z)
      character line1*1
      logical done

      done= .false.

      alphaval = 0.D0

      do i=1,200,1
         read(ninlha,'(a1)',end=9900) line1

c -- decide what it is and read the line if anything of interest --
         if (line1.eq.' ') then
            backspace ninlha
            read(ninlha,*) val

c -- value for the effective Higgs mixing parameter alpha --
c -- ! The given value is the 'best choice' solution. Depending on  ! --
c -- ! the spectrum calcluator it can be an on-shell parameter or   ! --
c -- ! can be given in the DR_bar definition at a certain           ! --
c -- ! characteristic scale etc. For details on the specific        ! --
c -- ! prescriptions see the manual of the particular spectrum      ! --
c -- ! calculator.                                                  ! --
            alphaval = val
            
         elseif(line1.eq.'#') then
            goto 1111
         elseif(line1.eq.'b'.or.line1.eq.'B'.or.line1.eq.'d'.or.line1.eq
     ..'D') then
            backspace ninlha
            done = .true.
            return
         endif

 1111    continue
      end do

 9900 print*,'SD_read_leshouches: end of file'
      done = .true.

      end

c -------------------------------------------------------------------- c

      subroutine SD_READ_HMIX(ninlha,hmixval,hmixcom,done)

      implicit double precision (a-h,m,o-z)
      double precision hmixval(1:10)
      character line1*1,line2*1,line3*20,hmixcom(1:10)*20
      logical done

      done= .false.

      do i=1,10,1
         hmixcom(i) = ' '
      end do

      do i=1,200,1
         read(ninlha,'(a1)',end=9900) line1

c -- decide what it is and read the line if anything of interest --
         if (line1.eq.' ') then
            backspace ninlha
            read(ninlha,*) idum,val,line2,line3

            do ii=1,10,1
               if(idum.eq.ii) then
                  hmixval(ii) = val
                  hmixcom(ii) = line3
               endif
            end do

         elseif(line1.eq.'#') then
            goto 1111
         elseif(line1.eq.'b'.or.line1.eq.'B'.or.line1.eq.'d'.or.line1.eq
     ..'D') then
            backspace ninlha
            done = .true.
            return
         endif

 1111    continue
      end do

 9900 print*,'SD_read_leshouches: end of file'
      done = .true.

      end

c -------------------------------------------------------------------- c

      subroutine SD_READ_GAUGE(ninlha,gaugeval,done)

      implicit double precision (a-h,m,o-z)
      double precision gaugeval(1:3)
      character line1*1
      logical done

      done= .false.

      do i=1,3,1
         gaugeval(i) = 0.D0
      end do

      do i=1,200,1
         read(ninlha,'(a1)',end=9900) line1

c -- decide what it is and read the line if anything of interest --
         if (line1.eq.' ') then
            backspace ninlha
            read(ninlha,*) idum,val

c -- The following parameters are the DR_bar running parameters at --
c -- the scale Q.                                                  --
c -- value for g_prime at the scale Q --
            if(idum.eq.1) then
               gaugeval(1) = val

c -- value for g at the scale Q --
            elseif(idum.eq.2) then
               gaugeval(2) = val

c -- value for g3 at the scale Q --
            elseif(idum.eq.3) then
               gaugeval(3) = val
            endif

         elseif(line1.eq.'#') then
            goto 1111
         elseif(line1.eq.'b'.or.line1.eq.'B'.or.line1.eq.'d'.or.line1.eq
     ..'D') then
            backspace ninlha
            done = .true.
            return
         endif

 1111    continue
      end do

 9900 print*,'SD_read_leshouches: end of file'
      done = .true.

      end

c -------------------------------------------------------------------- c

      subroutine SD_READ_MSOFT(ninlha,msoftval,softcom,done)

      implicit double precision (a-h,m,o-z)
      double precision msoftval(1:100)
      character line1*1,line2*1,line3*20,softcom(1:100)*20
      logical done

      done= .false.

      do i=1,100,1
         softcom(i)   = ' ' 
      end do

      do i=1,200,1
         read(ninlha,'(a1)',end=9900) line1

c -- decide what it is and read the line if anything of interest --
         if (line1.eq.' ') then
            backspace ninlha
            read(ninlha,*) idum,val,line2,line3

            do ii=1,100,1
               if(idum.eq.ii) then
                  msoftval(ii) = val
                  softcom(ii)  = line3
               endif
            end do

         elseif(line1.eq.'#') then
            goto 1111
         elseif(line1.eq.'b'.or.line1.eq.'B'.or.line1.eq.'d'.or.line1.eq
     ..'D') then
            backspace ninlha
            done = .true.
            return
         endif

 1111    continue
      end do

 9900 print*,'SD_read_leshouches: end of file'
      done = .true.

      end

c -------------------------------------------------------------------- c

      subroutine SD_READ_AU(ninlha,auval,done)

      implicit double precision (a-h,m,o-z)
      double precision auval(3,3)
      character line1*1
      logical done

      done= .false.

      unlikely = -123456789D0

      do i=1,3,1
         do j=1,3,1
            auval(i,j) = unlikely
         end do
      end do

      do i=1,200,1
         read(ninlha,'(a1)',end=9900) line1

c -- decide what it is and read the line if anything of interest --
         if (line1.eq.' ') then
            backspace ninlha
            read(ninlha,*) idum1,idum2,val

c -- The following parameters are the DR_bar running parameters at --
c -- the scale Q.                                                  --
c -- values for AU(i,j) at the scale Q --
            if(idum1.eq.1.and.idum2.eq.1) then
               auval(1,1) = val
            elseif(idum1.eq.1.and.idum2.eq.2) then
               auval(1,2) = val
            elseif(idum1.eq.1.and.idum2.eq.3) then
               auval(1,3) = val
            elseif(idum1.eq.2.and.idum2.eq.1) then
               auval(2,1) = val
            elseif(idum1.eq.2.and.idum2.eq.2) then
               auval(2,2) = val
            elseif(idum1.eq.2.and.idum2.eq.3) then
               auval(2,3) = val
            elseif(idum1.eq.3.and.idum2.eq.1) then
               auval(3,1) = val
            elseif(idum1.eq.3.and.idum2.eq.2) then
               auval(3,2) = val
            elseif(idum1.eq.3.and.idum2.eq.3) then
               auval(3,3) = val
            endif

         elseif(line1.eq.'#') then
            goto 1111
         elseif(line1.eq.'b'.or.line1.eq.'B'.or.line1.eq.'d'.or.line1.eq
     ..'D') then
            backspace ninlha
            done = .true.
            return
         endif

 1111    continue
      end do

 9900 print*,'SD_read_leshouches: end of file'
      done = .true.

      end

c -------------------------------------------------------------------- c

      subroutine SD_READ_AD(ninlha,adval,done)

      implicit double precision (a-h,m,o-z)
      double precision adval(3,3)
      character line1*1
      logical done

      done= .false.

      unlikely = -123456789D0

      do i=1,3,1
         do j=1,3,1
            adval(i,j) = unlikely
         end do
      end do

      do i=1,200,1
         read(ninlha,'(a1)',end=9900) line1

c -- decide what it is and read the line if anything of interest --
         if (line1.eq.' ') then
            backspace ninlha
            read(ninlha,*) idum1,idum2,val

c -- The following parameters are the DR_bar running parameters at --
c -- the scale Q.                                                  --
c -- values for AD(i,j) at the scale Q --
            if(idum1.eq.1.and.idum2.eq.1) then
               adval(1,1) = val
            elseif(idum1.eq.1.and.idum2.eq.2) then
               adval(1,2) = val
            elseif(idum1.eq.1.and.idum2.eq.3) then
               adval(1,3) = val
            elseif(idum1.eq.2.and.idum2.eq.1) then
               adval(2,1) = val
            elseif(idum1.eq.2.and.idum2.eq.2) then
               adval(2,2) = val
            elseif(idum1.eq.2.and.idum2.eq.3) then
               adval(2,3) = val
            elseif(idum1.eq.3.and.idum2.eq.1) then
               adval(3,1) = val
            elseif(idum1.eq.3.and.idum2.eq.2) then
               adval(3,2) = val
            elseif(idum1.eq.3.and.idum2.eq.3) then
               adval(3,3) = val
            endif

         elseif(line1.eq.'#') then
            goto 1111
         elseif(line1.eq.'b'.or.line1.eq.'B'.or.line1.eq.'d'.or.line1.eq
     ..'D') then
            backspace ninlha
            done = .true.
            return
         endif

 1111    continue
      end do

 9900 print*,'SD_read_leshouches: end of file'
      done = .true.

      end

c -------------------------------------------------------------------- c

      subroutine SD_READ_AE(ninlha,aeval,done)

      implicit double precision (a-h,m,o-z)
      double precision aeval(3,3)
      character line1*1
      logical done

      done= .false.

      unlikely = -123456789D0

      do i=1,3,1
         do j=1,3,1
            aeval(i,j) = unlikely
         end do
      end do

      do i=1,200,1
         read(ninlha,'(a1)',end=9900) line1

c -- decide what it is and read the line if anything of interest --
         if (line1.eq.' ') then
            backspace ninlha
            read(ninlha,*) idum1,idum2,val

c -- The following parameters are the DR_bar running parameters at --
c -- the scale Q.                                                  --
c -- values for AE(i,j) at the scale Q --
            if(idum1.eq.1.and.idum2.eq.1) then
               aeval(1,1) = val
            elseif(idum1.eq.1.and.idum2.eq.2) then
               aeval(1,2) = val
            elseif(idum1.eq.1.and.idum2.eq.3) then
               aeval(1,3) = val
            elseif(idum1.eq.2.and.idum2.eq.1) then
               aeval(2,1) = val
            elseif(idum1.eq.2.and.idum2.eq.2) then
               aeval(2,2) = val
            elseif(idum1.eq.2.and.idum2.eq.3) then
               aeval(2,3) = val
            elseif(idum1.eq.3.and.idum2.eq.1) then
               aeval(3,1) = val
            elseif(idum1.eq.3.and.idum2.eq.2) then
               aeval(3,2) = val
            elseif(idum1.eq.3.and.idum2.eq.3) then
               aeval(3,3) = val
            endif

         elseif(line1.eq.'#') then
            goto 1111
         elseif(line1.eq.'b'.or.line1.eq.'B'.or.line1.eq.'d'.or.line1.eq
     ..'D') then
            backspace ninlha
            done = .true.
            return
         endif

 1111    continue
      end do

 9900 print*,'SD_read_leshouches: end of file'
      done = .true.

      end

c -------------------------------------------------------------------- c

      subroutine SD_READ_YU(ninlha,yuval,done)

      implicit double precision (a-h,m,o-z)
      double precision yuval(3,3)
      character line1*1
      logical done

      done= .false.

      do i=1,3,1
         do j=1,3,1
            yuval(i,j) = 0.D0
         end do
      end do

      do i=1,200,1
         read(ninlha,'(a1)',end=9900) line1

c -- decide what it is and read the line if anything of interest --
         if (line1.eq.' ') then
            backspace ninlha
            read(ninlha,*) idum1,idum2,val

c -- The following parameters are the DR_bar running parameters at --
c -- the scale Q.                                                  --
c -- values for YU(i,j) at the scale Q --
            if(idum1.eq.1.and.idum2.eq.1) then
               yuval(1,1) = val
            elseif(idum1.eq.1.and.idum2.eq.2) then
               yuval(1,2) = val
            elseif(idum1.eq.1.and.idum2.eq.3) then
               yuval(1,3) = val
            elseif(idum1.eq.2.and.idum2.eq.1) then
               yuval(2,1) = val
            elseif(idum1.eq.2.and.idum2.eq.2) then
               yuval(2,2) = val
            elseif(idum1.eq.2.and.idum2.eq.3) then
               yuval(2,3) = val
            elseif(idum1.eq.3.and.idum2.eq.1) then
               yuval(3,1) = val
            elseif(idum1.eq.3.and.idum2.eq.2) then
               yuval(3,2) = val
            elseif(idum1.eq.3.and.idum2.eq.3) then
               yuval(3,3) = val
            endif

         elseif(line1.eq.'#') then
            goto 1111
         elseif(line1.eq.'b'.or.line1.eq.'B'.or.line1.eq.'d'.or.line1.eq
     ..'D') then
            backspace ninlha
            done = .true.
            return
         endif

 1111    continue
      end do

 9900 print*,'SD_read_leshouches: end of file'
      done = .true.

      end

c -------------------------------------------------------------------- c

      subroutine SD_READ_YD(ninlha,ydval,done)

      implicit double precision (a-h,m,o-z)
      double precision ydval(3,3)
      character line1*1
      logical done

      done= .false.

      do i=1,3,1
         do j=1,3,1
            ydval(i,j) = 0.D0
         end do
      end do

      do i=1,200,1
         read(ninlha,'(a1)',end=9900) line1

c -- decide what it is and read the line if anything of interest --
         if (line1.eq.' ') then
            backspace ninlha
            read(ninlha,*) idum1,idum2,val

c -- The following parameters are the DR_bar running parameters at --
c -- the scale Q.                                                  --
c -- values for YD(i,j) at the scale Q --
            if(idum1.eq.1.and.idum2.eq.1) then
               ydval(1,1) = val
            elseif(idum1.eq.1.and.idum2.eq.2) then
               ydval(1,2) = val
            elseif(idum1.eq.1.and.idum2.eq.3) then
               ydval(1,3) = val
            elseif(idum1.eq.2.and.idum2.eq.1) then
               ydval(2,1) = val
            elseif(idum1.eq.2.and.idum2.eq.2) then
               ydval(2,2) = val
            elseif(idum1.eq.2.and.idum2.eq.3) then
               ydval(2,3) = val
            elseif(idum1.eq.3.and.idum2.eq.1) then
               ydval(3,1) = val
            elseif(idum1.eq.3.and.idum2.eq.2) then
               ydval(3,2) = val
            elseif(idum1.eq.3.and.idum2.eq.3) then
               ydval(3,3) = val
            endif

         elseif(line1.eq.'#') then
            goto 1111
         elseif(line1.eq.'b'.or.line1.eq.'B'.or.line1.eq.'d'.or.line1.eq
     ..'D') then
            backspace ninlha
            done = .true.
            return
         endif

 1111    continue
      end do

 9900 print*,'SD_read_leshouches: end of file'
      done = .true.

      end

c -------------------------------------------------------------------- c

      subroutine SD_READ_YE(ninlha,yeval,done)

      implicit double precision (a-h,m,o-z)
      double precision yeval(3,3)
      character line1*1
      logical done

      done= .false.

      do i=1,3,1
         do j=1,3,1
            yeval(i,j) = 0.D0
         end do
      end do

      do i=1,200,1
         read(ninlha,'(a1)',end=9900) line1

c -- decide what it is and read the line if anything of interest --
         if (line1.eq.' ') then
            backspace ninlha
            read(ninlha,*) idum1,idum2,val

c -- The following parameters are the DR_bar running parameters at --
c -- the scale Q.                                                  --
c -- values for YE(i,j) at the scale Q --
            if(idum1.eq.1.and.idum2.eq.1) then
               yeval(1,1) = val
            elseif(idum1.eq.1.and.idum2.eq.2) then
               yeval(1,2) = val
            elseif(idum1.eq.1.and.idum2.eq.3) then
               yeval(1,3) = val
            elseif(idum1.eq.2.and.idum2.eq.1) then
               yeval(2,1) = val
            elseif(idum1.eq.2.and.idum2.eq.2) then
               yeval(2,2) = val
            elseif(idum1.eq.2.and.idum2.eq.3) then
               yeval(2,3) = val
            elseif(idum1.eq.3.and.idum2.eq.1) then
               yeval(3,1) = val
            elseif(idum1.eq.3.and.idum2.eq.2) then
               yeval(3,2) = val
            elseif(idum1.eq.3.and.idum2.eq.3) then
               yeval(3,3) = val
            endif

         elseif(line1.eq.'#') then
            goto 1111
         elseif(line1.eq.'b'.or.line1.eq.'B'.or.line1.eq.'d'.or.line1.eq
     ..'D') then
            backspace ninlha
            done = .true.
            return
         endif

 1111    continue
      end do

 9900 print*,'SD_read_leshouches: end of file'
      done = .true.

      end

c -------------------------------------------------------------------- c

      subroutine SD_READ_SPINFO(ninlha,spinfo1,spinfo2,done)

      implicit double precision (a-h,m,o-z)
      character line1*1,line2*100,spinfo1*100,spinfo2*100
      logical done

      done= .false.

      spinfo1 = ' '
      spinfo2 = ' '

      do i=1,200,1
         read(ninlha,'(a1)',end=9900) line1

c -- decide what it is and read the line if anything of interest --
         if (line1.eq.' ') then
            backspace ninlha
            read(ninlha,'(1x,i5,3x,a100)') idum,line2

c -- the name of the spectrum calculator --
            if(idum.eq.1) then
               spinfo1 = line2

c -- the version number of the spectrum calculator --
            elseif(idum.eq.2) then
               spinfo2 = line2
            endif

         elseif(line1.eq.'#') then
            goto 1111
         elseif(line1.eq.'b'.or.line1.eq.'B'.or.line1.eq.'d'.or.line1.eq
     ..'D') then
            backspace ninlha
            done = .true.
            return
         endif

 1111    continue
      end do

 9900 print*,'SD_read_leshouches: end of file'
      done = .true.

      end

c -------------------------------------------------------------------- c
c -------- Calculation of the couplings needed in the decays --------- c
c -------------------------------------------------------------------- c

      subroutine SD_couplings

      implicit double precision (a-h,m,o-z)

      dimension amneut(4),xmneut(4),amchar(2)
      dimension u(2,2),v(2,2),z(4,4),zp(4,4)

      dimension ahl(4,4),ahh(4,4),aa(4,4)
      dimension gkhlr(2,2),gkhll(2,2),gkhhr(2,2),gkhhl(2,2),gkhar(2,2),
     .          gkhal(2,2)
      dimension ql(4,2),qr(4,2),or(4,2),ol(4,2)
      dimension opl(2,2),opr(2,2),onl(4,4),onr(4,4)
      dimension ale(2,2),altau(2,2),alsne(2,2),blsne(2,2),alsnt(2,2),
     .          blsnt(2,2)
      dimension alsbo(2,2),aksbo(2,2),alsto(2,2),aksto(2,2)
      dimension alup(2,2),aldo(2,2)
      dimension ae(2,4),be(2,4),atau(2,4),btau(2,4),anu(2,4),bnu(2,4),
     .          antau(2,4),bntau(2,4)
      dimension atop(2,4),btop(2,4),abo(2,4),bbo(2,4)
      dimension aup(2,4),bup(2,4),ado(2,4),bdo(2,4)
      dimension gltt(2,2),ghtt(2,2)
      dimension glbb(2,2),ghbb(2,2)
      dimension gctb(2,2),chctb(2,2)
      dimension gztt(2,2),gzbb(2,2),gztautau(2,2)
      dimension gwtb(2,2),gwntau(2,2)
      dimension gul(2),gur(2),gdl(2),gdr(2),gtl(2),gtr(2),gbl(2),gbr(2)
      dimension q(4,4),s(4,4)
      dimension qc(2,2),sc(2,2)      

c ----- common blocks needed for the calculation of the couplings ---- c
c      COMMON/SD_flagmixang/flagcu,flagcd,flagce
      COMMON/SD_param/sdgf,amz,amw,pi,g2
      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2
      COMMON/SD_squarkud/asup1,asup2,asdown1,asdown2
      COMMON/SD_sfermionetau/ase1,ase2,astau1,astau2
      COMMON/SD_sneutrino/asne1,asne2,asntau1,asntau2
      COMMON/SD_hmass/ama,aml,amh,amch,amar
      COMMON/SD_mixang/alp_mssm,tanbeta
      COMMON/SD_mixmat/u,v,z,zp
      COMMON/SD_weinberg/sw,cw
      COMMON/SD_sfmixang/thet,theb,thel,cu,su,cd,sd,ce,se
      COMMON/SD_fermion/amt,amb,amtau
      COMMON/SD_break/autop,adbot,adtau,amu
      COMMON/SD_break1/sdaup,sdadown,sdael

c ------ common blocks for the couplings needed for the widths ------- c
      COMMON/SD_coup1/ahl,ahh,aa
      COMMON/SD_coup2/gkhll,gkhhl,gkhal,gkhlr,gkhhr,gkhar
      COMMON/SD_coup3/ql,qr,ol,or
      COMMON/SD_coup4/opl,opr,onl,onr
      COMMON/SD_coup5/ale,altau,alsne,blsne,alsnt,blsnt
      COMMON/SD_coup6/alsto,aksto,alsbo,aksbo
      COMMON/SD_coup7/alup,aldo
      COMMON/SD_coup8/ae,be,atau,btau,anu,bnu,antau,bntau      
      COMMON/SD_coup9/atop,btop,abo,bbo
      COMMON/SD_coup10/aup,bup,ado,bdo
      COMMON/SD_coup11/gltt,ghtt,gatt
      COMMON/SD_coup12/glbb,ghbb,gabb
      COMMON/SD_coup13/gctb,chctb
      COMMON/SD_coup14/chctbl,chctbr,chctaunur,chctaunul
      COMMON/SD_coup15/achtop,vchtop,achtau,vchtau
      COMMON/SD_coup16/czttl,czttr,czbbl,czbbr,cztautaul,cztautaur,
     .                 cznunul,cznunur
      COMMON/SD_coup17/azztoptop,vzztoptop,azztautau,vzztautau,
     .                 azzneutneut,vzzneutneut,azzbotbot,vzzbotbot
      COMMON/SD_coup18/awff,vwff
      COMMON/SD_coup19/gztt,gzbb,gztautau
      COMMON/SD_coup20/gwtb,gwntau
      COMMON/SD_coup21/gtr,gtl,gbr,gbl,gur,gul,gdr,gdl
      COMMON/SD_yukawa/ytewsb,ybewsb,ytauewsb

c ------------------------- the mixing angles ------------------------ c

      ct=dcos(thet)
      st=dsin(thet)
      cb=dcos(theb)
      sb=dsin(theb)
      cl=dcos(thel)
      sl=dsin(thel)

      tgbet=tanbeta
      bet  =datan(tanbeta) 
      alp  =alp_mssm
      tw   =sw/cw

c--------------------------------------------------------------------- c
c                             The couplings
c--------------------------------------------------------------------- c

c -- the Yukawa couplings at the scale of EWSB --
      ytc   = ytewsb/dsqrt(g2)
      ybc   = ybewsb/dsqrt(g2)
      ytauc = ytauewsb/dsqrt(g2)

c -------------------------------------------------------------------- c
c           Higgs-neutralino_i-neutralino_j couplings
c -------------------------------------------------------------------- c

      do i=1,4,1
         do j=1,4,1
            q(i,j)   = 1.d0/2.d0/cw*(z(i,3)*zp(j,2)+z(j,3)*zp(i,2))
            s(i,j)   = 1.d0/2.d0/cw*(z(i,4)*zp(j,2)+z(j,4)*zp(i,2))
            ahl(i,j) = (q(i,j)*dsin(alp)+s(i,j)*dcos(alp))/2.D0
            ahh(i,j) = (-q(i,j)*dcos(alp)+s(i,j)*dsin(alp))/2.D0
            aa(i,j)  = (-q(i,j)*dsin(bet)+s(i,j)*dcos(bet))/2.D0
         enddo
      enddo

c Feynman rule: ig*(ahl(i,j)*(1-g_5)+ahl(j,i)*(1+g_5))
c Feynman rule: ig*(ahh(i,j)*(1-g_5)+ahh(j,i)*(1+g_5))
c Feynman rule: g*(aa(i,j)*(1-g_5)-aa(j,i)*(1+g_5))

c -------------------------------------------------------------------- c
c                Higgs-chargino_i-chargino_j couplings 
c -------------------------------------------------------------------- c

      do i=1,2
         do j=1,2
            qc(i,j) = 1.D0/dsqrt(2.D0)*u(j,2)*v(i,1)
            sc(i,j) = 1.D0/dsqrt(2.D0)*u(j,1)*v(i,2)
         enddo
      enddo
      do i=1,2
         do j=1,2
            gkhlr(i,j) = -qc(i,j)*dsin(alp)+sc(i,j)*dcos(alp)
            gkhll(i,j) = -qc(j,i)*dsin(alp)+sc(j,i)*dcos(alp)
            gkhhr(i,j) = dcos(alp)*qc(i,j)+dsin(alp)*sc(i,j)
            gkhhl(i,j) = dcos(alp)*qc(j,i)+dsin(alp)*sc(j,i)
            gkhar(i,j) = dsin(bet)*qc(i,j)+dcos(bet)*sc(i,j)
            gkhal(i,j) = -dsin(bet)*qc(j,i)-dcos(bet)*sc(j,i)
         enddo
      enddo

c Feynman rule: -ig*[gkhll*(1-g_5)/2+gkhlr*(1+g_5)/2]
c Feynman rule: g*[gkhal*(1-g5)/2+gkhar*(1+g_5)/2]
c j in, i out

c -------------------------------------------------------------------- c
c               H^+ neutralino_i-chargino_j couplings
c -------------------------------------------------------------------- c

      do i=1,4
         do j=1,2
            ql(i,j) = dcos(bet)*(v(j,1)*z(i,4)+v(j,2)/dsqrt(2.D0)*
     .                (z(i,2)+z(i,1)*sw/cw))
            qr(i,j) = dsin(bet)*(u(j,1)*z(i,3)-u(j,2)/dsqrt(2.D0)*
     .                (z(i,2)+z(i,1)*sw/cw))
         enddo
      enddo

c Feynman rule: -i*g*[ql(i,j)*P_L + qr(i,j)*P_R]
c incoming H-, incoming chargino_j+

c -------------------------------------------------------------------- c
c                 Z-neutralino_i-neutralino_j couplings
c -------------------------------------------------------------------- c

      do i=1,4
         do j=1,4
            onr(i,j) = 1/2.D0/cw*(z(i,3)*z(j,3)-z(i,4)*z(j,4))
            onl(i,j) = -onr(i,j)
         enddo
      enddo

c Feynman rule: i*g*g_mu*(onl(i,j)*(1-g5)/2+onr(i,j)*(1+g5)/2)
c incoming neutralino_j, outgoing neutralino_i

c -------------------------------------------------------------------- c
c                  Z-chargino_i-chargino_j couplings
c -------------------------------------------------------------------- c

      opl(1,1) = -v(1,1)*v(1,1)-0.5D0*v(1,2)*v(1,2)+sw**2
      opr(1,1) = -u(1,1)*u(1,1)-0.5D0*u(1,2)*u(1,2)+sw**2

      opl(1,2) = -v(1,1)*v(2,1)-0.5D0*v(1,2)*v(2,2)
      opr(1,2) = -u(1,1)*u(2,1)-0.5D0*u(1,2)*u(2,2)

      opl(2,1) = opl(1,2)
      opr(2,1) = opr(1,2)

      opl(2,2) = -v(2,1)*v(2,1)-0.5D0*v(2,2)*v(2,2)+sw**2
      opr(2,2) = -u(2,1)*u(2,1)-0.5D0*u(2,2)*u(2,2)+sw**2

c Feynman rule: ig/costheta_W*g_mu*[opl(i,j)*P_L+opr(i,j)*P_R]
c incoming chargino_j, outgoing chargino_i

c -------------------------------------------------------------------- c
c               W^+ neutralino_i-chargino_j couplings
c -------------------------------------------------------------------- c

      do i=1,4
         do j=1,2
            or(i,j) =  1/dsqrt(2.D0)*z(i,3)*u(j,2)+z(i,2)*u(j,1)
            ol(i,j) = -1/dsqrt(2.D0)*z(i,4)*v(j,2)+z(i,2)*v(j,1)
         end do
      end do

c Feynman rule: ig*g_mu*[ ol(i,j)*P_L + or(i,j)*P_R ]
c outgoing W+, incoming chargino+ <=> incoming W+, outgoing chargino+

c -------------------------------------------------------------------- c
c             the chargino_k-selectron-neutrino_e couplings
c -------------------------------------------------------------------- c

      do k=1,2
         ale(1,k) = -U(k,1)*ce
         ale(2,k) = U(k,1)*se
      enddo

c Feynman rule: ig*[ale(1/2,k)*P_R]

c -------------------------------------------------------------------- c
c               the chargino_k-stau-neutrino_tau couplings
c -------------------------------------------------------------------- c

      do k=1,2
         altau(1,k) = -cl*U(k,1)+sl*Ytauc*U(k,2)
         altau(2,k) =  sl*U(k,1)+cl*Ytauc*U(k,2)
      enddo

c Feynman rule: ig*altau(1/2,k)*P_R
c blto(1/2,k) identical to 0.

c -------------------------------------------------------------------- c
c             The chargino_k-sneutrino_eL-electron coupling
c -------------------------------------------------------------------- c

      do k=1,2
         alsne(1,k) = -v(k,1)
         alsne(2,k) = 0.D0
         blsne(1,k) = 0.D0
         blsne(2,k) = 0.D0
      enddo

c Feynman rule: ig*[alsne(1/2,k)*P_R + blsne(1/2,k)*P_L]

c -------------------------------------------------------------------- c
c             the chargino_k-sneutrino_tau1/2-tau couplings
c -------------------------------------------------------------------- c

      do k=1,2
         alsnt(1,k) = -v(k,1)
         alsnt(2,k) = 0.D0
         blsnt(1,k) = ytauc*u(k,2)
         blsnt(2,k) = 0.D0
      end do

c Feynman rule: ig*[alsnt(1/2,k)*P_L + blsnt(1/2,k)*P_R ]

c -------------------------------------------------------------------- c
c               the chargino_k-stop1/2-bottom couplings
c -------------------------------------------------------------------- c

      do k=1,2
         alsto(1,k) = -ct*V(k,1)+st*Ytc*V(k,2)
         alsto(2,k) =  st*V(k,1)+ct*Ytc*V(k,2)
         aksto(1,k) =  ct*Ybc*U(k,2)
         aksto(2,k) = -st*Ybc*U(k,2)
      enddo

c Feynman rule: ig*[alsto(1/2,k)*P_R+aksto(1/2,k)*P_L]
c outgoing chargino+, outgoing bottom-quark

c -------------------------------------------------------------------- c
c               the chargino_k-sbottom1/2-top couplings
c -------------------------------------------------------------------- c

      do k=1,2
         alsbo(1,k) = -cb*U(k,1)+sb*Ybc*U(k,2)
         alsbo(2,k) =  sb*U(k,1)+cb*Ybc*U(k,2)
         aksbo(1,k) =  cb*Ytc*V(k,2)
         aksbo(2,k) = -sb*Ytc*V(k,2)
      enddo

c Feynman rule: ig*[alsbo(1/2,k)*P_R+aksbo(1/2,k)*P_L]
c incoming chargino+, outgoing top-quark

c -------------------------------------------------------------------- c
c               the chargino_k-sup1/2-down couplings 
c -------------------------------------------------------------------- c

      do k=1,2
         alup(1,k) = -V(k,1)*cu
         alup(2,k) =  V(k,1)*su
      enddo

c Feynman rule: ig*[ alup(1/2,k)*P_R ] 

c -------------------------------------------------------------------- c
c               the chargino_k-sdown1/2-up couplings
c -------------------------------------------------------------------- c

      do k=1,2
         aldo(1,k) = -U(k,1)*cd
         aldo(2,k) =  U(k,1)*sd
      enddo

c Feynman rule: ig*[aldo(1/2,k)*P_R]

c -------------------------------------------------------------------- c
c             neutralino-selectronL/R-electron couplings
c -------------------------------------------------------------------- c

      do k=1,4
         ae(1,k) = ce*dsqrt(2.D0)*(zp(k,1)*sw+(0.5D0-sw**2)*
     .             zp(k,2)/cw)
         ae(2,k) = -se*dsqrt(2.D0)*(zp(k,1)*sw+(0.5D0-sw**2)*
     .             zp(k,2)/cw)
         be(1,k) = se*dsqrt(2.D0)*sw*(zp(k,2)*tw-zp(k,1))
         be(2,k) = ce*dsqrt(2.D0)*sw*(zp(k,2)*tw-zp(k,1))
      enddo

c Feynman rule: ig*[ ae(1/2,k)*P_R + be(1/2,k)*P_L ]

c -------------------------------------------------------------------- c
c                   neutralino_k-stau-tau couplings
c -------------------------------------------------------------------- c

      do k=1,4
         atau(1,k) = cl*dsqrt(2.D0)*(zp(k,1)*sw+(0.5D0-sw**2)*
     .               zp(k,2)/cw)-sl*ytauc*z(k,3)
         atau(2,k) = -sl*dsqrt(2.D0)*(zp(k,1)*sw+(0.5D0-sw**2)*
     .               zp(k,2)/cw)-cl*ytauc*z(k,3)
         btau(1,k) = sl*dsqrt(2.D0)*sw*(zp(k,2)*tw-zp(k,1))
     .               -cl*ytauc*z(k,3)
         btau(2,k) = cl*dsqrt(2.D0)*sw*(zp(k,2)*tw-zp(k,1))
     .               +sl*ytauc*z(k,3)	
      enddo

c Feynman rule: ig*[ atau(1/2,k)*P_R + btau(1/2,k)*P_L ] 

c -------------------------------------------------------------------- c
c             neutralino-sneutrino_e-neutrino_e couplings
c -------------------------------------------------------------------- c

      do k=1,4
         anu(1,k) = -zp(k,2)/dsqrt(2.D0)/cw
         anu(2,k) = 0.D0
         bnu(1,k) = 0.D0
         bnu(2,k) = 0.D0	
      enddo

c Feynman rule: ig*[ anu(2,k)*P_R + bnu(2,k)*P_L ]

c -------------------------------------------------------------------- c
c          neutralino-sneutrinotau1/2-neutrinotau couplings
c -------------------------------------------------------------------- c

      do k=1,4
         antau(1,k) = -zp(k,2)/dsqrt(2.D0)/cw
         antau(2,k) = 0.D0
         bntau(1,k) = 0.D0
         bntau(2,k) = 0.D0	
      enddo

c Feynman rule: ig*[ antau(1/2,k)*P_R + bntau(1/2,k)*P_L ]

c -------------------------------------------------------------------- c
c                the neutralino_k-stop1/2-top couplings
c -------------------------------------------------------------------- c

      do k=1,4
         atop(1,k) = ct*dsqrt(2.D0)*(-2.D0*zp(k,1)*sw/3.D0
     .               +(-0.5D0+2.D0/3.D0*sw**2)*zp(k,2)/cw)-st*ytc*z(k,4)
         atop(2,k) = -st*dsqrt(2.D0)*(-2.D0*zp(k,1)*sw/3.D0+(-0.5D0
     .               +2.D0/3.D0*sw**2)*zp(k,2)/cw)-ct*ytc*z(k,4)
         btop(1,k) = -2.D0*st*dsqrt(2.D0)*sw*(zp(k,2)*tw-zp(k,1))/3.D0
     .               -ct*ytc*z(k,4)
         btop(2,k) = -2.D0*ct*dsqrt(2.D0)*sw*(zp(k,2)*tw-zp(k,1))/3.D0
     .               +st*ytc*z(k,4)	
      enddo

c Feynman rule: ig*[ atop(1/2,k)*P_R + btop(1/2,k)*P_L ]

c -------------------------------------------------------------------- c
c              the neutralino_k-sbottom1/2-bottom couplings
c -------------------------------------------------------------------- c

      do k=1,4
         abo(1,k) = cb*dsqrt(2.D0)*(zp(k,1)*sw/3.D0+(0.5D0
     .              -1.d0/3.D0*sw**2)*zp(k,2)/cw)-sb*ybc*z(k,3)
         abo(2,k) = -sb*dsqrt(2.D0)*(zp(k,1)*sw/3.D0+(0.5D0
     .              -1.D0/3.D0*sw**2)*zp(k,2)/cw)-cb*ybc*z(k,3)
         bbo(1,k) = sb*dsqrt(2.D0)*sw*(zp(k,2)*tw-zp(k,1))/3.D0
     .              -cb*ybc*z(k,3)
         bbo(2,k) = cb*dsqrt(2.D0)*sw*(zp(k,2)*tw-zp(k,1))/3.D0
     .              +sb*ybc*z(k,3)	
      enddo

c Feynman rule: ig*[ abo(1/2,k)*P_R + bbo(1/2,k)*P_L ] 

c -------------------------------------------------------------------- c
c                   neutralino_k-sup1/2-up couplings
c -------------------------------------------------------------------- c

      do k=1,4
         aup(1,k) = -cu*dsqrt(2.D0)*(2.D0/3.D0*zp(k,1)*sw+(0.5D0
     .              -2.D0/3.D0*sw**2)*zp(k,2)/cw)
         aup(2,k) = -su*dsqrt(2.D0)*(-2.D0*zp(k,1)*sw/3.D0+
     .              (-0.5D0+2.D0/3.D0*sw**2)*zp(k,2)/cw)
         bup(1,k) = -2.D0*su*dsqrt(2.D0)*sw*(zp(k,2)*tw-
     .              zp(k,1))/3.D0
         bup(2,k) = -2.D0*cu*dsqrt(2.D0)*sw*(zp(k,2)*tw-
     .              zp(k,1))/3.D0
      enddo

c Feynman rule: ig*[ aup(1/2,k)*P_R + bup(1/2,k)*P_L ]

c -------------------------------------------------------------------- c
c                neutralino_k-sdown1/2-down couplings
c -------------------------------------------------------------------- c

      do k=1,4
         ado(1,k) = cd*dsqrt(2.D0)*(zp(k,1)*sw/3.D0+(0.5D0
     .              -1.D0/3.D0*sw**2)*zp(k,2)/cw)
         ado(2,k) = -sd*dsqrt(2.D0)*(zp(k,1)*sw/3.D0+(0.5D0
     .              -1.d0/3.D0*sw**2)*zp(k,2)/cw)
         bdo(1,k) = sd*dsqrt(2.D0)*sw*(zp(k,2)*tw-zp(k,1))/3.D0
         bdo(2,k) = cd*dsqrt(2.D0)*sw*(zp(k,2)*tw-zp(k,1))/3.D0
      enddo

c Feynman rule: ig*[ ado(1/2,k)*P_R + bdo(1/2,k)*P_L ]

c -------------------------------------------------------------------- c
c                   the Higgs-stop1-stop2 couplings
c -------------------------------------------------------------------- c

      bhlt12 = amz*dsin(2.D0*thet)/2.D0/cw*(-0.5D0+4.D0/3.D0*sw**2)*
     .         dsin(alp+bet)-amt*dcos(2.D0*thet)/2.D0/amw/dsin(bet)*
     .         (amu*dsin(alp)+autop*dcos(alp))

      bhlt11 = amz/cw*dsin(alp+bet)*(1.D0/2.D0*dcos(thet)**2-2.D0/3.D0*
     .        sw**2*dcos(2.D0*thet))-ytc**2*2.D0*amw*dsin(bet)*dcos(alp)
     .         -ytc/dsqrt(2.D0)*dsin(2.D0*thet)*(autop*dcos(alp)+
     .         amu*dsin(alp))

      bhlt22 = amz/cw*dsin(alp+bet)*(1.D0/2.D0*dsin(thet)**2+2.D0/3.D0*
     .        sw**2*dcos(2.D0*thet))-ytc**2*2.D0*amw*dsin(bet)*dcos(alp)
     .         +ytc/dsqrt(2.D0)*dsin(2.D0*thet)*(autop*dcos(alp)+
     .         amu*dsin(alp))

      bhht12 = -amz*dsin(2.D0*thet)/2.D0/cw*(-0.5D0+4.D0/3.D0*sw**2)*
     .         dcos(alp+bet)-amt*dcos(2.D0*thet)/2.D0/amw/dsin(bet)*
     .         (-amu*dcos(alp)+autop*dsin(alp))

      bhht11 = -amz/cw*dcos(alp+bet)*(1.D0/2.D0*dcos(thet)**2-2.D0/3.D0*
     .        sw**2*dcos(2.D0*thet))-ytc**2*2.D0*amw*dsin(alp)*dsin(bet)
     .         -ytc/dsqrt(2.D0)*dsin(2.D0*thet)*(autop*dsin(alp)-
     .         amu*dcos(alp))

      bhht22 = -amz/cw*dcos(alp+bet)*(1.D0/2.D0*dsin(thet)**2+2.D0/3.D0*
     .        sw**2*dcos(2.D0*thet))-ytc**2*2.D0*amw*dsin(alp)*dsin(bet)
     .         +ytc/dsqrt(2.D0)*dsin(2.D0*thet)*(autop*dsin(alp)-
     .         amu*dcos(alp))

      bat  = -amt/2.D0/amw*(autop/tgbet+amu)
      
      gltt(1,1) = bhlt11*amw/amz**2
      gltt(1,2) = bhlt12*amw/amz**2
      gltt(2,1) = gltt(1,2)
      gltt(2,2) = bhlt22*amw/amz**2

      ghtt(1,1) = bhht11*amw/amz**2
      ghtt(1,2) = bhht12*amw/amz**2
      ghtt(2,1) = ghtt(1,2)
      ghtt(2,2) = bhht22*amw/amz**2

      gatt      = bat*amw/amz**2

c Feynman rule: ig*amz**2/amw*gltt and ig*amz**2/amw*ghtt
c               -g*amz**2/amw*gatt stop1 in stop2 out
c               +g*amz**2/amw*gatt stop2 in stop1 out

c -------------------------------------------------------------------- c
c                the Higgs-sbottom1-sbottom2 couplings		
c -------------------------------------------------------------------- c

      bhlb12 = amz*dsin(2.D0*theb)/2.D0/cw*(0.5D0-2.D0/3.D0*sw**2)*
     .         dsin(alp+bet)+amb*dcos(2.D0*theb)/2.D0/amw/dcos(bet)*
     .         (amu*dcos(alp)+adbot*dsin(alp))

      bhlb11 = amz/cw*dsin(alp+bet)*(-1.D0/2.D0*dcos(theb)**2+1.D0/3.D0*
     .        sw**2*dcos(2.D0*theb))+ybc**2*2.D0*amw*dsin(alp)*dcos(bet)
     .         -ybc/dsqrt(2.D0)*dsin(2.D0*theb)*(-adbot*dsin(alp)
     .         -amu*dcos(alp))

      bhlb22 = amz/cw*dsin(alp+bet)*(-1.D0/2.D0*dsin(theb)**2-1.D0/3.D0*
     .        sw**2*dcos(2.D0*theb))+ybc**2*2.D0*amw*dsin(alp)*dcos(bet)
     .         +ybc/dsqrt(2.D0)*dsin(2.D0*theb)*(-adbot*dsin(alp)
     .         -amu*dcos(alp))

      bhhb12 = -amz*dsin(2.D0*theb)/2.D0/cw*(0.5D0-2.D0/3.D0*sw**2)*
     .         dcos(alp+bet)-amb*dcos(2.D0*theb)/2.D0/amw/dcos(bet)*
     .         (-amu*dsin(alp)+adbot*dcos(alp))

      bhhb11 = -amz/cw*dcos(alp+bet)*(-1.D0/2.D0*dcos(theb)**2+
     .         1.D0/3.D0*sw**2*dcos(2.D0*theb))
     .         -ybc**2*2.D0*amw*dcos(alp)*dcos(bet)
     .         -ybc/dsqrt(2.D0)*dsin(2.D0*theb)*(adbot*dcos(alp)-
     .         amu*dsin(alp))
      
      bhhb22 = -amz/cw*dcos(alp+bet)*(-1.D0/2.D0*dsin(theb)**2
     .         -1.D0/3.D0*sw**2*dcos(2.D0*theb))
     .         -ybc**2*2.D0*amw*dcos(alp)*dcos(bet)
     .         +ybc/dsqrt(2.D0)*dsin(2.D0*theb)*(adbot*dcos(alp)-
     .         amu*dsin(alp))

      bab  = -amb/2.D0/amw*(adbot*tgbet+amu)

      glbb(1,1) = bhlb11*amw/amz**2
      glbb(1,2) = bhlb12*amw/amz**2
      glbb(2,1) = glbb(1,2)
      glbb(2,2) = bhlb22*amw/amz**2

      ghbb(1,1) = bhhb11*amw/amz**2
      ghbb(1,2) = bhhb12*amw/amz**2
      ghbb(2,1) = ghbb(1,2)
      ghbb(2,2) = bhhb22*amw/amz**2

      gabb      = bab*amw/amz**2

c Feynman rule: ig*amz**2/amw*glbb and ig*amz**2/amw*ghbb
c               -g*amz**2/amw*gabb sbottom1 in sbottom2 out
c               +g*amz**2/amw*gabb sbottom2 in sbottom1 out

c -------------------------------------------------------------------- c
c               H+ - stop1/2 - sbottom1/2 couplings
c -------------------------------------------------------------------- c

      s11 = 1.D0/dsqrt(2.D0)/amw*(amb**2*tgbet+amt**2/tgbet-amw**2*
     .      dsin(2.D0*bet))
      s12 = amb/dsqrt(2.D0)/amw*(adbot*tgbet+amu)
      s21 = amt/dsqrt(2.D0)/amw*(autop/tgbet+amu)
      s22 = 1.D0/dsqrt(2.D0)/amw*amb*amt*(1.D0/tgbet+tgbet)
	
      chctb(1,1) = (-ct*cb*s11-st*sb*s22-ct*sb*s12-st*cb*s21)
      chctb(1,2) = (ct*sb*s11-ct*cb*s12+sb*st*s21-st*cb*s22)
      chctb(2,1) = (st*cb*s11+st*sb*s12-ct*cb*s21-ct*sb*s22)
      chctb(2,2) = (-st*sb*s11+st*cb*s12+ct*sb*s21-ct*cb*s22)

      gctb(1,1) = chctb(1,1)/amw
      gctb(1,2) = chctb(1,2)/amw	
      gctb(2,1) = chctb(2,1)/amw
      gctb(2,2) = chctb(2,2)/amw

c Feynman rule: -ig*mw*gctb(i,j)
c chctb(1,2) is for stop1-sbottom2

c -------------------------------------------------------------------- c
c                          coupling H+-f-f'
c -------------------------------------------------------------------- c

      chctbr    = ybc*dsin(bet)
      chctbl    = ytc*dcos(bet)
      chctaunur = ytauc*dsin(bet)
      chctaunul = 0.D0

c Feynman rule: ie*(chctbr*pro(+1)+chctbl*pro(-1))  
c up-type out, down-type in 

      vchtau = -ytauc/2.D0*dsin(bet)
      achtau = -vchtau

      vchtop = -ybc/2.D0*dsin(bet)-ytc/2.D0*dcos(bet)
      achtop = ybc/2.D0*dsin(bet)-ytc/2.D0*dcos(bet)

c Feynman rule (H+ incoming) ig*[-vch+ach*g_5]
c Feynman rule (H- incoming) ig*[-vch-ach*g_5]

c -------------------------------------------------------------------- c
c                         Z-fermion-antifermion
c -------------------------------------------------------------------- c
      
      czttl     = 0.5D0*(1-4.D0/3.D0*sw**2)
      czttr     = 0.5D0*(-4.D0/3.D0*sw**2)
      czbbl     = 0.5D0*(-1+2.D0/3.D0*sw**2)
      czbbr     = 0.5d0*(2.D0/3.D0*sw**2)
      cztautaul = 0.5D0*(-1+2.D0*sw**2)
      cztautaur = 0.5D0*(2.D0*sw**2)
      cznunul   = 0.5D0
      cznunur   = 0.D0

c Feynman rule -ig*gamma_mu/costheta_W*[czffr*P_R+czffl*P_L]

      azztoptop   = 1.D0/4.D0/cw
      vzztoptop   = (1.D0-8.D0/3.D0*sw**2)/4.D0/cw

      azzbotbot   =  -1.D0/4.D0/cw
      vzzbotbot   = (-1.D0+4.D0/3.D0*sw**2)/4.D0/cw

      azztautau   =  -1.D0/4.D0/cw
      vzztautau   = (-1.D0+4.D0*sw**2)/4.D0/cw

      azzneutneut = 1.D0/4.D0/cw
      vzzneutneut = 1.D0/4.D0/cw

c Feynman rule: -i*g*g_mu*(vzz*1-azz*g_5)

c -------------------------------------------------------------------- c
c                      W fermion fermion coupling
c -------------------------------------------------------------------- c

      vwff = 1/2.D0/dsqrt(2.D0)
      awff = vwff

c Feynman rule: -i*g*g_mu*(vwff*1-vwff*g_5)

c -------------------------------------------------------------------- c
c                      Z-stop_i-stop_j coupling
c -------------------------------------------------------------------- c

      aztt11 = ct**2-4.D0/3.D0*sw**2
      aztt12 = -st*ct
      aztt21 = -st*ct
      aztt22 = st**2-4.D0/3.D0*sw**2

      gztt(1,1) = aztt11
      gztt(1,2) = aztt12
      gztt(2,1) = aztt21
      gztt(2,2) = aztt22

c Feynman rule: -ig*/2/cos_thetaW*gztt(i,j)*[p1(mu)+p2(mu)]
c p1(mu) incoming, p2(mu) outgoing

c -------------------------------------------------------------------- c
c                  Z-sbottom_i-sbottom_j coupling
c -------------------------------------------------------------------- c

      azbb11 = -cb**2+2.D0/3.D0*sw**2
      azbb12 = sb*cb
      azbb21 = sb*cb
      azbb22 = -sb**2+2.D0/3.D0*sw**2

      gzbb(1,1) = azbb11
      gzbb(1,2) = azbb12
      gzbb(2,1) = azbb21
      gzbb(2,2) = azbb22

c Feynman rule: -ig*/2/cos_thetaW*gzbb(i,j)*[p1(mu)+p2(mu)]

c -------------------------------------------------------------------- c
c                       Z-stau_i-stau_j coupling
c -------------------------------------------------------------------- c

      aztautau11 = -cl**2+2.D0*sw**2
      aztautau12 = sl*cl
      aztautau21 = sl*cl
      aztautau22 = -sl**2+2.D0*sw**2

      gztautau(1,1) = aztautau11
      gztautau(1,2) = aztautau12
      gztautau(2,1) = aztautau21
      gztautau(2,2) = aztautau22

c Feynman rule: -ig*/2/cos_thetaW*gztautau(i,j)*[p1(mu)+p2(mu)]

c -------------------------------------------------------------------- c
c                   W-stop_i-sbottom_j coupling
c -------------------------------------------------------------------- c

      gwtb(1,1) = cb*ct
      gwtb(1,2) = -(sb*ct)
      gwtb(2,1) = -(cb*st)
      gwtb(2,2) = sb*st

c Feynman rule: -ig/dsqrt(2)*gwtb(i,j)*[p1(mu)+p2(mu)]
c gwtb(1,2) corresponds to W-stop1-sbottom2
c i with p1(mu) in, j with p2(mu) out

c -------------------------------------------------------------------- c
c                    W-sneutrino_taui-stau_j coupling
c -------------------------------------------------------------------- c

      cn = 1.D0
      sn = 0.D0

      gwntau(1,1) = cl*cn
      gwntau(1,2) = -(sl*cn)
      gwntau(2,1) = -(cl*sn)
      gwntau(2,2) = sl*sn

c Feynman rule: -ig/dsqrt(2)*gwntau(i,j)*[p1(mu)+p2(mu)]
c gwntau(1,2) corresponds to W-sneutrino_tau1-stau2
c i with p1(mu) in, j with p2(mu) out

c -------------------------------------------------------------------- c
c                      gluino-up-sup couplings
c -------------------------------------------------------------------- c
 
      gur(1) = su
      gur(2) = cu
      gul(1) = -cu
      gul(2) = su

c Feynman rule: ig_s*t_ij*sqrt(2)*[gur(i)*P_L+gul(i)*P_R]
c incoming gluino, outgoing quark

c -------------------------------------------------------------------- c
c                    gluino-down-sdown couplings
c -------------------------------------------------------------------- c

      gdr(1) =  sd
      gdr(2) =  cd
      gdl(1) =  -cd
      gdl(2) =  sd

c Feynman rule: ig_s*t_ij*sqrt(2)*[gdr(i)*P_L+gdl(i)*P_R]
c incoming gluino, outgoing quark

c -------------------------------------------------------------------- c
c                     gluino-top-stop couplings
c -------------------------------------------------------------------- c

      gtr(1) = st
      gtr(2) = ct
      gtl(1) = -ct
      gtl(2) = st

c Feynman rule: ig_s*t_ij*sqrt(2)*[gtr(i)*P_L+gtl(i)*P_R]
c incoming gluino, outgoing quark

c -------------------------------------------------------------------- c
c	         the gluino-bottom-sbottom couplings
c -------------------------------------------------------------------- c

      gbr(1) = sb
      gbr(2) = cb
      gbl(1) = -cb
      gbl(2) = sb

c Feynman rule: ig_s*t_ij*sqrt(2)*[gbr(i)*P_L+gbl(i)*P_R]
c incoming gluino, outgoing quark

      end

c -------------------------------------------------------------------- c
c --------------------- scale dependent couplings -------------------- c
c -------------------------------------------------------------------- c

      double precision function SD_alphascall(scale,loopnum)

      implicit double precision (a-h,m,o-z)

      COMMON/SD_fermion/amt0,amb0,amtau0
      COMMON/SD_als/xlambda,amc,amb,amt,n0
      COMMON/SD_strangecharm/sams,amc0
      COMMON/SD_scheme/idrbar
      COMMON/SD_coupewsb/alsew,g2ew,g1ew
      COMMON/SD_refscale/amuref
      COMMON/SD_alspar/iparals
      COMMON/SD_outparam/salpha_MS,alphasmzms
      COMMON/SD_mwmzpole/amwp,amzp

      external SD_alphas

      pi = 4.D0*datan(1.D0) 

      amc = amc0
      amb = amb0
      amt = amt0

      if(iparals.eq.0) then
         alsewsb_drbar = alsew
         amewsb        = amuref
         if(idrbar.eq.1) then
            alsewsb = alsewsb_drbar
         else
            alsewsb_msbar = alsewsb_drbar / (1+alsewsb_drbar/4/pi)
            alsewsb = alsewsb_msbar
         endif
      elseif(iparals.eq.1) then
         alsewsb_drbar = alphasmzms/(1.D0-alphasmzms/4.D0/pi)
         amewsb        = amzp
         if(idrbar.eq.1) then
            alsewsb = alsewsb_drbar
         else
            alsewsb_msbar = alphasmzms
            alsewsb = alsewsb_msbar
         endif   
      endif

      if(amewsb.ge.amt0) then
         n0 = 6
      else
         n0 = 5
      endif
      acc  = 1.d-10
      loop = loopnum

      xlambda = SD_xitla(amewsb,n0,loop,alsewsb,acc)
      call SD_alsini(acc)

      SD_alphascall = SD_alphas(scale,loop)

      end

c -------------------------------------------------------------------- c

      subroutine SD_runmass(amdec,amfin,xval,runmb,runmt)

      implicit double precision (a-h,m,o-z)

      COMMON/SD_qcdflag/idrflagsd
      COMMON/SD_fermion/amt0,amb0,amtau0
      COMMON/SD_strangecharm/amsb,amc0
      COMMON/SD_als/xlambda,amc,amb,amt,n0
      COMMON/SD_runcoupscale/scalechoice,scaleofcoupling,inumloop
      COMMON/SD_scheme/idrbar
      COMMON/SD_coupewsb/alsew,g2ew,g1ew
      COMMON/SD_refscale/amuref

      pi = 4.D0*datan(1.D0) 

      amc = amc0
      amb = amb0
      amt = amt0

      idrflagsd     = idrbar
      alsewsb_drbar = alsew
      amewsb        = amuref

      if(idrbar.eq.1) then
         alsewsb = alsewsb_drbar
      else
         alsewsb_msbar = alsewsb_drbar / (1+alsewsb_drbar/4/pi)
         alsewsb = alsewsb_msbar
      endif

      if(amewsb.ge.amt0) then
         n0 = 6
      else
         n0 = 5
      endif
      acc  = 1.d-10
      loop = inumloop

      xlambda = SD_xitla(amewsb,n0,loop,alsewsb,acc)

      call SD_alsini(acc)

      qsc = dsqrt(amdec**2*(1.D0-xval+amfin**2/amdec**2))

      runmb = SD_runm(qsc,5)
      runmt = SD_runm(qsc,6)

      end

c -------------------------------------------------------------------- c
c The following routines and functions SD_xitla, SD_runm, SD_alphas,   c
c SD_alsini, SD_xiter are taken from HDECAY                            c
c The function SD_runm has been changed in order to enable the         c
c calculation of mbpole from mb(mb)_MSbar                              c
c -------------------------------------------------------------------- c

      double precision function SD_xitla(q,nf,no,alp,acc)
c--iteration routine to determine improved lambda's
      implicit double precision (a-h,o-z)
      b0(nf)=33.d0-2.d0*nf
      b1(nf)=6.d0*(153.d0-19.d0*nf)/b0(nf)**2
      als2(nf,x,xlb)=12.d0*pi/(b0(nf)*dlog(x**2/xlb**2))
     .              *(1.d0-b1(nf)*dlog(dlog(x**2/xlb**2))
     .              /dlog(x**2/xlb**2))
      aa(nf)=12d0*pi/b0(nf)
      bb(nf)=b1(nf)/aa(nf)
      xit(a,b,x)=a/2.d0*(1d0+dsqrt(1d0-4d0*b*dlog(x)))
      pi=4.d0*datan(1.d0)

C     nf=5
      xlb=q*dexp(-aa(nf)/alp/2.d0)
      if(no.eq.1)goto 111
      ii=0
1     ii=ii+1
      x=dlog(q**2/xlb**2)
      a=aa(nf)/alp
      b=bb(nf)*alp
      xx=xit(a,b,x)
      xlb=q*dexp(-xx/2.d0)
      y1=alp
      y2=als2(nf,q,xlb)
      dy=dabs(y2-y1)/y1
      if(dy.ge.acc) goto 1
111   SD_xitla=xlb
      return
      end

c -------------------------------------------------------------------- c

      double precision function SD_runm(q,nf)
      implicit double precision (a-h,m,o-z)
      parameter (nn=6)
      parameter (zeta3 = 1.202056903159594d0)
      dimension am(nn),ymsb(nn)

      COMMON/SD_als/xlambda,amca,amba,amta,n0a
      COMMON/SD_fermion/amt,amb,amtau
      COMMON/SD_strangecharm/amsb,amc
      COMMON/SD_qcdflag/idrflag
c maggie added 04/01/04
      COMMON/SD_mbmb/sd_mbmb,i_sd_mbmb
      COMMON/SD_mbpoleflag/idrmbpole
c end maggie added 04/01/04

      save istrange
      b0(nf)=(33.d0-2.d0*nf)/12d0
      b1(nf) = (102d0-38d0/3d0*nf)/16d0
      b2(nf) = (2857d0/2d0-5033d0/18d0*nf+325d0/54d0*nf**2)/64d0
      g0(nf) = 1d0
      g1(nf) = (202d0/3d0-20d0/9d0*nf)/16d0
      g2(nf) = (1249d0-(2216d0/27d0+160d0/3d0*zeta3)*nf
     .       - 140d0/81d0*nf**2)/64d0
      c1(nf) = g1(nf)/b0(nf) - b1(nf)*g0(nf)/b0(nf)**2
      c2(nf) = ((g1(nf)/b0(nf) - b1(nf)*g0(nf)/b0(nf)**2)**2
     .       + g2(nf)/b0(nf) + b1(nf)**2*g0(nf)/b0(nf)**3
     .       - b1(nf)*g1(nf)/b0(nf)**2 - b2(nf)*g0(nf)/b0(nf)**2)/2d0
C>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
C     c1(nf) = 1.175D0
C     c2(nf) = 1.501D0
C>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
c maggie question 04/01/04: Can I add the coeff3?
      tran(x,xk)=1d0+coeff1*SD_alphas(x,2)/pi
     .              +xk*(SD_alphas(x,2)/pi)**2
     .              +coeff3*(SD_alphas(x,2)/pi)**3
      cq(x,nf)=(2d0*b0(nf)*x)**(g0(nf)/b0(nf))
     .            *(1d0+c1(nf)*x+c2(nf)*x**2)
      data istrange/0/
      pi=4d0*datan(1d0)
      acc = 1.d-8

c maggie added 04/01/04
      if(i_sd_mbmb.eq.0) then
         idr = idrmbpole
      else
         idr = idrflag
      endif
c end maggie added 04/01/04

      if(idr.ne.1) then
       coeff1 = 4D0/3D0
      else
       coeff1 = 5D0/3D0
      endif
      coeff3=101.45424d0
c     coeff3 = 0.D0
      am(1) = 0
      am(2) = 0
c -------------------------------------------- c
      nnlo = 1
      imsbar = 0
      if(imsbar.eq.1)then
       if(istrange.eq.0)then
c -- strange pole mass from msbar-mass at 1 GeV
        amsd = xlambda
        amsu = 1.d8
123     ams  = (amsu+amsd)/2
        am(3) = ams
        xmsb = ams/cq(SD_alphas(ams,2)/pi,3)
     .            *cq(SD_alphas(1.d0,2)/pi,3)/tran(ams,0d0)
        dd = (xmsb-amsb)/amsb
        if(dabs(dd).ge.acc)then
         if(dd.le.0.d0)then
          amsd = am(3)
         else
          amsu = am(3)
         endif
         goto 123
        endif
        istrange=1
       endif
       am(3) = amsb
      else
       ams=amsb
       am(3) = ams
      endif

c--------------------------------------------------------------------- c
c-!! modifs jlk: to determine (perturbatively, at an order consistent
c with the pert. level used in RUNM) Mb(pole) from mb(mb)_MSbar input:
c    mbmb= mb(mb)_MSbar ; MPpole determined iteratively to acc. d-8
      if(i_sd_mbmb.eq.0) then
c i_sd_mbmb is just a counter because this calculation is only needed 
c once 
         do i=1,20
            if(i.eq.1) then
               mbsave=0.d0
               MBpole=sd_mbmb
            endif
            xkb= 16.11d0 -1.04d0*(4.d0-(amsb+amc)/MBpole)
            if(i.ge.3) then 
               amba=mbpole
               call SD_alsini(1.d-8)
            endif
            mbMBpole=sd_mbmb*
     .           CQ(SD_alphas(MBpole,2)/pi,4)
     .           /CQ(SD_alphas(sd_mbmb,2)/pi,4)
c  mbMPpole is mb(MBpole)
            MBpole= mbMBpole*tran(MBpole,xkb)
c tran(Q,xk) is the usual pert. relation between Mpole and mrun(Mpole),
c see its def. above
            if(dabs(1.d0-mbsave/MBpole).lt.1.d-8) goto 2
            mbsave=MBpole
         enddo
 2       AMB=MBpole
c     write(*,*)'last iter, mbpole: ',i,mbpole
         i_sd_mbmb=1
      endif
c rest of calculation follows as before: 
c--------------------------------------------------------------------- c

      am(3) = amsb
      am(4) = amc
      am(5) = amb
      am(6) = amt
      xk = 16.11d0
      do 1 i=1,nf-1
       xk = xk - 1.04d0*(1.d0-am(i)/am(nf))
1     continue
      if(nf.ge.4)then
       xmsb = am(nf)/tran(am(nf),0d0)
       xmhat = xmsb/cq(SD_alphas(am(nf),2)/pi,nf)
      else
       xmsb = 0
       xmhat = 0
      endif
      ymsb(3) = amsb
      if(nf.eq.3)then
       ymsb(4) = ymsb(3)*cq(SD_alphas(am(4),2)/pi,3)/
     .                   cq(SD_alphas(1.d0,2)/pi,3)
       ymsb(5) = ymsb(4)*cq(SD_alphas(am(5),2)/pi,4)/
     .                   cq(SD_alphas(am(4),2)/pi,4)
       ymsb(6) = ymsb(5)*cq(SD_alphas(am(6),2)/pi,5)/
     .                   cq(SD_alphas(am(5),2)/pi,5)
      elseif(nf.eq.4)then
       ymsb(4) = xmsb
       ymsb(5) = ymsb(4)*cq(SD_alphas(am(5),2)/pi,4)/
     .                   cq(SD_alphas(am(4),2)/pi,4)
       ymsb(6) = ymsb(5)*cq(SD_alphas(am(6),2)/pi,5)/
     .                   cq(SD_alphas(am(5),2)/pi,5)
      elseif(nf.eq.5)then
       ymsb(5) = xmsb
       ymsb(4) = ymsb(5)*cq(SD_alphas(am(4),2)/pi,4)/
     .                   cq(SD_alphas(am(5),2)/pi,4)
       ymsb(6) = ymsb(5)*cq(SD_alphas(am(6),2)/pi,5)/
     .                   cq(SD_alphas(am(5),2)/pi,5)
      elseif(nf.eq.6)then
       ymsb(6) = xmsb
       ymsb(5) = ymsb(6)*cq(SD_alphas(am(5),2)/pi,5)/
     .                   cq(SD_alphas(am(6),2)/pi,5)
       ymsb(4) = ymsb(5)*cq(SD_alphas(am(4),2)/pi,4)/
     .                   cq(SD_alphas(am(5),2)/pi,4)
      endif
      if(q.lt.amc)then
       n0=3
       q0 = 1.d0
      elseif(q.le.amb)then
       n0=4
       q0 = amc
      elseif(q.le.amt)then
       n0=5
       q0 = amb
      else
       n0=6
       q0 = amt
      endif
      if(nnlo.eq.1.and.nf.gt.3)then
       xkfac = tran(am(nf),0d0)/tran(am(nf),xk)
      else
       xkfac = 1d0
      endif
      SD_runm = ymsb(n0)*cq(SD_alphas(q,2)/pi,n0)/
     .               cq(SD_alphas(q0,2)/pi,n0)
     .       * xkfac
      return
      end

c -------------------------------------------------------------------- c

      double precision function SD_alphas(q,n)
      implicit double precision (a-h,o-z)
      dimension xlb(6)

      COMMON/SD_alslam/xlb1(6),xlb2(6)
      COMMON/SD_als/xlambda,amc,amb,amt,n0
      b0(nf)=33.d0-2.d0*nf
      b1(nf)=6.d0*(153.d0-19.d0*nf)/b0(nf)**2
      als1(nf,x)=12.d0*pi/(b0(nf)*dlog(x**2/xlb(nf)**2))
      als2(nf,x)=12.d0*pi/(b0(nf)*dlog(x**2/xlb(nf)**2))
     .          *(1.d0-b1(nf)*dlog(dlog(x**2/xlb(nf)**2))
     .           /dlog(x**2/xlb(nf)**2))

      pi=4.d0*datan(1.d0)
      if(n.eq.1)then
       do 1 i=1,6
        xlb(i)=xlb1(i)
1      continue
      else
       do 2 i=1,6
        xlb(i)=xlb2(i)
2      continue
      endif
      if(q.lt.amc)then
       nf=3
      elseif(q.le.amb)then
       nf=4
      elseif(q.le.amt)then
       nf=5
      else
       nf=6
      endif
      if(n.eq.1)then
        SD_alphas=als1(nf,q)
      else
        SD_alphas=als2(nf,q)
      endif
      return
      end

c -------------------------------------------------------------------- c

      subroutine SD_alsini(acc)
      implicit double precision (a-h,o-z)
      dimension xlb(6)

      COMMON/SD_alslam/xlb1(6),xlb2(6)
      COMMON/SD_als/xlambda,amc,amb,amt,n0

      xlb1(1)=0d0
      xlb1(2)=0d0
      xlb2(1)=0d0
      xlb2(2)=0d0

      if(n0.eq.3)then
       xlb(3)=xlambda
       xlb(4)=xlb(3)*(xlb(3)/amc)**(2.d0/25.d0)
       xlb(5)=xlb(4)*(xlb(4)/amb)**(2.d0/23.d0)
       xlb(6)=xlb(5)*(xlb(5)/amt)**(2.d0/21.d0)
      elseif(n0.eq.4)then
       xlb(4)=xlambda
       xlb(5)=xlb(4)*(xlb(4)/amb)**(2.d0/23.d0)
       xlb(3)=xlb(4)*(xlb(4)/amc)**(-2.d0/27.d0)
       xlb(6)=xlb(5)*(xlb(5)/amt)**(2.d0/21.d0)
      elseif(n0.eq.5)then
       xlb(5)=xlambda
       xlb(4)=xlb(5)*(xlb(5)/amb)**(-2.d0/25.d0)
       xlb(3)=xlb(4)*(xlb(4)/amc)**(-2.d0/27.d0)
       xlb(6)=xlb(5)*(xlb(5)/amt)**(2.d0/21.d0)
      elseif(n0.eq.6)then
       xlb(6)=xlambda
       xlb(5)=xlb(6)*(xlb(6)/amt)**(-2.d0/23.d0)
       xlb(4)=xlb(5)*(xlb(5)/amb)**(-2.d0/25.d0)
       xlb(3)=xlb(4)*(xlb(4)/amc)**(-2.d0/27.d0)
      endif
      do 1 i=1,6
       xlb1(i)=xlb(i)
1     continue

      if(n0.eq.3)then
       xlb(3)=xlambda
       xlb(4)=xlb(3)*(xlb(3)/amc)**(2.d0/25.d0)
     .             *(2.d0*dlog(amc/xlb(3)))**(-107.d0/1875.d0)
       xlb(4)=SD_xiter(amc,xlb(3),3,xlb(4),4,acc)
       xlb(5)=xlb(4)*(xlb(4)/amb)**(2.d0/23.d0)
     .             *(2.d0*dlog(amb/xlb(4)))**(-963.d0/13225.d0)
       xlb(5)=SD_xiter(amb,xlb(4),4,xlb(5),5,acc)
       xlb(6)=xlb(5)*(xlb(5)/amt)**(2.d0/21.d0)
     .            *(2.d0*dlog(amt/xlb(5)))**(-321.d0/3381.d0)
       xlb(6)=SD_xiter(amt,xlb(5),5,xlb(6),6,acc)
      elseif(n0.eq.4)then
       xlb(4)=xlambda
       xlb(5)=xlb(4)*(xlb(4)/amb)**(2.d0/23.d0)
     .             *(2.d0*dlog(amb/xlb(4)))**(-963.d0/13225.d0)
       xlb(5)=SD_xiter(amb,xlb(4),4,xlb(5),5,acc)
       xlb(3)=xlb(4)*(xlb(4)/amc)**(-2.d0/27.d0)
     .             *(2.d0*dlog(amc/xlb(4)))**(107.d0/2025.d0)
       xlb(3)=SD_xiter(amc,xlb(4),4,xlb(3),3,acc)
       xlb(6)=xlb(5)*(xlb(5)/amt)**(2.d0/21.d0)
     .            *(2.d0*dlog(amt/xlb(5)))**(-321.d0/3381.d0)
       xlb(6)=SD_xiter(amt,xlb(5),5,xlb(6),6,acc)
      elseif(n0.eq.5)then
       xlb(5)=xlambda
       xlb(4)=xlb(5)*(xlb(5)/amb)**(-2.d0/25.d0)
     .             *(2.d0*dlog(amb/xlb(5)))**(963.d0/14375.d0)
       xlb(4)=SD_xiter(amb,xlb(5),5,xlb(4),4,acc)
       xlb(3)=xlb(4)*(xlb(4)/amc)**(-2.d0/27.d0)
     .             *(2.d0*dlog(amc/xlb(4)))**(107.d0/2025.d0)
       xlb(3)=SD_xiter(amc,xlb(4),4,xlb(3),3,acc)
       xlb(6)=xlb(5)*(xlb(5)/amt)**(2.d0/21.d0)
     .            *(2.d0*dlog(amt/xlb(5)))**(-321.d0/3381.d0)
       xlb(6)=SD_xiter(amt,xlb(5),5,xlb(6),6,acc)
      elseif(n0.eq.6)then
       xlb(6)=xlambda
       xlb(5)=xlb(6)*(xlb(6)/amt)**(-2.d0/23.d0)
     .            *(2.d0*dlog(amt/xlb(6)))**(321.d0/3703.d0)
       xlb(5)=SD_xiter(amt,xlb(6),6,xlb(5),5,acc)
       xlb(4)=xlb(5)*(xlb(5)/amb)**(-2.d0/25.d0)
     .             *(2.d0*dlog(amb/xlb(5)))**(963.d0/14375.d0)
       xlb(4)=SD_xiter(amb,xlb(5),5,xlb(4),4,acc)
       xlb(3)=xlb(4)*(xlb(4)/amc)**(-2.d0/27.d0)
     .             *(2.d0*dlog(amc/xlb(4)))**(107.d0/2025.d0)
       xlb(3)=SD_xiter(amc,xlb(4),4,xlb(3),3,acc)
      endif
      do 2 i=1,6
       xlb2(i)=xlb(i)
2     continue

      return
      end

c -------------------------------------------------------------------- c

      double precision function SD_xiter(q,xlb1,nf1,xlb,nf2,acc)
      implicit double precision (a-h,o-z)
      b0(nf)=33.d0-2.d0*nf
      b1(nf)=6.d0*(153.d0-19.d0*nf)/b0(nf)**2
      als2(nf,x,xlb)=12.d0*pi/(b0(nf)*dlog(x**2/xlb**2))
     .              *(1.d0-b1(nf)*dlog(dlog(x**2/xlb**2))
     .              /dlog(x**2/xlb**2))
      aa(nf)=12d0*pi/b0(nf)
      bb(nf)=b1(nf)/aa(nf)
      xit(a,b,x)=a/2.d0*(1d0+dsqrt(1d0-4d0*b*dlog(x)))
      pi=4.d0*datan(1.d0)
      xlb2=xlb
      ii=0
1     ii=ii+1
      x=dlog(q**2/xlb2**2)
      alp=als2(nf1,q,xlb1)
      a=aa(nf2)/alp
      b=bb(nf2)*alp
      xx=xit(a,b,x)
      xlb2=q*dexp(-xx/2.d0)
      y1=als2(nf1,q,xlb1)
      y2=als2(nf2,q,xlb2)
      dy=dabs(y2-y1)/y1
      if(dy.ge.acc) goto 1
      SD_xiter=xlb2
      return
      end

c -------------------------------------------------------------------- c

      double precision function SD_yuk(i,q)

      implicit double precision (a-h,o-z)
      
      COMMON/SD_param/sdgf,amz,amw,pi,g2
      COMMON/SD_mixang/alp_mssm,tanbeta

      bet=datan(tanbeta)

      if(i.eq.1) then
         SD_yuk = q/(dsqrt(2.D0)*amw*dsin(bet))
      elseif(i.eq.2) then
         SD_yuk = q/(dsqrt(2.D0)*amw*dcos(bet))
      endif

      return 

      end

c -------------------------------------------------------------------- c
c                    The H+-topbar-bottom coupling                     c
c -------------------------------------------------------------------- c
c Feynman rule: ig*(-vchtopr+achtopr*g5)
c top out, bottom in

      subroutine SD_hctopbbot(vchtopr,achtopr)

      implicit double precision (a-h,m,o-z)

      COMMON/SD_mixang/alp_mssm,tanbeta
      COMMON/SD_scala/scalb,scalt

      bet=datan(tanbeta)

      cb = dcos(bet)
      sb = dsin(bet)

      vchtopr = -scalb/2.D0*sb-scalt/2.D0*cb
      achtopr = scalb/2.D0*sb-scalt/2.D0*cb

      end

c -------------------------------------------------------------------- c
c                     The H+-topbar-bottom coupling                    c
c -------------------------------------------------------------------- c
c Feynman rule: ie/sw*(chtbrunr*pro(+1)+chtbrunl*pro(-1))
c up out, down in 

      subroutine SD_higgschudb(chtbrunr,chtbrunl)

      implicit double precision (a-h,o-z)

      COMMON/SD_mixang/alp_mssm,tanbeta
      COMMON/SD_scala/scalb,scalt

      bet=datan(tanbeta)

      cb = dcos(bet)
      sb = dsin(bet)

      chtbrunr = scalb*sb
      chtbrunl = scalt*cb

      end 

c -------------------------------------------------------------------- c
c                    The h/H/A-top-topbar couplings                    c
c -------------------------------------------------------------------- c

      subroutine SD_phitoptop(hlttr,hhttr,hattr)

      implicit double precision (a-h,m,o-z)

      COMMON/SD_mixang/a,tanbeta
      COMMON/SD_scala/scalb,scalt

      bet=datan(tanbeta)

      hlttr = scalt*dcos(a)
      hhttr = scalt*dsin(a)
      hattr = -scalt*dcos(bet)

      end

c -------------------------------------------------------------------- c
c                       The h/H/A-b-bbar couplings                     c
c -------------------------------------------------------------------- c

      subroutine SD_phibotbot(hlbbr,hhbbr,habbr)

      implicit double precision (a-h,o-z)

      COMMON/SD_mixang/a,tanbeta
      COMMON/SD_scala/scalb,scalt

      bet=datan(tanbeta)

      hlbbr = scalb*(-dsin(a))
      hhbbr = scalb*dcos(a)
      habbr = -scalb*dsin(bet)

      end

c -------------------------------------------------------------------- c
c                  the chargino_k-sbottom1/2-top couplings             c
c -------------------------------------------------------------------- c
c Feynman rule: ig*[alsbot(1/2,k)*P_R+aksbot(1/2,k)*P_L]
c outgoing chargino+, outgoing top-quark

      subroutine SD_charsbottop(alsbot,aksbot)

      implicit double precision (a-h,m,o-z)

      dimension alsbot(2,2),aksbot(2,2)
      dimension u(2,2),v(2,2),z(4,4),zp(4,4)

      COMMON/SD_mixmat/u,v,z,zp
      COMMON/SD_scala/scalb,scalt
      COMMON/SD_sfmixang/thet,theb,thel,cu,su,cd,sd,ce,se

      cb = dcos(theb)
      sb = dsin(theb)

      do k=1,2
         alsbot(1,k)=-cb*U(k,1)+sb*scalb*U(k,2)
         alsbot(2,k)= sb*U(k,1)+cb*scalb*U(k,2)
         aksbot(1,k)=cb*scalt*V(k,2)
         aksbot(2,k)= -sb*scalt*V(k,2)
      enddo

      end

c -------------------------------------------------------------------- c
c               the chargino_k-stop1/2-bottom couplings                c
c -------------------------------------------------------------------- c
c Feynman rule: ig*[alstor(1/2,k)*P_R+akstor(1/2,k)*P_L]
c outgoing chargino+, outgoing bottom-quark

      subroutine SD_charstopbot(alstor,akstor)

      implicit double precision (a-h,m,o-z)

      dimension alstor(2,2),akstor(2,2)
      dimension u(2,2),v(2,2),z(4,4),zp(4,4)

      COMMON/SD_mixmat/u,v,z,zp
      COMMON/SD_scala/scalb,scalt
      COMMON/SD_sfmixang/thet,theb,thel,cu,su,cd,sd,ce,se

      ct = dcos(thet)
      st = dsin(thet)

      do k=1,2
         alstor(1,k)=-ct*V(k,1)+st*scalt*V(k,2)
         alstor(2,k)= st*V(k,1)+ct*scalt*V(k,2)
         akstor(1,k)=ct*scalb*U(k,2)
         akstor(2,k)= -st*scalb*U(k,2)
      enddo

      end

c -------------------------------------------------------------------- c
c              neutralino_k-sbottom1/2-bottom couplings                c
c -------------------------------------------------------------------- c
c Feynman rule: ig*[ abot(1/2,k)*P_R + bbot(1/2,k)*P_L ] 

      subroutine SD_neutsbotbot(abot,bbot)

      implicit double precision (a-h,m,o-z)

      dimension abot(2,4),bbot(2,4)
      dimension u(2,2),v(2,2),z(4,4),zp(4,4)

      COMMON/SD_mixmat/u,v,z,zp
      COMMON/SD_scala/scalb,scalt
      COMMON/SD_sfmixang/thet,theb,thel,cu,su,cd,sd,ce,se
      COMMON/SD_weinberg/sw,cw

      cb = dcos(theb)
      sb = dsin(theb)
      tw = sw/cw

      do k=1,4
         abot(1,k)=cb*dsqrt(2.d0)*(zp(k,1)*sw/3.d0+(0.5d0
     .            -1.d0/3.d0*sw**2)*zp(k,2)/cw)-sb*scalb*z(k,3)
         abot(2,k)=-sb*dsqrt(2.d0)*(zp(k,1)*sw/3.d0+(0.5d0
     .            -1.d0/3.d0*sw**2)*zp(k,2)/cw)-cb*scalb*z(k,3)
         bbot(1,k)=sb*dsqrt(2.d0)*sw*(zp(k,2)*tw-zp(k,1))/3.d0
     .            -cb*scalb*z(k,3)
         bbot(2,k)=cb*dsqrt(2.d0)*sw*(zp(k,2)*tw-zp(k,1))/3.d0
     .            +sb*scalb*z(k,3)	
      enddo

      end

c -------------------------------------------------------------------- c
c                    neutralino_k-stop1/2-top couplings                c
c -------------------------------------------------------------------- c
c Feynman rule: ig*[ atopr(1/2,k)*P_R + btopr(1/2,k)*P_L ]

      subroutine SD_neutstoptop(atopr,btopr)

      implicit double precision (a-h,o-z)

      dimension atopr(2,4),btopr(2,4)
      dimension u(2,2),v(2,2),z(4,4),zp(4,4)

      COMMON/SD_mixmat/u,v,z,zp
      COMMON/SD_scala/scalb,scalt
      COMMON/SD_sfmixang/thet,theb,thel,cu,su,cd,sd,ce,se
      COMMON/SD_weinberg/sw,cw

      ct = dcos(thet)
      st = dsin(thet)
      tw = sw/cw

      do k=1,4
         atopr(1,k)=ct*dsqrt(2.d0)*(-2.d0*zp(k,1)*sw/3.d0
     .            +(-0.5d0+2.d0/3.d0*sw**2)*zp(k,2)/cw)-st*scalt*z(k,4)
         atopr(2,k)=-st*dsqrt(2.d0)*(-2.d0*zp(k,1)*sw/3.d0+(-0.5d0
     .            +2.d0/3.d0*sw**2)*zp(k,2)/cw)-ct*scalt*z(k,4)
         btopr(1,k)=-2.d0*st*dsqrt(2.d0)*sw*(zp(k,2)*tw-zp(k,1))/3.d0
     .             -ct*scalt*z(k,4)
         btopr(2,k)=-2.d0*ct*dsqrt(2.d0)*sw*(zp(k,2)*tw-zp(k,1))/3.d0
     .             +st*scalt*z(k,4)	
      enddo

      end

c -------------------------------------------------------------------- c
c                   H+ - sneutrino_tau1/2 - stau1/2 couplings          c
c -------------------------------------------------------------------- c
c Feynman rule: -ig*mw*gcsntaur(i,j)
c chcsntau(1,2) is for sneutrino_tau1-stau2

      subroutine SD_hcstausntau(gcsntaur)

      implicit double precision (a-h,o-z)

      dimension chcsntau(2,2),gcsntaur(2,2)

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_break/au,ad,al,amu
      COMMON/SD_mixang/alp_mssm,tanbeta
      COMMON/SD_sfmixang/thet,theb,thel,cum,sum,cdm,sdm,cem,sem
      COMMON/SD_scalatau/scaltau

      cl = dcos(thel)
      sl = dsin(thel)
      cn = 1.D0
      sn = 0.D0

      b     = datan(tanbeta)
      tgbet = tanbeta

      s11 = 1.d0/dsqrt(2.d0)*amw*(scaltau**2-1.D0)*dsin(2.d0*b)
      s12 = scaltau*dcos(b)*(al*tgbet+amu)
      s21 = 0.D0
      s22 = 0.D0

      chcsntau(1,1)=(-cn*cl*s11-sn*sl*s22-cn*sl*s12-sn*cl*s21)
      chcsntau(1,2)=(cn*sl*s11-cn*cl*s12+sl*sn*s21-sn*cl*s22)
      chcsntau(2,1)=(sn*cl*s11+sn*sl*s12-cn*cl*s21-cn*sl*s22)
      chcsntau(2,2)=(-sn*sl*s11+sn*cl*s12+cn*sl*s21-cn*cl*s22)

      gcsntaur(1,1)=chcsntau(1,1)/amw
      gcsntaur(1,2)=chcsntau(1,2)/amw	
      gcsntaur(2,1)=chcsntau(2,1)/amw
      gcsntaur(2,2)=chcsntau(2,2)/amw

      end

c -------------------------------------------------------------------- c
c                   H+ - stop1/2 - sbottom1/2 couplings                c
c -------------------------------------------------------------------- c
c Feynman rule: -ig*mw*gctbr(i,j)
c gctbr(1,2) is for stop1-sbottom2

      subroutine SD_hcsbotstop(gctbr)

      implicit double precision (a-h,o-z)

      dimension chctb(2,2),gctbr(2,2)

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_break/au,ad,al,amu
      COMMON/SD_mixang/alp_mssm,tanbeta
      COMMON/SD_sfmixang/thet,theb,thel,cum,sum,cdm,sdm,cem,sem
      COMMON/SD_scala/scalb,scalt

      cb = dcos(theb)
      sb = dsin(theb)
      ct = dcos(thet)
      st = dsin(thet)

      b     = datan(tanbeta)
      tgbet = tanbeta

      s11 = 1.d0/dsqrt(2.d0)*amw*(scalb**2+scalt**2-1.D0)*dsin(2.d0*b)
      s12 = scalb*dcos(b)*(ad*tgbet+amu)
      s21 = scalt*dsin(b)*(au/tgbet+amu)
      s22 = dsqrt(2.d0)*amw*scalb*scalt
	
      chctb(1,1)=(-ct*cb*s11-st*sb*s22-ct*sb*s12-st*cb*s21)
      chctb(1,2)=(ct*sb*s11-ct*cb*s12+sb*st*s21-st*cb*s22)
      chctb(2,1)=(st*cb*s11+st*sb*s12-ct*cb*s21-ct*sb*s22)
      chctb(2,2)=(-st*sb*s11+st*cb*s12+ct*sb*s21-ct*cb*s22)

      gctbr(1,1)=chctb(1,1)/amw
      gctbr(1,2)=chctb(1,2)/amw	
      gctbr(2,1)=chctb(2,1)/amw
      gctbr(2,2)=chctb(2,2)/amw

      end

c -------------------------------------------------------------------- c
c                    the stau1-stau2-Higgs couplings		       c
c -------------------------------------------------------------------- c
c Feynman rule: ig*amz**2/amw*gltautaur and ig*amz**2/amw*ghtautaur
c               -g*amz**2/amw*gatautaur: stau1 in stau2 out
c               +g*amz**2/amw*gatautaur: stau2 in stau1 out

      subroutine SD_higgsstau1stau2(gltautaur,ghtautaur,gatautaur)

      implicit double precision (a-h,o-z)

      dimension gltautaur(2,2),ghtautaur(2,2)

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_break/au,ad,al,amu
      COMMON/SD_mixang/a,tanbeta
      COMMON/SD_sfmixang/thet,theb,thel,cum,sum,cdm,sdm,cem,sem
      COMMON/SD_scalatau/scaltau
      COMMON/SD_weinberg/sw,cw

      b     = datan(tanbeta)
      tgbet = dtan(b)

      bhltau12 = amz*dsin(2.D0*thel)/2.D0/cw*(0.5D0-2.D0*sw**2)*
     .           dsin(a+b)+scaltau/dsqrt(2.D0)*dcos(2.D0*thel)*
     .           (amu*dcos(a)+al*dsin(a))

      bhltau11 = amz/cw*dsin(a+b)*(-1.D0/2.D0*dcos(thel)**2+1.D0*
     .           sw**2*dcos(2.D0*thel))
     .           +scaltau**2*2.D0*amw*dsin(a)*dcos(b)
     .           -scaltau/dsqrt(2.D0)*dsin(2.D0*thel)*(-al*dsin(a)
     .                                                 -amu*dcos(a))

      bhltau22 = amz/cw*dsin(a+b)*(-1.D0/2.D0*dsin(thel)**2-1.D0*
     .           sw**2*dcos(2.D0*thel))
     .           +scaltau**2*2.D0*amw*dsin(a)*dcos(b)
     .           +scaltau/dsqrt(2.D0)*dsin(2.D0*thel)*(-al*dsin(a)
     .                                                 -amu*dcos(a))

      bhhtau12 = -amz*dsin(2.D0*thel)/2.D0/cw*(0.5D0-2.d0*sw**2)*
     .           dcos(a+b)-scaltau/dsqrt(2.D0)*dcos(2.D0*thel)*
     .           (-amu*dsin(a)+al*dcos(a))

      bhhtau11 = -amz/cw*dcos(a+b)*(-1.D0/2.D0*dcos(thel)**2+1.D0*
     .         sw**2*dcos(2.D0*thel))
     .         -scaltau**2*2.D0*amw*dcos(a)*dcos(b)
     .         -scaltau/dsqrt(2.D0)*dsin(2.D0*thel)*(al*dcos(a)-
     .                                               amu*dsin(a))
      
      bhhtau22 = -amz/cw*dcos(a+b)*(-1.D0/2.D0*dsin(thel)**2-1.D0*
     .           sw**2*dcos(2.D0*thel))
     .           -scaltau**2*2.D0*amw*dcos(a)*dcos(b)
     .           +scaltau/dsqrt(2.D0)*dsin(2.D0*thel)*(al*dcos(a)-
     .                                                 amu*dsin(a))

      batau = -scaltau/dsqrt(2.D0)*dcos(b)*(al*tgbet+amu)

      gltautaur(1,1)=bhltau11*amw/amz**2
      gltautaur(1,2)=bhltau12*amw/amz**2
      gltautaur(2,1)=gltautaur(1,2)
      gltautaur(2,2)=bhltau22*amw/amz**2

      ghtautaur(1,1)=bhhtau11*amw/amz**2
      ghtautaur(1,2)=bhhtau12*amw/amz**2
      ghtautaur(2,1)=ghtautaur(1,2)
      ghtautaur(2,2)=bhhtau22*amw/amz**2

      gatautaur=batau*amw/amz**2

      end

c -------------------------------------------------------------------- c
c                the sbottom1-sbottom2-Higgs couplings		       c
c -------------------------------------------------------------------- c
c Feynman rule: ig*amz**2/amw*glbb and ig*amz**2/amw*ghbb
c               -g*amz**2/amw*gabb sbottom1 in sbottom2 out
c               +g*amz**2/amw*gabb sbottom2 in sbottom1 out

      subroutine SD_higgssb1sb2(glbbr,ghbbr,gabbr)

      implicit double precision (a-h,o-z)

      dimension glbbr(2,2),ghbbr(2,2)

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_break/au,ad,al,amu
      COMMON/SD_mixang/a,tanbeta
      COMMON/SD_sfmixang/thet,theb,thel,cum,sum,cdm,sdm,cem,sem
      COMMON/SD_scala/scalb,scalt
      COMMON/SD_weinberg/sw,cw

      b     = datan(tanbeta)
      tgbet = dtan(b)

      bhlb12 = amz*dsin(2.D0*theb)/2.D0/cw*(0.5D0-2.d0/3.d0*sw**2)*
     .         dsin(a+b)+scalb/dsqrt(2.D0)*dcos(2.D0*theb)*(amu*dcos(a)
     .         +ad*dsin(a))

      bhlb11 = amz/cw*dsin(a+b)*(-1.D0/2.D0*dcos(theb)**2+1.D0/3.D0*
     .         sw**2*dcos(2.D0*theb))+scalb**2*2.D0*amw*dsin(a)*dcos(b)
     .         -scalb/dsqrt(2.D0)*dsin(2.D0*theb)*(-ad*dsin(a)
     .         -amu*dcos(a))

      bhlb22 = amz/cw*dsin(a+b)*(-1.D0/2.D0*dsin(theb)**2-1.D0/3.D0*
     .         sw**2*dcos(2.D0*theb))+scalb**2*2.D0*amw*dsin(a)*dcos(b)
     .         +scalb/dsqrt(2.D0)*dsin(2.D0*theb)*(-ad*dsin(a)
     .         -amu*dcos(a))

      bhhb12 = -amz*dsin(2.D0*theb)/2.D0/cw*(0.5D0-2.d0/3.d0*sw**2)*
     .         dcos(a+b)-scalb/dsqrt(2.D0)*dcos(2.D0*theb)*(-amu*dsin(a)
     .         +ad*dcos(a))

      bhhb11 = -amz/cw*dcos(a+b)*(-1.D0/2.D0*dcos(theb)**2+1.D0/3.D0*
     .         sw**2*dcos(2.D0*theb))-scalb**2*2.D0*amw*dcos(a)*dcos(b)
     .         -scalb/dsqrt(2.D0)*dsin(2.D0*theb)*(ad*dcos(a)-
     .         amu*dsin(a))
      
      bhhb22 = -amz/cw*dcos(a+b)*(-1.D0/2.D0*dsin(theb)**2-1.D0/3.D0*
     .         sw**2*dcos(2.D0*theb))-scalb**2*2.D0*amw*dcos(a)*dcos(b)
     .         +scalb/dsqrt(2.D0)*dsin(2.D0*theb)*(ad*dcos(a)-
     .         amu*dsin(a))

      bab = -scalb/dsqrt(2.D0)*dcos(b)*(ad*tgbet+amu)

      glbbr(1,1)=bhlb11*amw/amz**2
      glbbr(1,2)=bhlb12*amw/amz**2
      glbbr(2,1)=glbbr(1,2)
      glbbr(2,2)=bhlb22*amw/amz**2

      ghbbr(1,1)=bhhb11*amw/amz**2
      ghbbr(1,2)=bhhb12*amw/amz**2
      ghbbr(2,1)=ghbbr(1,2)
      ghbbr(2,2)=bhhb22*amw/amz**2

      gabbr=bab*amw/amz**2

      end

c -------------------------------------------------------------------- c
c                     The Higgs-stop1-stop2 couplings                  c
c -------------------------------------------------------------------- c
c Feynman rule: ig*amz**2/amw*glttr and ig*amz**2/amw*ghttr
c               -g*amz**2/amw*gattr stop1 in stop2 out
c               +g*amz**2/amw*gattr stop2 in stop1 out

      subroutine SD_higgsst1st2(glttr,ghttr,gattr)

      implicit double precision (a-h,m,o-z)

      dimension glttr(2,2),ghttr(2,2)

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_break/au,ad,al,amu
      COMMON/SD_mixang/a,tanbeta
      COMMON/SD_sfmixang/thet,theb,thel,cum,sum,cdm,sdm,cem,sem
      COMMON/SD_scala/scalb,scalt
      COMMON/SD_weinberg/sw,cw

      b     = datan(tanbeta)
      tgbet = tanbeta

      bhlt12 = amz*dsin(2.D0*thet)/2.D0/cw*(-0.5D0+4.d0/3.d0*sw**2)*
     .         dsin(a+b)-scalt/dsqrt(2.D0)*dcos(2.D0*thet)*(amu*dsin(a)
     .         +au*dcos(a))

      bhlt11 = amz/cw*dsin(a+b)*(1.D0/2.D0*dcos(thet)**2-2.D0/3.D0*
     .         sw**2*dcos(2.D0*thet))-scalt**2*2.D0*amw*dsin(b)*dcos(a)
     .         -scalt/dsqrt(2.D0)*dsin(2.D0*thet)*(au*dcos(a)+
     .         amu*dsin(a))

      bhlt22 = amz/cw*dsin(a+b)*(1.D0/2.D0*dsin(thet)**2+2.D0/3.D0*
     .         sw**2*dcos(2.D0*thet))-scalt**2*2.D0*amw*dsin(b)*dcos(a)
     .         +scalt/dsqrt(2.D0)*dsin(2.D0*thet)*(au*dcos(a)+
     .         amu*dsin(a))

      bhht12= -amz*dsin(2.D0*thet)/2.D0/cw*(-0.5D0+4.D0/3.D0*sw**2)*
     .        dcos(a+b)-scalt/dsqrt(2.D0)*dcos(2.D0*thet)*(-amu*dcos(a)
     .        +au*dsin(a))

      bhht11 = -amz/cw*dcos(a+b)*(1.D0/2.D0*dcos(thet)**2-2.D0/3.D0*
     .         sw**2*dcos(2.D0*thet))-scalt**2*2.D0*amw*dsin(a)*dsin(b)
     .         -scalt/dsqrt(2.D0)*dsin(2.D0*thet)*(au*dsin(a)-
     .         amu*dcos(a))

      bhht22 = -amz/cw*dcos(a+b)*(1.D0/2.D0*dsin(thet)**2+2.D0/3.D0*
     .         sw**2*dcos(2.D0*thet))-scalt**2*2.D0*amw*dsin(a)*dsin(b)
     .         +scalt/dsqrt(2.D0)*dsin(2.D0*thet)*(au*dsin(a)-
     .         amu*dcos(a))

      bat =-scalt/dsqrt(2.D0)*dsin(b)*(au/tgbet+amu)

      glttr(1,1)=bhlt11*amw/amz**2
      glttr(1,2)=bhlt12*amw/amz**2
      glttr(2,1)=glttr(1,2)
      glttr(2,2)=bhlt22*amw/amz**2

      ghttr(1,1)=bhht11*amw/amz**2
      ghttr(1,2)=bhht12*amw/amz**2
      ghttr(2,1)=ghttr(1,2)
      ghttr(2,2)=bhht22*amw/amz**2

      gattr=bat*amw/amz**2

      end

c -------------------------------------------------------------------- c
c -------------------- Derivatives of couplings ---------------------- c
c -------------------------------------------------------------------- c

c -------------------------------------------------------------------- c
c                   H+ - stop1/2 - sbottom1/2 couplings                c
c -------------------------------------------------------------------- c

      subroutine SD_hcsbotstopderiv(gcdmtr,gcdmbr,gcdabr,gcdatr,gcdthtr,
     .                              gcdthbr)

      implicit double precision (a-h,o-z)

      dimension chctbdt(2,2),chctbdb(2,2),chctbab(2,2),chctbat(2,2),
     .     chctbtt(2,2),gcdthtr(2,2),gcdthbr(2,2),chctbbb(2,2),
     .     gcdmtr(2,2),gcdmbr(2,2),gcdabr(2,2),gcdatr(2,2)

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_break/au,ad,al,amu
      COMMON/SD_mixang/alp_mssm,tanbeta
      COMMON/SD_sfmixang/thet,theb,thel,cum,sum,cdm,sdm,cem,sem
      COMMON/SD_scala/scalb,scalt
      COMMON/SD_weinberg/sw,cw

      cb = dcos(theb)
      sb = dsin(theb)
      ct = dcos(thet)
      st = dsin(thet)

      b     = datan(tanbeta)
      tgbet = dtan(b)

c ---- derivative d/dmtop ----

      tmpt = 1.D0/dsqrt(2.D0)/amw/dsin(b)

      s11t = 1.d0/dsqrt(2.d0)*amw*(2.D0*tmpt*scalt)*dsin(2.d0*b)
      s12t = 0.D0
      s21t = tmpt*dsin(b)*(au/tgbet+amu)
      s22t = dsqrt(2.d0)*amw*scalb*tmpt
	
      chctbdt(1,1)=(-ct*cb*s11t-st*sb*s22t-ct*sb*s12t-st*cb*s21t)
      chctbdt(1,2)=(ct*sb*s11t-ct*cb*s12t+sb*st*s21t-st*cb*s22t)
      chctbdt(2,1)=(st*cb*s11t+st*sb*s12t-ct*cb*s21t-ct*sb*s22t)
      chctbdt(2,2)=(-st*sb*s11t+st*cb*s12t+ct*sb*s21t-ct*cb*s22t)

      gcdmtr(1,1)=chctbdt(1,1)/amw
      gcdmtr(1,2)=chctbdt(1,2)/amw	
      gcdmtr(2,1)=chctbdt(2,1)/amw
      gcdmtr(2,2)=chctbdt(2,2)/amw

c ---- derivative d/dmbottom ----

      tmpb = 1.D0/dsqrt(2.D0)/amw/dcos(b)

      s11b = 1.d0/dsqrt(2.d0)*amw*(2.D0*tmpb*scalb)*dsin(2.d0*b)
      s12b = tmpb*dcos(b)*(ad*tgbet+amu)
      s21b = 0.D0
      s22b = dsqrt(2.d0)*amw*tmpb*scalt
	
      chctbdb(1,1)=(-ct*cb*s11b-st*sb*s22b-ct*sb*s12b-st*cb*s21b)
      chctbdb(1,2)=(ct*sb*s11b-ct*cb*s12b+sb*st*s21b-st*cb*s22b)
      chctbdb(2,1)=(st*cb*s11b+st*sb*s12b-ct*cb*s21b-ct*sb*s22b)
      chctbdb(2,2)=(-st*sb*s11b+st*cb*s12b+ct*sb*s21b-ct*cb*s22b)

      gcdmbr(1,1)=chctbdb(1,1)/amw
      gcdmbr(1,2)=chctbdb(1,2)/amw	
      gcdmbr(2,1)=chctbdb(2,1)/amw
      gcdmbr(2,2)=chctbdb(2,2)/amw

c ---- derivative d/dAb ----

      s11ab = 0.D0
      s12ab = scalb*dcos(b)*tgbet
      s21ab = 0.D0
      s22ab = 0.D0
	
      chctbab(1,1)=(-ct*cb*s11ab-st*sb*s22ab-ct*sb*s12ab-st*cb*s21ab)
      chctbab(1,2)=(ct*sb*s11ab-ct*cb*s12ab+sb*st*s21ab-st*cb*s22ab)
      chctbab(2,1)=(st*cb*s11ab+st*sb*s12ab-ct*cb*s21ab-ct*sb*s22ab)
      chctbab(2,2)=(-st*sb*s11ab+st*cb*s12ab+ct*sb*s21ab-ct*cb*s22ab)

      gcdabr(1,1)=chctbab(1,1)/amw
      gcdabr(1,2)=chctbab(1,2)/amw	
      gcdabr(2,1)=chctbab(2,1)/amw
      gcdabr(2,2)=chctbab(2,2)/amw

c ---- derivative d/dAt ----

      s11at = 0.D0
      s12at = 0.D0
      s21at = scalt*dsin(b)*1.D0/tgbet
      s22at = 0.D0
	
      chctbat(1,1)=(-ct*cb*s11at-st*sb*s22at-ct*sb*s12at-st*cb*s21at)
      chctbat(1,2)=(ct*sb*s11at-ct*cb*s12at+sb*st*s21at-st*cb*s22at)
      chctbat(2,1)=(st*cb*s11at+st*sb*s12at-ct*cb*s21at-ct*sb*s22at)
      chctbat(2,2)=(-st*sb*s11at+st*cb*s12at+ct*sb*s21at-ct*cb*s22at)

      gcdatr(1,1)=chctbat(1,1)/amw
      gcdatr(1,2)=chctbat(1,2)/amw	
      gcdatr(2,1)=chctbat(2,1)/amw
      gcdatr(2,2)=chctbat(2,2)/amw

c ---- derivative d/dtheta_t ----

      ctt = -dsin(thet)
      stt = dcos(thet)

      s11 = 1.d0/dsqrt(2.d0)*amw*(scalb**2+scalt**2-1.D0)*dsin(2.d0*b)
      s12 = scalb*dcos(b)*(ad*tgbet+amu)
      s21 = scalt*dsin(b)*(au/tgbet+amu)
      s22 = dsqrt(2.d0)*amw*scalb*scalt
	
      chctbtt(1,1)=(-ctt*cb*s11-stt*sb*s22-ctt*sb*s12-stt*cb*s21)
      chctbtt(1,2)=(ctt*sb*s11-ctt*cb*s12+sb*stt*s21-stt*cb*s22)
      chctbtt(2,1)=(stt*cb*s11+stt*sb*s12-ctt*cb*s21-ctt*sb*s22)
      chctbtt(2,2)=(-stt*sb*s11+stt*cb*s12+ctt*sb*s21-ctt*cb*s22)

      gcdthtr(1,1)=chctbtt(1,1)/amw
      gcdthtr(1,2)=chctbtt(1,2)/amw	
      gcdthtr(2,1)=chctbtt(2,1)/amw
      gcdthtr(2,2)=chctbtt(2,2)/amw

c ---- derivative d/dtheta_b ----

      cbb = -dsin(theb)
      sbb = dcos(theb)

      s11 = 1.d0/dsqrt(2.d0)*amw*(scalb**2+scalt**2-1.D0)*dsin(2.d0*b)
      s12 = scalb*dcos(b)*(ad*tgbet+amu)
      s21 = scalt*dsin(b)*(au/tgbet+amu)
      s22 = dsqrt(2.d0)*amw*scalb*scalt
	
      chctbbb(1,1)=(-ct*cbb*s11-st*sbb*s22-ct*sbb*s12-st*cbb*s21)
      chctbbb(1,2)=(ct*sbb*s11-ct*cbb*s12+sbb*st*s21-st*cbb*s22)
      chctbbb(2,1)=(st*cbb*s11+st*sbb*s12-ct*cbb*s21-ct*sbb*s22)
      chctbbb(2,2)=(-st*sbb*s11+st*cbb*s12+ct*sbb*s21-ct*cbb*s22)

      gcdthbr(1,1)=chctbbb(1,1)/amw
      gcdthbr(1,2)=chctbbb(1,2)/amw	
      gcdthbr(2,1)=chctbbb(2,1)/amw
      gcdthbr(2,2)=chctbbb(2,2)/amw

      end

c -------------------------------------------------------------------- c
c                    The stop1-stop2-Higgs couplings		       c
c -------------------------------------------------------------------- c

      subroutine SD_higgsst1st2deriv(dtlttr,dthttr,dtattr,datlttr,
     .                     dathttr,datattr,dthlttr,dthhttr,dthattr)

      implicit double precision (a-h,o-z)

      dimension dtlttr(2,2),dthttr(2,2),datlttr(2,2),dathttr(2,2),
     .          dthlttr(2,2),dthhttr(2,2)

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_break/au,ad,al,amu
      COMMON/SD_mixang/a,tanbeta
      COMMON/SD_sfmixang/thet,theb,thel,cum,sum,cdm,sdm,cem,sem
      COMMON/SD_scala/scalb,scalt
      COMMON/SD_weinberg/sw,cw

      b     = datan(tanbeta)
      tgbet = dtan(b)

c ---- derivative d/dmtop ----

      tmpt = 1.D0/dsqrt(2.D0)/amw/dsin(b)

      dthlt12 = -tmpt/dsqrt(2.D0)*dcos(2.D0*thet)*(amu*dsin(a)
     .          +au*dcos(a))

      dthlt11 = -2.D0*scalt*tmpt*2.D0*amw*dsin(b)*dcos(a)
     .         -tmpt/dsqrt(2.D0)*dsin(2.D0*thet)*(au*dcos(a)+
     .         amu*dsin(a))

      dthlt22 = -2.D0*scalt*tmpt*2.D0*amw*dsin(b)*dcos(a)
     .         +tmpt/dsqrt(2.D0)*dsin(2.D0*thet)*(au*dcos(a)+
     .         amu*dsin(a))

      dthht12= -tmpt/dsqrt(2.D0)*dcos(2.D0*thet)*(-amu*dcos(a)
     .         +au*dsin(a))

      dthht11 = -2.D0*scalt*tmpt*2.D0*amw*dsin(a)*dsin(b)
     .         -tmpt/dsqrt(2.D0)*dsin(2.D0*thet)*(au*dsin(a)-
     .         amu*dcos(a))

      dthht22 = -2.D0*scalt*tmpt*2.D0*amw*dsin(a)*dsin(b)
     .         +tmpt/dsqrt(2.D0)*dsin(2.D0*thet)*(au*dsin(a)-
     .         amu*dcos(a))

      dtat =-tmpt/dsqrt(2.D0)*dsin(b)*(au/tgbet+amu)

c ---- derivative At ----

      dathlt12 = -scalt/dsqrt(2.D0)*dcos(2.D0*thet)*dcos(a)

      dathlt11 = -scalt/dsqrt(2.D0)*dsin(2.D0*thet)*dcos(a)

      dathlt22 = scalt/dsqrt(2.D0)*dsin(2.D0*thet)*dcos(a)

      dathht12= -scalt/dsqrt(2.D0)*dcos(2.D0*thet)*dsin(a)

      dathht11 = -scalt/dsqrt(2.D0)*dsin(2.D0*thet)*dsin(a)

      dathht22 = scalt/dsqrt(2.D0)*dsin(2.D0*thet)*dsin(a)

      datat = -scalt/dsqrt(2.D0)*dsin(b)*1.D0/tgbet

c ---- derivative theta_t ----

      dthhlt12 = amz*dcos(2.D0*thet)/cw*(-0.5D0+4.d0/3.d0*sw**2)*
     .         dsin(a+b)+scalt/dsqrt(2.D0)*2.D0*dsin(2.D0*thet)*
     .         (amu*dsin(a)+au*dcos(a))

      dthhlt11 = amz/cw*dsin(a+b)*(-1.D0/2.D0*dsin(2.D0*thet)+4.D0/3.D0*
     .         sw**2*dsin(2.D0*thet))
     .         -2.D0*scalt/dsqrt(2.D0)*dcos(2.D0*thet)*(au*dcos(a)+
     .         amu*dsin(a))

      dthhlt22 = amz/cw*dsin(a+b)*(1.D0/2.D0*dsin(2.D0*thet)-4.D0/3.D0*
     .         sw**2*dsin(2.D0*thet))
     .         +2.D0*scalt/dsqrt(2.D0)*dcos(2.D0*thet)*(au*dcos(a)+
     .         amu*dsin(a))

      dthhht12= -amz*dcos(2.D0*thet)/cw*(-0.5D0+4.D0/3.D0*sw**2)*
     .        dcos(a+b)+scalt/dsqrt(2.D0)*2.D0*dsin(2.D0*thet)*
     .        (-amu*dcos(a)+au*dsin(a))

      dthhht11 = -amz/cw*dcos(a+b)*(-1.D0/2.D0*dsin(2.D0*thet)+
     .         4.D0/3.D0*sw**2*dsin(2.D0*thet))
     .         -2.D0*scalt/dsqrt(2.D0)*dcos(2.D0*thet)*(au*dsin(a)-
     .         amu*dcos(a))

      dthhht22 = -amz/cw*dcos(a+b)*(1.D0/2.D0*dsin(2.D0*thet)-4.D0/3.D0*
     .         sw**2*dsin(2.D0*thet))
     .         +2.D0*scalt/dsqrt(2.D0)*dcos(2.D0*thet)*(au*dsin(a)-
     .         amu*dcos(a))

      dthat = 0.D0

c -------------------------------------

      dtlttr(1,1)=dthlt11*amw/amz**2
      dtlttr(1,2)=dthlt12*amw/amz**2
      dtlttr(2,1)=dtlttr(1,2)
      dtlttr(2,2)=dthlt22*amw/amz**2

      dthttr(1,1)=dthht11*amw/amz**2
      dthttr(1,2)=dthht12*amw/amz**2
      dthttr(2,1)=dthttr(1,2)
      dthttr(2,2)=dthht22*amw/amz**2

      dtattr=dtat*amw/amz**2

c -------------------------------------

      datlttr(1,1)=dathlt11*amw/amz**2
      datlttr(1,2)=dathlt12*amw/amz**2
      datlttr(2,1)=datlttr(1,2)
      datlttr(2,2)=dathlt22*amw/amz**2

      dathttr(1,1)=dathht11*amw/amz**2
      dathttr(1,2)=dathht12*amw/amz**2
      dathttr(2,1)=dathttr(1,2)
      dathttr(2,2)=dathht22*amw/amz**2

      datattr=datat*amw/amz**2

c -------------------------------------

      dthlttr(1,1)=dthhlt11*amw/amz**2
      dthlttr(1,2)=dthhlt12*amw/amz**2
      dthlttr(2,1)=dthlttr(1,2)
      dthlttr(2,2)=dthhlt22*amw/amz**2

      dthhttr(1,1)=dthhht11*amw/amz**2
      dthhttr(1,2)=dthhht12*amw/amz**2
      dthhttr(2,1)=dthhttr(1,2)
      dthhttr(2,2)=dthhht22*amw/amz**2

      dthattr=dthat*amw/amz**2

      end

c -------------------------------------------------------------------- c
c                The sbottom1-sbottom2-Higgs couplings		       c
c -------------------------------------------------------------------- c

      subroutine SD_higgssb1sb2deriv(dblbbr,dbhbbr,dbabbr,dablbbr,
     .           dabhbbr,dababbr,dthlbbr,dthhbbr,dthabbr)

      implicit double precision (a-h,o-z)

      dimension dblbbr(2,2),dbhbbr(2,2),dablbbr(2,2),dabhbbr(2,2),
     .          dthlbbr(2,2),dthhbbr(2,2)

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_break/au,ad,al,amu
      COMMON/SD_mixang/a,tanbeta
      COMMON/SD_sfmixang/thet,theb,thel,cum,sum,cdm,sdm,cem,sem
      COMMON/SD_scala/scalb,scalt
      COMMON/SD_weinberg/sw,cw

      b     = datan(tanbeta)
      tgbet = dtan(b)

c ---- derivative d/dmbottom ----

      tmpb = 1.D0/dsqrt(2.D0)/amw/dcos(b)

      dbhlb12 = tmpb/dsqrt(2.D0)*dcos(2.D0*theb)*(amu*dcos(a)
     .         +ad*dsin(a))

      dbhlb11 = 2.D0*scalb*tmpb*2.D0*amw*dsin(a)*dcos(b)
     .         -tmpb/dsqrt(2.D0)*dsin(2.D0*theb)*(-ad*dsin(a)
     .         -amu*dcos(a))

      dbhlb22 = 2.D0*scalb*tmpb*2.D0*amw*dsin(a)*dcos(b)
     .         +tmpb/dsqrt(2.D0)*dsin(2.D0*theb)*(-ad*dsin(a)
     .         -amu*dcos(a))

      dbhhb12 = -tmpb/dsqrt(2.D0)*dcos(2.D0*theb)*(-amu*dsin(a)
     .         +ad*dcos(a))

      dbhhb11 = -2.D0*scalb*tmpb*2.D0*amw*dcos(a)*dcos(b)
     .         -tmpb/dsqrt(2.D0)*dsin(2.D0*theb)*(ad*dcos(a)-
     .         amu*dsin(a))
      
      dbhhb22 = -2.D0*scalb*tmpb*2.D0*amw*dcos(a)*dcos(b)
     .         +tmpb/dsqrt(2.D0)*dsin(2.D0*theb)*(ad*dcos(a)-
     .         amu*dsin(a))

      dbab = -tmpb/dsqrt(2.D0)*dcos(b)*(ad*tgbet+amu)

c ---- derivative Ab ----

      dabhlb12 = scalb/dsqrt(2.D0)*dcos(2.D0*theb)*dsin(a)

      dabhlb11 = -scalb/dsqrt(2.D0)*dsin(2.D0*theb)*(-dsin(a))

      dabhlb22 = scalb/dsqrt(2.D0)*dsin(2.D0*theb)*(-dsin(a))

      dabhhb12 = -scalb/dsqrt(2.D0)*dcos(2.D0*theb)*dcos(a)

      dabhhb11 = -scalb/dsqrt(2.D0)*dsin(2.D0*theb)*dcos(a)
      
      dabhhb22 = scalb/dsqrt(2.D0)*dsin(2.D0*theb)*dcos(a)

      dabab = -scalb/dsqrt(2.D0)*dcos(b)*tgbet

c ---- derivative theta_b ----

      dthbhlb12 = amz*dcos(2.D0*theb)/cw*(0.5D0-2.d0/3.d0*sw**2)*
     .         dsin(a+b)-scalb/dsqrt(2.D0)*2.D0*dsin(2.D0*theb)*
     .         (amu*dcos(a)+ad*dsin(a))

      dthbhlb11 = amz/cw*dsin(a+b)*(1.D0/2.D0*dsin(2.D0*theb)
     .         -2.D0/3.D0*sw**2*dsin(2.D0*theb))
     .         -2.D0*scalb/dsqrt(2.D0)*dcos(2.D0*theb)*(-ad*dsin(a)
     .         -amu*dcos(a))

      dthbhlb22 = amz/cw*dsin(a+b)*(-1.D0/2.D0*dsin(2.D0*theb)+
     .         2.D0/3.D0*sw**2*dsin(2.D0*theb))
     .         +2.D0*scalb/dsqrt(2.D0)*dcos(2.D0*theb)*(-ad*dsin(a)
     .         -amu*dcos(a))

      dthbhhb12 = -amz*dcos(2.D0*theb)/cw*(0.5D0-2.d0/3.d0*sw**2)*
     .         dcos(a+b)+scalb/dsqrt(2.D0)*2.D0*dsin(2.D0*theb)*
     .         (-amu*dsin(a)+ad*dcos(a))

      dthbhhb11 = -amz/cw*dcos(a+b)*(1.D0/2.D0*dsin(2.D0*theb)
     .         -2.D0/3.D0*sw**2*dsin(2.D0*theb))
     .         -2.D0*scalb/dsqrt(2.D0)*dcos(2.D0*theb)*(ad*dcos(a)-
     .         amu*dsin(a))
      
      dthbhhb22 = -amz/cw*dcos(a+b)*(-1.D0/2.D0*dsin(2.D0*theb)
     .         +2.D0/3.D0*sw**2*dsin(2.D0*theb))
     .         +2.D0*scalb/dsqrt(2.D0)*dcos(2.D0*theb)*(ad*dcos(a)-
     .         amu*dsin(a))

      dthbab = 0.D0
 
c --------------------------------------

      dblbbr(1,1)=dbhlb11*amw/amz**2
      dblbbr(1,2)=dbhlb12*amw/amz**2
      dblbbr(2,1)=dblbbr(1,2)
      dblbbr(2,2)=dbhlb22*amw/amz**2

      dbhbbr(1,1)=dbhhb11*amw/amz**2
      dbhbbr(1,2)=dbhhb12*amw/amz**2
      dbhbbr(2,1)=dbhbbr(1,2)
      dbhbbr(2,2)=dbhhb22*amw/amz**2

      dbabbr=dbab*amw/amz**2

c --------------------------------------

      dablbbr(1,1)=dabhlb11*amw/amz**2
      dablbbr(1,2)=dabhlb12*amw/amz**2
      dablbbr(2,1)=dablbbr(1,2)
      dablbbr(2,2)=dabhlb22*amw/amz**2

      dabhbbr(1,1)=dabhhb11*amw/amz**2
      dabhbbr(1,2)=dabhhb12*amw/amz**2
      dabhbbr(2,1)=dabhbbr(1,2)
      dabhbbr(2,2)=dabhhb22*amw/amz**2

      dababbr=dabab*amw/amz**2

c --------------------------------------

      dthlbbr(1,1)=dthbhlb11*amw/amz**2
      dthlbbr(1,2)=dthbhlb12*amw/amz**2
      dthlbbr(2,1)=dthlbbr(1,2)
      dthlbbr(2,2)=dthbhlb22*amw/amz**2

      dthhbbr(1,1)=dthbhhb11*amw/amz**2
      dthhbbr(1,2)=dthbhhb12*amw/amz**2
      dthhbbr(2,1)=dthhbbr(1,2)
      dthhbbr(2,2)=dthbhhb22*amw/amz**2

      dthabbr=dthbab*amw/amz**2

      return

      end

c ==================================================================== c
c                           top 2-body decays                          c
c ==================================================================== c

      subroutine SD_top2bod(topbw,topbh,topneutrstop)

      implicit double precision (a-h,m,o-z)
      double precision SD_lamb

      dimension topneutrstop(4,2)
      dimension atopr(2,4),btopr(2,4)
      dimension amneut(4),xmneut(4),amchar(2),gmst(2)

      COMMON/SD_param/sdgf,amz,amw,pi,g2
      COMMON/SD_hmass/ama,aml,amh,amch,amar
      COMMON/SD_mixang/alp_mssm,tanbeta
      COMMON/SD_fermion/amt,amb,amtau
      COMMON/SD_runcoupscale/scalechoice,scaleofcoupling,inumloop
      COMMON/SD_runmcalc/rmtc,rmbc,rmtauc
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2
      COMMON/SD_scala/scalb,scalt
      COMMON/SD_yukawa/ytewsb,ybewsb,ytauewsb
      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_mwmzpole/amwp,amzp

      external SD_runmass,SD_yuk,SD_lamb

      vtb = 1.D0

      gmst(1) = ast1
      gmst(2) = ast2

c -- the running couplings --

      if(scalechoice.eq.1.D0) then
         rmt = rmtc
         rmb = rmbc
         scalb = ybewsb/dsqrt(g2)
         scalt = ytewsb/dsqrt(g2)
      elseif(scalechoice.eq.2.D0) then
         call SD_runmass(amt,0.D0,0.D0,runmb,runmt)
         rmt = runmt
         rmb = runmb
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      elseif(scalechoice.eq.3.D0) then
         call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
         rmt = runmt
         rmb = runmb
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      endif

      call SD_neutstoptop(atopr,btopr)

c -------------------------------------------------------------------- c
c top --> bottom + W+/-

      if(amt.gt.(amb+amwp)) then
         topbw = vtb**2*g2*amt**3/64.D0/pi/amwp**2*
     .        (1.D0-amwp**2/amt**2)**2*(1.D0+2.D0*amwp**2/amt**2)
      else
         topbw = 0.D0
      endif

c -------------------------------------------------------------------- c
c top --> bottom + H+/-

      if(amt.gt.(amb+amch)) then
         topbh = g2*amt/64.D0/pi/amw**2*
     .        (1.D0-amch**2/amt**2)**2*
     .        (rmt**2/tanbeta**2+rmb**2*tanbeta**2)
      else
         topbh = 0.D0
      endif

c -------------------------------------------------------------------- c
c top --> neutralino_1/2/3/4 + stop_1/2

      do i=1,4,1
         do j=1,2,1
            if(amt.gt.(amneut(i)+gmst(j))) then
               topneutrstop(i,j) = g2/32.D0/pi/amt*(
     .              atopr(j,i)*btopr(j,i)*4.D0*amt*xmneut(i) +
     .              (atopr(j,i)**2+btopr(j,i)**2)*
     .              (amt**2-gmst(j)**2+amneut(i)**2) )*
     .              SD_lamb(amneut(i)/amt,gmst(j)/amt)
            else
               topneutrstop(i,j) = 0.D0
            endif
         end do
      end do

      end

c ==================================================================== c
c                        chargino 2-body decays                        c
c ==================================================================== c

      subroutine SD_char2bod(charst1,charst2,charsb1,charsb2,charsupl,
     .     charsupr,charsdownl,charsdownr,charsnel,charsn1,
     .     charsn2,charsell,charselr,charstau1,charstau2,char2zchic1,
     .     char2hlchic1,char2hhchic1,char2hachic1,charwneut,
     .     charhcneut,qcdcharst1,qcdcharst2,qcdcharsb1,qcdcharsb2,
     .     qcdcharsupl,qcdcharsupr,qcdcharsdownl,qcdcharsdownr)

      implicit double precision (a-h,m,o-z)

      double precision SD_lamb,lamv

      dimension ql(4,2),qr(4,2),or(4,2),ol(4,2)
      dimension opl(2,2),opr(2,2),onl(4,4),onr(4,4)
      dimension ale(2,2),altau(2,2),alsne(2,2),blsne(2,2),alsnt(2,2),
     .          blsnt(2,2)
      dimension alup(2,2),aldo(2,2)
      dimension alsbo(2,2),aksbo(2,2),alsto(2,2),aksto(2,2)
      dimension gkhlr(2,2),gkhll(2,2),gkhhr(2,2),gkhhl(2,2),gkhar(2,2),
     .          gkhal(2,2)
      dimension amchar(2),amneut(4),xmneut(4)
      dimension charwneut(2,4),charhcneut(2,4)
      dimension charst1(2),charst2(2),charsb1(2),charsb2(2),
     .          charsupl(2),charsupr(2),charsdownl(2),charsdownr(2),
     .          charsnel(2),charsn1(2),charsn2(2),charsell(2),
     .          charstau1(2),charstau2(2),charselr(2)
      dimension alstor(2,2),akstor(2,2),alsbot(2,2),aksbot(2,2)
      dimension qcdcharst1(2),qcdcharst2(2),qcdcharsb1(2),qcdcharsb2(2)
      dimension qcdcharsupl(2),qcdcharsupr(2),qcdcharsdownl(2),
     .          qcdcharsdownr(2)

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_weinberg/sw,cw
      COMMON/SD_fermion/amt,amb,amtau
      COMMON/SD_hmass/ama,aml,amh,amch,amar
      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2
      COMMON/SD_squarkud/asup1,asup2,asdown1,asdown2
      COMMON/SD_sfermionetau/ase1,ase2,astau1,astau2
      COMMON/SD_sneutrino/asne1,asne2,asntau1,asntau2
      COMMON/SD_coup2/gkhll,gkhhl,gkhal,gkhlr,gkhhr,gkhar
      COMMON/SD_coup3/ql,qr,ol,or
      COMMON/SD_coup4/opl,opr,onl,onr
      COMMON/SD_coup5/ale,altau,alsne,blsne,alsnt,blsnt
      COMMON/SD_coup6/alsto,aksto,alsbo,aksbo
      COMMON/SD_coup7/alup,aldo
      COMMON/SD_scala/scalb,scalt
      COMMON/SD_yukawa/ytewsb,ybewsb,ytauewsb
      COMMON/SD_runcoupscale/scalechoice,scaleofcoupling,inumloop
      COMMON/SD_mwmzpole/amwp,amzp
      COMMON/SD_runmcalc/rmtc,rmbc,rmtauc
      COMMON/SD_mixang/alp_mssm,tanbeta
      COMMON/SD_coupewsb/alsew,g2ew,g1ew
      COMMON/SD_refscale/amuref
      COMMON/SD_gluino/mgluino

      external SD_lamb
      external SD_alphascall,SD_runmass,SD_yuk
      external SD_realicorr,SD_gltchar,SD_grtchar
      external SD_glbchar,SD_grbchar
      external SD_gamtop1,SD_gamtop2,SD_gamglui1,SD_gamglui2,
     .         SD_gamglui3,SD_gam11,SD_gam12,SD_gamvirt,SD_gamreal,
     .         SD_gamcfdec
      external SD_ftotqcd

c -- the mass values needed for the QCD corrections --

      lamv = 1.D-15
      amuv = 1000.D20

c -------------------------------------------------------------------- c
c chi+_1/chi+_2 --> sneutrino_e + e+

      do i=1,2,1
         if(asne1.le.amchar(i)) then
            charsnel(i)=g2/2.d0*alsne(1,i)**2*
     .           (amchar(i)**2-asne1**2)*SD_lamb(0.d0,asne1/amchar(i))
     .           /(16*pi*amchar(i))
         else
            charsnel(i)=0.d0
         endif
      end do

c -------------------------------------------------------------------- c
c chi+_1/chi+_2 --> selectron_L+ + neutrino_e

      do i=1,2,1
         if(ase1.le.amchar(i)) then
            charsell(i)=g2/2.d0*(ale(1,i)**2)*
     .           (amchar(i)**2-ase1**2)*SD_lamb(0.d0,ase1/amchar(i))
     .           /(16*pi*amchar(i))
         else
            charsell(i)=0.d0
         endif
      end do

c -------------------------------------------------------------------- c
c chi+_1/chi+_2 --> selectron_R+ + neutrino_e

      do i=1,2,1
         if(ase2.le.amchar(i)) then
            charselr(i)=g2/2.d0*(ale(2,i)**2)*
     .           (amchar(i)**2-ase2**2)*SD_lamb(0.d0,ase2/amchar(i))
     .           /(16*pi*amchar(i))
         else
            charselr(i)=0.d0
         endif
      end do

c -------------------------------------------------------------------- c
c chi+_1/chi+_2 --> stau_1+ + neutrino_tau

      do i=1,2,1
         if (astau1.le.amchar(i)) then
            charstau1(i)=g2/2.d0*(altau(1,i)**2)*
     .           (amchar(i)**2-astau1**2)
     .           *SD_lamb(0.d0,astau1/amchar(i))
     .           /(16*pi*amchar(i))
         else
            charstau1(i)=0.d0
         endif
      end do

c -------------------------------------------------------------------- c
c chi+_1/chi+_2 --> stau_2+ + neutrino_tau

      do i=1,2,1
         if (astau2.le.amchar(i)) then
            charstau2(i)=g2/2.d0*((altau(2,i)**2)*
     .           (amchar(i)**2-astau2**2)
     .           )*SD_lamb(0.d0,astau2/amchar(i))
     .           /(16*pi*amchar(i))
         else
            charstau2(i)=0.d0
         endif
      end do

c -------------------------------------------------------------------- c
c chi+_1/chi+_2 --> sneutrino_tau1 +tau+

      do i=1,2,1
         if ((asntau1+amtau).le.amchar(i)) then
            charsn1(i)=g2/2.d0*(
     .          (alsnt(1,i)**2+blsnt(1,i)**2)*
     .          (amchar(i)**2-asntau1**2+amtau**2)
     .          +4.d0*alsnt(1,i)*blsnt(1,i)*amchar(i)*amtau)*
     .          SD_lamb(amtau/amchar(i),asntau1/amchar(i))
     .          /(16*pi*amchar(i))
         else
            charsn1(i)=0.d0
         endif
      end do

c -------------------------------------------------------------------- c
c chi+_1/chi+_2 --> sneutrino2_tau +tau+

      do i=1,2,1
         if ((asntau2+amtau).le.amchar(i)) then
            charsn2(i)=g2/2.d0*(
     .          (alsnt(2,i)**2+blsnt(2,i)**2)*
     .          (amchar(i)**2-asntau2**2+amtau**2)
     .          +4.d0*alsnt(2,i)*blsnt(2,i)*amchar(i)*amtau)*
     .          SD_lamb(amtau/amchar(i),asntau2/amchar(i))
     .          /(16*pi*amchar(i))
         else
            charsn2(i)=0.d0
         endif
      end do

c -------------------------------------------------------------------- c
c chi+_1/chi+_2 --> stop1 + bbar

      do i=1,2,1
         if(scalechoice.eq.1.D0) then
            scalb = ybewsb/dsqrt(g2)
            scalt = ytewsb/dsqrt(g2)
         elseif(scalechoice.eq.2.D0) then         
            call SD_runmass(amchar(i),0.D0,0.D0,runmb,runmt)
            scalb = SD_yuk(2,runmb)
            scalt = SD_yuk(1,runmt)
         elseif(scalechoice.eq.3.D0) then
            call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
            scalb = SD_yuk(2,runmb)
            scalt = SD_yuk(1,runmt)
         endif

         call SD_charstopbot(alstor,akstor)

         if ((ast1+amb).le.amchar(i)) then
            charst1(i)=3.D0*g2/2.d0*(
     .           (alstor(1,i)**2+akstor(1,i)**2)*
     .           (amchar(i)**2-ast1**2+amb**2)
     .           +4.D0*alstor(1,i)*akstor(1,i)*amchar(i)*amb)*
     .           SD_lamb(amb/amchar(i),ast1/amchar(i))/(16*pi*amchar(i))
         else
            charst1(i)=0.d0
         endif
      end do

c -- the QCD corrections --

      do i=1,2,1
         if ((ast1+amb).le.amchar(i)) then
            jsign = 0

            if(scalechoice.eq.1.D0) then
               scalb    = ybewsb/dsqrt(g2)
               scalt    = ytewsb/dsqrt(g2)
               gs2      = alsew*4.D0*pi
               amurefer = amuref
            elseif(scalechoice.eq.2.D0) then         
               call SD_runmass(amchar(i),0.D0,0.D0,runmb,runmt)
               scalb    = SD_yuk(2,runmb)
               scalt    = SD_yuk(1,runmt)
               gs2      = SD_alphascall(amchar(i),inumloop)*4.D0*pi
               amurefer = amchar(i)
            elseif(scalechoice.eq.3.D0) then
               call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
               scalb    = SD_yuk(2,runmb)
               scalt    = SD_yuk(1,runmt)
               gs2 = SD_alphascall(scaleofcoupling,inumloop)*4.D0*pi
               amurefer = scaleofcoupling
            endif

            amuvdiv = amuv/amurefer

            call SD_charstopbot(alstor,akstor)

            qcdcharst1(i)= -g2/24.D0/pi**2/amchar(i)*gs2/(4.D0*pi)*
     .           3.D0/2.D0*
     .           ((akstor(1,i)*SD_gltchar(1,i,amuv,amuvdiv,lamv)
     .            +alstor(1,i)*SD_grtchar(1,i,amuv,amuvdiv,lamv))*
     .           (-ast1**2+amb**2+amchar(i)**2)
     .           +2.D0*(akstor(1,i)*SD_grtchar(1,i,amuv,amuvdiv,lamv)
     .                 +alstor(1,i)*SD_gltchar(1,i,amuv,amuvdiv,lamv))*
     .           amb*amchar(i))*SD_lamb(amb/amchar(i),ast1/amchar(i)) 
     .           +g2/(6.D0*pi**2*amchar(i))*gs2/(4.D0*pi)*
     .           3.D0/2.D0*(-1.D0)*
     .           SD_realicorr(amb,amchar(i),ast1,lamv,2,jsign,1,i,1)
         else
            qcdcharst1(i)= 0.d0
         endif
      end do

c -------------------------------------------------------------------- c
c chi+_1/chi+_2 --> stop2 + bbar

      do i=1,2,1
         if(scalechoice.eq.1.D0) then
            scalb = ybewsb/dsqrt(g2)
            scalt = ytewsb/dsqrt(g2)
         elseif(scalechoice.eq.2.D0) then         
            call SD_runmass(amchar(i),0.D0,0.D0,runmb,runmt)
            scalb = SD_yuk(2,runmb)
            scalt = SD_yuk(1,runmt)
         elseif(scalechoice.eq.3.D0) then
            call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
            scalb = SD_yuk(2,runmb)
            scalt = SD_yuk(1,runmt)
         endif

         call SD_charstopbot(alstor,akstor)

         if ((ast2+amb).le.amchar(i)) then
            charst2(i)=3.d0*g2/2.d0*(
     .           (alstor(2,i)**2+akstor(2,i)**2)*
     .           (amchar(i)**2-ast2**2+amb**2)
     .           +4.d0*alstor(2,i)*akstor(2,i)*amchar(i)*amb)*
     .           SD_lamb(amb/amchar(i),ast2/amchar(i))/(16*pi*amchar(i))
         else
            charst2(i)=0.d0
         endif
      end do

c -- the QCD corrections --

      do i=1,2,1
         if ((ast2+amb).le.amchar(i)) then
            jsign = 0

            if(scalechoice.eq.1.D0) then
               scalb    = ybewsb/dsqrt(g2)
               scalt    = ytewsb/dsqrt(g2)
               gs2      = alsew*4.D0*pi
               amurefer = amuref
            elseif(scalechoice.eq.2.D0) then         
               call SD_runmass(amchar(i),0.D0,0.D0,runmb,runmt)
               scalb    = SD_yuk(2,runmb)
               scalt    = SD_yuk(1,runmt)
               gs2      = SD_alphascall(amchar(i),inumloop)*4.D0*pi
               amurefer = amchar(i)
            elseif(scalechoice.eq.3.D0) then
               call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
               scalb    = SD_yuk(2,runmb)
               scalt    = SD_yuk(1,runmt)
               gs2 = SD_alphascall(scaleofcoupling,inumloop)*4.D0*pi
               amurefer = scaleofcoupling
            endif

            amuvdiv = amuv/amurefer

            call SD_charstopbot(alstor,akstor)

            qcdcharst2(i)= -g2/24.D0/pi**2/amchar(i)*gs2/(4.D0*pi)*
     .           3.D0/2.D0*
     .           ((akstor(2,i)*SD_gltchar(2,i,amuv,amuvdiv,lamv)
     .            +alstor(2,i)*SD_grtchar(2,i,amuv,amuvdiv,lamv))*
     .           (-ast2**2+amb**2+amchar(i)**2)
     .           +2.D0*(akstor(2,i)*SD_grtchar(2,i,amuv,amuvdiv,lamv)
     .                 +alstor(2,i)*SD_gltchar(2,i,amuv,amuvdiv,lamv))*
     .           amb*amchar(i))*SD_lamb(amb/amchar(i),ast2/amchar(i)) 
     .           +g2/(6.D0*pi**2*amchar(i))*gs2/(4.D0*pi)*
     .           3.D0/2.D0*(-1.D0)*
     .           SD_realicorr(amb,amchar(i),ast2,lamv,2,jsign,2,i,1)
         else
            qcdcharst2(i)= 0.d0
         endif
      end do

c -------------------------------------------------------------------- c
c chi+_1/chi+_2 --> sbottom1* + top

      do i=1,2,1
         if(scalechoice.eq.1.D0) then
            scalb = ybewsb/dsqrt(g2)
            scalt = ytewsb/dsqrt(g2)
         elseif(scalechoice.eq.2.D0) then         
            call SD_runmass(amchar(i),0.D0,0.D0,runmb,runmt)
            scalb = SD_yuk(2,runmb)
            scalt = SD_yuk(1,runmt)
         elseif(scalechoice.eq.3.D0) then
            call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
            scalb = SD_yuk(2,runmb)
            scalt = SD_yuk(1,runmt)
         endif

         call SD_charsbottop(alsbot,aksbot)

         if ((asb1+amt).le.amchar(i)) then
            charsb1(i)=3.D0*g2/2.D0*(
     .           (alsbot(1,i)**2+aksbot(1,i)**2)*
     .           (amchar(i)**2-asb1**2+amt**2)
     .           +4.D0*alsbot(1,i)*aksbot(1,i)*amchar(i)*amt)*
     .           SD_lamb(amt/amchar(i),asb1/amchar(i))/(16*pi*amchar(i))
         else
            charsb1(i)=0.d0
         endif
      end do         

c -- the QCD corrections --

      do i=1,2,1
         if ((asb1+amt).le.amchar(i)) then
            jsign = 0

            if(scalechoice.eq.1.D0) then
               scalb    = ybewsb/dsqrt(g2)
               scalt    = ytewsb/dsqrt(g2)
               gs2      = alsew*4.D0*pi
               amurefer = amuref
            elseif(scalechoice.eq.2.D0) then         
               call SD_runmass(amchar(i),0.D0,0.D0,runmb,runmt)
               scalb    = SD_yuk(2,runmb)
               scalt    = SD_yuk(1,runmt)
               gs2      = SD_alphascall(amchar(i),inumloop)*4.D0*pi
               amurefer = amchar(i)
            elseif(scalechoice.eq.3.D0) then
               call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
               scalb    = SD_yuk(2,runmb)
               scalt    = SD_yuk(1,runmt)
               gs2 = SD_alphascall(scaleofcoupling,inumloop)*4.D0*pi
               amurefer = scaleofcoupling
            endif

            amuvdiv = amuv/amurefer

            call SD_charsbottop(alsbot,aksbot)

            qcdcharsb1(i)= -g2/24.D0/pi**2/amchar(i)*gs2/(4.D0*pi)*
     .           3.D0/2.D0*
     .           ((aksbot(1,i)*SD_glbchar(1,i,amuv,amuvdiv,lamv)
     .            +alsbot(1,i)*SD_grbchar(1,i,amuv,amuvdiv,lamv))*
     .           (-asb1**2+amt**2+amchar(i)**2)
     .           +2.D0*(aksbot(1,i)*SD_grbchar(1,i,amuv,amuvdiv,lamv)
     .                 +alsbot(1,i)*SD_glbchar(1,i,amuv,amuvdiv,lamv))*
     .           amt*amchar(i))*SD_lamb(amt/amchar(i),asb1/amchar(i)) 
     .           +g2/(6.D0*pi**2*amchar(i))*gs2/(4.D0*pi)*
     .           3.D0/2.D0*(-1.D0)*
     .           SD_realicorr(amt,amchar(i),asb1,lamv,2,jsign,1,i,2)
         else
            qcdcharsb1(i)= 0.d0
         endif
      end do

c -------------------------------------------------------------------- c
c chi+_1/chi+_2 --> sbottom2* + top

      do i=1,2,1
         if(scalechoice.eq.1.D0) then
            scalb = ybewsb/dsqrt(g2)
            scalt = ytewsb/dsqrt(g2)
         elseif(scalechoice.eq.2.D0) then         
            call SD_runmass(amchar(i),0.D0,0.D0,runmb,runmt)
            scalb = SD_yuk(2,runmb)
            scalt = SD_yuk(1,runmt)
         elseif(scalechoice.eq.3.D0) then
            call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
            scalb = SD_yuk(2,runmb)
            scalt = SD_yuk(1,runmt)
         endif

         call SD_charsbottop(alsbot,aksbot)

         if ((asb2+amt).le.amchar(i)) then
            charsb2(i)=3.D0*g2/2.D0*(
     .           (alsbot(2,i)**2+aksbot(2,i)**2)*
     .           (amchar(i)**2-asb2**2+amt**2)
     .           +4.D0*alsbot(2,i)*aksbot(2,i)*amchar(i)*amt)*
     .           SD_lamb(amt/amchar(i),asb2/amchar(i))/(16*pi*amchar(i))
         else
            charsb2(i)=0.d0
         endif
      end do

c -- the QCD corrections --

      do i=1,2,1
         if ((asb2+amt).le.amchar(i)) then
            jsign = 0

            if(scalechoice.eq.1.D0) then
               scalb    = ybewsb/dsqrt(g2)
               scalt    = ytewsb/dsqrt(g2)
               gs2      = alsew*4.D0*pi
               amurefer = amuref
            elseif(scalechoice.eq.2.D0) then         
               call SD_runmass(amchar(i),0.D0,0.D0,runmb,runmt)
               scalb    = SD_yuk(2,runmb)
               scalt    = SD_yuk(1,runmt)
               gs2      = SD_alphascall(amchar(i),inumloop)*4.D0*pi
               amurefer = amchar(i)
            elseif(scalechoice.eq.3.D0) then
               call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
               scalb    = SD_yuk(2,runmb)
               scalt    = SD_yuk(1,runmt)
               gs2 = SD_alphascall(scaleofcoupling,inumloop)*4.D0*pi
               amurefer = scaleofcoupling
            endif

            amuvdiv = amuv/amurefer

            call SD_charsbottop(alsbot,aksbot)

            qcdcharsb2(i)= -g2/24.D0/pi**2/amchar(i)*gs2/(4.D0*pi)*
     .           3.D0/2.D0*
     .           ((aksbot(2,i)*SD_glbchar(2,i,amuv,amuvdiv,lamv)
     .            +alsbot(2,i)*SD_grbchar(2,i,amuv,amuvdiv,lamv))*
     .           (-asb2**2+amt**2+amchar(i)**2)
     .           +2.D0*(aksbot(2,i)*SD_grbchar(2,i,amuv,amuvdiv,lamv)
     .                 +alsbot(2,i)*SD_glbchar(2,i,amuv,amuvdiv,lamv))*
     .           amt*amchar(i))*SD_lamb(amt/amchar(i),asb2/amchar(i)) 
     .           +g2/(6.D0*pi**2*amchar(i))*gs2/(4.D0*pi)*
     .           3.D0/2.D0*(-1.D0)*
     .           SD_realicorr(amt,amchar(i),asb2,lamv,2,jsign,2,i,2)
         else
            qcdcharsb2(i)= 0.d0
         endif
      end do

c -------------------------------------------------------------------- c
c chi+_1/chi+_2 --> sdownl* + up

      do i=1,2,1
         if(asdown1.le.amchar(i)) then
            charsdownl(i)=3.D0*g2/2.D0*aldo(1,i)**2*
     .           (amchar(i)**2-asdown1**2)*
     .           SD_lamb(0.D0,asdown1/amchar(i))/(16*pi*amchar(i))
         else
            charsdownl(i)=0.D0
         endif
      end do


c --- the QCD corrections ---

      do i=1,2,1
         if(amchar(i).ge.asdown1) then
            if(scalechoice.eq.1.D0) then
               gs2 = alsew*4.D0*pi
            elseif(scalechoice.eq.2.D0) then         
               gs2 = SD_alphascall(amchar(i),inumloop)*4.D0*pi
            elseif(scalechoice.eq.3.D0) then
               gs2 = SD_alphascall(scaleofcoupling,inumloop)*4.D0*pi
            endif

            qcdcharsdownl(i)=4.D0/3.D0*gs2/(4.D0*pi)/pi*charsdownl(i)*
     .       SD_ftotqcd(asdown1**2/amchar(i)**2,mgluino**2/amchar(i)**2)
         else
            qcdcharsdownl(i)=0.d0
         endif
      end do

c -------------------------------------------------------------------- c
c chi+_1/chi+_2 --> sdownr* + up

      do i=1,2,1
         if(asdown2.le.amchar(i)) then
            charsdownr(i)=3.D0*g2/2.D0*aldo(2,i)**2*
     .           (amchar(i)**2-asdown2**2)*
     .           SD_lamb(0.D0,asdown2/amchar(i))/(16*pi*amchar(i))
         else
            charsdownr(i)=0.D0
         endif
      end do

c --- the QCD corrections ---

      do i=1,2,1
         if(amchar(i).ge.asdown2) then
            if(scalechoice.eq.1.D0) then
               gs2 = alsew*4.D0*pi
            elseif(scalechoice.eq.2.D0) then         
               gs2 = SD_alphascall(amchar(i),inumloop)*4.D0*pi
            elseif(scalechoice.eq.3.D0) then
               gs2 = SD_alphascall(scaleofcoupling,inumloop)*4.D0*pi
            endif

            qcdcharsdownr(i)=4.D0/3.D0*gs2/(4.D0*pi)/pi*charsdownr(i)*
     .       SD_ftotqcd(asdown2**2/amchar(i)**2,mgluino**2/amchar(i)**2)
         else
            qcdcharsdownr(i)=0.d0
         endif
      end do

c -------------------------------------------------------------------- c
c chi+_1/chi+_2 --> supl + downbar

      do i=1,2,1
         if (asup1.le.amchar(i)) then
            charsupl(i)=3.d0*g2/2.d0*alup(1,i)**2*
     .           (amchar(i)**2-asup1**2)*
     .           SD_lamb(0.d0,asup1/amchar(i))/(16*pi*amchar(i))
         else
            charsupl(i)=0.d0
         endif
      end do

c --- the QCD corrections ---

      do i=1,2,1
         if(amchar(i).ge.asup1) then
            if(scalechoice.eq.1.D0) then
               gs2 = alsew*4.D0*pi
            elseif(scalechoice.eq.2.D0) then         
               gs2 = SD_alphascall(amchar(i),inumloop)*4.D0*pi
            elseif(scalechoice.eq.3.D0) then
               gs2 = SD_alphascall(scaleofcoupling,inumloop)*4.D0*pi
            endif

            qcdcharsupl(i)=4.D0/3.D0*gs2/(4.D0*pi)/pi*charsupl(i)*
     .       SD_ftotqcd(asup1**2/amchar(i)**2,mgluino**2/amchar(i)**2)
         else
            qcdcharsupl(i)=0.d0
         endif
      end do

c -------------------------------------------------------------------- c
c chi+_1/chi+_2 --> supr + downbar

      do i=1,2,1
         if (asup2.le.amchar(i)) then
            charsupr(i)=3.d0*g2/2.d0*alup(2,i)**2*
     .           (amchar(i)**2-asup2**2)*
     .           SD_lamb(0.d0,asup2/amchar(i))/(16*pi*amchar(i))
         else
            charsupr(i)=0.d0
         endif
      end do

c --- the QCD corrections ---

      do i=1,2,1
         if(amchar(i).ge.asup2) then
            if(scalechoice.eq.1.D0) then
               gs2 = alsew*4.D0*pi
            elseif(scalechoice.eq.2.D0) then         
               gs2 = SD_alphascall(amchar(i),inumloop)*4.D0*pi
            elseif(scalechoice.eq.3.D0) then
               gs2 = SD_alphascall(scaleofcoupling,inumloop)*4.D0*pi
            endif

            qcdcharsupr(i)=4.D0/3.D0*gs2/(4.D0*pi)/pi*charsupr(i)*
     .       SD_ftotqcd(asup2**2/amchar(i)**2,mgluino**2/amchar(i)**2)
         else
            qcdcharsupr(i)=0.d0
         endif
      end do

c -------------------------------------------------------------------- c
c chi+_2 --> chi+_1 + Z

      if ((amzp+amchar(1)).le.amchar(2)) then
         char2zchic1=g2/2.d0/cw**2*(-12.d0*amchar(1)*amchar(2)*
     .        opl(1,2)*opr(1,2)+(opl(1,2)**2+opr(1,2)**2)*
     .        ((amchar(1)**2+amchar(2)**2-amzp**2)+
     .        (amchar(2)**2+amzp**2-amchar(1)**2)*
     .        (amchar(2)**2-amchar(1)**2-amzp**2)/amzp**2))
     .        *SD_lamb(amchar(1)/amchar(2),amzp/amchar(2))
     .        /(16.d0*pi*amchar(2))
      else
         char2zchic1=0.d0
      endif

c -------------------------------------------------------------------- c
c chi+_2 --> chi+_1 + h

      if ((aml+amchar(1)).le.amchar(2)) then
         char2hlchic1=g2/2.d0*((gkhll(1,2)**2+gkhlr(1,2)**2)*
     .        (amchar(1)**2+amchar(2)**2-aml**2)+4.d0*gkhll(1,2)*
     .        gkhlr(1,2)*amchar(1)*amchar(2))*
     .        SD_lamb(amchar(1)/amchar(2),aml/amchar(2))
     .        /(16.d0*pi*amchar(2))
      else
         char2hlchic1=0.d0
      endif

c -------------------------------------------------------------------- c
c chi+_2 --> chi+_1 + H

      if ((amh+amchar(1)).le.amchar(2)) then
         char2hhchic1=g2/2.d0*((gkhhl(1,2)**2+gkhhr(1,2)**2)*
     .        (amchar(1)**2+amchar(2)**2-amh**2)+4.d0*gkhhl(1,2)*
     .        gkhhr(1,2)*amchar(1)*amchar(2))*
     .        SD_lamb(amchar(1)/amchar(2),amh/amchar(2))
     .        /(16.d0*pi*amchar(2))
      else
         char2hhchic1=0.d0
      endif

c -------------------------------------------------------------------- c
c chi+_2 --> chi+_1 + A

      if ((ama+amchar(1)).le.amchar(2)) then
         char2hachic1=g2/2.d0*((gkhal(1,2)**2+gkhar(1,2)**2)*
     .        (amchar(1)**2+amchar(2)**2-ama**2)+4.d0*gkhal(1,2)*
     .        gkhar(1,2)*amchar(1)*amchar(2))*
     .        SD_lamb(amchar(1)/amchar(2),ama/amchar(2))
     .        /(16.d0*pi*amchar(2))
      else
         char2hachic1=0.d0
      endif

c -------------------------------------------------------------------- c
c chi+_1/chi+_2 --> chi0_1/chi0_2/chi0_3/chi0_4 + H+

      do i=1,2,1
         do j=1,4,1
            if ((amch+amneut(j)).le.amchar(i)) then
               charhcneut(i,j)=g2/2.d0*((ql(j,i)**2+qr(j,i)**2)*
     .              (amneut(j)**2+amchar(i)**2-amch**2)+4.d0*ql(j,i)*
     .              qr(j,i)*xmneut(j)*amchar(i))*
     .              SD_lamb(amneut(j)/amchar(i),amch/amchar(i))
     .              /(16.d0*pi*amchar(i))
            else
               charhcneut(i,j)=0.d0
            endif
         end do
      end do

c -------------------------------------------------------------------- c
c chi+_1/chi+_2 --> chi0_1/chi0_2/chi0_3/chi0_4 + W+

      do i=1,2,1
         do j=1,4,1
            if ((amwp+amneut(j)).le.amchar(i)) then
               charwneut(i,j)=g2/2.d0*(
     .              -12.d0*xmneut(j)*amchar(i)*ol(j,i)*
     .              or(j,i)+(ol(j,i)**2+or(j,i)**2)*((amneut(j)**2+
     .              amchar(i)**2-amwp**2)+
     .              (amchar(i)**2+amwp**2-amneut(j)**2)*
     .              (amchar(i)**2-amneut(j)**2-amwp**2)/amwp**2))*
     .              SD_lamb(amneut(j)/amchar(i),amwp/amchar(i))
     .              /(16.d0*pi*amchar(i))
            else
               charwneut(i,j)=0.d0
            endif
         end do
      end do

      end

c ==================================================================== c
c                   The chargino1/2 3-body decays                      c
c ==================================================================== c

      subroutine SD_xintegchipm(xchitau,xchiel,xchiup,xchimu,xchich,
     .                          xchitop,xchar1el,xchar1mu,xchar1tau,
     .                          xchar1nue,xchar1numu,xchar1nutau,
     .                          xchar1up,xchar1dow,xchar1ch,xchar1str,
     .                          xchar1top,xchar1bot,xgluiupdb,xgluichsb,
     .                          xgluitopbb)
      
      implicit double precision (a-h,m,o-z)  
      integer nx1t,ny1t,ni,nj

      dimension xchitau(2,4),xchiel(2,4),xchiup(2,4),xchimu(2,4),
     .          xchich(2,4),xchitop(2,4),xgluiupdb(2),xgluichsb(2),
     .          xgluitopbb(2)
      dimension amneut(4),xmneut(4),amchar(2)

      external SD_ay,SD_by,SD_ax,SD_bx
      external SD_chipmtau,SD_chipmel,SD_chipmup,SD_chipmtop,SD_charel,
     .         SD_chartau,SD_charnue,SD_charnutau,SD_charup,SD_chardow,
     .         SD_charbot,SD_chartop,SD_gluiupdb,SD_gluitopbb

      COMMON/SD_nx1/nx1t,ny1t
      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_gluino/mgluino
      COMMON/SD_fermion/amt,amb,amtau
      COMMON/SD_param/sdgf,amz,amw,pi,g2
      COMMON/SD_indices/ni,nj

c -------------------------------------------------------------------- c
c ------------------------ neutralino tau nutau ---------------------- c
c -------------------------------------------------------------------- c

      do ni = 1,2,1
         do nj = 1,4,1
            xmu1=0.D0
            xmu2=amtau**2/amchar(ni)**2
            xmu3=amneut(nj)**2/amchar(ni)**2

            if(amchar(ni).gt.(amtau+amneut(nj))) then
               call SD_integ2(SD_chipmtau,SD_ax,SD_bx,SD_ay,SD_by,xmu1,
     .                     xmu2,xmu3,nx1t,ny1t,sum)
               xchitau(ni,nj) = sum/64.D0/(2.D0*pi)**3*amchar(ni)
            else
               xchitau(ni,nj) = 0.D0
            endif
         end do
      end do

c -------------------------------------------------------------------- c
c ------------------------- neutralino e+ nu_e ----------------------- c
c -------------------------------------------------------------------- c

      do ni = 1,2,1
         do nj = 1,4,1
            xmu1=0.D0
            xmu2=0.D0
            xmu3=amneut(nj)**2/amchar(ni)**2

            if(amchar(ni).gt.amneut(nj)) then
               call SD_integ2(SD_chipmel,SD_ax,SD_bx,SD_ay,SD_by,xmu1,
     .                     xmu2,xmu3,nx1t,ny1t,sum)
               xchiel(ni,nj) = sum/64.D0/(2.D0*pi)**3*amchar(ni)
            else
               xchiel(ni,nj) = 0.D0
            endif
         end do
      end do

c -------------------------------------------------------------------- c
c ----------------------- neutralino mu+ nu_mu ----------------------- c
c -------------------------------------------------------------------- c

      do i=1,4,1
         xchimu(1,i) = xchiel(1,i)
         xchimu(2,i) = xchiel(2,i)
      end do

c -------------------------------------------------------------------- c
c ----------------------- neutralino up downbar ---------------------- c
c -------------------------------------------------------------------- c

      do ni = 1,2,1
         do nj = 1,4,1
            xmu1=0.D0
            xmu2=0.D0
            xmu3=amneut(nj)**2/amchar(ni)**2

            if(amchar(ni).gt.amneut(nj)) then
               call SD_integ2(SD_chipmup,SD_ax,SD_bx,SD_ay,SD_by,xmu1,
     .                     xmu2,xmu3,nx1t,ny1t,sum)
               xchiup(ni,nj) = sum/64.D0/(2.D0*pi)**3*amchar(ni)*3.D0
            else
               xchiup(ni,nj) = 0.D0
            endif
         end do
      end do

c -------------------------------------------------------------------- c
c -------------------- neutralino charm strangebar ------------------- c
c -------------------------------------------------------------------- c

      do i=1,4,1
         xchich(1,i) = xchiup(1,i)
         xchich(2,i) = xchiup(2,i)
      end do

c -------------------------------------------------------------------- c
c --------------------- neutralino top bottombar --------------------- c
c -------------------------------------------------------------------- c

      do ni = 1,2,1
         do nj = 1,4,1
            xmu1=amt**2/amchar(ni)**2
            xmu2=amb**2/amchar(ni)**2
            xmu3=amneut(nj)**2/amchar(ni)**2

            if(amchar(ni).gt.(amneut(nj)+amt+amb)) then
               call SD_integ2(SD_chipmtop,SD_ax,SD_bx,SD_ay,SD_by,xmu1,
     .                     xmu2,xmu3,nx1t,ny1t,sum)
               xchitop(ni,nj) = sum/64.D0/(2.D0*pi)**3*amchar(ni)*3.D0
            else
               xchitop(ni,nj) = 0.D0
            endif
         end do
      end do

c -------------------------------------------------------------------- c
c --------------------------- chargino e+ e- ------------------------- c
c -------------------------------------------------------------------- c

      xmu1=0.D0
      xmu2=0.D0
      xmu3=amchar(1)**2/amchar(2)**2

      if(amchar(2).gt.amchar(1)) then
         call SD_integ2(SD_charel,SD_ax,SD_bx,SD_ay,SD_by,xmu1,xmu2,
     .               xmu3,nx1t,ny1t,sum)
         xchar1el = sum/64.D0/(2.D0*pi)**3*amchar(2)
      else
         xchar1el = 0.D0
      endif

c -------------------------------------------------------------------- c
c ------------------------- chargino mu+ mu- ------------------------- c
c -------------------------------------------------------------------- c

      xchar1mu = xchar1el

c -------------------------------------------------------------------- c
c ------------------------- chargino tau+ tau- ----------------------- c
c -------------------------------------------------------------------- c

      xmu1=amtau**2/amchar(2)**2
      xmu2=amtau**2/amchar(2)**2
      xmu3=amchar(1)**2/amchar(2)**2

      if(amchar(2).gt.(amchar(1)+2.D0*amtau)) then
         call SD_integ2(SD_chartau,SD_ax,SD_bx,SD_ay,SD_by,xmu1,xmu2,
     .               xmu3,nx1t,ny1t,sum)
         xchar1tau = sum/64.D0/(2.D0*pi)**3*amchar(2)
      else
         xchar1tau = 0.D0
      endif

c -------------------------------------------------------------------- c
c ---------------------- chargino nubar_e nu_e ----------------------- c
c -------------------------------------------------------------------- c

      xmu1=0.D0
      xmu2=0.D0
      xmu3=amchar(1)**2/amchar(2)**2

      if(amchar(2).gt.amchar(1)) then
         call SD_integ2(SD_charnue,SD_ax,SD_bx,SD_ay,SD_by,xmu1,xmu2,
     .               xmu3,nx1t,ny1t,sum)
         xchar1nue = sum/64.D0/(2.D0*pi)**3*amchar(2)
      else
         xchar1nue = 0.D0
      endif

c -------------------------------------------------------------------- c
c --------------------- chargino nubar_mu nu_mu ---------------------- c
c -------------------------------------------------------------------- c

      xchar1numu = xchar1nue

c -------------------------------------------------------------------- c
c -------------------- chargino nubar_tau nu_tau --------------------- c
c -------------------------------------------------------------------- c

      xmu1=0.D0
      xmu2=0.D0
      xmu3=amchar(1)**2/amchar(2)**2

      if(amchar(2).gt.amchar(1)) then
         call SD_integ2(SD_charnutau,SD_ax,SD_bx,SD_ay,SD_by,xmu1,
     .               xmu2,xmu3,nx1t,ny1t,sum)
         xchar1nutau = sum/64.D0/(2.D0*pi)**3*amchar(2)
      else
         xchar1nutau = 0.D0
      endif

c -------------------------------------------------------------------- c
c ------------------------ chargino up upbar ------------------------- c
c -------------------------------------------------------------------- c

      xmu1=0.D0
      xmu2=0.D0
      xmu3=amchar(1)**2/amchar(2)**2

      if(amchar(2).gt.amchar(1)) then
         call SD_integ2(SD_charup,SD_ax,SD_bx,SD_ay,SD_by,xmu1,xmu2,
     .               xmu3,nx1t,ny1t,sum)
         xchar1up = 3.D0*sum/64.D0/(2.D0*pi)**3*amchar(2)
      else
         xchar1up = 0.D0
      endif

c -------------------------------------------------------------------- c
c -------------------- chargino charm charmbar ----------------------- c
c -------------------------------------------------------------------- c

      xchar1ch = xchar1up

c -------------------------------------------------------------------- c
c ---------------------- chargino down downbar ----------------------- c
c -------------------------------------------------------------------- c

      xmu1=0.D0
      xmu2=0.D0
      xmu3=amchar(1)**2/amchar(2)**2

      if(amchar(2).gt.amchar(1)) then
         call SD_integ2(SD_chardow,SD_ax,SD_bx,SD_ay,SD_by,xmu1,xmu2,
     .               xmu3,nx1t,ny1t,sum)
         xchar1dow = 3.D0*sum/64.D0/(2.D0*pi)**3*amchar(2)
      else
         xchar1dow = 0.D0
      endif

c -------------------------------------------------------------------- c
c ------------------- chargino strange strangebar -------------------- c
c -------------------------------------------------------------------- c

      xchar1str = xchar1dow

c -------------------------------------------------------------------- c
c ----------------------- chargino top topbar ------------------------ c
c -------------------------------------------------------------------- c

      xmu1=amt**2/amchar(2)**2
      xmu2=amt**2/amchar(2)**2
      xmu3=amchar(1)**2/amchar(2)**2

      if(amchar(2).gt.(amchar(1)+2.D0*amt)) then
         call SD_integ2(SD_chartop,SD_ax,SD_bx,SD_ay,SD_by,xmu1,xmu2,
     .               xmu3,nx1t,ny1t,sum)
         xchar1top = 3.D0*sum/64.D0/(2.D0*pi)**3*amchar(2)
      else
         xchar1top = 0.D0
      endif

c -------------------------------------------------------------------- c
c -------------------- chargino bottom bottombar --------------------- c
c -------------------------------------------------------------------- c

      xmu1=amb**2/amchar(2)**2
      xmu2=amb**2/amchar(2)**2
      xmu3=amchar(1)**2/amchar(2)**2

      if(amchar(2).gt.(amchar(1)+2.D0*amb)) then
         call SD_integ2(SD_charbot,SD_ax,SD_bx,SD_ay,SD_by,xmu1,xmu2,
     .               xmu3,nx1t,ny1t,sum)
         xchar1bot = 3.D0*sum/64.D0/(2.D0*pi)**3*amchar(2)
      else
         xchar1bot = 0.D0
      endif

c -------------------------------------------------------------------- c
c ------------------------- gluino up downbar ------------------------ c
c -------------------------------------------------------------------- c

      do ni=1,2,1
         xmu1=0.D0
         xmu2=0.D0
         xmu3=mgluino**2/amchar(ni)**2

         if(amchar(ni).gt.dabs(mgluino)) then
            call SD_integ2(SD_gluiupdb,SD_ax,SD_bx,SD_ay,SD_by,xmu1,
     .                  xmu2,xmu3,nx1t,ny1t,sum)
            xgluiupdb(ni) = sum/64.D0/pi**3*amchar(ni)
         else
            xgluiupdb(ni) = 0.D0
         endif
      end do

c -------------------------------------------------------------------- c
c ---------------------- gluino charm strangebar --------------------- c
c -------------------------------------------------------------------- c

      xgluichsb(1) = xgluiupdb(1)
      xgluichsb(2) = xgluiupdb(2)

c -------------------------------------------------------------------- c
c ----------------------- gluino top bottombar ----------------------- c
c -------------------------------------------------------------------- c

      do ni=1,2,1
         xmu1=amt**2/amchar(ni)**2
         xmu2=amb**2/amchar(ni)**2
         xmu3=mgluino**2/amchar(ni)**2

         if(amchar(ni).gt.(dabs(mgluino)+amt+amb)) then
            call SD_integ2(SD_gluitopbb,SD_ax,SD_bx,SD_ay,SD_by,xmu1,
     .                  xmu2,xmu3,nx1t,ny1t,sum)
            xgluitopbb(ni) = sum/64.D0/pi**3*amchar(ni)
         else
            xgluitopbb(ni) = 0.D0
         endif
      end do

      end

c ==================================================================== c
c ======================= neutralino tau+ nutau ====================== c
c ==================================================================== c

      double precision function SD_chipmtau(x1,x2)

      implicit double precision (a-h,m,o-z)
      integer ni,nj
      
      dimension amneut(4),xmneut(4),amchar(2)
      dimension dsto(2),dstob(2)
      dimension ae(2,4),be(2,4),ato(2,4),bto(2,4),anu(2,4),bnu(2,4),
     .          antau(2,4),bntau(2,4)
      dimension ale(2,2),alto(2,2),alsne(2,2),blsne(2,2),alsnt(2,2),
     .          blsnt(2,2),blto(2,2)
      dimension ql(4,2),qr(4,2),or(4,2),ol(4,2)

      COMMON/SD_indices/ni,nj
      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_hmass/ama,aml,amh,amch,amar
      COMMON/SD_fermion/amt,amb,amtau
      COMMON/SD_sfermionetau/ase1,ase2,astau1,astau2
      COMMON/SD_sneutrino/asne1,asne2,asntau1,asntau2
      COMMON/SD_coup5/ale,alto,alsne,blsne,alsnt,blsnt
      COMMON/SD_coup8/ae,be,ato,bto,anu,bnu,antau,bntau    
      COMMON/SD_coup3/ql,qr,ol,or
      COMMON/SD_coup15/achtop,vchtop,achtau,vchtau
      COMMON/SD_coup18/awff,vwff
      COMMON/SD_mwmzpole/amwp,amzp

c --- several definitions

c --- the neutrino mass ---
      amne = 0.D0

      xmustau1 = astau1**2/amchar(ni)**2
      xmustau2 = astau2**2/amchar(ni)**2
      xmusn1   = asntau1**2/amchar(ni)**2
      xmusn2   = asntau2**2/amchar(ni)**2
      xmutau   = amtau**2/amchar(ni)**2
      xmun     = amne**2/amchar(ni)**2

      xmuneut1 = amneut(nj)**2/amchar(ni)**2

      x3 = 2.D0-x1-x2
      y3 = 1.D0+xmuneut1-x3

      do i=1,2,1
         blto(1,i)   = 0.D0
         blto(2,i)   = 0.D0
      end do

      uh = 1.D0-x1+xmun
      th = 1.D0-x2+xmutau

c -------------------------------------------------------------------- c
c                         stau/sneutrino_tau exchange 
c -------------------------------------------------------------------- c

      dsto(1)  = 1-x1-xmustau1+xmun
      dsto(2)  = 1-x1-xmustau2+xmun
      dstob(1) = 1-x2-xmusn1+xmutau
      dstob(2) = 1-x2-xmusn2+xmutau

      chipmstau=0.D0

c ---- final state masses included ----

      if((amneut(nj)+amtau).le.amchar(ni)) then
         do i=1,2
            do k=1,2
               chipmstau=chipmstau
     .          +g2**2/dsto(k)/dsto(i)*(
     .           (alto(i,ni)*blto(k,ni)+blto(i,ni)*alto(k,ni))*
     .           (ato(i,nj)*bto(k,nj)+bto(i,nj)*ato(k,nj))*
     .           xmneut(nj)/amchar(ni)*dsqrt(xmun*xmutau)*(-4.D0)+
     .           (alto(i,ni)*alto(k,ni)+blto(i,ni)*blto(k,ni))*
     .           (ato(i,nj)*bto(k,nj)+bto(i,nj)*ato(k,nj))*
     .           xmneut(nj)/amchar(ni)*dsqrt(xmutau)*2.D0*
     .           (uh-xmun-1.D0)+
     .           (alto(i,ni)*blto(k,ni)+blto(i,ni)*alto(k,ni))*
     .           (ato(i,nj)*ato(k,nj)+bto(i,nj)*bto(k,nj))*
     .           dsqrt(xmun)*2.D0*(uh-xmutau-xmuneut1)+
     .           (alto(i,ni)*alto(k,ni)+blto(i,ni)*blto(k,ni))*
     .           (ato(i,nj)*ato(k,nj)+bto(i,nj)*bto(k,nj))*
     .           (-uh**2+uh*(1.D0+xmuneut1+xmun+xmutau)-
     .           (xmuneut1+xmutau)*(1.D0+xmun)))
     .           +g2**2/dstob(k)/dstob(i)*(
     .           (alsnt(i,ni)*blsnt(k,ni)+blsnt(i,ni)*alsnt(k,ni))*
     .           (antau(i,nj)*bntau(k,nj)+bntau(i,nj)*antau(k,nj))*
     .           xmneut(nj)/amchar(ni)*dsqrt(xmutau*xmun)*(-4.D0)+
     .           (alsnt(i,ni)*alsnt(k,ni)+blsnt(i,ni)*blsnt(k,ni))*
     .           (antau(i,nj)*bntau(k,nj)+bntau(i,nj)*antau(k,nj))*
     .           xmneut(nj)/amchar(ni)*dsqrt(xmun)*2.D0*
     .           (th-xmutau-1.D0)+
     .           (alsnt(i,ni)*blsnt(k,ni)+blsnt(i,ni)*alsnt(k,ni))*
     .           (antau(i,nj)*antau(k,nj)+bntau(i,nj)*bntau(k,nj))*
     .           dsqrt(xmutau)*2.D0*(th-xmun-xmuneut1)+
     .           (alsnt(i,ni)*alsnt(k,ni)+blsnt(i,ni)*blsnt(k,ni))*
     .           (antau(i,nj)*antau(k,nj)+bntau(i,nj)*bntau(k,nj))*
     .           (-th**2+th*(1.D0+xmuneut1+xmun+xmutau)-(xmuneut1+xmun)*
     .           (1.D0+xmutau)))
     .           -2.D0*g2**2/dsto(k)/dstob(i)*(
     .           (blsnt(i,ni)*blto(k,ni)*antau(i,nj)*ato(k,nj)
     .           +alsnt(i,ni)*alto(k,ni)*bntau(i,nj)*bto(k,nj))*
     .           xmneut(nj)/amchar(ni)*dsqrt(xmun*xmutau)*(-2.D0)+
     .           (alsnt(i,ni)*blto(k,ni)*antau(i,nj)*ato(k,nj)
     .           +blsnt(i,ni)*alto(k,ni)*bntau(i,nj)*bto(k,nj))*
     .           xmneut(nj)/amchar(ni)*dsqrt(xmun)*
     .           (th-xmutau-1.D0)+
     .           (blsnt(i,ni)*alto(k,ni)*antau(i,nj)*ato(k,nj)
     .           +alsnt(i,ni)*blto(k,ni)*bntau(i,nj)*bto(k,nj))*
     .           xmneut(nj)/amchar(ni)*dsqrt(xmutau)*
     .           (uh-xmun-1.D0)+
     .           (alsnt(i,ni)*alto(k,ni)*antau(i,nj)*ato(k,nj)
     .           +blsnt(i,ni)*blto(k,ni)*bntau(i,nj)*bto(k,nj))*
     .           xmneut(nj)/amchar(ni)*(uh+th-xmuneut1-1.D0)+
     .           (alto(k,ni)*blsnt(i,ni)*ato(k,nj)*bntau(i,nj)
     .           +blto(k,ni)*alsnt(i,ni)*bto(k,nj)*antau(i,nj))*
     .           dsqrt(xmun*xmutau)*(uh+th-xmun-xmutau)+
     .           (alto(k,ni)*alsnt(i,ni)*ato(k,nj)*bntau(i,nj)
     .           +blto(k,ni)*blsnt(i,ni)*bto(k,nj)*antau(i,nj))*
     .           dsqrt(xmun)*(uh-xmutau-xmuneut1)+
     .           (blto(k,ni)*blsnt(i,ni)*ato(k,nj)*bntau(i,nj)
     .           +alto(k,ni)*alsnt(i,ni)*bto(k,nj)*antau(i,nj))*
     .           dsqrt(xmutau)*(th-xmun-xmuneut1)+
     .           (blto(k,ni)*alsnt(i,ni)*ato(k,nj)*bntau(i,nj)
     .           +alto(k,ni)*blsnt(i,ni)*bto(k,nj)*antau(i,nj))*
     .           (uh*th-xmun*xmutau-xmuneut1))
            enddo
         enddo         
      else
         chipmstau=0.D0
      endif

c -------------------------------------------------------------------- c
c                              W exchange
c -------------------------------------------------------------------- c

      xmuw = amwp**2/amchar(ni)**2
      dw   = y3-xmuw

      chipmw = 0.D0

c ---- final state masses included ----

      rh = xmuneut1+xmun+xmutau-th-uh+1.D0
      sh = (xmuneut1-th-uh+1.D0)*(xmun+xmutau)+4.D0*xmun*xmutau
      rk = xmuneut1*(xmun+xmutau-th-uh+4.D0)+xmun+xmutau-uh-th

      if((amneut(nj)+amtau).le.amchar(ni)) then
         chipmw=chipmw+g2**2/dw**2*(
     .    ol(nj,ni)*or(nj,ni)*2.D0*vwff**2*
     .    xmneut(nj)/amchar(ni)*(8.D0/xmuw**2*rh*sh-16.D0/xmuw*sh
     .    -16.D0*(xmuneut1-uh-th+1.D0))
     .    +(ol(nj,ni)**2+or(nj,ni)**2)*2.D0*vwff**2*
     .    (-2.D0/xmuw**2*rk*sh+8.D0/xmuw*(xmuneut1*(2.D0*xmun*xmutau+
     .    2.D0*(xmun+xmutau)-xmun*th-xmutau*uh)+2.D0*xmun*xmutau
     .    -xmun*uh-xmutau*th)+4.D0*(xmuneut1*(uh+th-xmun-xmutau-2.D0)+
     .    (xmun+xmutau)*(uh+th-1.D0)-2.D0*xmun*xmutau+th*(-th+1.D0)+
     .    uh*(-uh+1.D0)))+
     .    (ol(nj,ni)**2-or(nj,ni)**2)*vwff**2*8.D0*(
     .    xmuneut1*(xmun-xmutau+th-uh)+(xmun+xmutau)*(th-uh)-xmun+
     .    xmutau+th*(-th+1.D0)+uh*(uh-1.D0))
     .    )
      else
         chipmw=0.D0
      endif

c -------------------------------------------------------------------- c
c                              H+ exchange
c -------------------------------------------------------------------- c

      xmuch = amch**2/amchar(ni)**2
      dh    = y3-xmuch

c ---- final state masses included ----

      if((amneut(nj)+amtau).le.amchar(ni)) then
         chipmh=g2**2/dh**2*(
     .    ql(nj,ni)*qr(nj,ni)*(
     .    (vchtau**2-achtau**2)*
     .    xmneut(nj)/amchar(ni)*dsqrt(xmun*xmutau)*(-16.D0)+
     .    (vchtau**2+achtau**2)*
     .    xmneut(nj)/amchar(ni)*8.D0*(1.D0+xmuneut1-th-uh) ) 
     .    +(ql(nj,ni)**2+qr(nj,ni)**2)*(
     .    (vchtau**2-achtau**2)*
     .    dsqrt(xmun*xmutau)*4.D0*(xmun+xmutau-th-uh)+
     .    (vchtau**2+achtau**2)*
     .    2.D0*(xmuneut1*(uh+th-xmun-xmutau)+(xmun+xmutau)*(uh+th-1.D0)
     .    -(th+uh)**2+uh+th)) )
      else
         chipmh=0.D0
      endif

c -------------------------------------------------------------------- c
c                    W+ stau/sneutrino_tau interference
c -------------------------------------------------------------------- c

      chipmwstau=0.D0

c ---- final state masses included ----

      if((amneut(nj)+amtau).le.amchar(ni)) then
         do i=1,2
            chipmwstau=chipmwstau
     .       +g2**2/dsto(i)/dw*2.D0*vwff*(
     .      blto(i,ni)*bto(i,nj)*or(nj,ni)*
     .      xmneut(nj)/amchar(ni)*dsqrt(xmun*xmutau)*(
     .      1/xmuw*(-4.D0)*(1.D0+xmuneut1+xmun+xmutau-uh-th)+16.D0) +
     .      alto(i,ni)*ato(i,nj)*ol(nj,ni)*
     .      xmneut(nj)/amchar(ni)*(2.D0/xmuw*((xmuneut1+1.D0-uh-th)*
     .      (xmun+xmutau)+4.D0*xmun*xmutau)+4.D0*(1.D0+xmuneut1-
     .      uh-th)) +
     .      blto(i,ni)*bto(i,nj)*ol(nj,ni)*dsqrt(xmun*xmutau)*
     .      (2.D0/xmuw*(xmuneut1*(xmun+xmutau-th-uh+4.D0)+xmun+xmutau
     .      -th-uh)+4.D0*(xmun+xmutau-th-uh)) +
     .      alto(i,ni)*ato(i,nj)*or(nj,ni)*
     .      (2.D0/xmuw*(xmuneut1*(-2.D0*xmun*xmutau+xmun*th
     .      -2.D0*xmun+xmutau*uh-2.D0*xmutau)+xmun*(-2.D0*xmutau+uh)
     .      +xmutau*th)+4.D0*(xmuneut1*(xmun-uh+1.D0)+xmun*(xmutau-uh)
     .      +xmutau*(1.D0-uh)+uh**2-uh)) + 
     .      ato(i,nj)*blto(i,ni)*ol(nj,ni)*
     .      xmneut(nj)/amchar(ni)*dsqrt(xmun)*(2.D0/xmuw*
     .      (xmuneut1*(1.D0+xmun-uh)+1.D0+xmun*(xmutau-uh)+xmutau*
     .      (xmutau-th-2.D0*uh+3.D0)+th*(uh-1.D0)+uh*(uh-2.D0))+
     .      4.D0*(1.D0+xmutau-th)) +
     .      bto(i,nj)*alto(i,ni)*or(nj,ni)*
     .      xmneut(nj)/amchar(ni)*dsqrt(xmutau)*
     .      (2.D0/xmuw*(xmuneut1*(-1.D0-xmun+uh)-1.D0+xmutau*(-1.D0+uh)
     .      +uh*(2.D0-th-uh)+th+xmun*(-xmun-xmutau+th+2.D0*uh-2.D0))+
     .      8.D0*(1.D0+xmun-uh)) +
     .      blto(i,ni)*ato(i,nj)*or(nj,ni)*
     .      dsqrt(xmun)*((-2.D0)/xmuw*(xmuneut1-uh+xmutau)*
     .      (xmuneut1+xmun+xmutau-th-uh+1.D0)+8.D0*(xmuneut1+xmutau
     .      -uh)) +
     .      alto(i,ni)*bto(i,nj)*ol(nj,ni)*
     .      dsqrt(xmutau)*(2.D0/xmuw*(xmuneut1*(xmuneut1+
     .      3.D0*xmun-th-2.D0*uh+1.D0)+xmun*(xmun+xmutau-th-2.D0*uh)+
     .      xmutau*(1.D0-uh)+uh*th+uh**2-uh)+4.D0*(xmuneut1+xmun-th)) )
     .      -g2**2/dstob(i)/dw*2.D0*vwff*(
     .      blsnt(i,ni)*bntau(i,nj)*ol(nj,ni)*
     .      xmneut(nj)/amchar(ni)*dsqrt(xmun*xmutau)*(
     .      1/xmuw*(-4.D0)*(1.D0+xmuneut1+xmun+xmutau-uh-th)+16.D0) +
     .      alsnt(i,ni)*antau(i,nj)*or(nj,ni)*
     .      xmneut(nj)/amchar(ni)*(2.D0/xmuw*((xmun+xmutau)*(xmuneut1
     .      +1.D0-th-uh)+4.D0*xmun*xmutau)+4.D0*(1.D0+xmuneut1-uh
     .      -th)) +
     .      blsnt(i,ni)*bntau(i,nj)*or(nj,ni)*dsqrt(xmun*xmutau)*
     .      (2.D0/xmuw*(xmuneut1*(xmun+xmutau-th-uh+4.D0)+xmun+xmutau
     .      -th-uh)+4.D0*(xmun+xmutau-th-uh)) +
     .      alsnt(i,ni)*antau(i,nj)*ol(nj,ni)*
     .      (2.D0/xmuw*(xmuneut1*(-2.D0*xmun*xmutau+xmun*th-2.D0*xmun
     .      +xmutau*uh-2.D0*xmutau)+xmun*(-2.D0*xmutau+uh)+xmutau*th)
     .      +4.D0*(xmuneut1*(xmutau-th+1.D0)+xmun*(xmutau-th+1.D0)+
     .      th*(-xmutau+th-1.D0))) + 
     .      antau(i,nj)*blsnt(i,ni)*or(nj,ni)*
     .      xmneut(nj)/amchar(ni)*dsqrt(xmutau)*
     .      (2.D0/xmuw*(xmuneut1*(1.D0+xmutau-th)+1.D0+xmun*(xmun+
     .      xmutau-2.D0*th-uh+3.D0)+th*(th-xmutau+uh-2.D0)-uh)
     .      +4.D0*(1.D0+xmun-uh)) +
     .      alsnt(i,ni)*bntau(i,nj)*ol(nj,ni)*
     .      xmneut(nj)/amchar(ni)*dsqrt(xmun)*
     .      (2.D0/xmuw*(xmuneut1*(-1.D0-xmutau+th)-1.D0+xmun*(-xmutau+
     .      th-1.D0)+xmutau*(2.D0*th+uh-2.D0-xmutau)-th*(th+uh)+2.D0*
     .      th+uh)+8.D0*(1.D0+xmutau-th)) +
     .      blsnt(i,ni)*antau(i,nj)*ol(nj,ni)*dsqrt(xmutau)*(
     .      2.D0/xmuw*(xmuneut1*(-xmuneut1-2.D0*xmun-xmutau+2.D0*th+uh
     .      -1.D0)+xmun*(-xmun-xmutau+2.D0*th+uh-1.D0)+th*(xmutau-th-
     .      uh+1))+8.D0*(xmuneut1+xmun-th)) +
     .      alsnt(i,ni)*bntau(i,nj)*or(nj,ni)*dsqrt(xmun)*(
     .      2.D0/xmuw*(xmuneut1*(xmuneut1+3.D0*xmutau-uh-2.D0*th+1.D0)
     .      +xmun*(xmutau-th+1.D0)+xmutau*(xmutau-2.D0*th-uh)+uh*th+
     .      th**2-th)+4.D0*(xmuneut1+xmutau-uh)) )
         enddo
      else
         chipmwstau=0.D0
      endif

c -------------------------------------------------------------------- c
c                     H+ stau/sneutrino_tau interference
c -------------------------------------------------------------------- c
	
      chipmhstau = 0.D0

c ---- final state masses included ----

      if((amneut(nj)+amtau).le.amchar(ni)) then
         do i=1,2
            chipmhstau=chipmhstau
     .       -g2**2/dh/dsto(i)*2.D0*vchtau*(
     .       bto(i,nj)*blto(i,ni)*qr(nj,ni)*(-2.D0)*
     .       dsqrt(xmun)*(xmuneut1+xmutau-uh) +
     .       ato(i,nj)*alto(i,ni)*ql(nj,ni)*2.D0*
     .       dsqrt(xmutau)*(xmuneut1+xmun-th) +
     .       bto(i,nj)*blto(i,ni)*ql(nj,ni)*2.D0*
     .       xmneut(nj)/amchar(ni)*dsqrt(xmun)*(1.D0+xmutau-th) +
     .       ato(i,nj)*alto(i,ni)*qr(nj,ni)*(-2.D0)*
     .       xmneut(nj)/amchar(ni)*dsqrt(xmutau)*(1.D0+xmun-uh) +
     .       bto(i,nj)*alto(i,ni)*ql(nj,ni)*2.D0*
     .       xmneut(nj)/amchar(ni)*(1.D0+xmuneut1-uh-th) +
     .       ato(i,nj)*blto(i,ni)*qr(nj,ni)*(-4.D0)*
     .       xmneut(nj)/amchar(ni)*dsqrt(xmun*xmutau) +
     .       ato(i,nj)*blto(i,ni)*ql(nj,ni)*2.D0*
     .       dsqrt(xmun*xmutau)*(xmun+xmutau-th-uh) +
     .       alto(i,ni)*bto(i,nj)*qr(nj,ni)*2.D0*
     .       (-uh**2-uh*th+uh*(1.D0+xmun+xmutau+xmuneut1)-xmutau-
     .       xmuneut1*xmun) ) 
     .       +2.D0*g2**2/dh/dstob(i)*2.D0*vchtau*(
     .       bntau(i,nj)*blsnt(i,ni)*ql(nj,ni)*
     .       dsqrt(xmun)*(uh-xmuneut1-xmutau) +
     .       antau(i,nj)*alsnt(i,ni)*qr(nj,ni)*
     .       dsqrt(xmutau)*(-th+xmun+xmuneut1) +
     .       bntau(i,nj)*blsnt(i,ni)*qr(nj,ni)*
     .       dsqrt(xmun)*xmneut(nj)/amchar(ni)*(-th+1.D0+xmutau) +
     .       antau(i,nj)*alsnt(i,ni)*ql(nj,ni)*
     .       dsqrt(xmutau)*xmneut(nj)/amchar(ni)*(uh-1.D0-xmun) +
     .       bntau(i,nj)*alsnt(i,ni)*qr(nj,ni)*
     .       2.D0*xmneut(nj)/amchar(ni)*dsqrt(xmun*xmutau) +
     .       antau(i,nj)*blsnt(i,ni)*qr(nj,ni)*
     .       (uh*th+th**2-th*(1.D0+xmun+xmutau+xmuneut1)+xmun+
     .       xmutau*xmuneut1) +
     .       antau(i,nj)*blsnt(i,ni)*ql(nj,ni)*
     .       xmneut(nj)/amchar(ni)*(uh+th-xmuneut1-1.D0) +
     .       bntau(i,nj)*alsnt(i,ni)*ql(nj,ni)*
     .       dsqrt(xmun*xmutau)*(uh+th-xmun-xmutau) )
         enddo
      else
         chipmhstau=0.D0
      endif

c -------------------------------------------------------------------- c
c 	               interference W+ H-
c -------------------------------------------------------------------- c

      chipmwh=0.D0	

      if((amneut(nj)+amtau).le.amchar(ni)) then      
         chipmwh=chipmwh-4.D0*g2**2/dh/dw*vwff*vchtau*(
     .    (ol(nj,ni)*ql(nj,ni)+or(nj,ni)*qr(nj,ni))*
     .    xmneut(nj)/amchar(ni)*dsqrt(xmutau)*(
     .    2.D0/xmuw*(-2.D0-xmuneut1*(xmun+xmutau-th-uh+2.D0)-xmun*
     .    (2.D0*xmun+xmutau-3.D0*th-3.D0*uh+5.D0)-xmutau*(xmun-th-uh
     .    +1.D0)-(th+uh)**2+3.D0*(th+uh))+4.D0*(-uh+xmun+1.D0))
     .    +(ol(nj,ni)*qr(nj,ni)+or(nj,ni)*ql(nj,ni))*dsqrt(xmutau)*(
     .    2.D0/xmuw*(2.D0*xmuneut1**2-xmuneut1*(-5.D0*xmun-xmutau+
     .    3.D0*(th+uh)-2.D0)-xmun*(-2.D0*xmun-xmutau+3.D0*(th+uh)-1.D0)-
     .    xmutau*(-xmun+uh+th-1.D0)+(th+uh)**2-(th+uh))
     .    -4.D0*(xmuneut1+xmun-th) ) )
      else
         chipmwh=0.D0
      endif

c -------------------------------------------------------------------- c

      SD_chipmtau = chipmstau+chipmw+chipmh+chipmwstau+chipmhstau+
     .              chipmwh

      end

c ==================================================================== c
c =========================== neutralino e+ nue ====================== c
c ==================================================================== c

      double precision function SD_chipmel(x1,x2)

      implicit double precision (a-h,m,o-z)
      integer ni,nj

      dimension amneut(4),xmneut(4),amchar(2)
      dimension dsel(2),dselb(2)
      dimension ae(2,4),be(2,4),ato(2,4),bto(2,4),anu(2,4),bnu(2,4),
     .          antau(2,4),bntau(2,4)
      dimension ale(2,2),alto(2,2),alsne(2,2),blsne(2,2),alsnt(2,2),
     .          blsnt(2,2),ble(2,2)
      dimension ql(4,2),qr(4,2),or(4,2),ol(4,2)

      COMMON/SD_indices/ni,nj
      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_sfermionetau/ase1,ase2,astau1,astau2
      COMMON/SD_sneutrino/asne1,asne2,asntau1,asntau2
      COMMON/SD_coup5/ale,alto,alsne,blsne,alsnt,blsnt
      COMMON/SD_coup8/ae,be,ato,bto,anu,bnu,antau,bntau    
      COMMON/SD_coup3/ql,qr,ol,or
      COMMON/SD_coup18/awff,vwff
      COMMON/SD_mwmzpole/amwp,amzp

      xmuneut1 = amneut(nj)**2/amchar(ni)**2

      x3 = 2.D0-x1-x2
      y1 = 1.D0-xmuneut1-x1
      y2 = 1.D0-xmuneut1-x2
      y3 = 1.D0+xmuneut1-x3

      do i=1,2,1
         ble(1,i) = 0.D0
         ble(2,i) = 0.D0
      end do

c -------------------------------------------------------------------- c
c                           sfermion exchange
c -------------------------------------------------------------------- c

      xmusel1  = ase1**2/amchar(ni)**2
      xmusel2  = ase2**2/amchar(ni)**2
      xmusnel1 = asne1**2/amchar(ni)**2
      xmusnel2 = asne2**2/amchar(ni)**2

      dsel(1)  = 1.D0-x1-xmusel1
      dsel(2)  = 1.D0-x1-xmusel2
      dselb(1) = 1.D0-x2-xmusnel1
      dselb(2) = 1.D0-x2-xmusnel2

      chipmsel=0.D0
      
      if(amneut(nj).le.amchar(ni)) then
         do i=1,2
            do k=1,2
               chipmsel=chipmsel+g2**2/dsel(k)/dsel(i)*x1*y1*
     .              (ale(k,ni)*ale(i,ni)+ble(k,ni)*ble(i,ni))*
     .              (ae(k,nj)*ae(i,nj)+be(k,nj)*be(i,nj))
     .              +g2**2/dselb(k)/dselb(i)*x2*y2*
     .              (alsne(k,ni)*alsne(i,ni)+blsne(k,ni)*blsne(i,ni))*
     .              (anu(k,nj)*anu(i,nj)+bnu(k,nj)*bnu(i,nj))
     .              +g2**2/dsel(i)/dselb(k)*(
     .              (anu(k,nj)*ale(i,ni)*blsne(k,ni)*be(i,nj)+
     .              alsne(k,ni)*ae(i,nj)*bnu(k,nj)*ble(i,ni))*
     .              (-x1*y1-x2*y2+x3*y3)
     .              +2.D0*(alsne(k,ni)*anu(k,nj)*ale(i,ni)*ae(i,nj)
     .              +blsne(k,ni)*bnu(k,nj)*ble(i,ni)*be(i,nj))*
     .              xmneut(nj)/amchar(ni)*y3)
            enddo
         enddo
      else
         chipmsel=0.D0
      endif

c -------------------------------------------------------------------- c
c                               W+ exchange
c -------------------------------------------------------------------- c

      xmuw  = amwp**2/amchar(ni)**2
      dw    = y3-xmuw

      if(amneut(nj).le.amchar(ni)) then
         chipmw=g2**2*16.D0/dw**2*vwff**2*
     .        (ol(nj,ni)**2*x2*y2+or(nj,ni)**2*x1*y1
     .        -2.D0*xmneut(nj)/amchar(ni)*ol(nj,ni)*or(nj,ni)*y3)
      else
         chipmw=0.D0
      endif
	
c -------------------------------------------------------------------- c
c                            W+ sel interference
c -------------------------------------------------------------------- c

      chipmwsel=0.D0

      if(amneut(nj).le.amchar(ni)) then
         do i=1,2
            chipmwsel=chipmwsel-g2**2*4.D0/dsel(i)/dw*(
     .           2.D0*ale(i,ni)*ae(i,nj)*or(nj,ni)*vwff*x1*y1
     .           -2.D0*xmneut(nj)/amchar(ni)*ale(i,ni)*ae(i,nj)*
     .           ol(nj,ni)*vwff*y3)
         enddo
      else
         chipmwsel=0.D0
      endif
      
c -------------------------------------------------------------------- c
c                         W+ sneutrino_e interference
c -------------------------------------------------------------------- c
      
	chipmwsnel=0.D0
        
	if(amneut(nj).le.amchar(ni)) then
           do i=1,2
              chipmwsnel=chipmwsnel+g2**2*4.D0/dselb(i)/dw*(
     .             2.D0*alsne(i,ni)*anu(i,nj)*ol(nj,ni)*vwff*x2*y2
     .             -2.D0*xmneut(nj)/amchar(ni)*alsne(i,ni)*anu(i,nj)*
     .             or(nj,ni)*vwff*y3)
           end do
	else
           chipmwsnel=0.D0
	endif
        
c -------------------------------------------------------------------- c

        SD_chipmel = chipmsel+chipmw+chipmwsel+chipmwsnel

	end

c ==================================================================== c
c ========================= neutralino up downbar ==================== c
c ==================================================================== c

      double precision function SD_chipmup(x1,x2)

      implicit double precision (a-h,m,o-z)
      integer ni,nj

      dimension amneut(4),xmneut(4),amchar(2)
      dimension dsdown(2),dsup(2)
      dimension alup(2,2),aldo(2,2),bldo(2,2),blup(2,2)
      dimension aup(2,4),bup(2,4),ado(2,4),bdo(2,4)
      dimension ql(4,2),qr(4,2),or(4,2),ol(4,2)

      COMMON/SD_indices/ni,nj
      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_squarkud/asup1,asup2,asdown1,asdown2
      COMMON/SD_coup7/alup,aldo
      COMMON/SD_coup3/ql,qr,ol,or
      COMMON/SD_coup10/aup,bup,ado,bdo
      COMMON/SD_coup18/awff,vwff
      COMMON/SD_mwmzpole/amwp,amzp

      xmuneut1 = amneut(nj)**2/amchar(ni)**2

      x3=2.D0-x1-x2
      y1=1.D0-xmuneut1-x1
      y2=1.D0-xmuneut1-x2
      y3=1.D0+xmuneut1-x3

      do i=1,2,1
         bldo(1,i) = 0.D0
         bldo(2,i) = 0.D0
         blup(1,i) = 0.D0
         blup(2,i) = 0.D0
      end do

c -------------------------------------------------------------------- c
c                            sdown exchange
c -------------------------------------------------------------------- c

      xmusd1 = asdown1**2/amchar(ni)**2
      xmusd2 = asdown2**2/amchar(ni)**2

      dsdown(1)=1.D0-x1-xmusd1
      dsdown(2)=1.D0-x1-xmusd2
      
      chipmsdown=0.D0
      
      if(amneut(nj).le.amchar(ni)) then
         do i=1,2
            do k=1,2
               chipmsdown=chipmsdown+g2**2/dsdown(k)/dsdown(i)*x1*y1*
     .              (aldo(i,ni)*aldo(k,ni)+bldo(i,ni)*bldo(k,ni))
     .              *(ado(i,nj)*ado(k,nj)+bdo(i,nj)*bdo(k,nj))
            enddo
         enddo
      else
         chipmsdown=0.D0
      endif

c -------------------------------------------------------------------- c
c                             sup exchange
c -------------------------------------------------------------------- c

      xmusup1 = asup1**2/amchar(ni)**2
      xmusup2 = asup2**2/amchar(ni)**2

      dsup(1)=1.D0-x2-xmusup1
      dsup(2)=1.D0-x2-xmusup2

      chipmsup=0.D0

      if(amneut(nj).le.amchar(ni)) then
         do i=1,2
            do k=1,2
               chipmsup=chipmsup+g2**2/dsup(i)/dsup(k)*x2*y2*
     .              (alup(i,ni)*alup(k,ni)+blup(i,ni)*blup(k,ni)) 
     .              *(aup(i,nj)*aup(k,nj)+bup(i,nj)*bup(k,nj))
            enddo
         enddo
      else
         chipmsup=0.D0
      endif

c -------------------------------------------------------------------- c
c                        sup sdown interference
c -------------------------------------------------------------------- c

      chipmsdownsup=0.D0
      
      if(amneut(nj).le.amchar(ni)) then
         do i=1,2
            do k=1,2
               chipmsdownsup=chipmsdownsup+
     .              g2**2/dsup(k)/dsdown(i)*(
     .              (aup(k,nj)*aldo(i,ni)*blup(k,ni)*bdo(i,nj)+
     .              alup(k,ni)*ado(i,nj)*bup(k,nj)*bldo(i,ni))*
     .              (-x1*y1-x2*y2+x3*y3) 
     .              +2.D0*(alup(k,ni)*aup(k,nj)*aldo(i,ni)*ado(i,nj)
     .              +blup(k,ni)*bup(k,nj)*bldo(i,ni)*bdo(i,nj))
     .              *xmneut(nj)/amchar(ni)*y3)
            enddo
         enddo
      else
         chipmsdownsup=0.D0
      endif

c -------------------------------------------------------------------- c
c                             W+ exchange
c -------------------------------------------------------------------- c

      xmuw = amwp**2/amchar(ni)**2
      dw   = y3-xmuw

      chipmw=0.d0
      
      if(amneut(nj).le.amchar(ni)) then
         chipmw=g2**2*16.D0/dw**2*vwff**2*
     .        (or(nj,ni)**2*x1*y1+ol(nj,ni)**2*x2*y2
     .        -2.D0*ol(nj,ni)*or(nj,ni)*xmneut(nj)/amchar(ni)*y3)
      else
         chipmw=0.D0
      endif
	
c -------------------------------------------------------------------- c
c                         W+ sdown interference
c -------------------------------------------------------------------- c

      chipmwsdown=0.D0
      
      if(amneut(nj).le.amchar(ni)) then
         do i=1,2
            chipmwsdown=chipmwsdown-g2**2*4.D0/dsdown(i)/dw*
     .           (2.D0*vwff*or(nj,ni)*aldo(i,ni)*ado(i,nj)*x1*y1
     .           -2.D0*vwff*ol(nj,ni)*aldo(i,ni)*ado(i,nj)*
     .           xmneut(nj)/amchar(ni)*y3)
         enddo 
      else
         chipmwsdown=0.d0
      endif

c -------------------------------------------------------------------- c
c                          W+ sup interference
c -------------------------------------------------------------------- c

      chipmwsup=0.D0
      
      if(amneut(nj).le.amchar(ni)) then
         do i=1,2
            chipmwsup=chipmwsup+g2**2*4.D0/dsup(i)/dw*(
     .           (2.D0*vwff*ol(nj,ni)*alup(i,ni)*aup(i,nj)*x2*y2
     .           -2.D0*vwff*or(nj,ni)*alup(i,ni)*aup(i,nj)*
     .           xmneut(nj)/amchar(ni)*y3))
         enddo
      else
         chipmwsup=0.D0
      endif
	
c -------------------------------------------------------------------- c

      SD_chipmup = chipmsdown+chipmsup+chipmsdownsup+chipmw+
     .             chipmwsdown+chipmwsup

      end

c ==================================================================== c
c ======================= neutralino top bottombar =================== c
c ==================================================================== c

      double precision function SD_chipmtop(x1,x2)

      implicit double precision (a-h,m,o-z)
      
      dimension amneut(4),xmneut(4),amchar(2)
      dimension dsb(2),dst(2)
      dimension alsbot(2,2),aksbot(2,2),alstor(2,2),akstor(2,2)
      dimension abot(2,4),bbot(2,4),atopr(2,4),btopr(2,4)
      dimension ql(4,2),qr(4,2),or(4,2),ol(4,2)

      COMMON/SD_indices/ni,nj
      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_hmass/ama,aml,amh,amch,amar
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2
      COMMON/SD_fermion/amt,amb,amtau
      COMMON/SD_coup3/ql,qr,ol,or
      COMMON/SD_coup18/awff,vwff
      COMMON/SD_scala/scalb,scalt
      COMMON/SD_yukawa/ytewsb,ybewsb,ytauewsb
      COMMON/SD_runcoupscale/scalechoice,scaleofcoupling,inumloop
      COMMON/SD_mwmzpole/amwp,amzp

      external SD_yuk

c --- the running couplings ---

      if(scalechoice.eq.1.D0) then
         scalb = ybewsb/dsqrt(g2)
         scalt = ytewsb/dsqrt(g2)
      elseif(scalechoice.eq.2.D0) then         
         call SD_runmass(amchar(ni),0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      elseif(scalechoice.eq.3.D0) then
         call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      endif

      call SD_charsbottop(alsbot,aksbot)
      call SD_charstopbot(alstor,akstor)
      call SD_neutsbotbot(abot,bbot)
      call SD_neutstoptop(atopr,btopr)

      call SD_hctopbbot(vchtopr,achtopr)
      vch = vchtopr
      ach = achtopr

c --- some definitions ---

      xmuneut1 = amneut(nj)**2/amchar(ni)**2
      xmusbot1 = asb1**2/amchar(ni)**2
      xmusbot2 = asb2**2/amchar(ni)**2
      xmustop1 = ast1**2/amchar(ni)**2
      xmustop2 = ast2**2/amchar(ni)**2
      xmut     = amt**2/amchar(ni)**2
      xmub     = amb**2/amchar(ni)**2

      x3 = 2.D0-x1-x2
      y3 = 1.D0+xmuneut1-x3

      uh = 1.D0-x1+xmut
      th = 1.D0-x2+xmub

c -------------------------------------------------------------------- c
c                      sbottom and stop exchange
c -------------------------------------------------------------------- c

      dsb(1) = 1.D0-x1-xmusbot1+xmut
      dsb(2) = 1.D0-x1-xmusbot2+xmut
      dst(1) = 1.D0-x2-xmustop1+xmub
      dst(2) = 1.D0-x2-xmustop2+xmub

      chipmsfer=0.D0

c ---- final state masses included ----

      if ((amneut(nj)+amb+amt).le.amchar(ni)) then
         do i=1,2
            do k=1,2
               chipmsfer=chipmsfer
     .           +g2**2/dsb(k)/dsb(i)*(
     .           (alsbot(i,ni)*aksbot(k,ni)+aksbot(i,ni)*alsbot(k,ni))*
     .           (abot(i,nj)*bbot(k,nj)+bbot(i,nj)*abot(k,nj))*
     .           xmneut(nj)/amchar(ni)*dsqrt(xmut*xmub)*(-4.D0)+
     .           (alsbot(i,ni)*alsbot(k,ni)+aksbot(i,ni)*aksbot(k,ni))*
     .           (abot(i,nj)*bbot(k,nj)+bbot(i,nj)*abot(k,nj))*
     .           xmneut(nj)/amchar(ni)*dsqrt(xmub)*2.D0*
     .           (uh-xmut-1.D0)+
     .           (alsbot(i,ni)*aksbot(k,ni)+aksbot(i,ni)*alsbot(k,ni))*
     .           (abot(i,nj)*abot(k,nj)+bbot(i,nj)*bbot(k,nj))*
     .           dsqrt(xmut)*2.D0*(uh-xmub-xmuneut1)+
     .           (alsbot(i,ni)*alsbot(k,ni)+aksbot(i,ni)*aksbot(k,ni))*
     .           (abot(i,nj)*abot(k,nj)+bbot(i,nj)*bbot(k,nj))*
     .           (-uh**2+uh*(1.D0+xmuneut1+xmut+xmub)-
     .           (xmuneut1+xmub)*(1.D0+xmut)))
     .           +g2**2/dst(k)/dst(i)*(
     .           (alstor(i,ni)*akstor(k,ni)+akstor(i,ni)*alstor(k,ni))*
     .           (atopr(i,nj)*btopr(k,nj)+btopr(i,nj)*atopr(k,nj))*
     .           xmneut(nj)/amchar(ni)*dsqrt(xmub*xmut)*(-4.D0)+
     .           (alstor(i,ni)*alstor(k,ni)+akstor(i,ni)*akstor(k,ni))*
     .           (atopr(i,nj)*btopr(k,nj)+btopr(i,nj)*atopr(k,nj))*
     .           xmneut(nj)/amchar(ni)*dsqrt(xmut)*2.D0*
     .           (th-xmub-1.D0)+
     .           (alstor(i,ni)*akstor(k,ni)+akstor(i,ni)*alstor(k,ni))*
     .           (atopr(i,nj)*atopr(k,nj)+btopr(i,nj)*btopr(k,nj))*
     .           dsqrt(xmub)*2.D0*(th-xmut-xmuneut1)+
     .           (alstor(i,ni)*alstor(k,ni)+akstor(i,ni)*akstor(k,ni))*
     .           (atopr(i,nj)*atopr(k,nj)+btopr(i,nj)*btopr(k,nj))*
     .           (-th**2+th*(1.D0+xmuneut1+xmut+xmub)-(xmuneut1+xmut)*
     .           (1.D0+xmub)))
     .           -2.D0*g2**2/dsb(k)/dst(i)*(
     .           (akstor(i,ni)*aksbot(k,ni)*atopr(i,nj)*abot(k,nj)
     .           +alstor(i,ni)*alsbot(k,ni)*btopr(i,nj)*bbot(k,nj))*
     .           xmneut(nj)/amchar(ni)*dsqrt(xmut*xmub)*(-2.D0)+
     .           (alstor(i,ni)*aksbot(k,ni)*atopr(i,nj)*abot(k,nj)
     .           +akstor(i,ni)*alsbot(k,ni)*btopr(i,nj)*bbot(k,nj))*
     .           xmneut(nj)/amchar(ni)*dsqrt(xmut)*
     .           (th-xmub-1.D0)+
     .           (akstor(i,ni)*alsbot(k,ni)*atopr(i,nj)*abot(k,nj)
     .           +alstor(i,ni)*aksbot(k,ni)*btopr(i,nj)*bbot(k,nj))*
     .           xmneut(nj)/amchar(ni)*dsqrt(xmub)*
     .           (uh-xmut-1.D0)+
     .           (alstor(i,ni)*alsbot(k,ni)*atopr(i,nj)*abot(k,nj)
     .           +akstor(i,ni)*aksbot(k,ni)*btopr(i,nj)*bbot(k,nj))*
     .           xmneut(nj)/amchar(ni)*(uh+th-xmuneut1-1.D0)+
     .           (alsbot(k,ni)*akstor(i,ni)*abot(k,nj)*btopr(i,nj)
     .           +aksbot(k,ni)*alstor(i,ni)*bbot(k,nj)*atopr(i,nj))*
     .           dsqrt(xmut*xmub)*(uh+th-xmut-xmub)+
     .           (alsbot(k,ni)*alstor(i,ni)*abot(k,nj)*btopr(i,nj)
     .           +aksbot(k,ni)*akstor(i,ni)*bbot(k,nj)*atopr(i,nj))*
     .           dsqrt(xmut)*(uh-xmub-xmuneut1)+
     .           (aksbot(k,ni)*akstor(i,ni)*abot(k,nj)*btopr(i,nj)
     .           +alsbot(k,ni)*alstor(i,ni)*bbot(k,nj)*atopr(i,nj))*
     .           dsqrt(xmub)*(th-xmut-xmuneut1)+
     .           (aksbot(k,ni)*alstor(i,ni)*abot(k,nj)*btopr(i,nj)
     .           +alsbot(k,ni)*akstor(i,ni)*bbot(k,nj)*atopr(i,nj))*
     .           (uh*th-xmut*xmub-xmuneut1))
            enddo
         enddo         
      else
         chipmsfer=0.D0
      endif

c -------------------------------------------------------------------- c
c                            W exchange
c -------------------------------------------------------------------- c

      xmuw = amwp**2/amchar(ni)**2
      dw   = y3-xmuw

      chipmw = 0.D0

c ---- final state masses included ----

      rh = xmuneut1+xmut+xmub-th-uh+1.D0
      sh = (xmuneut1-th-uh+1.D0)*(xmut+xmub)+4.D0*xmut*xmub
      rk = xmuneut1*(xmut+xmub-th-uh+4.D0)+xmut+xmub-uh-th

      if ((amneut(nj)+amt+amb).le.amchar(ni)) then
         chipmw=chipmw+g2**2/dw**2*(
     .    ol(nj,ni)*or(nj,ni)*2.D0*vwff**2*
     .    xmneut(nj)/amchar(ni)*(8.D0/xmuw**2*rh*sh-16.D0/xmuw*sh
     .    -16.D0*(xmuneut1-uh-th+1.D0))
     .    +(ol(nj,ni)**2+or(nj,ni)**2)*2.D0*vwff**2*
     .    (-2.D0/xmuw**2*rk*sh+8.D0/xmuw*(xmuneut1*(2.D0*xmut*xmub+
     .    2.D0*(xmut+xmub)-xmut*th-xmub*uh)+2.D0*xmut*xmub
     .    -xmut*uh-xmub*th)+4.D0*(xmuneut1*(uh+th-xmut-xmub-2.D0)+
     .    (xmut+xmub)*(uh+th-1.D0)-2.D0*xmut*xmub+th*(-th+1.D0)+
     .    uh*(-uh+1.D0)))+
     .    (ol(nj,ni)**2-or(nj,ni)**2)*vwff**2*8.D0*(
     .    xmuneut1*(xmut-xmub+th-uh)+(xmut+xmub)*(th-uh)-xmut+
     .    xmub+th*(-th+1.D0)+uh*(uh-1.D0))
     .    )
      else
         chipmw=0.D0
      endif

c -------------------------------------------------------------------- c
c                            H+ exchange
c -------------------------------------------------------------------- c

      xmuch = amch**2/amchar(ni)**2
      dh    = y3-xmuch

c ---- final state masses included ----

      if((amneut(nj)+amt+amb).le.amchar(ni)) then
         chipmh=g2**2/dh**2*(
     .    ql(nj,ni)*qr(nj,ni)*(
     .    (vch**2-ach**2)*
     .    xmneut(nj)/amchar(ni)*dsqrt(xmut*xmub)*(-16.D0)+
     .    (vch**2+ach**2)*
     .    xmneut(nj)/amchar(ni)*8.D0*(1.D0+xmuneut1-th-uh) ) 
     .    +(ql(nj,ni)**2+qr(nj,ni)**2)*(
     .    (vch**2-ach**2)*
     .    dsqrt(xmut*xmub)*4.D0*(xmut+xmub-th-uh)+
     .    (vch**2+ach**2)*
     .    2.D0*(xmuneut1*(uh+th-xmut-xmub)+(xmut+xmub)*(uh+th-1.D0)
     .    -(th+uh)**2+uh+th)) )
      else
         chipmh=0.D0
      endif

c -------------------------------------------------------------------- c
c                     W+ sbottom/stop interference
c -------------------------------------------------------------------- c

      chipmwsbot = 0.D0

c ---- final state masses included ----

      if((amneut(nj)+amt+amb).le.amchar(ni)) then
         do i=1,2
            chipmwsbot=chipmwsbot
     .       +g2**2/dsb(i)/dw*2.D0*vwff*(
     .      aksbot(i,ni)*bbot(i,nj)*or(nj,ni)*
     .      xmneut(nj)/amchar(ni)*dsqrt(xmut*xmub)*(
     .      1/xmuw*(-4.D0)*(1.D0+xmuneut1+xmut+xmub-uh-th)+16.D0) +
     .      alsbot(i,ni)*abot(i,nj)*ol(nj,ni)*
     .      xmneut(nj)/amchar(ni)*(2.D0/xmuw*((xmuneut1+1.D0-uh-th)*
     .      (xmut+xmub)+4.D0*xmut*xmub)+4.D0*(1.D0+xmuneut1-
     .      uh-th)) +
     .      aksbot(i,ni)*bbot(i,nj)*ol(nj,ni)*dsqrt(xmut*xmub)*
     .      (2.D0/xmuw*(xmuneut1*(xmut+xmub-th-uh+4.D0)+xmut+xmub
     .      -th-uh)+4.D0*(xmut+xmub-th-uh)) +
     .      alsbot(i,ni)*abot(i,nj)*or(nj,ni)*
     .      (2.D0/xmuw*(xmuneut1*(-2.D0*xmut*xmub+xmut*th
     .      -2.D0*xmut+xmub*uh-2.D0*xmub)+xmut*(-2.D0*xmub+uh)
     .      +xmub*th)+4.D0*(xmuneut1*(xmut-uh+1.D0)+xmut*(xmub-uh)
     .      +xmub*(1.D0-uh)+uh**2-uh)) + 
     .      abot(i,nj)*aksbot(i,ni)*ol(nj,ni)*
     .      xmneut(nj)/amchar(ni)*dsqrt(xmut)*(2.D0/xmuw*
     .      (xmuneut1*(1.D0+xmut-uh)+1.D0+xmut*(xmub-uh)+xmub*
     .      (xmub-th-2.D0*uh+3.D0)+th*(uh-1.D0)+uh*(uh-2.D0))+
     .      4.D0*(1.D0+xmub-th)) +
     .      bbot(i,nj)*alsbot(i,ni)*or(nj,ni)*
     .      xmneut(nj)/amchar(ni)*dsqrt(xmub)*
     .      (2.D0/xmuw*(xmuneut1*(-1.D0-xmut+uh)-1.D0+xmub*(-1.D0+uh)
     .      +uh*(2.D0-th-uh)+th+xmut*(-xmut-xmub+th+2.D0*uh-2.D0))+
     .      8.D0*(1.D0+xmut-uh)) +
     .      aksbot(i,ni)*abot(i,nj)*or(nj,ni)*
     .      dsqrt(xmut)*((-2.D0)/xmuw*(xmuneut1-uh+xmub)*
     .      (xmuneut1+xmut+xmub-th-uh+1.D0)+8.D0*(xmuneut1+xmub
     .      -uh)) +
     .      alsbot(i,ni)*bbot(i,nj)*ol(nj,ni)*
     .      dsqrt(xmub)*(2.D0/xmuw*(xmuneut1*(xmuneut1+
     .      3.D0*xmut-th-2.D0*uh+1.D0)+xmut*(xmut+xmub-th-2.D0*uh)+
     .      xmub*(1.D0-uh)+uh*th+uh**2-uh)+4.D0*(xmuneut1+xmut-th)) )
     .      -g2**2/dst(i)/dw*2.D0*vwff*(
     .      akstor(i,ni)*btopr(i,nj)*ol(nj,ni)*
     .      xmneut(nj)/amchar(ni)*dsqrt(xmut*xmub)*(
     .      1/xmuw*(-4.D0)*(1.D0+xmuneut1+xmut+xmub-uh-th)+16.D0) +
     .      alstor(i,ni)*atopr(i,nj)*or(nj,ni)*
     .      xmneut(nj)/amchar(ni)*(2.D0/xmuw*((xmut+xmub)*(xmuneut1
     .      +1.D0-th-uh)+4.D0*xmut*xmub)+4.D0*(1.D0+xmuneut1-uh
     .      -th)) +
     .      akstor(i,ni)*btopr(i,nj)*or(nj,ni)*dsqrt(xmut*xmub)*
     .      (2.D0/xmuw*(xmuneut1*(xmut+xmub-th-uh+4.D0)+xmut+xmub
     .      -th-uh)+4.D0*(xmut+xmub-th-uh)) +
     .      alstor(i,ni)*atopr(i,nj)*ol(nj,ni)*
     .      (2.D0/xmuw*(xmuneut1*(-2.D0*xmut*xmub+xmut*th-2.D0*xmut
     .      +xmub*uh-2.D0*xmub)+xmut*(-2.D0*xmub+uh)+xmub*th)
     .      +4.D0*(xmuneut1*(xmub-th+1.D0)+xmut*(xmub-th+1.D0)+
     .      th*(-xmub+th-1.D0))) + 
     .      atopr(i,nj)*akstor(i,ni)*or(nj,ni)*
     .      xmneut(nj)/amchar(ni)*dsqrt(xmub)*
     .      (2.D0/xmuw*(xmuneut1*(1.D0+xmub-th)+1.D0+xmut*(xmut+
     .      xmub-2.D0*th-uh+3.D0)+th*(th-xmub+uh-2.D0)-uh)
     .      +4.D0*(1.D0+xmut-uh)) +
     .      alstor(i,ni)*btopr(i,nj)*ol(nj,ni)*
     .      xmneut(nj)/amchar(ni)*dsqrt(xmut)*
     .      (2.D0/xmuw*(xmuneut1*(-1.D0-xmub+th)-1.D0+xmut*(-xmub+
     .      th-1.D0)+xmub*(2.D0*th+uh-2.D0-xmub)-th*(th+uh)+2.D0*
     .      th+uh)+8.D0*(1.D0+xmub-th)) +
     .      akstor(i,ni)*atopr(i,nj)*ol(nj,ni)*dsqrt(xmub)*(
     .      2.D0/xmuw*(xmuneut1*(-xmuneut1-2.D0*xmut-xmub+2.D0*th+uh
     .      -1.D0)+xmut*(-xmut-xmub+2.D0*th+uh-1.D0)+th*(xmub-th-
     .      uh+1))+8.D0*(xmuneut1+xmut-th)) +
     .      alstor(i,ni)*btopr(i,nj)*or(nj,ni)*dsqrt(xmut)*(
     .      2.D0/xmuw*(xmuneut1*(xmuneut1+3.D0*xmub-uh-2.D0*th+1.D0)
     .      +xmut*(xmub-th+1.D0)+xmub*(xmub-2.D0*th-uh)+uh*th+
     .      th**2-th)+4.D0*(xmuneut1+xmub-uh)) )
         enddo
      else
         chipmwsbot=0.D0
      endif

c -------------------------------------------------------------------- c
c                        H+ sbottom/stop interference
c -------------------------------------------------------------------- c
	
      chipmhsbot = 0.D0

c ---- final state masses included ----

      if((amneut(nj)+amt+amb).le.amchar(ni)) then
         do i=1,2
            chipmhsbot=chipmhsbot
     .       -g2**2/dh/dsb(i)*(
     .       (abot(i,nj)*alsbot(i,ni)*ql(nj,ni)*(vch+ach)
     .       +bbot(i,nj)*aksbot(i,ni)*qr(nj,ni)*(vch-ach))*(-2.D0)*
     .       dsqrt(xmut)*(xmuneut1+xmub-uh) +
     .       (abot(i,nj)*alsbot(i,ni)*ql(nj,ni)*(vch-ach)
     .       +bbot(i,nj)*aksbot(i,ni)*qr(nj,ni)*(vch+ach))*2.D0*
     .       dsqrt(xmub)*(xmuneut1+xmut-th) +
     .       (abot(i,nj)*alsbot(i,ni)*qr(nj,ni)*(vch+ach)
     .       +bbot(i,nj)*aksbot(i,ni)*ql(nj,ni)*(vch-ach))*2.D0*
     .       xmneut(nj)/amchar(ni)*dsqrt(xmut)*(1.D0+xmub-th) +
     .       (abot(i,nj)*alsbot(i,ni)*qr(nj,ni)*(vch-ach)
     .       +bbot(i,nj)*aksbot(i,ni)*ql(nj,ni)*(vch+ach))*(-2.D0)*
     .       xmneut(nj)/amchar(ni)*dsqrt(xmub)*(1.D0+xmut-uh) +
     .       (bbot(i,nj)*alsbot(i,ni)*ql(nj,ni)*(vch-ach)
     .       +abot(i,nj)*aksbot(i,ni)*qr(nj,ni)*(vch+ach))*2.D0*
     .       xmneut(nj)/amchar(ni)*(1.D0+xmuneut1-uh-th) +
     .       (abot(i,nj)*aksbot(i,ni)*qr(nj,ni)*(vch-ach)
     .       +bbot(i,nj)*alsbot(i,ni)*ql(nj,ni)*(vch+ach))*(-4.D0)*
     .       xmneut(nj)/amchar(ni)*dsqrt(xmut*xmub) +
     .       (abot(i,nj)*aksbot(i,ni)*ql(nj,ni)*(vch-ach)
     .       +bbot(i,nj)*alsbot(i,ni)*qr(nj,ni)*(vch+ach))*2.D0*
     .       dsqrt(xmut*xmub)*(xmut+xmub-th-uh) +
     .       (alsbot(i,ni)*bbot(i,nj)*qr(nj,ni)*(vch-ach)
     .       +aksbot(i,ni)*abot(i,nj)*ql(nj,ni)*(vch+ach))*2.D0*
     .       (-uh**2-uh*th+uh*(1.D0+xmut+xmub+xmuneut1)-xmub-
     .       xmuneut1*xmut) ) 
     .       +2.D0*g2**2/dh/dst(i)*(
     .       (btopr(i,nj)*akstor(i,ni)*ql(nj,ni)*(vch-ach)
     .       +atopr(i,nj)*alstor(i,ni)*qr(nj,ni)*(vch+ach))*
     .       dsqrt(xmut)*(uh-xmuneut1-xmub) +
     .       (atopr(i,nj)*alstor(i,ni)*qr(nj,ni)*(vch-ach)
     .       +btopr(i,nj)*akstor(i,ni)*ql(nj,ni)*(vch+ach))*
     .       dsqrt(xmub)*(-th+xmut+xmuneut1) +
     .       (atopr(i,nj)*alstor(i,ni)*ql(nj,ni)*(vch+ach)
     .       +btopr(i,nj)*akstor(i,ni)*qr(nj,ni)*(vch-ach))*
     .       dsqrt(xmut)*xmneut(nj)/amchar(ni)*(-th+1.D0+xmub) +
     .       (atopr(i,nj)*alstor(i,ni)*ql(nj,ni)*(vch-ach)
     .       +btopr(i,nj)*akstor(i,ni)*qr(nj,ni)*(vch+ach))*
     .       dsqrt(xmub)*xmneut(nj)/amchar(ni)*(uh-1.D0-xmut) +
     .       (btopr(i,nj)*alstor(i,ni)*qr(nj,ni)*(vch-ach)
     .       +atopr(i,nj)*akstor(i,ni)*ql(nj,ni)*(vch+ach))*
     .       2.D0*xmneut(nj)/amchar(ni)*dsqrt(xmut*xmub) +
     .       (atopr(i,nj)*akstor(i,ni)*qr(nj,ni)*(vch-ach)
     .       +btopr(i,nj)*alstor(i,ni)*ql(nj,ni)*(vch+ach))*
     .       (uh*th+th**2-th*(1.D0+xmut+xmub+xmuneut1)+xmut+
     .       xmub*xmuneut1) +
     .       (atopr(i,nj)*akstor(i,ni)*ql(nj,ni)*(vch-ach)
     .       +btopr(i,nj)*alstor(i,ni)*qr(nj,ni)*(vch+ach))*
     .       xmneut(nj)/amchar(ni)*(uh+th-xmuneut1-1.D0) +
     .       (btopr(i,nj)*alstor(i,ni)*ql(nj,ni)*(vch-ach)
     .       +atopr(i,nj)*akstor(i,ni)*qr(nj,ni)*(vch+ach))*
     .       dsqrt(xmut*xmub)*(uh+th-xmut-xmub) )
         enddo
      else
         chipmhsbot=0.D0
      endif

c -------------------------------------------------------------------- c
c 	               interference W+ H-
c -------------------------------------------------------------------- c

      chipmwh=0.D0	

      if((amneut(nj)+amt+amb).le.amchar(ni)) then      
         chipmwh=chipmwh-2.D0*g2**2/dh/dw*vwff*(
     .    (ol(nj,ni)*ql(nj,ni)+or(nj,ni)*qr(nj,ni))*(
     .    (vch-ach)*xmneut(nj)/amchar(ni)*dsqrt(xmub)*(
     .    2.D0/xmuw*(-2.D0-xmuneut1*(xmut+xmub-th-uh+2.D0)-xmut*
     .    (2.D0*xmut+xmub-3.D0*th-3.D0*uh+5.D0)-xmub*(xmut-th-uh
     .    +1.D0)-(th+uh)**2+3.D0*(th+uh))+4.D0*(-uh+xmut+1.D0)) +
     .    (vch+ach)*xmneut(nj)/amchar(ni)*dsqrt(xmut)*(
     .    2.D0/xmuw*(2.D0+xmuneut1*(xmut+xmub-th-uh+2.D0)+xmut*
     .    (-th-uh+1.D0+xmub)+xmub*(xmut+2.D0*xmub-3.D0*(th+uh)+5.D0)
     .    +(th+uh)**2-3.D0*(th+uh))+4.D0*(th-xmub-1.D0) ) )
     .    +(ol(nj,ni)*qr(nj,ni)+or(nj,ni)*ql(nj,ni))*(
     .    (vch-ach)*dsqrt(xmub)*(
     .    2.D0/xmuw*(2.D0*xmuneut1**2-xmuneut1*(-5.D0*xmut-xmub+
     .    3.D0*(th+uh)-2.D0)-xmut*(-2.D0*xmut-xmub+3.D0*(th+uh)-1.D0)-
     .    xmub*(-xmut+uh+th-1.D0)+(th+uh)**2-(th+uh))
     .    -4.D0*(xmuneut1+xmut-th) )+
     .    (vch+ach)*dsqrt(xmut)*(
     .    2.D0/xmuw*(-2.D0*xmuneut1**2+xmuneut1*(-xmut-5.D0*xmub+3.D0*
     .    (th+uh)-2.D0)+xmut*(-xmub+th+uh-1.D0)+xmub*(-xmut-2.D0*xmub+
     .    3.D0*(th+uh)-1.D0)-(th+uh)**2+(th+uh)) +4.D0*(xmuneut1+xmub
     .    -uh) ) ) )
      else
         chipmwh=0.D0
      endif

c -------------------------------------------------------------------- c

      SD_chipmtop = chipmsfer+chipmw+chipmh+chipmwsbot+chipmhsbot+
     .              chipmwh

      end

c ==================================================================== c
c =========================== chargino1 e+ e- ======================== c
c ==================================================================== c

      double precision function SD_charel(x1,x2)

      implicit double precision (a-h,m,o-z)

      dimension amneut(4),xmneut(4),amchar(2)
      dimension dsel(2)
      dimension ale(2,2),alto(2,2),alsne(2,2),blsne(2,2),alsnt(2,2),
     .          blsnt(2,2)
      dimension opl(2,2),opr(2,2),onl(4,4),onr(4,4)

      COMMON/SD_indices/ni,nj
      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_sfermionetau/ase1,ase2,astau1,astau2
      COMMON/SD_sneutrino/asne1,asne2,asntau1,asntau2
      COMMON/SD_coup4/opl,opr,onl,onr
      COMMON/SD_coup5/ale,alto,alsne,blsne,alsnt,blsnt
      COMMON/SD_coup17/azztoptop,vzztoptop,azztautau,vzztautau,
     .                 azzneutneut,vzzneutneut,azzbotbot,vzzbotbot
      COMMON/SD_weinberg/sw,cw
      COMMON/SD_mwmzpole/amwp,amzp

      xmuneut1 = amchar(1)**2/amchar(2)**2

      x3 = 2.D0-x1-x2
      y1 = 1.D0-xmuneut1-x1
      y2 = 1.D0-xmuneut1-x2
      y3 = 1.D0+xmuneut1-x3

c -------------------------------------------------------------------- c
c                          sneutrino_el exchange
c -------------------------------------------------------------------- c

      xmusnel1 = asne1**2/amchar(2)**2
      xmusnel2 = asne2**2/amchar(2)**2

      dsel(1)  = 1.D0-x2-xmusnel1
      dsel(2)  = 1.D0-x2-xmusnel2

      charsnel=0.D0
      
      if(amchar(1).le.amchar(2)) then
         do i=1,2
            do k=1,2
               charsnel=charsnel+g2**2/dsel(k)/dsel(i)*x2*y2*
     .         (alsne(k,2)*alsne(i,2)+blsne(k,2)*blsne(i,2))*
     .         (alsne(k,1)*alsne(i,1)+blsne(k,1)*blsne(i,1))
            enddo
         enddo
      else
         charsnel=0.D0
      endif

c -------------------------------------------------------------------- c
c                             Z exchange
c -------------------------------------------------------------------- c

      xmuz  = amzp**2/amchar(2)**2
      dz    = y3-xmuz

      if(amchar(1).le.amchar(2)) then
         charz=g2**2*4.D0/dz**2/cw**2*
     .        (((azztautau+vzztautau)**2*opl(1,2)**2
     .        + (azztautau-vzztautau)**2*opr(1,2)**2)*x2*y2
     .        +((azztautau+vzztautau)**2*opr(1,2)**2
     .        + (azztautau-vzztautau)**2*opl(1,2)**2)*x1*y1
     .        -4.D0*dsqrt(xmuneut1)*opl(1,2)*opr(1,2)
     .        *(azztautau**2+vzztautau**2)*y3 )
      else
         charz=0.D0
      endif
	
c -------------------------------------------------------------------- c
c                      Z-sneutrino_el interference
c -------------------------------------------------------------------- c

      charzsnel=0.D0

      if(amchar(1).le.amchar(2)) then
         do i=1,2
            charzsnel=charzsnel+g2**2*4.D0/dsel(i)/dz/cw
     .           *((alsne(i,2)*alsne(i,1)*opl(1,2)*
     .           (azztautau+vzztautau)+
     .           blsne(i,2)*blsne(i,1)*opr(1,2)*
     .           (-azztautau+vzztautau))*x2*y2
     .           -(alsne(i,1)*alsne(i,2)*opr(1,2)*
     .           (azztautau+vzztautau)
     .           +blsne(i,1)*blsne(i,2)*opl(1,2)*
     .           (-azztautau+vzztautau)
     .           )*dsqrt(xmuneut1)*y3)
         enddo
      else
         charzsnel=0.D0
      endif

c -------------------------------------------------------------------- c

      SD_charel = charsnel+charz+charzsnel
      
      end

c ==================================================================== c
c ========================== chargino1 tau+ tau- ===================== c
c ==================================================================== c

      double precision function SD_chartau(x1,x2)

      implicit double precision (a-h,m,o-z)
      
      dimension amneut(4),xmneut(4),amchar(2)
      dimension dsto(2)
      dimension opl(2,2),opr(2,2),onl(4,4),onr(4,4)
      dimension ale(2,2),altau(2,2),alsne(2,2),blsne(2,2),alsnt(2,2),
     .          blsnt(2,2)
      dimension gkhlr(2,2),gkhll(2,2),gkhhr(2,2),gkhhl(2,2),gkhar(2,2),
     .          gkhal(2,2)

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_mixang/a,tanbeta
      COMMON/SD_hmass/ama,aml,amh,amch,amar
      COMMON/SD_fermion/amt,amb,amtau
      COMMON/SD_sneutrino/asne1,asne2,asntau1,asntau2
      COMMON/SD_yukawa/yt,yb,ytau
      COMMON/SD_weinberg/sw,cw
      COMMON/SD_coup2/gkhll,gkhhl,gkhal,gkhlr,gkhhr,gkhar
      COMMON/SD_coup4/opl,opr,onl,onr
      COMMON/SD_coup5/ale,altau,alsne,blsne,alsnt,blsnt
      COMMON/SD_coup17/azztoptop,vzztoptop,azztautau,vzztautau,
     .                 azzneutneut,vzzneutneut,azzbotbot,vzzbotbot
      COMMON/SD_mwmzpole/amwp,amzp

c --- several definitions ---

      ytauc = ytau/dsqrt(g2)

      b=datan(tanbeta)

      vzz = vzztautau
      azz = azztautau

      xmuneut1 = amchar(1)**2/amchar(2)**2
      xmusn1   = asntau1**2/amchar(2)**2
      xmusn2   = asntau2**2/amchar(2)**2
      xmutau   = amtau**2/amchar(2)**2

      x3 = 2.D0-x1-x2
      y3 = 1.D0+xmuneut1-x3

      uh = 1.D0-x1+xmutau
      th = 1.D0-x2+xmutau

c -------------------------------------------------------------------- c
c                        sneutrino_tau exchange 
c -------------------------------------------------------------------- c

      dsto(1) = 1.D0-x2-xmusn1+xmutau
      dsto(2) = 1.D0-x2-xmusn2+xmutau

      charsntau=0.D0

c ---- final state masses included ----

      if((amchar(1)+2.D0*amtau).le.amchar(2)) then
         do i=1,2
            do k=1,2
               charsntau=charsntau
     .           +g2**2/dsto(k)/dsto(i)*(
     .           (alsnt(i,2)*blsnt(k,2)+blsnt(i,2)*alsnt(k,2))*
     .           (alsnt(i,1)*blsnt(k,1)+blsnt(i,1)*alsnt(k,1))*
     .           amchar(1)/amchar(2)*xmutau*(-4.D0)+
     .           (alsnt(i,2)*alsnt(k,2)+blsnt(i,2)*blsnt(k,2))*
     .           (alsnt(i,1)*blsnt(k,1)+blsnt(i,1)*alsnt(k,1))*
     .           amchar(1)/amchar(2)*dsqrt(xmutau)*2.D0*
     .           (th-xmutau-1.D0)+
     .           (alsnt(i,2)*blsnt(k,2)+blsnt(i,2)*alsnt(k,2))*
     .           (alsnt(i,1)*alsnt(k,1)+blsnt(i,1)*blsnt(k,1))*
     .           dsqrt(xmutau)*2.D0*(th-xmutau-xmuneut1)+
     .           (alsnt(i,2)*alsnt(k,2)+blsnt(i,2)*blsnt(k,2))*
     .           (alsnt(i,1)*alsnt(k,1)+blsnt(i,1)*blsnt(k,1))*
     .           (-th**2+th*(1.D0+xmuneut1+2.D0*xmutau)-
     .           (xmuneut1+xmutau)*(1.D0+xmutau)))
            enddo
         enddo         
      else
         charsntau=0.D0
      endif

c -------------------------------------------------------------------- c
c                            Z exchange
c -------------------------------------------------------------------- c

      xmuz = amzp**2/amchar(2)**2
      dz   = y3-xmuz

      charztau = 0.D0

c ---- final state masses included ----

      rh = xmuneut1+2.D0*xmutau-th-uh+1.D0
      sh = (xmuneut1-th-uh+1.D0)*2.D0*xmutau+4.D0*xmutau**2
      rk = xmuneut1*(2.D0*xmutau-th-uh+4.D0)+2.D0*xmutau-uh-th

      if((amchar(1)+2.D0*amtau).le.amchar(2)) then
         charztau=charztau+g2**2/dz**2/cw**2*(
     .    opl(1,2)*opr(1,2)*(vzz**2-azz**2)*
     .    amchar(1)/amchar(2)*xmutau*(-16.D0/xmuz**2*rh**2+
     .    32.D0/xmuz*rh-64.D0)+
     .    opl(1,2)*opr(1,2)*(vzz**2+azz**2)*
     .    amchar(1)/amchar(2)*(8.D0/xmuz**2*rh*sh-16.D0/xmuz*sh
     .    -16.D0*(xmuneut1-uh-th+1.D0))+
     .    (opl(1,2)**2+opr(1,2)**2)*(vzz**2-azz**2)*
     .    xmutau*(4.D0/xmuz**2*rh*rk-8.D0/xmuz*rk+8.D0*(uh+th-
     .    2.D0*xmutau))
     .    +(opl(1,2)**2+opr(1,2)**2)*(vzz**2+azz**2)*
     .    (-2.D0/xmuz**2*rk*sh+8.D0/xmuz*(xmuneut1*(2.D0*xmutau**2+
     .    4.D0*xmutau-xmutau*(th+uh))+2.D0*xmutau**2-xmutau*(uh+th))+
     .    4.D0*(xmuneut1*(uh+th-2.D0*xmutau-2.D0)+2.D0*xmutau*(uh+th-
     .    1.D0)-2.D0*xmutau**2+th*(-th+1.D0)+uh*(-uh+1.D0)))+
     .    (opl(1,2)**2-opr(1,2)**2)*vzz*azz*8.D0*(
     .    xmuneut1*(th-uh)+2.D0*xmutau*(th-uh)+th*(-th+1.D0)+uh*(uh-
     .    1.D0)))
      else
         charztau=0.D0
      endif

c -------------------------------------------------------------------- c
c                            Hl exchange
c -------------------------------------------------------------------- c

      xmuhl = aml**2/amchar(2)**2
      dhl   = y3-xmuhl
      
c ---- final state masses included ----

      if((amchar(1)+2.D0*amtau).le.amchar(2)) then
         charhltau=g2**2/dhl**2*(ytauc*dsin(a))**2*(
     .    gkhll(1,2)*gkhlr(1,2)*amchar(1)/amchar(2)*xmutau*(-8.D0)+
     .    gkhll(1,2)*gkhlr(1,2)*amchar(1)/amchar(2)*4.D0*(1.D0+
     .    xmuneut1-th-uh)+
     .    (gkhll(1,2)**2+gkhlr(1,2)**2)*xmutau*(-2.D0)*(-2.D0*xmutau
     .    +th+uh)+
     .    (gkhll(1,2)**2+gkhlr(1,2)**2)*(xmuneut1*(uh+th-2.D0*xmutau)
     .    +2.D0*xmutau*(uh+th-1.D0)-(th+uh)**2+uh+th))
      else
         charhltau=0.D0
      endif

c -------------------------------------------------------------------- c
c                            HH exchange
c -------------------------------------------------------------------- c

      xmuhh = amh**2/amchar(2)**2
      dhh   = y3-xmuhh
     
c ---- final state masses included ----

      if((amchar(1)+2.D0*amtau).le.amchar(2)) then
         charhhtau=g2**2/dhh**2*(ytauc*dcos(a))**2*(
     .    gkhhl(1,2)*gkhhr(1,2)*amchar(1)/amchar(2)*xmutau*(-8.D0)+
     .    gkhhl(1,2)*gkhhr(1,2)*amchar(1)/amchar(2)*4.D0*(1.D0+
     .    xmuneut1-th-uh)+
     .    (gkhhl(1,2)**2+gkhhr(1,2)**2)*xmutau*(-2.D0)*(-2.D0*xmutau
     .    +th+uh)+
     .    (gkhhl(1,2)**2+gkhhr(1,2)**2)*(xmuneut1*(uh+th-2.D0*xmutau)
     .    +2.D0*xmutau*(uh+th-1.D0)-(th+uh)**2+uh+th))
      else
         charhhtau=0.D0
      endif

c -------------------------------------------------------------------- c
c                            HA exchange
c -------------------------------------------------------------------- c

      xmuha = ama**2/amchar(2)**2
      dha   = y3-xmuha
     
c ---- final state masses included ----

      if((amchar(1)+2.D0*amtau).le.amchar(2)) then
         charhatau=g2**2/dha**2*(ytauc*dsin(b))**2*(
     .    gkhal(1,2)*gkhar(1,2)*amchar(1)/amchar(2)*xmutau*8.D0+
     .    gkhal(1,2)*gkhar(1,2)*amchar(1)/amchar(2)*4.D0*(1.D0+
     .    xmuneut1-th-uh)+
     .    (gkhal(1,2)**2+gkhar(1,2)**2)*xmutau*2.D0*(-2.D0*xmutau
     .    +th+uh)+
     .    (gkhal(1,2)**2+gkhar(1,2)**2)*(xmuneut1*(uh+th-2.D0*xmutau)
     .    +2.D0*xmutau*(uh+th-1.D0)-(th+uh)**2+uh+th))
      else
         charhatau=0.D0
      endif

c -------------------------------------------------------------------- c
c                         interference h-H
c -------------------------------------------------------------------- c

c ---- final state masses included ----

      if((amchar(1)+2.D0*amtau).le.amchar(2)) then
        charhhhl =2.D0*g2**2/dhh/dhl*ytauc*dcos(a)*ytauc*(-dsin(a))*(
     .   (gkhll(1,2)*gkhhr(1,2)+gkhlr(1,2)*gkhhl(1,2))*(
     .   amchar(1)/amchar(2)*xmutau*(-4.D0) +
     .   amchar(1)/amchar(2)*2.D0*(1.D0+xmuneut1-uh-th) ) +
     .   (gkhll(1,2)*gkhhl(1,2)+gkhlr(1,2)*gkhhr(1,2))*(
     .   xmutau*2.D0*(2.D0*xmutau-th-uh)+
     .   (xmuneut1*(uh+th-2.D0*xmutau)+2.D0*xmutau*(uh+th-1.D0)
     .   +th+uh-(th+uh)**2)) )
      else
         charhhhl =0.D0
      endif

c -------------------------------------------------------------------- c
c                    Z sneutrino_tau interference
c -------------------------------------------------------------------- c

      charzsntau=0.D0

c ---- final state masses included ----

      if((amchar(1)+2.D0*amtau).le.amchar(2)) then
         do i=1,2
            hv1 = alsnt(i,2)*alsnt(i,1)*opr(2,1)*(vzz-azz)
     .           +blsnt(i,2)*blsnt(i,1)*opl(2,1)*(vzz+azz)
            hv2 = alsnt(i,2)*alsnt(i,1)*opr(2,1)*(vzz+azz)
     .           +blsnt(i,2)*blsnt(i,1)*opl(2,1)*(vzz-azz)
            hv3 = alsnt(i,2)*alsnt(i,1)*opl(2,1)*(vzz-azz)
     .           +blsnt(i,2)*blsnt(i,1)*opr(2,1)*(vzz+azz)
            hv4 = alsnt(i,2)*alsnt(i,1)*opl(2,1)*(vzz+azz)
     .           +blsnt(i,2)*blsnt(i,1)*opr(2,1)*(vzz-azz)

            hv5 = alsnt(i,1)*blsnt(i,2)*opr(2,1)*(vzz+azz)
     .           +blsnt(i,1)*alsnt(i,2)*opl(2,1)*(vzz-azz)
            hv6 = alsnt(i,1)*blsnt(i,2)*opr(2,1)*(vzz-azz)
     .           +blsnt(i,1)*alsnt(i,2)*opl(2,1)*(vzz+azz)
            hv7 = alsnt(i,1)*blsnt(i,2)*opl(2,1)*(vzz+azz)
     .           +blsnt(i,1)*alsnt(i,2)*opr(2,1)*(vzz-azz)
            hv8 = alsnt(i,1)*blsnt(i,2)*opl(2,1)*(vzz-azz)
     .           +blsnt(i,1)*alsnt(i,2)*opr(2,1)*(vzz+azz)

            charzsntau=charzsntau
     .      -g2**2/dsto(i)/dz/cw*(
     .      hv1*amchar(1)/amchar(2)*xmutau*(
     .      1/xmuz*(-4.D0)*(1.D0+xmuneut1+2.D0*xmutau-uh-th)+16.D0) +
     .      hv2*amchar(1)/amchar(2)*(2.D0/xmuz*(2.D0*xmutau*(xmuneut1+
     .      1.D0-th-uh)+4.D0*xmutau**2)+4.D0*(1.D0+xmuneut1-uh-th)) +
     .      hv3*xmutau*(2.D0/xmuz*(xmuneut1*(2.D0*xmutau-th-uh+4.D0)+
     .      2.D0*xmutau-th-uh)+4.D0*(2.D0*xmutau-th-uh)) +
     .      hv4*(2.D0/xmuz*(xmuneut1*(-2.D0*xmutau**2+xmutau*th
     .      -2.D0*xmutau+xmutau*uh-2.D0*xmutau)+xmutau*(-2.D0*xmutau
     .      +uh)+xmutau*th)+4.D0*(xmuneut1*(xmutau-th+1.D0)+xmutau*
     .      (xmutau-th)+xmutau*(1.D0-th)+th**2-th)) + 
     .      hv5*amchar(1)/amchar(2)*dsqrt(xmutau)*
     .      (2.D0/xmuz*(xmuneut1*(1.D0+xmutau-th)+1.D0+xmutau*
     .      (2.D0*xmutau-2.D0*th-uh+3.D0)+th*(th-xmutau+uh-2.D0)-uh)+
     .      4.D0*(1.D0+xmutau-uh)) +
     .      hv6*amchar(1)/amchar(2)*dsqrt(xmutau)*
     .      (2.D0/xmuz*(xmuneut1*(-1.D0-xmutau+th)-1.D0+xmutau*
     .      (-xmutau+th-1.D0)+xmutau*(2.D0*th+uh-2.D0-xmutau)
     .      -th*(th+uh)+2.D0*th+uh)+8.D0*(1.D0+xmutau-th)) +
     .      hv7*dsqrt(xmutau)*(2.D0/xmuz*(xmuneut1*(-xmuneut1
     .      -3.D0*xmutau+2.D0*th+uh-1.D0)+xmutau*(-2.D0*xmutau+2.D0*th+
     .      uh-1.D0)+th*(xmutau-th-uh+1))+8.D0*(xmuneut1+xmutau-th))+
     .      hv8*dsqrt(xmutau)*(2.D0/xmuz*(xmuneut1*(xmuneut1+
     .      3.D0*xmutau-uh-2.D0*th+1.D0)+xmutau*(xmutau-th+1.D0)+
     .      xmutau*(xmutau-2.D0*th-uh)+uh*th+th**2-th)+4.D0*(xmuneut1
     .      +xmutau-uh)) )
         enddo
      else
         charzsntau=0.D0
      endif

c -------------------------------------------------------------------- c
c                     Hl-sneutrino_tau interference
c -------------------------------------------------------------------- c

      charhlsntau=0.D0	

c ---- final state masses included ----

      if ((amchar(1)+2.D0*amtau).le.amchar(2)) then
         do i=1,2
            charhlsntau=charhlsntau
     .       +2.D0*g2**2/dhl/dsto(i)*(ytauc*(-dsin(a))/dsqrt(2.D0))*(
     .       (alsnt(i,1)*alsnt(i,2)*gkhlr(1,2)+
     .        blsnt(i,2)*blsnt(i,1)*gkhll(1,2))*(
     .       dsqrt(xmutau)*(uh-xmuneut1-xmutau) +
     .       dsqrt(xmutau)*(-th+xmutau+xmuneut1) ) +
     .       (alsnt(i,1)*alsnt(i,2)*gkhll(1,2)+
     .        blsnt(i,2)*blsnt(i,1)*gkhlr(1,2))*(
     .       dsqrt(xmutau)*amchar(1)/amchar(2)*(-th+1.D0+xmutau) +
     .       dsqrt(xmutau)*amchar(1)/amchar(2)*(uh-1.D0-xmutau) ) +
     .       (alsnt(i,1)*blsnt(i,2)*gkhll(1,2)
     .       +alsnt(i,2)*blsnt(i,1)*gkhlr(1,2))*(
     .       2.D0*xmutau*amchar(1)/amchar(2) +
     .       amchar(1)/amchar(2)*(uh+th-xmuneut1-1.D0) ) +
     .       (alsnt(i,1)*blsnt(i,2)*gkhlr(1,2)
     .       +alsnt(i,2)*blsnt(i,1)*gkhll(1,2))*(
     .       (uh*th+th**2-th*(1.D0+2.D0*xmutau+xmuneut1)+xmutau+
     .       xmutau*xmuneut1) +
     .       xmutau*(uh+th-2.D0*xmutau)) )
         enddo
      else
         charhlsntau=0.D0
      endif

c -------------------------------------------------------------------- c
c                     HH-sneutrino_tau interference
c -------------------------------------------------------------------- c

      charhhsntau=0.D0	

c ---- final state masses included ----

      if ((amchar(1)+2.D0*amtau).le.amchar(2)) then
         do i=1,2
            charhhsntau=charhhsntau
     .       +2.D0*g2**2/dhh/dsto(i)*(ytauc*dcos(a)/dsqrt(2.D0))*(
     .       (alsnt(i,1)*alsnt(i,2)*gkhhr(1,2)+
     .        blsnt(i,2)*blsnt(i,1)*gkhhl(1,2))*(
     .       dsqrt(xmutau)*(uh-xmuneut1-xmutau) +
     .       dsqrt(xmutau)*(-th+xmutau+xmuneut1) ) +
     .       (alsnt(i,1)*alsnt(i,2)*gkhhl(1,2)+
     .        blsnt(i,2)*blsnt(i,1)*gkhhr(1,2))*(
     .       dsqrt(xmutau)*amchar(1)/amchar(2)*(-th+1.D0+xmutau) +
     .       dsqrt(xmutau)*amchar(1)/amchar(2)*(uh-1.D0-xmutau) ) +
     .       (alsnt(i,1)*blsnt(i,2)*gkhhl(1,2)
     .       +alsnt(i,2)*blsnt(i,1)*gkhhr(1,2))*(
     .       2.D0*xmutau*amchar(1)/amchar(2) +
     .       amchar(1)/amchar(2)*(uh+th-xmuneut1-1.D0) ) +
     .       (alsnt(i,1)*blsnt(i,2)*gkhhr(1,2)
     .       +alsnt(i,2)*blsnt(i,1)*gkhhl(1,2))*(
     .       (uh*th+th**2-th*(1.D0+2.D0*xmutau+xmuneut1)+xmutau+
     .       xmutau*xmuneut1) +
     .       xmutau*(uh+th-2.D0*xmutau)) )
         enddo
      else
         charhhsntau=0.D0
      endif

c -------------------------------------------------------------------- c
c                     HA-sneutrino_tau interference
c -------------------------------------------------------------------- c

      charhasntau=0.D0	

c ---- final state masses included ----

      if ((amchar(1)+2.D0*amtau).le.amchar(2)) then
         do i=1,2
            charhasntau=charhasntau
     .       +2.D0*g2**2/dha/dsto(i)*(ytauc*(-dsin(b))/dsqrt(2.D0))*(
     .       (alsnt(i,1)*alsnt(i,2)*gkhar(1,2)-
     .        blsnt(i,2)*blsnt(i,1)*gkhal(1,2))*(
     .       dsqrt(xmutau)*(uh-xmuneut1-xmutau) +
     .       dsqrt(xmutau)*(-th+xmutau+xmuneut1)*(-1.D0) ) +
     .       (alsnt(i,1)*alsnt(i,2)*gkhal(1,2)-
     .        blsnt(i,2)*blsnt(i,1)*gkhar(1,2))*(
     .       dsqrt(xmutau)*amchar(1)/amchar(2)*(-th+1.D0+xmutau) +
     .       dsqrt(xmutau)*amchar(1)/amchar(2)*(uh-1.D0-xmutau)*(-1.D0)
     .       ) +
     .       (alsnt(i,1)*blsnt(i,2)*gkhal(1,2)
     .       -alsnt(i,2)*blsnt(i,1)*gkhar(1,2))*(
     .       2.D0*xmutau*amchar(1)/amchar(2) +
     .       amchar(1)/amchar(2)*(uh+th-xmuneut1-1.D0)*(-1.D0) ) +
     .       (alsnt(i,1)*blsnt(i,2)*gkhar(1,2)
     .       -alsnt(i,2)*blsnt(i,1)*gkhal(1,2))*(
     .       (uh*th+th**2-th*(1.D0+2.D0*xmutau+xmuneut1)+xmutau+
     .       xmutau*xmuneut1)*(-1.D0) +
     .       xmutau*(uh+th-2.D0*xmutau)) )
         enddo
      else
         charhasntau=0.D0
      endif

c -------------------------------------------------------------------- c
c 	                interference Z and H/h/A
c -------------------------------------------------------------------- c

      charzhl=0.D0	

      if ((amchar(1)+2.D0*amtau).le.amchar(2)) then      
         charzhl=charzhl            
     .    -2.D0*g2**2/cw/dhl/dz*vzz*(-ytauc*dsin(a))/dsqrt(2.D0)*(
     .    amchar(1)/amchar(2)*dsqrt(xmutau)*
     .    (gkhll(1,2)*opl(1,2)+gkhlr(1,2)*opr(1,2))*(
     .    4.D0*(th-xmutau-1.D0) - 4.D0*(uh-xmutau-1.D0) )
     .    +dsqrt(xmutau)*(gkhll(1,2)*opr(1,2)+gkhlr(1,2)*opl(1,2))*(
     .    4.D0*(xmuneut1+xmutau-uh)-4.D0*(xmuneut1+xmutau-th)) )
      else
         charzhl=0.D0
      endif

      charzhh=0.D0	

      if ((amchar(1)+2.D0*amtau).le.amchar(2)) then      
         charzhh=charzhh            
     .    -2.D0*g2**2/cw/dhh/dz*vzz*(ytauc*dcos(a))/dsqrt(2.D0)*(
     .    amchar(1)/amchar(2)*dsqrt(xmutau)*
     .    (gkhhl(1,2)*opl(1,2)+gkhhr(1,2)*opr(1,2))*(
     .    4.D0*(th-xmutau-1.D0) - 4.D0*(uh-xmutau-1.D0) )
     .    +dsqrt(xmutau)*(gkhhl(1,2)*opr(1,2)+gkhhr(1,2)*opl(1,2))*(
     .    4.D0*(xmuneut1+xmutau-uh)-4.D0*(xmuneut1+xmutau-th)) )
      else
         charzhh=0.D0
      endif

      charza=0.D0

      if ((amchar(1)+2.D0*amtau).le.amchar(2)) then      
         charza=charza
     .    -2.D0*g2**2/cw/dha/dz*azz*(-ytauc*dsin(b))/dsqrt(2.D0)*(
     .    amchar(1)/amchar(2)*dsqrt(xmutau)*
     .    (gkhal(1,2)*opl(1,2)+gkhar(1,2)*opr(1,2))*(
     .    4.D0/xmuz*(2.D0+xmuneut1*(2.D0*xmutau-th-uh+2.D0)+xmutau*
     .    (-uh-th+1.D0+xmutau)+xmutau*(3.D0*xmutau-3.D0*(th+uh)+5.D0)
     .    +(th+uh)**2-3.D0*(th+uh))+
     .    4.D0*(th-xmutau-1.D0) +4.D0*(uh-xmutau-1.D0) )
     .    +dsqrt(xmutau)*(gkhal(1,2)*opr(1,2)+gkhar(1,2)*opl(1,2))*(
     .    4.D0/xmuz*(-2.D0*xmuneut1**2+xmuneut1*(-6.D0*xmutau+
     .    3.D0*(th+uh)-2.D0)+xmutau*(-xmutau+th+uh-1.D0)+xmutau*
     .    (-3.D0*xmutau+3.D0*(uh+th)-1.D0)-(th+uh)**2+(th+uh))+
     .    4.D0*(xmuneut1+xmutau-uh)+4.D0*(xmuneut1+xmutau-th)) )
      else
         charza=0.D0
      endif

c -------------------------------------------------------------------- c

      SD_chartau = charsntau+charztau+charhltau+charhhtau+charhatau+
     .             charhhhl+charzsntau+charhlsntau+charhhsntau+
     .             charhasntau+charzhl+charzhh+charza

      end

c ==================================================================== c
c ======================= chargino1 nu_e nubar_e ===================== c
c ==================================================================== c

      double precision function SD_charnue(x1,x2)

      implicit double precision (a-h,m,o-z)

      dimension amneut(4),xmneut(4),amchar(2)
      dimension dsel(2)
      dimension ale(2,2),alto(2,2),alsne(2,2),blsne(2,2),alsnt(2,2),
     .          blsnt(2,2),ble(2,2)
      dimension opl(2,2),opr(2,2),onl(4,4),onr(4,4)

      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_weinberg/sw,cw
      COMMON/SD_sfermionetau/ase1,ase2,astau1,astau2
      COMMON/SD_coup4/opl,opr,onl,onr
      COMMON/SD_coup5/ale,alto,alsne,blsne,alsnt,blsnt
      COMMON/SD_coup17/azztoptop,vzztoptop,azztautau,vzztautau,
     .                 azzneutneut,vzzneutneut,azzbotbot,vzzbotbot
      COMMON/SD_mwmzpole/amwp,amzp

      xmuneut1 = amchar(1)**2/amchar(2)**2

      x3 = 2.D0-x1-x2
      y1 = 1.D0-xmuneut1-x1
      y2 = 1.D0-xmuneut1-x2
      y3 = 1.D0+xmuneut1-x3

      do i=1,2,1
         ble(1,i) = 0.D0
         ble(2,i) = 0.D0
      end do

c -------------------------------------------------------------------- c
c                          selectron exchange
c -------------------------------------------------------------------- c

      xmusel1 = ase1**2/amchar(2)**2
      xmusel2 = ase2**2/amchar(2)**2

      dsel(1)  = 1.D0-x1-xmusel1
      dsel(2)  = 1.D0-x1-xmusel2

      charsel=0.D0
      
      if (amchar(1).le.amchar(2)) then
         do i=1,2
            do k=1,2
               charsel=charsel+g2**2/dsel(k)/dsel(i)*x1*y1*
     .         (ale(k,2)*ale(i,2)+ble(k,2)*ble(i,2))*
     .         (ale(k,1)*ale(i,1)+ble(k,1)*ble(i,1))
            enddo
         enddo
      else
         charsel=0.D0
      endif

c -------------------------------------------------------------------- c
c                             Z exchange
c -------------------------------------------------------------------- c

      xmuz  = amzp**2/amchar(2)**2
      dz    = y3-xmuz

      charz=0.D0

      if (amchar(1).le.amchar(2)) then
         charz=charz+g2**2*4.D0/dz**2/cw**2*
     .        (((azzneutneut+vzzneutneut)**2*opl(1,2)**2
     .        + (azzneutneut-vzzneutneut)**2*opr(1,2)**2)*x2*y2
     .        +((azzneutneut+vzzneutneut)**2*opr(1,2)**2
     .        + (azzneutneut-vzzneutneut)**2*opl(1,2)**2)*x1*y1
     .        -4.D0*dsqrt(xmuneut1)*opl(1,2)*opr(1,2)
     .        *(azzneutneut**2+vzzneutneut**2)*y3 )
      else
         charz=0.D0
      endif
	
c -------------------------------------------------------------------- c
c                      Z-selectron interference
c -------------------------------------------------------------------- c

      charzsel=0.D0
      
      if(amchar(1).le.amchar(2)) then
         do i=1,2
            charzsel=charzsel-g2**2*4.D0/dsel(i)/dz/cw
     .           *((ale(i,2)*ale(i,1)*opr(1,2)*
     .           (azzneutneut+vzzneutneut)+
     .           ble(i,2)*ble(i,1)*opl(1,2)*
     .           (-azzneutneut+vzzneutneut))*x1*y1
     .           -(ale(i,1)*ale(i,2)*opl(1,2)*
     .           (azzneutneut+vzzneutneut)
     .           +ble(i,1)*ble(i,2)*opr(1,2)*
     .           (-azzneutneut+vzzneutneut)
     .           )*dsqrt(xmuneut1)*y3)
         enddo
      else
         charzsel=0.D0
      endif
      
c -------------------------------------------------------------------- c

      SD_charnue = charsel+charz+charzsel

      end

c ==================================================================== c
c ===================== chargino1 nu_tau nubar_tau =================== c
c ==================================================================== c

      double precision function SD_charnutau(x1,x2)

      implicit double precision (a-h,m,o-z)

      dimension amneut(4),xmneut(4),amchar(2)
      dimension dsl(2)
      dimension opl(2,2),opr(2,2),onl(4,4),onr(4,4)
      dimension ale(2,2),alto(2,2),alsne(2,2),blsne(2,2),alsnt(2,2),
     .          blsnt(2,2),blto(2,2)

      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_param/sdgf,amz,amw,pi,g2
      COMMON/SD_weinberg/sw,cw
      COMMON/SD_coup4/opl,opr,onl,onr
      COMMON/SD_coup5/ale,alto,alsne,blsne,alsnt,blsnt
      COMMON/SD_coup17/azztoptop,vzztoptop,azztautau,vzztautau,
     .                 azzneutneut,vzzneutneut,azzbotbot,vzzbotbot
      COMMON/SD_sfermionetau/ase1,ase2,astau1,astau2
      COMMON/SD_mwmzpole/amwp,amzp

      xmuneut1 = amchar(1)**2/amchar(2)**2

      x3 = 2.D0-x1-x2
      y1 = 1.D0-xmuneut1-x1
      y2 = 1.D0-xmuneut1-x2
      y3 = 1.D0+xmuneut1-x3

      do i=1,2,1
         blto(1,i) = 0.D0
         blto(2,i) = 0.D0
      end do

c -------------------------------------------------------------------- c
c                           stau exchange
c -------------------------------------------------------------------- c

      xmusl1 = astau1**2/amchar(2)**2
      xmusl2 = astau2**2/amchar(2)**2

      dsl(1)  = 1.D0-x1-xmusl1
      dsl(2)  = 1.D0-x1-xmusl2

      charstau=0.D0
      
      if (amchar(1).le.amchar(2)) then
         do i=1,2
            do k=1,2
               charstau=charstau+g2**2/dsl(k)/dsl(i)*x1*y1*
     .         (alto(k,2)*alto(i,2)+blto(k,2)*blto(i,2))*
     .         (alto(k,1)*alto(i,1)+blto(k,1)*blto(i,1))
            enddo
         enddo
      else
         charstau=0.D0
      endif

c -------------------------------------------------------------------- c
c                             Z exchange
c -------------------------------------------------------------------- c

      xmuz  = amzp**2/amchar(2)**2
      dz    = y3-xmuz

      charz=0.D0

      if (amchar(1).le.amchar(2)) then
         charz=charz+g2**2*4.D0/dz**2/cw**2*
     .        (((azzneutneut+vzzneutneut)**2*opl(1,2)**2
     .        + (azzneutneut-vzzneutneut)**2*opr(1,2)**2)*x2*y2
     .        +((azzneutneut+vzzneutneut)**2*opr(1,2)**2
     .        + (azzneutneut-vzzneutneut)**2*opl(1,2)**2)*x1*y1
     .        -4.D0*dsqrt(xmuneut1)*opl(1,2)*opr(1,2)
     .        *(azzneutneut**2+vzzneutneut**2)*y3 )
      else
         charz=0.D0
      endif
	
c -------------------------------------------------------------------- c
c                        Z-stau interference
c -------------------------------------------------------------------- c

      charzstau=0.D0
      
      if(amchar(1).le.amchar(2)) then
         do i=1,2
            charzstau=charzstau-g2**2*4.D0/dsl(i)/dz/cw
     .           *((alto(i,2)*alto(i,1)*opr(1,2)*
     .           (azzneutneut+vzzneutneut)+
     .           blto(i,2)*blto(i,1)*opl(1,2)*
     .           (-azzneutneut+vzzneutneut))*x1*y1
     .           -(alto(i,1)*alto(i,2)*opl(1,2)*
     .           (azzneutneut+vzzneutneut)
     .           +blto(i,1)*blto(i,2)*opr(1,2)*
     .           (-azzneutneut+vzzneutneut)
     .           )*dsqrt(xmuneut1)*y3)
         enddo
      else
         charzstau=0.D0
      endif
      
c -------------------------------------------------------------------- c

      SD_charnutau = charstau+charz+charzstau
      
      end

c ==================================================================== c
c ======================== chargino1 up upbar ======================== c
c ==================================================================== c

      double precision function SD_charup(x1,x2)

      implicit double precision (a-h,m,o-z)

      dimension amneut(4),xmneut(4),amchar(2)
      dimension dsd(2)
      dimension opl(2,2),opr(2,2),onl(4,4),onr(4,4)
      dimension alup(2,2),aldo(2,2),bldo(2,2)

      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_param/sdgf,amz,amw,pi,g2
      COMMON/SD_squarkud/asup1,asup2,asdown1,asdown2
      COMMON/SD_weinberg/sw,cw
      COMMON/SD_coup4/opl,opr,onl,onr
      COMMON/SD_coup7/alup,aldo
      COMMON/SD_coup17/azztoptop,vzztoptop,azztautau,vzztautau,
     .                 azzneutneut,vzzneutneut,azzbotbot,vzzbotbot
      COMMON/SD_mwmzpole/amwp,amzp

      xmuneut1 = amchar(1)**2/amchar(2)**2

      x3 = 2.D0-x1-x2
      y1 = 1.D0-xmuneut1-x1
      y2 = 1.D0-xmuneut1-x2
      y3 = 1.D0+xmuneut1-x3

      do i=1,2,1
         bldo(1,i) = 0.D0
         bldo(2,i) = 0.D0
      end do

c -------------------------------------------------------------------- c
c                            sdown exchange
c -------------------------------------------------------------------- c

      xmusd1 = asdown1**2/amchar(2)**2
      xmusd2 = asdown2**2/amchar(2)**2

      dsd(1)  = 1.D0-x1-xmusd1
      dsd(2)  = 1.D0-x1-xmusd2

      charsdow=0.D0
      
      if (amchar(1).le.amchar(2)) then
         do i=1,2
            do k=1,2
               charsdow=charsdow+g2**2/dsd(k)/dsd(i)*x1*y1*
     .         (aldo(k,2)*aldo(i,2)+bldo(k,2)*bldo(i,2))*
     .         (aldo(k,1)*aldo(i,1)+bldo(k,1)*bldo(i,1))
            enddo
         enddo
      else
         charsdow=0.D0
      endif

c -------------------------------------------------------------------- c
c                             Z exchange
c -------------------------------------------------------------------- c

      xmuz = amzp**2/amchar(2)**2
      dz   = y3-xmuz

      charz=0.D0

      if (amchar(1).le.amchar(2)) then
         charz=charz+g2**2*4.D0/dz**2/cw**2*
     .        (((azztoptop+vzztoptop)**2*opl(1,2)**2
     .        + (azztoptop-vzztoptop)**2*opr(1,2)**2)*x2*y2
     .        +((azztoptop+vzztoptop)**2*opr(1,2)**2
     .        + (azztoptop-vzztoptop)**2*opl(1,2)**2)*x1*y1
     .        -4.D0*dsqrt(xmuneut1)*opl(1,2)*opr(1,2)
     .        *(azztoptop**2+vzztoptop**2)*y3 )
      else
         charz=0.D0
      endif
	
c -------------------------------------------------------------------- c
c                        Z-sdown interference
c -------------------------------------------------------------------- c

      charzsdow=0.D0
      
      if(amchar(1).le.amchar(2)) then
         do i=1,2
            charzsdow=charzsdow-g2**2*4.D0/dsd(i)/dz/cw
     .           *((aldo(i,2)*aldo(i,1)*
     .           opr(1,2)*(azztoptop+vzztoptop)+
     .           bldo(i,2)*bldo(i,1)*opl(1,2)*
     .           (-azztoptop+vzztoptop))*x1*y1
     .           -(aldo(i,1)*aldo(i,2)*opl(1,2)*(azztoptop+vzztoptop)
     .           +bldo(i,1)*bldo(i,2)*opr(1,2)*(-azztoptop+vzztoptop)
     .           )*dsqrt(xmuneut1)*y3)
         enddo
      else
         charzsdow=0.D0
      endif

c -------------------------------------------------------------------- c

      SD_charup = charsdow+charz+charzsdow

      end

c ==================================================================== c
c ====================== chargino1 down downbar ====================== c
c ==================================================================== c

      double precision function SD_chardow(x1,x2)

      implicit double precision (a-h,m,o-z)

      dimension amneut(4),xmneut(4),amchar(2)
      dimension dsup(2)
      dimension opl(2,2),opr(2,2),onl(4,4),onr(4,4)
      dimension alup(2,2),aldo(2,2),blup(2,2)

      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_param/sdgf,amz,amw,pi,g2
      COMMON/SD_coup17/azztoptop,vzztoptop,azztautau,vzztautau,
     .                 azzneutneut,vzzneutneut,azzbotbot,vzzbotbot
      COMMON/SD_weinberg/sw,cw
      COMMON/SD_squarkud/asup1,asup2,asdown1,asdown2
      COMMON/SD_coup4/opl,opr,onl,onr
      COMMON/SD_coup7/alup,aldo
      COMMON/SD_mwmzpole/amwp,amzp

      xmuneut1 = amchar(1)**2/amchar(2)**2

      x3 = 2.D0-x1-x2
      y1 = 1.D0-xmuneut1-x1
      y2 = 1.D0-xmuneut1-x2
      y3 = 1.D0+xmuneut1-x3

      do i=1,2,1
         blup(1,i) = 0.D0
         blup(2,i) = 0.D0
      end do

c -------------------------------------------------------------------- c
c                            sup exchange
c -------------------------------------------------------------------- c

      xmusup1 = asup1**2/amchar(2)**2
      xmusup2 = asup2**2/amchar(2)**2

      dsup(1)  = 1-x2-xmusup1
      dsup(2)  = 1-x2-xmusup2

      charsup=0.D0
      
      if (amchar(1).le.amchar(2)) then
         do i=1,2
            do k=1,2
               charsup=charsup+g2**2/dsup(k)/dsup(i)*x2*y2*
     .         (alup(k,2)*alup(i,2)+blup(k,2)*blup(i,2))*
     .         (alup(k,1)*alup(i,1)+blup(k,1)*blup(i,1))
            enddo
         enddo
      else
         charsup=0.D0
      endif

c -------------------------------------------------------------------- c
c                             Z exchange
c -------------------------------------------------------------------- c

      xmuz = amzp**2/amchar(2)**2
      dz   = y3-xmuz

      charz=0.D0

      if (amchar(1).le.amchar(2)) then
         charz=charz+g2**2*4.D0/dz**2/cw**2*
     .        (((azzbotbot+vzzbotbot)**2*opl(1,2)**2
     .        + (azzbotbot-vzzbotbot)**2*opr(1,2)**2)*x2*y2
     .        +((azzbotbot+vzzbotbot)**2*opr(1,2)**2
     .        + (azzbotbot-vzzbotbot)**2*opl(1,2)**2)*x1*y1
     .        -4.D0*dsqrt(xmuneut1)*opl(1,2)*opr(1,2)
     .        *(azzbotbot**2+vzzbotbot**2)*y3 )
      else
         charz=0.D0
      endif
	
c -------------------------------------------------------------------- c
c                         Z-sup interference
c -------------------------------------------------------------------- c

      charzsup=0.D0
      
      if(amchar(1).le.amchar(2)) then
         do i=1,2
            charzsup=charzsup+g2**2*4.D0/dsup(i)/dz/cw
     .           *((alup(i,2)*alup(i,1)*opl(1,2)*(azzbotbot+vzzbotbot)+
     .           blup(i,2)*blup(i,1)*opr(1,2)*
     .           (-azzbotbot+vzzbotbot))*x2*y2
     .           -(alup(i,1)*alup(i,2)*opr(1,2)*(azzbotbot+vzzbotbot)
     .           +blup(i,1)*blup(i,2)*opl(1,2)*(-azzbotbot+vzzbotbot)
     .           )*dsqrt(xmuneut1)*y3)
         enddo
      else
         charzsup=0.D0
      endif

c -------------------------------------------------------------------- c

      SD_chardow = charsup+charz+charzsup

      end

c ==================================================================== c
c ==================== chargino1 bottom bottombar ==================== c
c ==================================================================== c

      double precision function SD_charbot(x1,x2)

      implicit double precision (a-h,m,o-z)
      
      dimension amneut(4),xmneut(4),amchar(2)
      dimension dstop(2)
      dimension opl(2,2),opr(2,2),onl(4,4),onr(4,4)
      dimension alstor(2,2),akstor(2,2),alstor1(2,2),akstor1(2,2),
     .          alstor2(2,2),akstor2(2,2)
      dimension gkhlr(2,2),gkhll(2,2),gkhhr(2,2),gkhhl(2,2),gkhar(2,2),
     .          gkhal(2,2)

      COMMON/SD_indices/ni,nj
      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_hmass/ama,aml,amh,amch,amar
      COMMON/SD_fermion/amt,amb,amtau
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2
      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_mixang/a,tanbeta
      COMMON/SD_scala/scalb,scalt
      COMMON/SD_weinberg/sw,cw
      COMMON/SD_coup4/opl,opr,onl,onr
      COMMON/SD_coup2/gkhll,gkhhl,gkhal,gkhlr,gkhhr,gkhar
      COMMON/SD_coup17/azztoptop,vzztoptop,azztautau,vzztautau,
     .                 azzneutneut,vzzneutneut,azzbotbot,vzzbotbot
      COMMON/SD_yukawa/ytewsb,ybewsb,ytauewsb
      COMMON/SD_runcoupscale/scalechoice,scaleofcoupling,inumloop
      COMMON/SD_mwmzpole/amwp,amzp

c --- the running couplings ---

      if(scalechoice.eq.1.D0) then
         scalb = ybewsb/dsqrt(g2)
         scalt = ytewsb/dsqrt(g2)
      elseif(scalechoice.eq.2.D0) then         
         call SD_runmass(amchar(2),0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      elseif(scalechoice.eq.3.D0) then
         call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      endif

      call SD_charstopbot(alstor,akstor)
      do i=1,2,1
         do j=1,2,1
            alstor1(i,j)=alstor(i,j)
            akstor1(i,j)=akstor(i,j)
            alstor2(i,j)=alstor(i,j)
            akstor2(i,j)=akstor(i,j)
         end do
      end do

      call SD_phibotbot(hlbbr,hhbbr,habbr)

c --- several definitions ---

      xmuneut1 = amchar(1)**2/amchar(2)**2
      xmust1   = ast1**2/amchar(2)**2
      xmust2   = ast2**2/amchar(2)**2
      xmub     = amb**2/amchar(2)**2

      x3 = 2.D0-x1-x2
      y3 = 1.D0+xmuneut1-x3

      uh = 1.D0-x1+xmub
      th = 1.D0-x2+xmub

      vzz = vzzbotbot
      azz = azzbotbot

c -------------------------------------------------------------------- c
c                            stop exchange 
c -------------------------------------------------------------------- c

      dstop(1)  = 1.D0-x2-xmust1+xmub
      dstop(2)  = 1.D0-x2-xmust2+xmub

      charstop=0.D0

c ---- final state masses included ----

      if((amchar(1)+2.D0*amb).le.amchar(2)) then
         do i=1,2
            do k=1,2
               charstop=charstop
     .           +g2**2/dstop(k)/dstop(i)*(
     .           (alstor1(i,2)*akstor1(k,2)+akstor1(i,2)*alstor1(k,2))*
     .           (alstor2(i,1)*akstor2(k,1)+akstor2(i,1)*alstor2(k,1))*
     .           amchar(1)/amchar(2)*xmub*(-4.D0)+
     .           (alstor1(i,2)*alstor1(k,2)+akstor1(i,2)*akstor1(k,2))*
     .           (alstor2(i,1)*akstor2(k,1)+akstor2(i,1)*alstor2(k,1))*
     .           amchar(1)/amchar(2)*dsqrt(xmub)*2.D0*
     .           (th-xmub-1.D0)+
     .           (alstor1(i,2)*akstor1(k,2)+akstor1(i,2)*alstor1(k,2))*
     .           (alstor2(i,1)*alstor2(k,1)+akstor2(i,1)*akstor2(k,1))*
     .           dsqrt(xmub)*2.D0*(th-xmub-xmuneut1)+
     .           (alstor1(i,2)*alstor1(k,2)+akstor1(i,2)*akstor1(k,2))*
     .           (alstor2(i,1)*alstor2(k,1)+akstor2(i,1)*akstor2(k,1))*
     .           (-th**2+th*(1.D0+xmuneut1+2.D0*xmub)-
     .           (xmuneut1+xmub)*(1.D0+xmub)))
            enddo
         enddo         
      else
         charstop=0.D0
      endif

c -------------------------------------------------------------------- c
c                            Z exchange
c -------------------------------------------------------------------- c

      xmuz = amzp**2/amchar(2)**2
      dz   = y3-xmuz

      charzbot = 0.D0
      
c ---- final state masses included ----

      rh = xmuneut1+2.D0*xmub-th-uh+1.D0
      sh = (xmuneut1-th-uh+1.D0)*2.D0*xmub+4.D0*xmub**2
      rk = xmuneut1*(2.D0*xmub-th-uh+4.D0)+2.D0*xmub-uh-th

      if((amchar(1)+2.D0*amb).le.amchar(2)) then
         charzbot=charzbot+g2**2/dz**2/cw**2*(
     .    opl(1,2)*opr(1,2)*(vzz**2-azz**2)*
     .    amchar(1)/amchar(2)*xmub*(-16.D0/xmuz**2*rh**2+
     .    32.D0/xmuz*rh-64.D0)+
     .    opl(1,2)*opr(1,2)*(vzz**2+azz**2)*
     .    amchar(1)/amchar(2)*(8.D0/xmuz**2*rh*sh-16.D0/xmuz*sh
     .    -16.D0*(xmuneut1-uh-th+1.D0))+
     .    (opl(1,2)**2+opr(1,2)**2)*(vzz**2-azz**2)*
     .    xmub*(4.D0/xmuz**2*rh*rk-8.D0/xmuz*rk+8.D0*(uh+th-
     .    2.D0*xmub))
     .    +(opl(1,2)**2+opr(1,2)**2)*(vzz**2+azz**2)*
     .    (-2.D0/xmuz**2*rk*sh+8.D0/xmuz*(xmuneut1*(2.D0*xmub**2+
     .    4.D0*xmub-xmub*(th+uh))+2.D0*xmub**2-xmub*(uh+th))+
     .    4.D0*(xmuneut1*(uh+th-2.D0*xmub-2.D0)+2.D0*xmub*(uh+th-
     .    1.D0)-2.D0*xmub**2+th*(-th+1.D0)+uh*(-uh+1.D0)))+
     .    (opl(1,2)**2-opr(1,2)**2)*vzz*azz*8.D0*(
     .    xmuneut1*(th-uh)+2.D0*xmub*(th-uh)+th*(-th+1.D0)+uh*(uh-
     .    1.D0)))
      else
         charzbot=0.D0
      endif

c -------------------------------------------------------------------- c
c                            Hl exchange
c -------------------------------------------------------------------- c

      xmuhl = aml**2/amchar(2)**2
      dhl   = y3-xmuhl

c ---- final state masses included ----

      if((amchar(1)+2.D0*amb).le.amchar(2)) then
         charhlbot=g2**2/dhl**2*hlbbr**2*(
     .    gkhll(1,2)*gkhlr(1,2)*amchar(1)/amchar(2)*xmub*(-8.D0)+
     .    gkhll(1,2)*gkhlr(1,2)*amchar(1)/amchar(2)*4.D0*(1.D0+
     .    xmuneut1-th-uh)+
     .    (gkhll(1,2)**2+gkhlr(1,2)**2)*xmub*(-2.D0)*(-2.D0*xmub
     .    +th+uh)+
     .    (gkhll(1,2)**2+gkhlr(1,2)**2)*(xmuneut1*(uh+th-2.D0*xmub)
     .    +2.D0*xmub*(uh+th-1.D0)-(th+uh)**2+uh+th))
      else
         charhlbot=0.D0
      endif

c -------------------------------------------------------------------- c
c                            HH exchange
c -------------------------------------------------------------------- c

      xmuhh = amh**2/amchar(2)**2
      dhh   = y3-xmuhh

c ---- final state masses included ----

      if((amchar(1)+2.D0*amb).le.amchar(2)) then
         charhhbot=g2**2/dhh**2*hhbbr**2*(
     .    gkhhl(1,2)*gkhhr(1,2)*amchar(1)/amchar(2)*xmub*(-8.D0)+
     .    gkhhl(1,2)*gkhhr(1,2)*amchar(1)/amchar(2)*4.D0*(1.D0+
     .    xmuneut1-th-uh)+
     .    (gkhhl(1,2)**2+gkhhr(1,2)**2)*xmub*(-2.D0)*(-2.D0*xmub
     .    +th+uh)+
     .    (gkhhl(1,2)**2+gkhhr(1,2)**2)*(xmuneut1*(uh+th-2.D0*xmub)
     .    +2.D0*xmub*(uh+th-1.D0)-(th+uh)**2+uh+th))
      else
         charhhbot=0.D0
      endif

c -------------------------------------------------------------------- c
c                            HA exchange
c -------------------------------------------------------------------- c

      xmuha = ama**2/amchar(2)**2
      dha   = y3-xmuha
 
c ---- final state masses included ----

      if((amchar(1)+2.D0*amb).le.amchar(2)) then
         charhabot=g2**2/dha**2*habbr**2*(
     .    gkhal(1,2)*gkhar(1,2)*amchar(1)/amchar(2)*xmub*8.D0+
     .    gkhal(1,2)*gkhar(1,2)*amchar(1)/amchar(2)*4.D0*(1.D0+
     .    xmuneut1-th-uh)+
     .    (gkhal(1,2)**2+gkhar(1,2)**2)*xmub*2.D0*(-2.D0*xmub+th+uh)+
     .    (gkhal(1,2)**2+gkhar(1,2)**2)*(xmuneut1*(uh+th-2.D0*xmub)
     .    +2.D0*xmub*(uh+th-1.D0)-(th+uh)**2+uh+th))
      else
         charhabot=0.D0
      endif

c -------------------------------------------------------------------- c
c                         interference h-H
c -------------------------------------------------------------------- c

c ---- final state masses included ----

      if((amchar(1)+2.D0*amb).le.amchar(2)) then
        charhhhl=2.D0*g2**2/dhh/dhl*hhbbr*hlbbr*(
     .   (gkhll(1,2)*gkhhr(1,2)+gkhlr(1,2)*gkhhl(1,2))*(
     .   amchar(1)/amchar(2)*xmub*(-4.D0) +
     .   amchar(1)/amchar(2)*2.D0*(1.D0+xmuneut1-uh-th) ) +
     .   (gkhll(1,2)*gkhhl(1,2)+gkhlr(1,2)*gkhhr(1,2))*(
     .   xmub*2.D0*(2.D0*xmub-th-uh)+
     .   (xmuneut1*(uh+th-2.D0*xmub)+2.D0*xmub*(uh+th-1.D0)
     .   +th+uh-(th+uh)**2)) )
      else
         charhhhl =0.D0
      endif

c -------------------------------------------------------------------- c
c                       Z stop interference
c -------------------------------------------------------------------- c

      charzstop=0.D0

c ---- final state masses included ----

      if((amchar(1)+2.D0*amb).le.amchar(2)) then
         do i=1,2
            hv1 = alstor1(i,2)*alstor2(i,1)*opr(2,1)*(vzz-azz)
     .           +akstor1(i,2)*akstor2(i,1)*opl(2,1)*(vzz+azz)
            hv2 = alstor1(i,2)*alstor2(i,1)*opr(2,1)*(vzz+azz)
     .           +akstor1(i,2)*akstor2(i,1)*opl(2,1)*(vzz-azz)
            hv3 = alstor1(i,2)*alstor2(i,1)*opl(2,1)*(vzz-azz)
     .           +akstor1(i,2)*akstor2(i,1)*opr(2,1)*(vzz+azz)
            hv4 = alstor1(i,2)*alstor2(i,1)*opl(2,1)*(vzz+azz)
     .           +akstor1(i,2)*akstor2(i,1)*opr(2,1)*(vzz-azz)

            hv5 = alstor2(i,1)*akstor1(i,2)*opr(2,1)*(vzz+azz)
     .           +akstor2(i,1)*alstor1(i,2)*opl(2,1)*(vzz-azz)
            hv6 = alstor2(i,1)*akstor1(i,2)*opr(2,1)*(vzz-azz)
     .           +akstor2(i,1)*alstor1(i,2)*opl(2,1)*(vzz+azz)
            hv7 = alstor2(i,1)*akstor1(i,2)*opl(2,1)*(vzz+azz)
     .           +akstor2(i,1)*alstor1(i,2)*opr(2,1)*(vzz-azz)
            hv8 = alstor2(i,1)*akstor1(i,2)*opl(2,1)*(vzz-azz)
     .           +akstor2(i,1)*alstor1(i,2)*opr(2,1)*(vzz+azz)

            charzstop=charzstop
     .      -g2**2/dstop(i)/dz/cw*(
     .      hv1*amchar(1)/amchar(2)*xmub*(
     .      1/xmuz*(-4.D0)*(1.D0+xmuneut1+2.D0*xmub-uh-th)+16.D0) +
     .      hv2*amchar(1)/amchar(2)*(2.D0/xmuz*(2.D0*xmub*(xmuneut1+
     .      1.D0-th-uh)+4.D0*xmub**2)+4.D0*(1.D0+xmuneut1-uh-th)) +
     .      hv3*xmub*(2.D0/xmuz*(xmuneut1*(2.D0*xmub-th-uh+4.D0)+
     .      2.D0*xmub-th-uh)+4.D0*(2.D0*xmub-th-uh)) +
     .      hv4*(2.D0/xmuz*(xmuneut1*(-2.D0*xmub**2+xmub*th
     .      -2.D0*xmub+xmub*uh-2.D0*xmub)+xmub*(-2.D0*xmub
     .      +uh)+xmub*th)+4.D0*(xmuneut1*(xmub-th+1.D0)+xmub*
     .      (xmub-th)+xmub*(1.D0-th)+th**2-th)) + 
     .      hv5*amchar(1)/amchar(2)*dsqrt(xmub)*
     .      (2.D0/xmuz*(xmuneut1*(1.D0+xmub-th)+1.D0+xmub*
     .      (2.D0*xmub-2.D0*th-uh+3.D0)+th*(th-xmub+uh-2.D0)-uh)+
     .      4.D0*(1.D0+xmub-uh)) +
     .      hv6*amchar(1)/amchar(2)*dsqrt(xmub)*
     .      (2.D0/xmuz*(xmuneut1*(-1.D0-xmub+th)-1.D0+xmub*
     .      (-xmub+th-1.D0)+xmub*(2.D0*th+uh-2.D0-xmub)
     .      -th*(th+uh)+2.D0*th+uh)+8.D0*(1.D0+xmub-th)) +
     .      hv7*dsqrt(xmub)*(2.D0/xmuz*(xmuneut1*(-xmuneut1
     .      -3.D0*xmub+2.D0*th+uh-1.D0)+xmub*(-2.D0*xmub+2.D0*th+
     .      uh-1.D0)+th*(xmub-th-uh+1.D0))+8.D0*(xmuneut1+xmub-th)) +
     .      hv8*dsqrt(xmub)*(2.D0/xmuz*(xmuneut1*(xmuneut1+
     .      3.D0*xmub-uh-2.D0*th+1.D0)+xmub*(xmub-th+1.D0)+
     .      xmub*(xmub-2.D0*th-uh)+uh*th+th**2-th)+4.D0*(xmuneut1
     .      +xmub-uh)) )
         enddo
      else
         charzstop=0.D0
      endif

c -------------------------------------------------------------------- c
c                         Hl-stop interference
c -------------------------------------------------------------------- c

      charhlstop=0.D0	

c ---- final state masses included ----

      if ((amchar(1)+2.D0*amb).le.amchar(2)) then
         do i=1,2
            charhlstop=charhlstop
     .       +2.D0*g2**2/dhl/dstop(i)*(hlbbr/dsqrt(2.D0))*(
     .       (alstor2(i,1)*alstor1(i,2)*gkhlr(1,2)+
     .        akstor1(i,2)*akstor2(i,1)*gkhll(1,2))*(
     .       dsqrt(xmub)*(uh-xmuneut1-xmub) +
     .       dsqrt(xmub)*(-th+xmub+xmuneut1) ) +
     .       (alstor2(i,1)*alstor1(i,2)*gkhll(1,2)+
     .        akstor1(i,2)*akstor2(i,1)*gkhlr(1,2))*(
     .       dsqrt(xmub)*amchar(1)/amchar(2)*(-th+1.D0+xmub) +
     .       dsqrt(xmub)*amchar(1)/amchar(2)*(uh-1.D0-xmub) ) +
     .       (alstor2(i,1)*akstor1(i,2)*gkhll(1,2)
     .       +alstor1(i,2)*akstor2(i,1)*gkhlr(1,2))*(
     .       2.D0*xmub*amchar(1)/amchar(2) +
     .       amchar(1)/amchar(2)*(uh+th-xmuneut1-1.D0) ) +
     .       (alstor2(i,1)*akstor1(i,2)*gkhlr(1,2)
     .       +alstor1(i,2)*akstor2(i,1)*gkhll(1,2))*(
     .       (uh*th+th**2-th*(1.D0+2.D0*xmub+xmuneut1)+xmub+
     .       xmub*xmuneut1) +
     .       xmub*(uh+th-2.D0*xmub)) )
         enddo
      else
         charhlstop=0.D0
      endif

c -------------------------------------------------------------------- c
c                         HH-stop interference
c -------------------------------------------------------------------- c

      charhhstop=0.D0	

c ---- final state masses included ----

      if((amchar(1)+2.D0*amb).le.amchar(2)) then
         do i=1,2
            charhhstop=charhhstop
     .       +2.D0*g2**2/dhh/dstop(i)*(hhbbr/dsqrt(2.D0))*(
     .       (alstor2(i,1)*alstor1(i,2)*gkhhr(1,2)+
     .        akstor1(i,2)*akstor2(i,1)*gkhhl(1,2))*(
     .       dsqrt(xmub)*(uh-xmuneut1-xmub) +
     .       dsqrt(xmub)*(-th+xmub+xmuneut1) ) +
     .       (alstor2(i,1)*alstor1(i,2)*gkhhl(1,2)+
     .        akstor1(i,2)*akstor2(i,1)*gkhhr(1,2))*(
     .       dsqrt(xmub)*amchar(1)/amchar(2)*(-th+1.D0+xmub) +
     .       dsqrt(xmub)*amchar(1)/amchar(2)*(uh-1.D0-xmub) ) +
     .       (alstor2(i,1)*akstor1(i,2)*gkhhl(1,2)
     .       +alstor1(i,2)*akstor2(i,1)*gkhhr(1,2))*(
     .       2.D0*xmub*amchar(1)/amchar(2) +
     .       amchar(1)/amchar(2)*(uh+th-xmuneut1-1.D0) ) +
     .       (alstor2(i,1)*akstor1(i,2)*gkhhr(1,2)
     .       +alstor1(i,2)*akstor2(i,1)*gkhhl(1,2))*(
     .       (uh*th+th**2-th*(1.D0+2.D0*xmub+xmuneut1)+xmub+
     .       xmub*xmuneut1) +
     .       xmub*(uh+th-2.D0*xmub)) )
         enddo
      else
         charhhstop=0.D0
      endif

c -------------------------------------------------------------------- c
c                       HA-stop interference
c -------------------------------------------------------------------- c

      charhastop=0.D0	

c ---- final state masses included ----

      if((amchar(1)+2.D0*amb).le.amchar(2)) then
         do i=1,2
            charhastop=charhastop
     .       +2.D0*g2**2/dha/dstop(i)*(habbr/dsqrt(2.D0))*(
     .       (alstor2(i,1)*alstor1(i,2)*gkhar(1,2)-
     .        akstor1(i,2)*akstor2(i,1)*gkhal(1,2))*(
     .       dsqrt(xmub)*(uh-xmuneut1-xmub) +
     .       dsqrt(xmub)*(-th+xmub+xmuneut1)*(-1.D0) ) +
     .       (alstor2(i,1)*alstor1(i,2)*gkhal(1,2)-
     .        akstor1(i,2)*akstor2(i,1)*gkhar(1,2))*(
     .       dsqrt(xmub)*amchar(1)/amchar(2)*(-th+1.D0+xmub) +
     .       dsqrt(xmub)*amchar(1)/amchar(2)*(uh-1.D0-xmub)*(-1.D0)
     .       ) +
     .       (alstor2(i,1)*akstor1(i,2)*gkhal(1,2)
     .       -alstor1(i,2)*akstor2(i,1)*gkhar(1,2))*(
     .       2.D0*xmub*amchar(1)/amchar(2) +
     .       amchar(1)/amchar(2)*(uh+th-xmuneut1-1.D0)*(-1.D0) ) +
     .       (alstor2(i,1)*akstor1(i,2)*gkhar(1,2)
     .       -alstor1(i,2)*akstor2(i,1)*gkhal(1,2))*(
     .       (uh*th+th**2-th*(1.D0+2.D0*xmub+xmuneut1)+xmub+
     .       xmub*xmuneut1)*(-1.D0) +
     .       xmub*(uh+th-2.D0*xmub)) )
         enddo
      else
         charhastop=0.D0
      endif

c -------------------------------------------------------------------- c
c 	                interference Z and H/h/A
c -------------------------------------------------------------------- c

      charzhl=0.D0	

      if((amchar(1)+2.D0*amb).le.amchar(2)) then      
         charzhl=charzhl            
     .    -2.D0*g2**2/cw/dhl/dz*vzz*hlbbr/dsqrt(2.D0)*(
     .    amchar(1)/amchar(2)*dsqrt(xmub)*
     .    (gkhll(1,2)*opl(1,2)+gkhlr(1,2)*opr(1,2))*(
     .    4.D0*(th-xmub-1.D0) - 4.D0*(uh-xmub-1.D0) )
     .    +dsqrt(xmub)*(gkhll(1,2)*opr(1,2)+gkhlr(1,2)*opl(1,2))*(
     .    4.D0*(xmuneut1+xmub-uh)-4.D0*(xmuneut1+xmub-th)) )
      else
         charzhl=0.D0
      endif

      charzhh=0.D0	

      if((amchar(1)+2.D0*amb).le.amchar(2)) then      
         charzhh=charzhh            
     .    -2.D0*g2**2/cw/dhh/dz*vzz*hhbbr/dsqrt(2.D0)*(
     .    amchar(1)/amchar(2)*dsqrt(xmub)*
     .    (gkhhl(1,2)*opl(1,2)+gkhhr(1,2)*opr(1,2))*(
     .    4.D0*(th-xmub-1.D0) - 4.D0*(uh-xmub-1.D0) )
     .    +dsqrt(xmub)*(gkhhl(1,2)*opr(1,2)+gkhhr(1,2)*opl(1,2))*(
     .    4.D0*(xmuneut1+xmub-uh)-4.D0*(xmuneut1+xmub-th)) )
      else
         charzhh=0.D0
      endif

      charza=0.D0

      if((amchar(1)+2.D0*amb).le.amchar(2)) then      
         charza=charza
     .    -2.D0*g2**2/cw/dha/dz*azz*habbr/dsqrt(2.D0)*(
     .    amchar(1)/amchar(2)*dsqrt(xmub)*
     .    (gkhal(1,2)*opl(1,2)+gkhar(1,2)*opr(1,2))*(
     .    4.D0/xmuz*(2.D0+xmuneut1*(2.D0*xmub-th-uh+2.D0)+xmub*
     .    (-uh-th+1.D0+xmub)+xmub*(3.D0*xmub-3.D0*(th+uh)+5.D0)
     .    +(th+uh)**2-3.D0*(th+uh))+
     .    4.D0*(th-xmub-1.D0) +4.D0*(uh-xmub-1.D0) )
     .    +dsqrt(xmub)*(gkhal(1,2)*opr(1,2)+gkhar(1,2)*opl(1,2))*(
     .    4.D0/xmuz*(-2.D0*xmuneut1**2+xmuneut1*(-6.D0*xmub+
     .    3.D0*(th+uh)-2.D0)+xmub*(-xmub+th+uh-1.D0)+xmub*
     .    (-3.D0*xmub+3.D0*(uh+th)-1.D0)-(th+uh)**2+(th+uh))+
     .    4.D0*(xmuneut1+xmub-uh)+4.D0*(xmuneut1+xmub-th)) )
      else
         charza=0.D0
      endif

c -------------------------------------------------------------------- c

      SD_charbot = charstop+charzbot+charhlbot+charhhbot+charhabot+
     .             charhhhl+charzstop+charhlstop+charhhstop+
     .             charhastop+charzhl+charzhh+charza

      end

c ==================================================================== c
c ======================= chargino1 top topbar ======================= c
c ==================================================================== c

      double precision function SD_chartop(x1,x2)

      implicit double precision (a-h,m,o-z)
      
      dimension amneut(4),xmneut(4),amchar(2)
      dimension dsbot(2)
      dimension opl(2,2),opr(2,2),onl(4,4),onr(4,4)
      dimension gkhlr(2,2),gkhll(2,2),gkhhr(2,2),gkhhl(2,2),gkhar(2,2),
     .          gkhal(2,2)
      dimension alsbot(2,2),aksbot(2,2),alsbot1(2,2),aksbot1(2,2),
     .          alsbot2(2,2),aksbot2(2,2)

      COMMON/SD_indices/ni,nj
      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_hmass/ama,aml,amh,amch,amar
      COMMON/SD_fermion/amt,amb,amtau
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2
      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_mixang/a,tanbeta
      COMMON/SD_scala/scalb,scalt
      COMMON/SD_yukawa/ytewsb,ybewsb,ytauewsb
      COMMON/SD_weinberg/sw,cw
      COMMON/SD_coup4/opl,opr,onl,onr
      COMMON/SD_coup2/gkhll,gkhhl,gkhal,gkhlr,gkhhr,gkhar
      COMMON/SD_coup17/azztoptop,vzztoptop,azztautau,vzztautau,
     .                 azzneutneut,vzzneutneut,azzbotbot,vzzbotbot
      COMMON/SD_runcoupscale/scalechoice,scaleofcoupling,inumloop
      COMMON/SD_mwmzpole/amwp,amzp

c --- the running couplings ---

      if(scalechoice.eq.1.D0) then
         scalb = ybewsb/dsqrt(g2)
         scalt = ytewsb/dsqrt(g2)
      elseif(scalechoice.eq.2.D0) then         
         call SD_runmass(amchar(2),0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      elseif(scalechoice.eq.3.D0) then
         call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      endif

      call SD_charsbottop(alsbot,aksbot)
      do i=1,2,1
         do j=1,2,1
            alsbot1(i,j)=alsbot(i,j)
            aksbot1(i,j)=aksbot(i,j)
            alsbot2(i,j)=alsbot(i,j)
            aksbot2(i,j)=aksbot(i,j)
         end do
      end do

      call SD_phitoptop(hlttr,hhttr,hattr)

c --- several definitions ---

      xmuneut1 = amchar(1)**2/amchar(2)**2
      xmusb1   = asb1**2/amchar(2)**2
      xmusb2   = asb2**2/amchar(2)**2
      xmut     = amt**2/amchar(2)**2

      x3 = 2.D0-x1-x2
      y3 = 1.D0+xmuneut1-x3

      uh = 1.D0-x1+xmut
      th = 1.D0-x2+xmut

      vzz = vzztoptop
      azz = azztoptop

c -------------------------------------------------------------------- c
c                          sbottom exchange 
c -------------------------------------------------------------------- c

      dsbot(1) = 1-x1-xmusb1+xmut
      dsbot(2) = 1-x1-xmusb2+xmut

      charsbot=0.D0

c ---- final state masses included ----

      if((amchar(1)+2.D0*amt).le.amchar(2)) then
         do i=1,2
            do k=1,2
               charsbot=charsbot
     .          +g2**2/dsbot(k)/dsbot(i)*(
     .           (alsbot1(i,2)*aksbot1(k,2)+aksbot1(i,2)*alsbot1(k,2))*
     .           (alsbot2(i,1)*aksbot2(k,1)+aksbot2(i,1)*alsbot2(k,1))*
     .           amchar(1)/amchar(2)*xmut*(-4.D0)+
     .           (alsbot1(i,2)*alsbot1(k,2)+aksbot1(i,2)*aksbot1(k,2))*
     .           (alsbot2(i,1)*aksbot2(k,1)+aksbot2(i,1)*alsbot2(k,1))*
     .           amchar(1)/amchar(2)*dsqrt(xmut)*2.D0*
     .           (uh-xmut-1.D0)+
     .           (alsbot1(i,2)*aksbot1(k,2)+aksbot1(i,2)*alsbot1(k,2))*
     .           (alsbot2(i,1)*alsbot2(k,1)+aksbot2(i,1)*aksbot2(k,1))*
     .           dsqrt(xmut)*2.D0*(uh-xmut-xmuneut1)+
     .           (alsbot1(i,2)*alsbot1(k,2)+aksbot1(i,2)*aksbot1(k,2))*
     .           (alsbot2(i,1)*alsbot2(k,1)+aksbot2(i,1)*aksbot2(k,1))*
     .           (-uh**2+uh*(1.D0+xmuneut1+2.D0*xmut)-(xmuneut1+xmut)*
     .           (1.D0+xmut)))
            enddo
         enddo         
      else
         charsbot=0.D0
      endif

c -------------------------------------------------------------------- c
c                            Z exchange
c -------------------------------------------------------------------- c

      xmuz = amzp**2/amchar(2)**2
      dz   = y3-xmuz

      charztop=0.D0

c ---- final state masses included ----

      rh = xmuneut1+2.D0*xmut-th-uh+1.D0
      sh = (xmuneut1-th-uh+1.D0)*2.D0*xmut+4.D0*xmut**2
      rk = xmuneut1*(2.D0*xmut-th-uh+4.D0)+2.D0*xmut-uh-th

      if((amchar(1)+2.D0*amt).le.amchar(2)) then
         charztop=charztop+g2**2/dz**2/cw**2*(
     .    opl(1,2)*opr(1,2)*(vzz**2-azz**2)*
     .    amchar(1)/amchar(2)*xmut*(-16.D0/xmuz**2*rh**2+
     .    32.D0/xmuz*rh-64.D0)+
     .    opl(1,2)*opr(1,2)*(vzz**2+azz**2)*
     .    amchar(1)/amchar(2)*(8.D0/xmuz**2*rh*sh-16.D0/xmuz*sh
     .    -16.D0*(xmuneut1-uh-th+1.D0))+
     .    (opl(1,2)**2+opr(1,2)**2)*(vzz**2-azz**2)*
     .    xmut*(4.D0/xmuz**2*rh*rk-8.D0/xmuz*rk+8.D0*(uh+th-2.D0*xmut))
     .    +(opl(1,2)**2+opr(1,2)**2)*(vzz**2+azz**2)*
     .    (-2.D0/xmuz**2*rk*sh+8.D0/xmuz*(xmuneut1*(2.D0*xmut**2+
     .    4.D0*xmut-xmut*(th+uh))+2.D0*xmut**2-xmut*(uh+th))+4.D0*(
     .    xmuneut1*(uh+th-2.D0*xmut-2.D0)+2.D0*xmut*(uh+th-1.D0)
     .    -2.D0*xmut**2+th*(-th+1.D0)+uh*(-uh+1.D0)))+
     .    (opl(1,2)**2-opr(1,2)**2)*vzz*azz*8.D0*(
     .    xmuneut1*(th-uh)+2.D0*xmut*(th-uh)+th*(-th+1.D0)+uh*(uh-1.D0))
     .    )
      else
         charztop=0.D0
      endif

c -------------------------------------------------------------------- c
c                            Hl exchange
c -------------------------------------------------------------------- c

      xmuhl = aml**2/amchar(2)**2
      dhl   = y3-xmuhl
      
c ---- final state masses included ----

      if((amchar(1)+2.D0*amt).le.amchar(2)) then
         charhltop=g2**2/dhl**2*hlttr**2/2.D0*(
     .    gkhll(1,2)*gkhlr(1,2)*(
     .    amchar(1)/amchar(2)*xmut*(-16.D0)+
     .    amchar(1)/amchar(2)*8.D0*(1.D0+xmuneut1-th-uh) )+
     .    (gkhll(1,2)**2+gkhlr(1,2)**2)*(
     .    xmut*4.D0*(2.D0*xmut-th-uh)+
     .    2.D0*(xmuneut1*(uh+th-2.D0*xmut)+2.D0*xmut*(uh+th-1.D0)
     .    -(th+uh)**2+uh+th)) )
      else
         charhltop=0.D0
      endif

c -------------------------------------------------------------------- c
c                            HH exchange
c -------------------------------------------------------------------- c

      xmuhh = amh**2/amchar(2)**2
      dhh   = y3-xmuhh
      
c ---- final state masses included ----

      if((amchar(1)+2.D0*amt).le.amchar(2)) then
         charhhtop=g2**2/dhh**2*hhttr**2/2.D0*(
     .    gkhhl(1,2)*gkhhr(1,2)*(
     .    amchar(1)/amchar(2)*xmut*(-16.D0)+
     .    amchar(1)/amchar(2)*8.D0*(1.D0+xmuneut1-th-uh) )+
     .    (gkhhl(1,2)**2+gkhhr(1,2)**2)*(
     .    xmut*4.D0*(2.D0*xmut-th-uh)+
     .    2.D0*(xmuneut1*(uh+th-2.D0*xmut)+2.D0*xmut*(uh+th-1.D0)
     .    -(th+uh)**2+uh+th)) )
      else
         charhhtop=0.D0
      endif

c -------------------------------------------------------------------- c
c                            HA exchange
c -------------------------------------------------------------------- c

      xmuha = ama**2/amchar(2)**2
      dha   = y3-xmuha
      
c ---- final state masses included ----

      if((amchar(1)+2.D0*amt).le.amchar(2)) then
         charhatop=g2**2/dha**2*hattr**2/2.D0*(
     .    gkhal(1,2)*gkhar(1,2)*(
     .    amchar(1)/amchar(2)*xmut*16.D0+
     .    amchar(1)/amchar(2)*8.D0*(1.D0+xmuneut1-th-uh) )+
     .    (gkhal(1,2)**2+gkhar(1,2)**2)*(
     .    xmut*(-4.D0)*(2.D0*xmut-th-uh)+
     .    2.D0*(xmuneut1*(uh+th-2.D0*xmut)+2.D0*xmut*(uh+th-1.D0)
     .    -(th+uh)**2+uh+th)) )
      else
         charhatop=0.D0
      endif

c -------------------------------------------------------------------- c
c                         interference h-H
c -------------------------------------------------------------------- c

c ---- final state masses included ----

      if((amchar(1)+2.D0*amt).le.amchar(2)) then
        charhhhl =2.D0*g2**2/dhh/dhl*hlttr*hhttr*(
     .   (gkhll(1,2)*gkhhr(1,2)+gkhlr(1,2)*gkhhl(1,2))*(
     .   amchar(1)/amchar(2)*xmut*(-4.D0)+
     .   amchar(1)/amchar(2)*2.D0*(1.D0+xmuneut1-uh-th) )+
     .   (gkhll(1,2)*gkhhl(1,2)+gkhlr(1,2)*gkhhr(1,2))*(
     .   xmut*2.D0*(2.D0*xmut-th-uh)+
     .   (xmuneut1*(uh+th-2.D0*xmut)+2.D0*xmut*(uh+th-1.D0)+th+uh
     .   -(th+uh)**2)) )
      else
         charhhhl=0.D0
      endif

c -------------------------------------------------------------------- c
c                      Z-sbottom interference
c -------------------------------------------------------------------- c

      charzsbot=0.D0

c ---- final state masses included ----

      if((amchar(1)+2.D0*amt).le.amchar(2)) then
         do i=1,2
            hv1 = alsbot1(i,2)*alsbot2(i,1)*opl(2,1)*(vzz-azz)
     .           +aksbot1(i,2)*aksbot2(i,1)*opr(2,1)*(vzz+azz)
            hv2 = alsbot1(i,2)*alsbot2(i,1)*opl(2,1)*(vzz+azz)
     .           +aksbot1(i,2)*aksbot2(i,1)*opr(2,1)*(vzz-azz)
            hv3 = alsbot1(i,2)*alsbot2(i,1)*opr(2,1)*(vzz-azz)
     .           +aksbot1(i,2)*aksbot2(i,1)*opl(2,1)*(vzz+azz)
            hv4 = alsbot1(i,2)*alsbot2(i,1)*opr(2,1)*(vzz+azz)
     .           +aksbot1(i,2)*aksbot2(i,1)*opl(2,1)*(vzz-azz)

            hv5 = alsbot2(i,1)*aksbot1(i,2)*opl(2,1)*(vzz+azz)
     .           +aksbot2(i,1)*alsbot1(i,2)*opr(2,1)*(vzz-azz)
            hv6 = alsbot2(i,1)*aksbot1(i,2)*opl(2,1)*(vzz-azz)
     .           +aksbot2(i,1)*alsbot1(i,2)*opr(2,1)*(vzz+azz)
            hv7 = alsbot2(i,1)*aksbot1(i,2)*opr(2,1)*(vzz+azz)
     .           +aksbot2(i,1)*alsbot1(i,2)*opl(2,1)*(vzz-azz)
            hv8 = alsbot2(i,1)*aksbot1(i,2)*opr(2,1)*(vzz-azz)
     .           +aksbot2(i,1)*alsbot1(i,2)*opl(2,1)*(vzz+azz)

            charzsbot=charzsbot
     .      +g2**2/dsbot(i)/dz/cw*(
     .      hv1*amchar(1)/amchar(2)*xmut*(
     .      1/xmuz*(-4.D0)*(1.D0+xmuneut1+2.D0*xmut-uh-th)+16.D0) +
     .      hv2*amchar(1)/amchar(2)*(2.D0/xmuz*((xmuneut1+1.D0-uh-th)*
     .      2.D0*xmut+4.D0*xmut**2)+4.D0*(1.D0+xmuneut1-uh-th)) +
     .      hv3*xmut*(2.D0/xmuz*(xmuneut1*(2.D0*xmut-th-uh+4.D0)+2.D0*
     .      xmut-th-uh)+4.D0*(2.D0*xmut-th-uh)) +
     .      hv4*(2.D0/xmuz*(xmuneut1*(-2.D0*xmut**2+xmut*th-2.D0*xmut+
     .      xmut*uh-2.D0*xmut)+xmut*(-2.D0*xmut+uh)+xmut*th)+4.D0*(
     .      xmuneut1*(xmut-uh+1.D0)+xmut*(xmut-uh)+xmut*(1.D0-uh)+uh**2
     .      -uh)) + 
     .      hv5*amchar(1)/amchar(2)*dsqrt(xmut)*(2.D0/xmuz*
     .      (xmuneut1*(1.D0+xmut-uh)+1.D0+xmut*(xmut-uh)+xmut*
     .      (xmut-th-2.D0*uh+3.D0)+th*(uh-1.D0)+uh*(uh-2.D0))+
     .      4.D0*(1.D0+xmut-th)) +
     .      hv6*amchar(1)/amchar(2)*dsqrt(xmut)*
     .      (2.D0/xmuz*(xmuneut1*(-1.D0-xmut+uh)-1.D0+xmut*(-1.D0+uh)
     .      +uh*(2.D0-th-uh)+th+xmut*(-2.D0*xmut+th+2.D0*uh-2.D0))+
     .      8.D0*(1.D0+xmut-uh)) +
     .      hv7*dsqrt(xmut)*(
     .      (-2.D0)/xmuz*(xmuneut1-uh+xmut)*(xmuneut1+2.D0*xmut-th-uh
     .      +1.D0)+8.D0*(xmuneut1+xmut-uh)) +
     .      hv8*dsqrt(xmut)*(
     .      2.D0/xmuz*(xmuneut1*(xmuneut1+3.D0*xmut-th-2.D0*uh+1.D0)+
     .      xmut*(2.D0*xmut-th-2.D0*uh)+xmut*(1.D0-uh)+uh*th+uh**2-uh)+
     .      4.D0*(xmuneut1+xmut-th)))
         enddo
      else
         charzsbot=0.D0
      endif

c -------------------------------------------------------------------- c
c                      Hl-sbottom interference
c -------------------------------------------------------------------- c

      charhlsbot=0.D0	

c ---- final state masses included ----

      if((amchar(1)+2.D0*amt).le.amchar(2)) then
         do i=1,2
            charhlsbot=charhlsbot
     .       +2.D0*g2**2/dhl/dsbot(i)*(hlttr/dsqrt(2.D0))*(
     .       (alsbot1(i,2)*alsbot2(i,1)*gkhll(1,2)+
     .        aksbot1(i,2)*aksbot2(i,1)*gkhlr(1,2))*(
     .       dsqrt(xmut)*(xmuneut1+xmut-uh) +
     .       dsqrt(xmut)*(-xmuneut1-xmut+th)) +
     .       (alsbot1(i,2)*alsbot2(i,1)*gkhlr(1,2)+
     .        aksbot1(i,2)*aksbot2(i,1)*gkhll(1,2))*(
     .       amchar(1)/amchar(2)*dsqrt(xmut)*(-1.D0-xmut+th) +
     .       amchar(1)/amchar(2)*dsqrt(xmut)*(1.D0+xmut-uh) )
     .       +(alsbot2(i,1)*aksbot1(i,2)*gkhlr(1,2)+
     .         alsbot1(i,2)*aksbot2(i,1)*gkhll(1,2))*(
     .       amchar(1)/amchar(2)*(-1.D0-xmuneut1+uh+th) +
     .       2.D0*amchar(1)/amchar(2)*xmut ) +
     .       (alsbot2(i,1)*aksbot1(i,2)*gkhll(1,2)+
     .        alsbot1(i,2)*aksbot2(i,1)*gkhlr(1,2))*(
     .       xmut*(-2.D0*xmut+th+uh) +
     .       (uh**2+uh*th-uh*(1.D0+2.D0*xmut+xmuneut1)+xmut+xmuneut1*
     .       xmut)) )
         enddo
      else
         charhlsbot=0.D0
      endif

c -------------------------------------------------------------------- c
c                        HH-sbottom interference
c -------------------------------------------------------------------- c

      charhhsbot=0.D0	

c ---- final state masses included ----

      if((amchar(1)+2.D0*amt).le.amchar(2)) then
         do i=1,2
            charhhsbot=charhhsbot
     .       +2.D0*g2**2/dhh/dsbot(i)*(hhttr/dsqrt(2.D0))*(
     .       (alsbot1(i,2)*alsbot2(i,1)*gkhhl(1,2)+
     .        aksbot1(i,2)*aksbot2(i,1)*gkhhr(1,2))*(
     .       dsqrt(xmut)*(xmuneut1+xmut-uh) +
     .       dsqrt(xmut)*(-xmuneut1-xmut+th)) +
     .       (alsbot1(i,2)*alsbot2(i,1)*gkhhr(1,2)+
     .        aksbot1(i,2)*aksbot2(i,1)*gkhhl(1,2))*(
     .       amchar(1)/amchar(2)*dsqrt(xmut)*(-1.D0-xmut+th) +
     .       amchar(1)/amchar(2)*dsqrt(xmut)*(1.D0+xmut-uh) )
     .       +(alsbot2(i,1)*aksbot1(i,2)*gkhhr(1,2)+
     .         alsbot1(i,2)*aksbot2(i,1)*gkhhl(1,2))*(
     .       amchar(1)/amchar(2)*(-1.D0-xmuneut1+uh+th) +
     .       2.D0*amchar(1)/amchar(2)*xmut ) +
     .       (alsbot2(i,1)*aksbot1(i,2)*gkhhl(1,2)+
     .        alsbot1(i,2)*aksbot2(i,1)*gkhhr(1,2))*(
     .       xmut*(-2.D0*xmut+th+uh) +
     .       (uh**2+uh*th-uh*(1.D0+2.D0*xmut+xmuneut1)+xmut+xmuneut1*
     .       xmut)) )
         enddo
      else
         charhhsbot=0.D0
      endif

c -------------------------------------------------------------------- c
c                       HA-sbottom interference
c -------------------------------------------------------------------- c

      charhasbot=0.D0	

c ---- final state masses included ----

      if((amchar(1)+2.D0*amt).le.amchar(2)) then
         do i=1,2
            charhasbot=charhasbot
     .       +2.D0*g2**2/dha/dsbot(i)*(hattr/dsqrt(2.D0))*(
     .       (alsbot1(i,2)*alsbot2(i,1)*gkhal(1,2)-
     .        aksbot1(i,2)*aksbot2(i,1)*gkhar(1,2))*(
     .       dsqrt(xmut)*(xmuneut1+xmut-uh) -
     .       dsqrt(xmut)*(-xmuneut1-xmut+th)) +
     .       (alsbot1(i,2)*alsbot2(i,1)*gkhar(1,2)-
     .        aksbot1(i,2)*aksbot2(i,1)*gkhal(1,2))*(
     .       amchar(1)/amchar(2)*dsqrt(xmut)*(-1.D0-xmut+th) -
     .       amchar(1)/amchar(2)*dsqrt(xmut)*(1.D0+xmut-uh) )
     .       +(alsbot2(i,1)*aksbot1(i,2)*gkhar(1,2)-
     .         alsbot1(i,2)*aksbot2(i,1)*gkhal(1,2))*(
     .       amchar(1)/amchar(2)*(-1.D0-xmuneut1+uh+th) -
     .       2.D0*amchar(1)/amchar(2)*xmut ) +
     .       (-alsbot2(i,1)*aksbot1(i,2)*gkhal(1,2)+
     .        alsbot1(i,2)*aksbot2(i,1)*gkhar(1,2))*(
     .       xmut*(-2.D0*xmut+th+uh) -
     .       (uh**2+uh*th-uh*(1.D0+2.D0*xmut+xmuneut1)+xmut+xmuneut1*
     .       xmut)) )
         enddo
      else
         charhasbot=0.D0
      endif

c -------------------------------------------------------------------- c
c 	                interference Z and H/h/A
c -------------------------------------------------------------------- c

      charzhl=0.D0	

      if((amchar(1)+2.D0*amt).le.amchar(2)) then      
         charzhl=charzhl
     .    -2.D0*g2**2/cw/dhl/dz*vzz*(hlttr/dsqrt(2.D0))*(
     .    amchar(1)/amchar(2)*dsqrt(xmut)*
     .    (gkhll(1,2)*opl(1,2)+gkhlr(1,2)*opr(1,2))*(
     .    4.D0*(th-xmut-1.D0)-4.D0*(uh-xmut-1.D0))
     .    +dsqrt(xmut)*(gkhll(1,2)*opr(1,2)+gkhlr(1,2)*opl(1,2))*(
     .    4.D0*(xmuneut1+xmut-uh)-4.D0*(xmuneut1+xmut-th)) )
      else
         charzhl=0.D0
      endif

      charzhh=0.D0	

      if((amchar(1)+2.D0*amt).le.amchar(2)) then      
         charzhh=charzhh
     .    -2.D0*g2**2/cw/dhh/dz*vzz*(hhttr/dsqrt(2.D0))*(
     .    amchar(1)/amchar(2)*dsqrt(xmut)*
     .    (gkhhl(1,2)*opl(1,2)+gkhhr(1,2)*opr(1,2))*(
     .    4.D0*(th-xmut-1.D0)-4.D0*(uh-xmut-1.D0))
     .    +dsqrt(xmut)*(gkhhl(1,2)*opr(1,2)+gkhhr(1,2)*opl(1,2))*(
     .    4.D0*(xmuneut1+xmut-uh)-4.D0*(xmuneut1+xmut-th)) )
      else
         charzhh=0.D0
      endif

      charzha=0.D0	

      if((amchar(1)+2.D0*amt).le.amchar(2)) then      
         charzha=charzha
     .    -2.D0*g2**2/cw/dha/dz*azz*(hattr/dsqrt(2.D0))*(
     .    amchar(1)/amchar(2)*dsqrt(xmut)*
     .    (gkhal(1,2)*opl(1,2)+gkhar(1,2)*opr(1,2))*(
     .    4.D0/xmuz*(2.D0+xmuneut1*(2.D0*xmut-th-uh+2.D0)+xmut*
     .    (-uh-th+1.D0+xmut)+xmut*(3.D0*xmut-3.D0*(th+uh)+5.D0)
     .    +(th+uh)**2-3.D0*(th+uh))+
     .    4.D0*(th-xmut-1.D0)+4.D0*(uh-xmut-1.D0))
     .    +dsqrt(xmut)*(gkhal(1,2)*opr(1,2)+gkhar(1,2)*opl(1,2))*(
     .    4.D0/xmuz*(-2.D0*xmuneut1**2+xmuneut1*(-6.D0*xmut+
     .    3.D0*(th+uh)-2.D0)+xmut*(-xmut+th+uh-1.D0)+xmut*
     .    (-3.D0*xmut+3.D0*(uh+th)-1.D0)-(th+uh)**2+(th+uh))+
     .    4.D0*(xmuneut1+xmut-uh)+4.D0*(xmuneut1+xmut-th)) )
      else
         charzha=0.D0
      endif

c -------------------------------------------------------------------- c

      SD_chartop = charsbot+charztop+charhltop+charhhtop+charhatop+
     .             charhhhl+charzsbot+charhlsbot+charhhsbot+
     .             charhasbot+charzhl+charzhh+charzha

      end

c ==================================================================== c
c ========================= gluino up downbar ======================== c
c ==================================================================== c

      double precision function SD_gluiupdb(x1,x2)

      implicit double precision (a-h,m,o-z)

      dimension amneut(4),xmneut(4),amchar(2)
      dimension gul(2),gur(2),gdl(2),gdr(2),gtl(2),gtr(2),gbl(2),gbr(2)
      dimension dsdow(2),dsup(2)
      dimension alup(2,2),aldo(2,2),bldo(2,2),blup(2,2)

      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_gluino/mgluino	      
      COMMON/SD_param/sdgf,amz,amw,pi,g2
      COMMON/SD_indices/ni,nj
      COMMON/SD_squarkud/asup1,asup2,asdown1,asdown2
      COMMON/SD_coup21/gtr,gtl,gbr,gbl,gur,gul,gdr,gdl
      COMMON/SD_coup7/alup,aldo
      COMMON/SD_coupewsb/alsew,g2ew,g1ew
      COMMON/SD_runcoupscale/scalechoice,scaleofcoupling,inumloop

      external SD_alphascall

c --- the running couplings ---

      if(scalechoice.eq.1.D0) then
         gs21 = alsew*4.D0*pi
         gs22 = gs21
      elseif(scalechoice.eq.2.D0) then         
         gs21 = SD_alphascall(amchar(ni),inumloop)*4.D0*pi
         gs22 = gs21
      elseif(scalechoice.eq.3.D0) then
         gs21 = SD_alphascall(scaleofcoupling,inumloop)*4.D0*pi
         gs22 = gs21
      endif

c --- several definitions ---      

      xmuneut1 = mgluino**2/amchar(ni)**2

      x3 = 2.D0-x1-x2
      y1 = 1.D0-xmuneut1-x1
      y2 = 1.D0-xmuneut1-x2
      y3 = 1.D0+xmuneut1-x3

      do i=1,2,1
         bldo(1,i) = 0.D0
         bldo(2,i) = 0.D0
         blup(1,i) = 0.D0
         blup(2,i) = 0.D0
      end do

c -------------------------------------------------------------------- c
c                           sdown/sup exchange
c -------------------------------------------------------------------- c

      xmusd1 = asdown1/amchar(ni)**2
      xmusd2 = asdown2/amchar(ni)**2
      xmusu1 = asup1/amchar(ni)**2
      xmusu2 = asup2/amchar(ni)**2

      dsdow(1) = 1-x1-xmusd1
      dsdow(2) = 1-x1-xmusd2
      dsup(1)  = 1-x2-xmusu1
      dsup(2)  = 1-x2-xmusu2

      SD_gluiupdb=0.D0

      if (dabs(mgluino).le.amchar(ni)) then
         do i=1,2
            do k=1,2
               SD_gluiupdb=SD_gluiupdb
     .            +g2*gs21/dsdow(i)/dsdow(k)*x1*y1
     .            *(aldo(i,ni)*aldo(k,ni)+bldo(i,ni)*bldo(k,ni))
     .            *(gdr(i)*gdr(k)+gdl(i)*gdl(k))
     .            +g2*gs22/dsup(i)/dsup(k)*x2*y2
     .            *(alup(i,ni)*alup(k,ni)+blup(i,ni)*blup(k,ni))
     .            *(gur(i)*gur(k)+gul(i)*gul(k))
     .            +g2*dsqrt(gs21)*dsqrt(gs22)/dsdow(i)/dsup(k)*(
     .            (gul(k)*gdr(i)*aldo(i,ni)*blup(k,ni)+
     .             gdl(i)*gur(k)*alup(k,ni)*bldo(i,ni))*
     .            (-x1*y1-x2*y2+x3*y3) +
     .            2.D0*(gul(k)*gdl(i)*alup(k,ni)*aldo(i,ni)+
     .                  gur(k)*gdr(i)*blup(k,ni)*bldo(i,ni))*
     .            mgluino/amchar(ni)*y3 )
            enddo
         enddo
      else 
         SD_gluiupdb=0.D0	
      endif

      end

c ==================================================================== c
c ======================== gluino top bottombar ====================== c
c ==================================================================== c

      double precision function SD_gluitopbb(x1,x2)

      implicit double precision (a-h,m,o-z)

      dimension amneut(4),xmneut(4),amchar(2)
      dimension gul(2),gur(2),gdl(2),gdr(2),gtl(2),gtr(2),gbl(2),gbr(2)
      dimension dsbot(2),dstop(2)
      dimension alsbot(2,2),aksbot(2,2),alstor(2,2),akstor(2,2)

      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_gluino/mgluino	      
      COMMON/SD_fermion/amt,amb,amtau
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2
      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_indices/ni,nj
      COMMON/SD_scala/scalb,scalt
      COMMON/SD_yukawa/ytewsb,ybewsb,ytauewsb
      COMMON/SD_coup21/gtr,gtl,gbr,gbl,gur,gul,gdr,gdl
      COMMON/SD_coupewsb/alsew,g2ew,g1ew
      COMMON/SD_runcoupscale/scalechoice,scaleofcoupling,inumloop

      external SD_alphascall

c --- the running couplings ---

      if(scalechoice.eq.1.D0) then
         gs21 = alsew*4.D0*pi
         gs22 = gs21
      elseif(scalechoice.eq.2.D0) then         
         gs21 = SD_alphascall(amchar(ni),inumloop)*4.D0*pi
         gs22 = gs21
      elseif(scalechoice.eq.3.D0) then
         gs21 = SD_alphascall(scaleofcoupling,inumloop)*4.D0*pi
         gs22 = gs21
      endif

      if(scalechoice.eq.1.D0) then
         scalb = ybewsb/dsqrt(g2)
         scalt = ytewsb/dsqrt(g2)
      elseif(scalechoice.eq.2.D0) then         
         call SD_runmass(amchar(ni),0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      elseif(scalechoice.eq.3.D0) then
         call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      endif

      call SD_charsbottop(alsbot,aksbot)
      call SD_charstopbot(alstor,akstor)

c --- several definitions ---

      xmuneut1 = mgluino**2/amchar(ni)**2
      xmut     = amt**2/amchar(ni)**2
      xmub     = amb**2/amchar(ni)**2
      xmusb1   = asb1**2/amchar(ni)**2
      xmusb2   = asb2**2/amchar(ni)**2
      xmust1   = ast1**2/amchar(ni)**2
      xmust2   = ast2**2/amchar(ni)**2

c -------------------------------------------------------------------- c
c                         sbottom/stop exchange
c -------------------------------------------------------------------- c

      dsbot(1)  = 1.D0-x1-xmusb1+xmut
      dsbot(2)  = 1.D0-x1-xmusb2+xmut
      dstop(1)  = 1.D0-x2-xmust1+xmub
      dstop(2)  = 1.D0-x2-xmust2+xmub

      SD_gluitopbb=0.D0

c ---- final state masses included ----

      uh = 1.D0-x1+xmut
      th = 1.D0-x2+xmub

      if ((dabs(mgluino)+amt+amb).le.amchar(ni)) then
         do i=1,2
            do k=1,2
               db1 = alsbot(k,ni)*aksbot(i,ni)+alsbot(i,ni)*aksbot(k,ni)
               db2 = alsbot(k,ni)*alsbot(i,ni)+aksbot(k,ni)*aksbot(i,ni)
               db3 = gbl(k)*gbr(i)+gbl(i)*gbr(k)
               db4 = gbl(i)*gbl(k)+gbr(i)*gbr(k)

               ab1 = db1*db3
               ab2 = db2*db3
               ab3 = db1*db4
               ab4 = db2*db4

               dt1 = alstor(k,ni)*akstor(i,ni)+alstor(i,ni)*akstor(k,ni)
               dt2 = alstor(k,ni)*alstor(i,ni)+akstor(k,ni)*akstor(i,ni)
               dt3 = gtl(k)*gtr(i)+gtl(i)*gtr(k)
               dt4 = gtl(i)*gtl(k)+gtr(i)*gtr(k)

               at1 = dt1*dt3
               at2 = dt2*dt3
               at3 = dt1*dt4
               at4 = dt2*dt4

               SD_gluitopbb=SD_gluitopbb+g2*gs21/dsbot(i)/dsbot(k)*
     .          (ab1*(-4.D0)*mgluino/amchar(ni)*dsqrt(xmub*xmut)+
     .           ab2*2.D0*mgluino/amchar(ni)*dsqrt(xmub)*(-xmut-1.D0
     .           +uh) +
     .           ab3*2.D0*dsqrt(xmut)*(-xmub-xmuneut1+uh)+
     .           ab4*(-uh**2+uh*(1.D0+xmuneut1+xmub+xmut)-(xmuneut1
     .           +xmub)*(1.D0+xmut)) )
     .           +g2*gs22/dstop(i)/dstop(k)*
     .          (at1*(-4.D0)*mgluino/amchar(ni)*dsqrt(xmub*xmut)+
     .           at2*2.D0*mgluino/amchar(ni)*dsqrt(xmut)*(-xmub-1.D0
     .           +th) +
     .           at3*2.D0*dsqrt(xmub)*(-xmut-xmuneut1+th)+
     .           at4*(-th**2+th*(1.D0+xmuneut1+xmub+xmut)-(xmuneut1
     .           +xmut)*(1.D0+xmub)) )
     .           +(-2.D0)*g2*dsqrt(gs21)*dsqrt(gs22)
     .           /dstop(k)/dsbot(i)*(
     .           (alstor(k,ni)*aksbot(i,ni)*gtl(k)*gbr(i)+
     .            alsbot(i,ni)*akstor(k,ni)*gbl(i)*gtr(k))*
     .            dsqrt(xmub*xmut)*(uh+th-xmub-xmut)+
     .           (alstor(k,ni)*alsbot(i,ni)*gtl(k)*gbr(i)+
     .            aksbot(i,ni)*akstor(k,ni)*gbl(i)*gtr(k))*dsqrt(xmub)*
     .           (th-xmuneut1-xmut) +
     .           (akstor(k,ni)*alsbot(i,ni)*gtl(k)*gbl(i)+
     .            aksbot(i,ni)*alstor(k,ni)*gbr(i)*gtr(k))*
     .           mgluino/amchar(ni)*dsqrt(xmub)*(uh-xmut-1.D0) +
     .           (akstor(k,ni)*aksbot(i,ni)*gtl(k)*gbl(i)+
     .            alsbot(i,ni)*alstor(k,ni)*gbr(i)*gtr(k))*(-2.D0)*
     .           mgluino/amchar(ni)*dsqrt(xmub*xmut) +
     .           (akstor(k,ni)*aksbot(i,ni)*gtl(k)*gbr(i)+
     .            alsbot(i,ni)*alstor(k,ni)*gbl(i)*gtr(k))*dsqrt(xmut)*
     .           (uh-xmuneut1-xmub) +
     .           (akstor(k,ni)*alsbot(i,ni)*gtl(k)*gbr(i)+
     .            aksbot(i,ni)*alstor(k,ni)*gbl(i)*gtr(k))*
     .           (uh*th-xmuneut1-xmut*xmub) +
     .           (alstor(k,ni)*alsbot(i,ni)*gtl(k)*gbl(i)+
     .            aksbot(i,ni)*akstor(k,ni)*gbr(i)*gtr(k))*
     .           mgluino/amchar(ni)*(uh+th-xmuneut1-1.D0) +
     .           (alstor(k,ni)*aksbot(i,ni)*gtl(k)*gbl(i)+
     .            alsbot(i,ni)*akstor(k,ni)*gbr(i)*gtr(k))*
     .           dsqrt(xmut*xmuneut1)*(th-xmub-1.D0) )
            enddo
         enddo
      else 
         SD_gluitopbb=0.D0	
      endif

      end

c ==================================================================== c
c                       neutralino 2-body decays                       c
c ==================================================================== c

      subroutine SD_neut2bod(neutwchar,neutzneut,neuthcchar,neuthlneut,
     .     neuthhneut,neuthaneut,neutsnel,neutsell,neutselr,
     .     neutstau1,neutstau2,neutsn1,neutsn2,neutst1,neutst2,
     .     neutsb1,neutsb2,neutsupl,neutsupr,neutsdownl,neutsdownr,
     .     qcdneutst1,qcdneutst2,qcdneutsb1,qcdneutsb2,qcdneutsupl,
     .     qcdneutsupr,qcdneutsdownl,qcdneutsdownr)

      implicit double precision (a-h,m,o-z)
      double precision SD_lamb,lamv
      double precision neutwchar,neutzneut,neuthcchar,neuthlneut,
     .          neuthhneut,neuthaneut,neutsnel,neutsell,neutselr,
     .          neutstau1,neutstau2,neutsn1,neutsn2,neutst1,neutst2,
     .          neutsupl,neutsupr,neutsdownl,neutsdownr,neutsb1,
     .          neutsb2

      dimension neutwchar(4,2),neutzneut(4,4),neuthcchar(4,2),
     .          neuthlneut(4,4),neuthhneut(4,4),neuthaneut(4,4),
     .          neutsnel(4),neutsell(4),neutselr(4),neutstau1(4),
     .          neutstau2(4),neutsn1(4),neutsn2(4),neutst1(4),
     .          neutst2(4),neutsupl(4),neutsupr(4),neutsdownl(4),
     .          neutsdownr(4),neutsb1(4),neutsb2(4)
      dimension amneut(4),xmneut(4),amchar(2)
      dimension ql(4,2),qr(4,2),or(4,2),ol(4,2)
      dimension ahl(4,4),ahh(4,4),aa(4,4)
      dimension opl(2,2),opr(2,2),oppl(4,4),oppr(4,4)
      dimension ae(2,4),be(2,4),ato(2,4),bto(2,4),anu(2,4),bnu(2,4),
     .          antau(2,4),bntau(2,4)
      dimension abot(2,4),bbot(2,4)
      dimension atopr(2,4),btopr(2,4)
      dimension aup(2,4),bup(2,4),ado(2,4),bdo(2,4)
      dimension qcdneutst1(4),qcdneutst2(4),qcdneutsb1(4),qcdneutsb2(4)
      dimension qcdneutsupl(4),qcdneutsupr(4),qcdneutsdownl(4),
     .          qcdneutsdownr(4)

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_hmass/ama,aml,amh,amch,amar
      COMMON/SD_fermion/amt,amb,amtau
      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2
      COMMON/SD_squarkud/asup1,asup2,asdown1,asdown2
      COMMON/SD_sfermionetau/ase1,ase2,astau1,astau2
      COMMON/SD_sneutrino/asne1,asne2,asntau1,asntau2
      COMMON/SD_scala/scalb,scalt
      COMMON/SD_yukawa/ytewsb,ybewsb,ytauewsb
      COMMON/SD_coup1/ahl,ahh,aa
      COMMON/SD_coup3/ql,qr,ol,or
      COMMON/SD_coup4/opl,opr,oppl,oppr
      COMMON/SD_coup8/ae,be,ato,bto,anu,bnu,antau,bntau  
      COMMON/SD_coup10/aup,bup,ado,bdo
      COMMON/SD_runcoupscale/scalechoice,scaleofcoupling,inumloop
      COMMON/SD_mwmzpole/amwp,amzp
      COMMON/SD_runmcalc/rmtc,rmbc,rmtauc
      COMMON/SD_mixang/alp_mssm,tanbeta
      COMMON/SD_coupewsb/alsew,g2ew,g1ew
      COMMON/SD_refscale/amuref
      COMMON/SD_gluino/mgluino

      external SD_lamb
      external SD_alphascall,SD_runmass,SD_yuk
      external SD_gltneut,SD_grtneut,SD_realicorr
      external SD_glbneut,SD_grbneut
      external SD_gamtop1,SD_gamtop2,SD_gamglui1,SD_gamglui2,
     .         SD_gamglui3,SD_gam11,SD_gam12,SD_gamvirt,SD_gamreal,
     .         SD_gamcfdec
      external SD_ftotqcd

c -- the mass values needed for the QCD corrections --

      lamv = 1.D-15
      amuv = 1000.D20

c -------------------------------------------------------------------- c
c  chi0_1/chi0_2/chi0_3/chi0_4 --> chi+_1/chi+_2 + W

      do i=1,4,1
         do j=1,2,1
            if(amneut(i).ge.(amwp+amchar(j))) then
               neutwchar(i,j) = g2/2.D0*(
     .              -12.D0*xmneut(i)*amchar(j)*ol(i,j)*or(i,j)
     .              +(ol(i,j)**2+or(i,j)**2)*
     .              ((amchar(j)**2+amneut(i)**2-amwp**2)
     .              +(amneut(i)**2+amwp**2-amchar(j)**2)
     .              *(amneut(i)**2-amchar(j)**2-amwp**2)/amwp**2))
     .              *SD_lamb(amchar(j)/amneut(i),amwp/amneut(i))
     .              /(16*pi*amneut(i))
            else
               neutwchar(i,j)=0.d0
            endif
         end do
      end do

c -------------------------------------------------------------------- c
c  chi0_2/chi0_3/chi0_4 --> chi0_1/chi0_2/chi0_3 + Z

      do i=1,4,1
         do j=1,4,1
            if(j.ge.i) then 
               neutzneut(i,j) = 0.D0
            else
               if(amneut(i).ge.(amneut(j)+amzp)) then
                  neutzneut(i,j)=g2/2.D0*(
     .                 -12*xmneut(i)*xmneut(j)*oppl(i,j)*oppr(i,j)
     .                 +(oppl(i,j)**2+oppr(i,j)**2)*
     .                 ((amneut(i)**2+amneut(j)**2-amzp**2)
     .                 +(amneut(i)**2+amzp**2-amneut(j)**2)
     .                 *(amneut(i)**2-amneut(j)**2-amzp**2)/amzp**2))
     .                 *SD_lamb(amneut(j)/amneut(i),amzp/amneut(i))
     .                 /(16*pi*amneut(i))
               else
                  neutzneut(i,j)=0.d0
               endif
            endif
         end do
      end do

c -------------------------------------------------------------------- c
c  chi0_1/chi0_2/chi0_3/chi0_4 --> chi+_1/chi+_2 + H-

      do i=1,4,1
         do j=1,2,1
            if(amneut(i).ge.(amchar(j)+amch)) then
               neuthcchar(i,j) = g2/2.D0*
     .              ((ql(i,j)**2+qr(i,j)**2)*
     .              (amchar(j)**2+amneut(i)**2-amch**2)
     .              +4.D0*ql(i,j)*qr(i,j)*amchar(j)*xmneut(i))
     .              *SD_lamb(amchar(j)/amneut(i),amch/amneut(i))
     .              /(16*pi*amneut(i))
            else
               neuthcchar(i,j) =0.D0
            endif
         end do
      end do

c -------------------------------------------------------------------- c
c  chi0_2/chi0_3/chi0_4 --> chi0_1/chi0_2/chi0_3 + h

      do i=1,4,1
         do j=1,4,1
            if(j.ge.i) then
               neuthlneut(i,j) = 0.D0
            else
               if(amneut(i).ge.(amneut(j)+aml)) then
                  neuthlneut(i,j)=g2/2.D0*
     .                 4.D0*(2.D0*ahl(i,j)**2*
     .                 (amneut(i)**2+amneut(j)**2-aml**2)
     .                 +4.D0*ahl(i,j)**2*xmneut(i)*xmneut(j))
     .                 *SD_lamb(amneut(j)/amneut(i),aml/amneut(i))
     .                 /(16*pi*amneut(i))
               else
                  neuthlneut(i,j)=0.D0
               endif
            endif
         end do
      end do

c -------------------------------------------------------------------- c
c  chi0_2/chi0_3/chi0_4 --> chi0_1/chi0_2/chi0_3 + H

      do i=1,4,1
         do j=1,4,1
            if(j.ge.i) then
               neuthhneut(i,j) = 0.D0
            else
               if(amneut(i).ge.(amneut(j)+amh)) then
                  neuthhneut(i,j)=g2/2.D0*
     .                 4.D0*(2.D0*ahh(i,j)**2*
     .                 (amneut(i)**2+amneut(j)**2-amh**2)
     .                 +4.D0*ahh(i,j)**2*xmneut(i)*xmneut(j))
     .                 *SD_lamb(amneut(j)/amneut(i),amh/amneut(i))
     .                 /(16*pi*amneut(i))
               else
                  neuthhneut(i,j)=0.D0
               endif
            endif
         end do
      end do

c -------------------------------------------------------------------- c
c  chi0_2/chi0_3/chi0_4 --> chi0_1/chi0_2/chi0_3 + A

      do i=1,4,1
         do j=1,4,1
            if(j.ge.i) then
               neuthaneut(i,j) = 0.D0
            else
               if(amneut(i).ge.(amneut(j)+ama)) then
                  neuthaneut(i,j)=g2/2.D0*
     .                 4.D0*(2.D0*aa(i,j)**2*
     .                 (amneut(i)**2+amneut(j)**2-ama**2)
     .                 -4.D0*aa(i,j)**2*xmneut(i)*xmneut(j))
     .                 *SD_lamb(amneut(j)/amneut(i),ama/amneut(i))
     .                 /(16*pi*amneut(i))
               else
                  neuthaneut(i,j)=0.D0
               endif
            endif
         end do
      end do

c -------------------------------------------------------------------- c
c  chi0_1/chi0_2/chi0_3/chi0_4 --> sneutrino_el neutrino_el

      do i=1,4,1
         if(amneut(i).ge.asne1) then
            neutsnel(i)=g2/2.D0*anu(1,i)**2*
     .           (amneut(i)**2-asne1**2)*SD_lamb(0.D0,asne1/amneut(i))
     .           /(16*pi*amneut(i))
         else
            neutsnel(i)=0.D0
         endif
      end do

c -------------------------------------------------------------------- c
c  chi0_1/chi0_2/chi0_3/chi0_4 --> selectron_l electron

      do i=1,4,1
         if(amneut(i).ge.ase1) then
            neutsell(i)=g2/2.D0*(ae(1,i)**2+be(1,i)**2)*
     .           (amneut(i)**2-ase1**2)*SD_lamb(0.D0,ase1/amneut(i))
     .           /(16*pi*amneut(i))
         else
            neutsell(i)=0.D0
         endif
      end do

c -------------------------------------------------------------------- c
c  chi0_1/chi0_2/chi0_3/chi0_4 --> selectron_r electron

      do i=1,4,1
         if(amneut(i).ge.ase2) then
            neutselr(i)=g2/2.D0*(ae(2,i)**2+be(2,i)**2)*
     .           (amneut(i)**2-ase2**2)*SD_lamb(0.D0,ase2/amneut(i))
     .           /(16*pi*amneut(i))
         else
            neutselr(i)=0.D0
         endif
      end do

c -------------------------------------------------------------------- c
c  chi0_1/chi0_2/chi0_3/chi0_4 --> stau1 tau

      do i=1,4,1
         if(amneut(i).ge.(astau1+amtau)) then
            neutstau1(i)=g2/2.D0*((ato(1,i)**2+bto(1,i)**2)*
     .           (amneut(i)**2-astau1**2+amtau**2)
     .           +4.D0*amtau*xmneut(i)*ato(1,i)*bto(1,i)
     .           )*SD_lamb(amtau/amneut(i),astau1/amneut(i))
     .           /(16*pi*amneut(i))
         else
            neutstau1(i)=0.D0
         endif
      end do

c -------------------------------------------------------------------- c
c  chi0_1/chi0_2/chi0_3/chi0_4 --> stau2 tau

      do i=1,4,1
         if(amneut(i).ge.(astau2+amtau)) then
            neutstau2(i)=g2/2.D0*((ato(2,i)**2+bto(2,i)**2)*
     .           (amneut(i)**2-astau2**2+amtau**2)
     .           +4.D0*amtau*xmneut(i)*ato(2,i)*bto(2,i)
     .           )*SD_lamb(amtau/amneut(i),astau2/amneut(i))
     .           /(16*pi*amneut(i))
         else
            neutstau2(i)=0.D0
         endif
      end do         

c -------------------------------------------------------------------- c
c  chi0_1/chi0_2/chi0_3/chi0_4 --> sneutrino_tau1 neutrino_tau

      do i=1,4,1
         if(amneut(i).ge.asntau1) then
            neutsn1(i)=g2/2.D0*(antau(1,i)**2+bntau(1,i)**2)*
     .           (amneut(i)**2-asntau1**2)*
     .           SD_lamb(0.D0,asntau1/amneut(i))
     .           /(16*pi*amneut(i))
         else
            neutsn1(i)=0.D0
         endif
      end do

c -------------------------------------------------------------------- c
c  chi0_1/chi0_2/chi0_3/chi0_4 --> sneutrino_tau2 neutrino_tau

      do i=1,4,1
         if(amneut(i).ge.asntau2) then
            neutsn2(i)=g2/2.D0*(antau(2,i)**2+bntau(2,i)**2)*
     .           (amneut(i)**2-asntau2**2)*
     .           SD_lamb(0.D0,asntau2/amneut(i))
     .           /(16*pi*amneut(i))
         else
            neutsn2(i)=0.D0
         endif
      end do

c -------------------------------------------------------------------- c
c  chi0_1/chi0_2/chi0_3/chi0_4 --> supl + up

      do i=1,4,1
         if(amneut(i).ge.asup1) then
            neutsupl(i)=3.D0*g2/2.D0*(aup(1,i)**2+bup(1,i)**2)
     .           *(amneut(i)**2-asup1**2)
     .           *SD_lamb(0.D0,asup1/amneut(i))
     .           /(16*pi*amneut(i))
         else
            neutsupl(i)=0.D0
         endif
      end do

c --- the QCD corrections ---

      do i=1,4,1
         if(amneut(i).ge.asup1) then
            if(scalechoice.eq.1.D0) then
               gs2 = alsew*4.D0*pi
            elseif(scalechoice.eq.2.D0) then         
               gs2 = SD_alphascall(amneut(i),inumloop)*4.D0*pi
            elseif(scalechoice.eq.3.D0) then
               gs2 = SD_alphascall(scaleofcoupling,inumloop)*4.D0*pi
            endif

            qcdneutsupl(i)=4.D0/3.D0*gs2/(4.D0*pi)/pi*
     .         neutsupl(i)*
     .         SD_ftotqcd(asup1**2/amneut(i)**2,mgluino**2/amneut(i)**2)
         else
            qcdneutsupl(i)=0.D0
         endif
      end do

c -------------------------------------------------------------------- c
c  chi0_1/chi0_2/chi0_3/chi0_4 --> supr + up

      do i=1,4,1
         if(amneut(i).ge.asup2) then
            neutsupr(i)=3.D0*g2/2.D0*(aup(2,i)**2+bup(2,i)**2)
     .           *(amneut(i)**2-asup2**2)
     .           *SD_lamb(0.D0,asup2/amneut(i))
     .           /(16*pi*amneut(i))
         else
            neutsupr(i)=0.D0
         endif
      end do

c --- the QCD corrections ---

      do i=1,4,1
         if(amneut(i).ge.asup2) then
            if(scalechoice.eq.1.D0) then
               gs2 = alsew*4.D0*pi
            elseif(scalechoice.eq.2.D0) then         
               gs2 = SD_alphascall(amneut(i),inumloop)*4.D0*pi
            elseif(scalechoice.eq.3.D0) then
               gs2 = SD_alphascall(scaleofcoupling,inumloop)*4.D0*pi
            endif

            qcdneutsupr(i)=4.D0/3.D0*gs2/(4.D0*pi)/pi*
     .         neutsupr(i)*
     .         SD_ftotqcd(asup2**2/amneut(i)**2,mgluino**2/amneut(i)**2)
         else
            qcdneutsupr(i)=0.D0
         endif
      end do

c -------------------------------------------------------------------- c
c  chi0_1/chi0_2/chi0_3/chi0_4 --> sdownl + down

      do i=1,4,1
         if(amneut(i).ge.asdown1) then
            neutsdownl(i)=3.D0*g2/2.D0*(ado(1,i)**2+bdo(1,i)**2)
     .           *(amneut(i)**2-asdown1**2)
     .           *SD_lamb(0.D0,asdown1/amneut(i))
     .           /(16*pi*amneut(i))
         else
            neutsdownl(i)=0.D0
         endif
      end do

c --- the QCD corrections ---

      do i=1,4,1
         if(amneut(i).ge.asdown1) then
            if(scalechoice.eq.1.D0) then
               gs2 = alsew*4.D0*pi
            elseif(scalechoice.eq.2.D0) then         
               gs2 = SD_alphascall(amneut(i),inumloop)*4.D0*pi
            elseif(scalechoice.eq.3.D0) then
               gs2 = SD_alphascall(scaleofcoupling,inumloop)*4.D0*pi
            endif

            qcdneutsdownl(i)=4.D0/3.D0*gs2/(4.D0*pi)/pi*
     .       neutsdownl(i)*
     .       SD_ftotqcd(asdown1**2/amneut(i)**2,mgluino**2/amneut(i)**2)
         else
            qcdneutsdownl(i)=0.D0
         endif
      end do

c -------------------------------------------------------------------- c
c  chi0_1/chi0_2/chi0_3/chi0_4 --> sdownr + down

      do i=1,4,1
         if(amneut(i).ge.asdown2) then
            neutsdownr(i)=3.D0*g2/2.D0*(ado(2,i)**2+bdo(2,i)**2)
     .           *(amneut(i)**2-asdown2**2)
     .           *SD_lamb(0.D0,asdown2/amneut(i))
     .           /(16*pi*amneut(i))
         else
            neutsdownr(i)=0.D0
         endif
      end do

c --- the QCD corrections ---

      do i=1,4,1
         if(amneut(i).ge.asdown2) then
            if(scalechoice.eq.1.D0) then
               gs2 = alsew*4.D0*pi
            elseif(scalechoice.eq.2.D0) then         
               gs2 = SD_alphascall(amneut(i),inumloop)*4.D0*pi
            elseif(scalechoice.eq.3.D0) then
               gs2 = SD_alphascall(scaleofcoupling,inumloop)*4.D0*pi
            endif

            qcdneutsdownr(i)=4.D0/3.D0*gs2/(4.D0*pi)/pi*
     .       neutsdownr(i)*
     .       SD_ftotqcd(asdown2**2/amneut(i)**2,mgluino**2/amneut(i)**2)
         else
            qcdneutsdownr(i)=0.D0
         endif
      end do

c -------------------------------------------------------------------- c
c  chi0_1/chi0_2/chi0_3/chi0_4 --> stop1 + top

      do i=1,4,1
         if(scalechoice.eq.1.D0) then
            scalb = ybewsb/dsqrt(g2)
            scalt = ytewsb/dsqrt(g2)
         elseif(scalechoice.eq.2.D0) then         
            call SD_runmass(amneut(i),0.D0,0.D0,runmb,runmt)
            scalb = SD_yuk(2,runmb)
            scalt = SD_yuk(1,runmt)
         elseif(scalechoice.eq.3.D0) then
            call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
            scalb = SD_yuk(2,runmb)
            scalt = SD_yuk(1,runmt)
         endif

         call SD_neutstoptop(atopr,btopr)
         
         if(amneut(i).ge.(ast1+amt)) then
            neutst1(i)=3.D0*g2/2.D0*((atopr(1,i)**2+btopr(1,i)**2)
     .           *(amneut(i)**2-ast1**2+amt**2)
     .           +4.D0*amt*xmneut(i)*atopr(1,i)*btopr(1,i)
     .           )*SD_lamb(amt/amneut(i),ast1/amneut(i))
     .           /(16*pi*amneut(i))
         else
            neutst1(i)=0.D0
         endif
      end do

c -- the QCD corrections --

      do i=1,4,1
         if(amneut(i).ge.(ast1+amt)) then
            if(scalechoice.eq.1.D0) then
               scalb    = ybewsb/dsqrt(g2)
               scalt    = ytewsb/dsqrt(g2)
               gs2      = alsew*4.D0*pi
               amurefer = amuref
            elseif(scalechoice.eq.2.D0) then         
               call SD_runmass(amneut(i),0.D0,0.D0,runmb,runmt)
               scalb    = SD_yuk(2,runmb)
               scalt    = SD_yuk(1,runmt)
               gs2      = SD_alphascall(amneut(i),inumloop)*4.D0*pi
               amurefer = amneut(i)
            elseif(scalechoice.eq.3.D0) then
               call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
               scalb    = SD_yuk(2,runmb)
               scalt    = SD_yuk(1,runmt)
               gs2      = 
     .              SD_alphascall(scaleofcoupling,inumloop)*4.D0*pi
               amurefer = scaleofcoupling
            endif
            
            call SD_neutstoptop(atopr,btopr)
         
            amuvdiv = amuv/amurefer

            if(xmneut(i).le.0.D0) then
               jsign = 1
            else
               jsign = 0
            endif

            qcdneutst1(i)= -g2/24.D0/pi**2/amneut(i)*gs2/(4.D0*pi)*
     .           3.D0/2.D0*
     .           ((btopr(1,i)*SD_gltneut(1,i,amuv,amuvdiv,lamv)+
     .             atopr(1,i)*SD_grtneut(1,i,amuv,amuvdiv,lamv))*
     .            (-ast1**2+amt**2+amneut(i)**2)
     .           +2.D0*(btopr(1,i)*SD_grtneut(1,i,amuv,amuvdiv,lamv)
     .                 +atopr(1,i)*SD_gltneut(1,i,amuv,amuvdiv,lamv))*
     .           amt*xmneut(i))*SD_lamb(amt/amneut(i),ast1/amneut(i)) 
     .           +g2/(6.D0*pi**2*amneut(i))*gs2/(4.D0*pi)*
     .           3.D0/2.D0*(-1.D0)*
     .           SD_realicorr(amt,amneut(i),ast1,lamv,1,jsign,1,i,1)
         else
            qcdneutst1(i)=0.D0
         endif
      end do

c -------------------------------------------------------------------- c
c  chi0_1/chi0_2/chi0_3/chi0_4 --> stop2 + top

      do i=1,4,1
         if(scalechoice.eq.1.D0) then
            scalb = ybewsb/dsqrt(g2)
            scalt = ytewsb/dsqrt(g2)
         elseif(scalechoice.eq.2.D0) then         
            call SD_runmass(amneut(i),0.D0,0.D0,runmb,runmt)
            scalb = SD_yuk(2,runmb)
            scalt = SD_yuk(1,runmt)
         elseif(scalechoice.eq.3.D0) then
            call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
            scalb = SD_yuk(2,runmb)
            scalt = SD_yuk(1,runmt)
         endif

         call SD_neutstoptop(atopr,btopr)

         if(amneut(i).ge.(ast2+amt)) then
            neutst2(i)=3.D0*g2/2.D0*((atopr(2,i)**2+btopr(2,i)**2)*
     .           (amneut(i)**2-ast2**2+amt**2)
     .           +4.D0*amt*xmneut(i)*atopr(2,i)*btopr(2,i)
     .           )*SD_lamb(amt/amneut(i),ast2/amneut(i))
     .           /(16*pi*amneut(i))
         else
            neutst2(i)=0.D0
         endif
      end do

c -- the QCD corrections --

      do i=1,4,1
         if(amneut(i).ge.(ast2+amt)) then
            if(scalechoice.eq.1.D0) then
               scalb    = ybewsb/dsqrt(g2)
               scalt    = ytewsb/dsqrt(g2)
               gs2      = alsew*4.D0*pi
               amurefer = amuref
            elseif(scalechoice.eq.2.D0) then         
               call SD_runmass(amneut(i),0.D0,0.D0,runmb,runmt)
               scalb    = SD_yuk(2,runmb)
               scalt    = SD_yuk(1,runmt)
               gs2      = SD_alphascall(amneut(i),inumloop)*4.D0*pi
               amurefer = amneut(i)
            elseif(scalechoice.eq.3.D0) then
               call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
               scalb    = SD_yuk(2,runmb)
               scalt    = SD_yuk(1,runmt)
               gs2      = 
     .              SD_alphascall(scaleofcoupling,inumloop)*4.D0*pi
               amurefer = scaleofcoupling
            endif
            
            call SD_neutstoptop(atopr,btopr)
            
            amuvdiv = amuv/amurefer

            if(xmneut(i).le.0.D0) then
               jsign = 1
            else
               jsign = 0
            endif

            qcdneutst2(i)= -g2/24.D0/pi**2/amneut(i)*gs2/(4.D0*pi)*
     .           3.D0/2.D0*
     .           ((btopr(2,i)*SD_gltneut(2,i,amuv,amuvdiv,lamv)+
     .             atopr(2,i)*SD_grtneut(2,i,amuv,amuvdiv,lamv))*
     .            (-ast2**2+amt**2+amneut(i)**2)
     .           +2.D0*(btopr(2,i)*SD_grtneut(2,i,amuv,amuvdiv,lamv)
     .                 +atopr(2,i)*SD_gltneut(2,i,amuv,amuvdiv,lamv))*
     .           amt*xmneut(i))*SD_lamb(amt/amneut(i),ast2/amneut(i)) 
     .           +g2/(6.D0*pi**2*amneut(i))*gs2/(4.D0*pi)*
     .           3.D0/2.D0*(-1.D0)*
     .           SD_realicorr(amt,amneut(i),ast2,lamv,1,jsign,2,i,1)
         else
            qcdneutst2(i)=0.D0
         endif
      end do

c -------------------------------------------------------------------- c
c  chi0_1/chi0_2/chi0_3/chi0_4 --> sbottom1 + bottom

      do i=1,4,1
         if(scalechoice.eq.1.D0) then
            scalb = ybewsb/dsqrt(g2)
            scalt = ytewsb/dsqrt(g2)
         elseif(scalechoice.eq.2.D0) then         
            call SD_runmass(amneut(i),0.D0,0.D0,runmb,runmt)
            scalb = SD_yuk(2,runmb)
            scalt = SD_yuk(1,runmt)
         elseif(scalechoice.eq.3.D0) then
            call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
            scalb = SD_yuk(2,runmb)
            scalt = SD_yuk(1,runmt)
         endif

         call SD_neutsbotbot(abot,bbot)

         if(amneut(i).ge.(asb1+amb)) then
            neutsb1(i)=3.D0*g2/2.d0*((abot(1,i)**2+bbot(1,i)**2)*
     .           (amneut(i)**2-asb1**2+amb**2)
     .           +4.D0*amb*xmneut(i)*abot(1,i)*bbot(1,i)
     .           )*SD_lamb(amb/amneut(i),asb1/amneut(i))
     .           /(16*pi*amneut(i))
         else
            neutsb1(i)=0.D0
         endif
      end do

c -- the QCD corrections --

      do i=1,4,1
         if(amneut(i).ge.(asb1+amb)) then
            if(scalechoice.eq.1.D0) then
               scalb    = ybewsb/dsqrt(g2)
               scalt    = ytewsb/dsqrt(g2)
               gs2      = alsew*4.D0*pi
               amurefer = amuref
            elseif(scalechoice.eq.2.D0) then         
               call SD_runmass(amneut(i),0.D0,0.D0,runmb,runmt)
               scalb    = SD_yuk(2,runmb)
               scalt    = SD_yuk(1,runmt)
               gs2      = SD_alphascall(amneut(i),inumloop)*4.D0*pi
               amurefer = amneut(i)
            elseif(scalechoice.eq.3.D0) then
               call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
               scalb    = SD_yuk(2,runmb)
               scalt    = SD_yuk(1,runmt)
               gs2      = 
     .              SD_alphascall(scaleofcoupling,inumloop)*4.D0*pi
               amurefer = scaleofcoupling
            endif
            
            call SD_neutsbotbot(abot,bbot)
         
            amuvdiv = amuv/amurefer

            if(xmneut(i).le.0.D0) then
               jsign = 1
            else
               jsign = 0
            endif

            qcdneutsb1(i)= -g2/24.D0/pi**2/amneut(i)*gs2/(4.D0*pi)*
     .           3.D0/2.D0*
     .           ((bbot(1,i)*SD_glbneut(1,i,amuv,amuvdiv,lamv)+
     .             abot(1,i)*SD_grbneut(1,i,amuv,amuvdiv,lamv))*
     .            (-asb1**2+amb**2+amneut(i)**2)
     .           +2.D0*(bbot(1,i)*SD_grbneut(1,i,amuv,amuvdiv,lamv)
     .                 +abot(1,i)*SD_glbneut(1,i,amuv,amuvdiv,lamv))*
     .           amb*xmneut(i))*SD_lamb(amb/amneut(i),asb1/amneut(i)) 
     .           +g2/(6.D0*pi**2*amneut(i))*gs2/(4.D0*pi)*
     .           3.D0/2.D0*(-1.D0)*
     .           SD_realicorr(amb,amneut(i),asb1,lamv,1,jsign,1,i,2)
         else
            qcdneutsb1(i)=0.D0
         endif
      end do

c -------------------------------------------------------------------- c
c  chi0_1/chi0_2/chi0_3/chi0_4 --> sbottom2 + bottom

      do i=1,4,1
         if(scalechoice.eq.1.D0) then
            scalb = ybewsb/dsqrt(g2)
            scalt = ytewsb/dsqrt(g2)
         elseif(scalechoice.eq.2.D0) then         
            call SD_runmass(amneut(i),0.D0,0.D0,runmb,runmt)
            scalb = SD_yuk(2,runmb)
            scalt = SD_yuk(1,runmt)
         elseif(scalechoice.eq.3.D0) then
            call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
            scalb = SD_yuk(2,runmb)
            scalt = SD_yuk(1,runmt)
         endif

         call SD_neutsbotbot(abot,bbot)

         if(amneut(i).ge.(asb2+amb)) then
            neutsb2(i)=3.D0*g2/2.D0*((abot(2,i)**2+bbot(2,i)**2)*
     .           (amneut(i)**2-asb2**2+amb**2)
     .           +4.D0*amb*xmneut(i)*abot(2,i)*bbot(2,i)
     .           )*SD_lamb(amb/amneut(i),asb2/amneut(i))
     .           /(16*pi*amneut(i))
         else
            neutsb2(i)=0.D0
         endif
      end do

c -- the QCD corrections --

      do i=1,4,1
         if(amneut(i).ge.(asb2+amb)) then
            if(scalechoice.eq.1.D0) then
               scalb    = ybewsb/dsqrt(g2)
               scalt    = ytewsb/dsqrt(g2)
               gs2      = alsew*4.D0*pi
               amurefer = amuref
            elseif(scalechoice.eq.2.D0) then         
               call SD_runmass(amneut(i),0.D0,0.D0,runmb,runmt)
               scalb    = SD_yuk(2,runmb)
               scalt    = SD_yuk(1,runmt)
               gs2      = SD_alphascall(amneut(i),inumloop)*4.D0*pi
               amurefer = amneut(i)
            elseif(scalechoice.eq.3.D0) then
               call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
               scalb    = SD_yuk(2,runmb)
               scalt    = SD_yuk(1,runmt)
               gs2      = 
     .              SD_alphascall(scaleofcoupling,inumloop)*4.D0*pi
               amurefer = scaleofcoupling
            endif
            
            call SD_neutsbotbot(abot,bbot)
         
            amuvdiv = amuv/amurefer

            if(xmneut(i).le.0.D0) then
               jsign = 1
            else
               jsign = 0
            endif

            qcdneutsb2(i)= -g2/24.D0/pi**2/amneut(i)*gs2/(4.D0*pi)*
     .           3.D0/2.D0*
     .           ((bbot(2,i)*SD_glbneut(2,i,amuv,amuvdiv,lamv)+
     .             abot(2,i)*SD_grbneut(2,i,amuv,amuvdiv,lamv))*
     .            (-asb2**2+amb**2+amneut(i)**2)
     .           +2.D0*(bbot(2,i)*SD_grbneut(2,i,amuv,amuvdiv,lamv)
     .                 +abot(2,i)*SD_glbneut(2,i,amuv,amuvdiv,lamv))*
     .           amb*xmneut(i))*SD_lamb(amb/amneut(i),asb2/amneut(i)) 
     .           +g2/(6.D0*pi**2*amneut(i))*gs2/(4.D0*pi)*
     .           3.D0/2.D0*(-1.D0)*
     .           SD_realicorr(amb,amneut(i),asb2,lamv,1,jsign,2,i,2)
         else
            qcdneutsb2(i)=0.D0
         endif
      end do

      end

c ==================================================================== c
c          Radiative decays neutralino_i -> neutralino_j photon        c
c ==================================================================== c

      subroutine SD_neutraddecay(ninjphoton)

      implicit double precision (a-h,m,o-z)
      double precision ninjphoton
      dimension amneut(4),xmneut(4),amchar(2),eps(4),gefgh(2)

      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_weinberg/sw,cw
      COMMON/SD_loopdecij/ni,nj

      external SD_gcoupefgh,SD_gcoupabcd,SD_gcoupabcd0

      if(xmneut(nj).ge.0.D0) then
         eps(nj) = 1.D0
      else
         eps(nj) = -1.D0
      endif

      do k=1,2,1
         if(amneut(ni).gt.amneut(nj)) then
            gefgh(k) = SD_gcoupefgh(xmneut(ni),xmneut(nj),amchar(k),ni,
     .                              nj,k)
         else
            gefgh(k) = 0.D0
         endif
      end do 

      if(amneut(ni).gt.amneut(nj)) then
         gabcd = SD_gcoupabcd(xmneut(ni),xmneut(nj),ni,nj)
      else
         gabcd = 0.D0
      endif

      if(amneut(ni).gt.amneut(nj)) then
         gabcd0 = SD_gcoupabcd0(xmneut(ni),xmneut(nj),ni,nj)
      else
         gabcd0 = 0.D0
      endif

      if(amneut(ni).gt.amneut(nj)) then
         gijgamma = g2*dsqrt(g2)*sw*amneut(ni)*eps(nj)/8.D0/pi**2*
     .        (gefgh(1)+gefgh(2)+gabcd+gabcd0)
      else
         gijgamma = 0.D0
      endif

      ninjphoton = gijgamma**2*(amneut(ni)**2-amneut(nj)**2)**3/
     .             8.D0/pi/amneut(ni)**5

      end

c -------------------------------------------------------------------- c

      double precision function SD_gcoupefgh(xmni,xmnj,mchar,i,j,k)

      implicit double precision (a-h,m,o-z)
      complex*16 SD_iint,SD_i2int,SD_jint,SD_kint

      dimension ql(4,2),qr(4,2),or(4,2),ol(4,2)

      external SD_iint,SD_i2int,SD_jint,SD_kint

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_coup3/ql,qr,ol,or
      COMMON/SD_mwmzpole/amwp,amzp

      if(xmni.le.0.D0) then
         epsi = -1.D0
      else
         epsi = 1.D0
      endif
      if(xmnj.le.0.D0) then
         epsj = -1.D0
      else
         epsj = 1.D0
      endif

      amni = dabs(xmni)
      amnj = dabs(xmnj)

      fl = ol(i,k)
      fr = or(i,k)
      gl = ol(j,k)
      gr = or(j,k)

      SD_gcoupefgh = (gl*fl-gr*fr)*(epsi*amni*
     .     dreal((SD_i2int(amni,amnj,mchar,amwp)
     .   -SD_jint(amni,amnj,mchar,amwp)-SD_kint(amni,amnj,mchar,amwp))) 
     .     + epsj*amnj*dreal((SD_jint(amni,amnj,mchar,amwp)
     .                       -SD_kint(amni,amnj,mchar,amwp))) )
     .     + 2.D0*mchar*(gl*fr-gr*fl)*
     .       dreal(SD_jint(amni,amnj,mchar,amwp))

      return

      end

c -------------------------------------------------------------------- c

      double precision function SD_gcoupabcd(xmni,xmnj,i,j)

      implicit double precision (a-h,m,o-z)
      complex*16 SD_iint,SD_i2int,SD_jint,SD_kint

      external SD_iint,SD_i2int,SD_jint,SD_kint

      dimension abot(2,4),bbot(2,4),atopr(2,4),btopr(2,4)
      dimension ae(2,4),be(2,4),atau(2,4),btau(2,4),anu(2,4),bnu(2,4),
     .          antau(2,4),bntau(2,4)
      dimension amneut(4),xmneut(4),amchar(2)
      dimension u(2,2),v(2,2),z(4,4),zp(4,4)

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_weinberg/sw,cw
      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_mixmat/u,v,z,zp
      COMMON/SD_hmass/ama,aml,amh,amch,amar
      COMMON/SD_mixang/alp_mssm,tanbeta
      COMMON/SD_fermion/amt,amb,amtau
      COMMON/SD_scala/scalb,scalt
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2
      COMMON/SD_sfermionetau/ase1,ase2,astau1,astau2
      COMMON/SD_yukawa/ytewsb,ybewsb,ytauewsb
      COMMON/SD_runcoupscale/scalechoice,scaleofcoupling,inumloop
      COMMON/SD_coup8/ae,be,atau,btau,anu,bnu,antau,bntau      
      COMMON/SD_mwmzpole/amwp,amzp

c --- some definitions ---

      if(xmni.le.0.D0) then
         epsi = -1.D0
      else
         epsi = 1.D0
      endif
      if(xmnj.le.0.D0) then
         epsj = -1.D0
      else
         epsj = 1.D0
      endif

      amni = dabs(xmni)
      amnj = dabs(xmnj)

      beta  = datan(tanbeta)
      sbeta = dsin(beta)
      cbeta = dcos(beta)

      zip = z(i,2)+z(i,1)*sw/cw
      zim = z(i,2)-z(i,1)*sw/cw
      zjp = z(j,2)+z(j,1)*sw/cw
      zjm = z(j,2)-z(j,1)*sw/cw

c --- the (non) running couplings ---

      if(scalechoice.eq.1.D0) then
         scalb = ybewsb/dsqrt(g2)
         scalt = ytewsb/dsqrt(g2)
      elseif(scalechoice.eq.2.D0) then         
         call SD_runmass(amni,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      elseif(scalechoice.eq.3.D0) then
         call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      endif

      call SD_neutsbotbot(abot,bbot)
      call SD_neutstoptop(atopr,btopr)

      SD_gcoupabcd  = 0.D0

      do k=1,6,1
         if(k.eq.1) then
            ef   = 2.D0/3.D0
            cf   = 3.D0
            mfer = amt
            mbos = ast1
            gl   = -dsqrt(2.D0)*atopr(1,j)
            gr   = -dsqrt(2.D0)*btopr(1,j)
            fl   = -dsqrt(2.D0)*btopr(1,i)
            fr   = -dsqrt(2.D0)*atopr(1,i)
            glfrgrfl = gl*fr-gr*fl
            glflgrfr = gl*fl-gr*fr
         elseif(k.eq.2) then
            ef   = 2.D0/3.D0
            cf   = 3.D0
            mfer = amt
            mbos = ast2
            gl   = -dsqrt(2.D0)*atopr(2,j)
            gr   = -dsqrt(2.D0)*btopr(2,j)
            fl   = -dsqrt(2.D0)*btopr(2,i)
            fr   = -dsqrt(2.D0)*atopr(2,i)
            glfrgrfl = gl*fr-gr*fl
            glflgrfr = gl*fl-gr*fr
         elseif(k.eq.3) then
            ef   = -1.D0/3.D0
            cf   = 3.D0
            mfer = amb
            mbos = asb1
            gl   = -dsqrt(2.D0)*abot(1,j)
            gr   = -dsqrt(2.D0)*bbot(1,j)
            fl   = -dsqrt(2.D0)*bbot(1,i)
            fr   = -dsqrt(2.D0)*abot(1,i)
            glfrgrfl = gl*fr-gr*fl
            glflgrfr = gl*fl-gr*fr
         elseif(k.eq.4) then
            ef   = -1.D0/3.D0
            cf   = 3.D0
            mfer = amb
            mbos = asb2
            gl   = -dsqrt(2.D0)*abot(2,j)
            gr   = -dsqrt(2.D0)*bbot(2,j)
            fl   = -dsqrt(2.D0)*bbot(2,i)
            fr   = -dsqrt(2.D0)*abot(2,i)
            glfrgrfl = gl*fr-gr*fl
            glflgrfr = gl*fl-gr*fr
         elseif(k.eq.5) then
            ef   = -1.D0
            cf   = 1.D0
            mfer = amtau
            mbos = astau1
            gl   = -dsqrt(2.D0)*atau(1,j)
            gr   = -dsqrt(2.D0)*btau(1,j)
            fl   = -dsqrt(2.D0)*btau(1,i)
            fr   = -dsqrt(2.D0)*atau(1,i)
            glfrgrfl = gl*fr-gr*fl
            glflgrfr = gl*fl-gr*fr
         elseif(k.eq.6) then
            ef   = -1.D0
            cf   = 1.D0
            mfer = amtau
            mbos = astau2
            gl   = -dsqrt(2.D0)*atau(2,j)
            gr   = -dsqrt(2.D0)*btau(2,j)
            fl   = -dsqrt(2.D0)*btau(2,i)
            fr   = -dsqrt(2.D0)*atau(2,i)
            glfrgrfl = gl*fr-gr*fl
            glflgrfr = gl*fl-gr*fr
         endif

         SD_gcoupabcd = SD_gcoupabcd -1.D0/4.D0*ef*cf*( 
     .        glfrgrfl*(epsi*amni*dreal((SD_i2int(amni,amnj,mfer,mbos)-
     .                             SD_kint(amni,amnj,mfer,mbos)))
     .                 -epsj*amnj*dreal(SD_kint(amni,amnj,mfer,mbos)) )
     .        +mfer*glflgrfr*dreal(SD_iint(amni,amnj,mfer,mbos)) )
      end do

      do k=1,2,1
         ef   = 1.D0
         cf   = 1.D0
         mfer = amchar(k)
         mbos = amch

         glfrgrfl = 2.D0*cbeta**2*(z(j,4)*v(k,1)+1.D0/dsqrt(2.D0)*
     .        zjp*v(k,2))*(z(i,4)*v(k,1)+1.D0/dsqrt(2.D0)*zip*v(k,2))
     .        -2.D0*sbeta**2*(z(j,3)*u(k,1)-1.D0/dsqrt(2.D0)*zjp*
     .        u(k,2))*(z(i,3)*u(k,1)-1.D0/dsqrt(2.D0)*zip*u(k,2))
         glflgrfr = dsin(2.D0*beta)*(u(k,1)*v(k,1)*(z(j,4)*z(i,3)-
     .        z(j,3)*z(i,4))-1.D0/dsqrt(2.D0)*zip*(z(j,3)*u(k,1)*
     .        v(k,2)+z(j,4)*u(k,2)*v(k,1))+1.D0/dsqrt(2.D0)*zjp*(
     .        z(i,3)*u(k,1)*v(k,2)+z(i,4)*u(k,2)*v(k,1)))

         SD_gcoupabcd = SD_gcoupabcd -1.D0/4.D0*ef*cf*( 
     .        glfrgrfl*(epsi*amni*dreal((SD_i2int(amni,amnj,mfer,mbos)-
     .                             SD_kint(amni,amnj,mfer,mbos)))
     .                 -epsj*amnj*dreal(SD_kint(amni,amnj,mfer,mbos)) )
     .        +mfer*glflgrfr*dreal(SD_iint(amni,amnj,mfer,mbos)) )
      end do

      do k=1,2,1
         ef   = 1.D0
         cf   = 1.D0
         mfer = amchar(k)
         mbos = amwp

         glfrgrfl = 2.D0*sbeta**2*(z(j,4)*v(k,1)+1.D0/dsqrt(2.D0)*
     .        zjp*v(k,2))*(z(i,4)*v(k,1)+1.D0/dsqrt(2.D0)*zip*v(k,2))
     .        -2.D0*cbeta**2*(z(j,3)*u(k,1)-1.D0/dsqrt(2.D0)*zjp*
     .        u(k,2))*(z(i,3)*u(k,1)-1.D0/dsqrt(2.D0)*zip*u(k,2))
         glflgrfr = -dsin(2.D0*beta)*(u(k,1)*v(k,1)*(z(j,4)*z(i,3)-
     .        z(j,3)*z(i,4))-1.D0/dsqrt(2.D0)*zip*(z(j,3)*u(k,1)*
     .        v(k,2)+z(j,4)*u(k,2)*v(k,1))+1.D0/dsqrt(2.D0)*zjp*(
     .        z(i,3)*u(k,1)*v(k,2)+z(i,4)*u(k,2)*v(k,1)))

         SD_gcoupabcd = SD_gcoupabcd -1.D0/4.D0*ef*cf*( 
     .        glfrgrfl*(epsi*amni*dreal((SD_i2int(amni,amnj,mfer,mbos)-
     .                                   SD_kint(amni,amnj,mfer,mbos)))
     .                 -epsj*amnj*dreal(SD_kint(amni,amnj,mfer,mbos)) )
     .        +mfer*glflgrfr*dreal(SD_iint(amni,amnj,mfer,mbos)) )
      end do

      return

      end

c -------------------------------------------------------------------- c

      double precision function SD_gcoupabcd0(xmni,xmnj,i,j)

      implicit double precision (a-h,m,o-z)
      complex*16 SD_i2int0,SD_kint0,SD_iint

      external SD_i2int0,SD_kint0,SD_iint

      dimension aup(2,4),bup(2,4),ado(2,4),bdo(2,4)
      dimension ae(2,4),be(2,4),atau(2,4),btau(2,4),anu(2,4),bnu(2,4),
     .          antau(2,4),bntau(2,4)
      dimension amneut(4),xmneut(4),amchar(2)

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_weinberg/sw,cw
      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_fermion/amt,amb,amtau
      COMMON/SD_squarkud/asup1,asup2,asdown1,asdown2
      COMMON/SD_sfermionetau/ase1,ase2,astau1,astau2
      COMMON/SD_coup8/ae,be,atau,btau,anu,bnu,antau,bntau      
      COMMON/SD_coup10/aup,bup,ado,bdo

c --- some definitions ---

      if(xmni.le.0.D0) then
         epsi = -1.D0
      else
         epsi = 1.D0
      endif
      if(xmnj.le.0.D0) then
         epsj = -1.D0
      else
         epsj = 1.D0
      endif

      amni = dabs(xmni)
      amnj = dabs(xmnj)

      amu = 1.D-2
      amd = 1.D-2
      ame = 1.D-2

c --- the couplings ---

      SD_gcoupabcd0  = 0.D0

      do k=1,6,1
         if(k.eq.1) then
            ef   = 2.D0/3.D0
            cf   = 3.D0
            mfer = amu
            mbos = asup1
            gl   = -dsqrt(2.D0)*aup(1,j)
            gr   = -dsqrt(2.D0)*bup(1,j)
            fl   = -dsqrt(2.D0)*bup(1,i)
            fr   = -dsqrt(2.D0)*aup(1,i)
            glfrgrfl = gl*fr-gr*fl
            glflgrfr = gl*fl-gr*fr
         elseif(k.eq.2) then
            ef   = 2.D0/3.D0
            cf   = 3.D0
            mfer = amu
            mbos = asup2
            gl   = -dsqrt(2.D0)*aup(2,j)
            gr   = -dsqrt(2.D0)*bup(2,j)
            fl   = -dsqrt(2.D0)*bup(2,i)
            fr   = -dsqrt(2.D0)*aup(2,i)
            glfrgrfl = gl*fr-gr*fl
            glflgrfr = gl*fl-gr*fr
         elseif(k.eq.3) then
            ef   = -1.D0/3.D0
            cf   = 3.D0
            mfer = amd
            mbos = asdown1
            gl   = -dsqrt(2.D0)*ado(1,j)
            gr   = -dsqrt(2.D0)*bdo(1,j)
            fl   = -dsqrt(2.D0)*bdo(1,i)
            fr   = -dsqrt(2.D0)*ado(1,i)
            glfrgrfl = gl*fr-gr*fl
            glflgrfr = gl*fl-gr*fr
         elseif(k.eq.4) then
            ef   = -1.D0/3.D0
            cf   = 3.D0
            mfer = amd
            mbos = asdown2
            gl   = -dsqrt(2.D0)*ado(2,j)
            gr   = -dsqrt(2.D0)*bdo(2,j)
            fl   = -dsqrt(2.D0)*bdo(2,i)
            fr   = -dsqrt(2.D0)*ado(2,i)
            glfrgrfl = gl*fr-gr*fl
            glflgrfr = gl*fl-gr*fr
         elseif(k.eq.5) then
            ef   = -1.D0
            cf   = 1.D0
            mfer = ame
            mbos = ase1
            gl   = -dsqrt(2.D0)*ae(1,j)
            gr   = -dsqrt(2.D0)*be(1,j)
            fl   = -dsqrt(2.D0)*be(1,i)
            fr   = -dsqrt(2.D0)*ae(1,i)
            glfrgrfl = gl*fr-gr*fl
            glflgrfr = gl*fl-gr*fr
         elseif(k.eq.6) then
            ef   = -1.D0
            cf   = 1.D0
            mfer = ame
            mbos = ase2
            gl   = -dsqrt(2.D0)*ae(2,j)
            gr   = -dsqrt(2.D0)*be(2,j)
            fl   = -dsqrt(2.D0)*be(2,i)
            fr   = -dsqrt(2.D0)*ae(2,i)
            glfrgrfl = gl*fr-gr*fl
            glflgrfr = gl*fl-gr*fr
         endif

         SD_gcoupabcd0 = SD_gcoupabcd0 -1.D0/4.D0*ef*cf*( 
     .        glfrgrfl*(epsi*amni*dreal((SD_i2int0(amni,amnj,mbos)-
     .                             SD_kint0(amni,amnj,mbos)))
     .                 -epsj*amnj*dreal(SD_kint0(amni,amnj,mbos)) ) )
      end do

      SD_gcoupabcd0 = 2.D0*SD_gcoupabcd0

      return

      end

c ==================================================================== c
c                          GMSB 2-body decays                          c
c ==================================================================== c
c  The formulae are taken from                                         c
c  S.Ambrosanio,G.L.Kane,G.D.Kribs,S.P.Martin and S.Mrenna             c
c  Phys.Rev.D54 (1996) 5395.                                           c
c ==================================================================== c

      subroutine SD_gluinograv(ggravgl)

      implicit double precision (a-h,k-z)

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_massgrav/mgravitino
      COMMON/SD_gluino/mgluino

      mplanck = 2.4D18

      unlikely = -123456789D0
      if(mgravitino.eq.unlikely) then
         amgravitino = 0.D0
      else
         amgravitino = mgravitino
      endif

c -- gluino -> Gravitino gluon --

      if(mgluino.ge.amgravitino) then
         ggravgl = mgluino**5/48.D0/pi/mplanck**2/amgravitino**2
      else
         ggravgl = 0.D0
      endif

      end

c -------------------------------------------------------------------- c

      subroutine SD_gmsb2bod(neutgammagravitino,neutZgravitino,
     .                       neuthlgravitino,neuthhgravitino,
     .                       neuthagravitino,stautaugravitino)

      implicit double precision (a-h,k-z)
      double precision nl,nq

      dimension u(2,2),v(2,2),z(4,4),zp(4,4)
      dimension amchar(2),amneut(4),xmneut(4)
      dimension neutgammagravitino(4),neutZgravitino(4),
     .          neuthlgravitino(4),neuthhgravitino(4),neuthagravitino(4)
      dimension khl(4),khh(4),kha(4),kz(4),kgamma(4)

      COMMON/SU_GMSB/mgmmess,mgmsusy,nl,nq
      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_mixang/alp_mssm,tanbeta
      COMMON/SD_weinberg/sw,cw
      COMMON/SD_mixmat/u,v,z,zp
      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_sfermionetau/ase1,ase2,astau1,astau2
      COMMON/SD_hmass/ama,aml,amh,amch,amar
      COMMON/SD_mwmzpole/amwp,amzp
      COMMON/SD_massgrav/mgravitino
      COMMON/SD_fermion/amt,amb,amtau

      bet   = datan(tanbeta) 
      alp   = alp_mssm

      mplanck = 2.4D18

      f      = mgmmess**2
      f0     = mgmsusy**2
      ratiok = f/f0
      do i=1,4,1
         kgamma(i) = zp(i,1)**2
         kz(i)     = zp(i,2)**2+0.5D0*(z(i,3)*dcos(bet)
     .               -z(i,4)*dsin(bet))**2	
         khl(i)    = (z(i,3)*dsin(alp)-z(i,4)*dcos(alp))**2
         khh(i)    = (z(i,3)*dcos(alp)+z(i,4)*dsin(alp))**2
         kha(i)    = (z(i,3)*dsin(bet)+z(i,4)*dcos(bet))**2
      end do

      unlikely = -123456789D0
      if(mgravitino.eq.unlikely) then
         amgravitino = 0.D0
      else
         amgravitino = mgravitino
      endif

c -- neutralino_i -> Gravitino gamma --

      do i=1,4,1
         if(amneut(i).ge.amgravitino) then
            neutgammagravitino(i) = kgamma(i)*amneut(i)**5/48.D0/pi
     .           /mplanck**2/amgravitino**2
         else
            neutgammagravitino(i) = 0.D0
         endif
      end do

c -- neutralino_i -> Gravitino Z --

      do i=1,4,1
         if(amneut(i).ge.(amgravitino+amzp)) then
            neutzgravitino(i) = kz(i)/kgamma(i)*neutgammagravitino(i)*
     .           (1.D0-amzp**2/amneut(i)**2)**4
         else
            neutzgravitino(i) = 0.D0
         endif
      end do

c -- neutralino_i -> Gravitino h --

      do i=1,4,1
         if(amneut(i).ge.(amgravitino+aml)) then
            neuthlgravitino(i) = khl(i)/kgamma(i)/2.D0*
     .           neutgammagravitino(i)*
     .           (1.D0-aml**2/amneut(i)**2)**4
         else
            neuthlgravitino(i) = 0.D0
         endif
      end do

c -- neutralino1 -> Gravitino H --

      do i=1,4,1
         if(amneut(i).ge.(amgravitino+amh)) then
            neuthhgravitino(i) = khh(i)/kgamma(i)/2.D0*
     .           neutgammagravitino(i)*
     .           (1.D0-amh**2/amneut(i)**2)**4
         else
            neuthhgravitino(i) = 0.D0
         endif
      end do

c -- neutralino1 -> Gravitino A --

      do i=1,4,1
         if(amneut(i).ge.(amgravitino+ama)) then
            neuthagravitino(i) = kha(i)/kgamma(i)/2.D0*
     .           neutgammagravitino(i)*
     .           (1.D0-ama**2/amneut(i)**2)**4
         else
            neuthagravitino(i) = 0.D0
         endif
      end do

c -- stau1 -> Gravitino tau --
      
      if(astau1.ge.(amgravitino+amtau)) then
         stautaugravitino = astau1**5/48.D0/pi/mplanck**2
     .        /amgravitino**2
      else
         stautaugravitino = 0.D0
      endif      

      end

c -------------------------------------------------------------------- c

      subroutine SD_gmsbchar2bod(charwgravitino,charhcgravitino)

      implicit double precision (a-h,k-z)
      double precision nl,nq

      dimension u(2,2),v(2,2),z(4,4),zp(4,4)
      dimension amchar(2),amneut(4),xmneut(4)
      dimension charwgravitino(2),charhcgravitino(2)
      dimension kit(2),kil(2),kic(2)

      COMMON/SU_GMSB/mgmmess,mgmsusy,nl,nq
      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_mixang/alp_mssm,tanbeta
      COMMON/SD_weinberg/sw,cw
      COMMON/SD_mixmat/u,v,z,zp
      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_sfermionetau/ase1,ase2,astau1,astau2
      COMMON/SD_hmass/ama,aml,amh,amch,amar
      COMMON/SD_mwmzpole/amwp,amzp
      COMMON/SD_massgrav/mgravitino
      COMMON/SD_fermion/amt,amb,amtau

      bet   = datan(tanbeta) 
      alp   = alp_mssm

      mplanck = 2.4D18

      do i=1,2,1
         kit(i) = 1.D0/2.D0*(v(i,1)**2+u(i,1)**2)
         kil(i) = v(i,2)**2*dsin(bet)**2+u(i,2)**2*dcos(bet)**2
         kic(i) = v(i,2)**2*dcos(bet)**2+u(i,2)**2*dsin(bet)**2
      end do

      unlikely = -123456789D0
      if(mgravitino.eq.unlikely) then
         amgravitino = 0.D0
      else
         amgravitino = mgravitino
      endif

c -- chargino_i+ -> Gravitino W+ --

      do i=1,2,1
         if(amchar(i).ge.(amgravitino+amw)) then
            charwgravitino(i) = (2.D0*kit(i)+kil(i))*amchar(i)**5
     .           /96.D0/pi/mplanck**2/amgravitino**2*
     .           (1.D0-amw**2/amchar(i)**2)**4
         else
            charwgravitino(i) = 0.D0
         endif
      end do

c -- chargino_i+ -> Gravitino H+ --

      do i=1,2,1
         if(amchar(i).ge.(amgravitino+amch)) then
            charhcgravitino(i) = kic(i)*amchar(i)**5
     .           /96.D0/pi/mplanck**2/amgravitino**2*
     .           (1.D0-amch**2/amchar(i)**2)**4
         else
            charhcgravitino(i) = 0.D0
         endif
      end do

      end

c ==================================================================== c
c                   The neutralino_1/2/3/4 3-body decays               c
c ==================================================================== c

      subroutine SD_xintegneut(xneutel,xneutmu,xneuttau,xneutnue,
     .                      xneutnumu,xneutnutau,xneutup,xneutdow,
     .                      xneutst,xneutch,xneutbot,xneuttop,
     .                      xchelne,xchmunmu,xchtauntau,xchubdow,
     .                      xchcbs,xchtbb,xgluinoup,xgluinodo,
     .                      xgluinoch,xgluinost,xgluinotop,
     .                      xgluinobot)

      implicit double precision (a-h,m,o-z) 
      integer ni,nj
      integer nx1t,ny1t

      dimension xneutel(4,4),xneutmu(4,4),xneuttau(4,4),
     .          xneutnue(4,4),xneutnumu(4,4),xneutnutau(4,4),
     .          xneutup(4,4),xneutdow(4,4),xneutst(4,4),xneutch(4,4),
     .          xneutbot(4,4),xneuttop(4,4),xgluinoup(4),
     .          xgluinodo(4),xgluinoch(4),xgluinost(4),xgluinobot(4),
     .          xgluinotop(4),xchelne(4,2),xchmunmu(4,2),
     .          xchtauntau(4,2),xchubdow(4,2),xchcbs(4,2),xchtbb(4,2)
      dimension amneut(4),xmneut(4),amchar(2)

      external SD_ay,SD_by,SD_ax,SD_bx
      external SD_neutel,SD_neuttau,SD_neutnue,SD_neutnutau
      external SD_neutup,SD_neutdow,SD_neutbot,SD_neuttop
      external SD_chelne,SD_chtauntau,SD_chubd,SD_chtbb
      external SD_xgluibot,SD_xgluido,SD_xgluiup,SD_xgluitop

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_gluino/mgluino
      COMMON/SD_fermion/amt,amb,amtau
      COMMON/SD_break/au,ad,al,amu
      COMMON/SD_indices/ni,nj
      COMMON/SD_nx1/nx1t,ny1t

c -------------------------------------------------------------------- c
c --------------------------- gluino up upbar ------------------------ c
c -------------------------------------------------------------------- c

      do ni=1,4,1
         xmu1=0.D0
         xmu2=0.D0
         xmu3=mgluino**2/amneut(ni)**2

         if(amneut(ni).gt.dabs(mgluino)) then
            call SD_integ2(SD_xgluiup,SD_ax,SD_bx,SD_ay,SD_by,xmu1,
     .                  xmu2,xmu3,nx1t,ny1t,sum)
            xgluinoup(ni) = sum/64.D0/pi**3*amneut(ni)
         else
            xgluinoup(ni) = 0.D0
         endif
      enddo

c -------------------------------------------------------------------- c
c ------------------------- gluino down downbar ---------------------- c
c -------------------------------------------------------------------- c

      do ni = 1,4,1
         xmu1=0.D0
         xmu2=0.D0
         xmu3=mgluino**2/amneut(ni)**2

         if(amneut(ni).gt.dabs(mgluino)) then
            call SD_integ2(SD_xgluido,SD_ax,SD_bx,SD_ay,SD_by,xmu1,
     .                  xmu2,xmu3,nx1t,ny1t,sum)
            xgluinodo(ni) = sum/64.d0/pi**3*amneut(ni)
         else
            xgluinodo(ni) = 0.D0
         endif
      enddo

c -------------------------------------------------------------------- c
c ------------------------ gluino charm charmbar --------------------- c
c -------------------------------------------------------------------- c

      do i=1,4,1
         xgluinoch(i) = xgluinoup(i)
      end do

c -------------------------------------------------------------------- c
c ---------------------- gluino strange strangebar ------------------- c
c -------------------------------------------------------------------- c

      do i=1,4,1
         xgluinost(i) = xgluinodo(i)
      end do

c -------------------------------------------------------------------- c
c ------------------------- gluino top topbar ------------------------ c
c -------------------------------------------------------------------- c

      do ni=1,4,1
         xmu1=amt**2/amneut(ni)**2
         xmu2=amt**2/amneut(ni)**2
         xmu3=mgluino**2/amneut(ni)**2

         if(amneut(ni).gt.(2.D0*amt+dabs(mgluino))) then
            call SD_integ2(SD_xgluitop,SD_ax,SD_bx,SD_ay,SD_by,xmu1,
     .                  xmu2,xmu3,nx1t,ny1t,sum)
            xgluinotop(ni) = sum/64.D0/pi**3*amneut(ni)
         else
            xgluinotop(ni) = 0.D0
         endif
      enddo

c -------------------------------------------------------------------- c
c --------------------------- gluino b bbar -------------------------- c
c -------------------------------------------------------------------- c
	
      do ni=1,4,1
         xmu1=amb**2/amneut(ni)**2
         xmu2=amb**2/amneut(ni)**2
         xmu3=mgluino**2/amneut(ni)**2

         if(amneut(ni).gt.(2.D0*amb+dabs(mgluino))) then
            call SD_integ2(SD_xgluibot,SD_ax,SD_bx,SD_ay,SD_by,xmu1,
     .                  xmu2,xmu3,nx1t,ny1t,sum)
            xgluinobot(ni) = sum/64.D0/pi**3*amneut(ni)
         else
            xgluinobot(ni) = 0.D0
         endif
      enddo

c -------------------------------------------------------------------- c
c --------------------------- neutralino e+ e- ----------------------- c
c -------------------------------------------------------------------- c

      do ni = 2,4,1
         do nj = 1,4,1     
            xmu1=0.D0
            xmu2=0.D0
            xmu3=amneut(nj)**2/amneut(ni)**2

            if(nj.ge.ni) then
               xneutel(ni,nj) = 0.D0
            else
               if(amneut(ni).gt.amneut(nj)) then
                  call SD_integ2(SD_neutel,SD_ax,SD_bx,SD_ay,SD_by,
     .                        xmu1,xmu2,xmu3,nx1t,ny1t,sum)
                  xneutel(ni,nj) = sum/64.D0/(2*pi)**3*amneut(ni)
               else
                  xneutel(ni,nj) = 0.D0
               endif
            endif
         end do
      end do

      do i=1,4,1
         xneutel(1,i) = 0.D0
      end do

c -------------------------------------------------------------------- c
c ------------------------ neutralino mu+ mu- ------------------------ c
c -------------------------------------------------------------------- c

      do ni = 1,4,1
         xneutmu(1,ni) = xneutel(1,ni)
         xneutmu(2,ni) = xneutel(2,ni)
         xneutmu(3,ni) = xneutel(3,ni)
         xneutmu(4,ni) = xneutel(4,ni)
      end do

c -------------------------------------------------------------------- c
c ------------------------ neutralino tau+ tau- ---------------------- c
c -------------------------------------------------------------------- c

      do ni = 2,4,1
         do nj = 1,4,1     
            xmu1=amtau**2/amneut(ni)**2
            xmu2=amtau**2/amneut(ni)**2
            xmu3=amneut(nj)**2/amneut(ni)**2

            if(nj.ge.ni) then
               xneuttau(ni,nj) = 0.D0
            else
               if(amneut(ni).gt.(2.D0*amtau+amneut(nj))) then
                  call SD_integ2(SD_neuttau,SD_ax,SD_bx,SD_ay,SD_by,
     .                        xmu1,xmu2,xmu3,nx1t,ny1t,sum)
                  xneuttau(ni,nj) = sum/64.D0/(2*pi)**3*amneut(ni)
               else
                  xneuttau(ni,nj) = 0.d0
               endif
            endif
         enddo
      enddo

      do i=1,4,1
         xneuttau(1,i) = 0.D0
      end do

c -------------------------------------------------------------------- c
c ----------------------- neutralino nu_e nu_ebar -------------------- c
c -------------------------------------------------------------------- c

      do ni = 2,4,1
         do nj = 1,4,1     
            xmu1=0.D0
            xmu2=0.D0
            xmu3=amneut(nj)**2/amneut(ni)**2

            if(nj.ge.ni) then
               xneutnue(ni,nj) = 0.D0
            else
               if(amneut(ni).gt.amneut(nj)) then
                  call SD_integ2(SD_neutnue,SD_ax,SD_bx,SD_ay,SD_by,
     .                        xmu1,xmu2,xmu3,nx1t,ny1t,sum)
                  xneutnue(ni,nj) = sum/64.D0/(2*pi)**3*amneut(ni)
               else
                  xneutnue(ni,nj) = 0.D0
               endif
            endif
         end do
      end do

      do i=1,4,1
         xneutnue(1,i) = 0.D0
      end do

c -------------------------------------------------------------------- c
c --------------------- neutralino nu_mu nu_mubar -------------------- c
c -------------------------------------------------------------------- c

      do i = 1,4,1
         xneutnumu(1,i) = xneutnue(1,i)
         xneutnumu(2,i) = xneutnue(2,i)
         xneutnumu(3,i) = xneutnue(3,i)
         xneutnumu(4,i) = xneutnue(4,i)
      end do

c -------------------------------------------------------------------- c
c -------------------- neutralino nu_tau nu_taubar ------------------- c
c -------------------------------------------------------------------- c

      do ni = 2,4,1
         do nj = 1,4,1     
            xmu1=0.D0
            xmu2=0.D0
            xmu3=amneut(nj)**2/amneut(ni)**2

            if(nj.ge.ni) then
               xneutnutau(ni,nj) = 0.D0
            else
               if(amneut(ni).gt.amneut(nj)) then
                  call SD_integ2(SD_neutnutau,SD_ax,SD_bx,SD_ay,SD_by,
     .                        xmu1,xmu2,xmu3,nx1t,ny1t,sum)
                  xneutnutau(ni,nj) = sum/64.D0/(2*pi)**3*amneut(ni)
               else
                  xneutnutau(ni,nj) = 0.D0
               endif
            endif
         end do
      end do

      do i=1,4,1
         xneutnutau(1,i) = 0.D0
      end do

c -------------------------------------------------------------------- c
c ----------------------- neutralino up upbar ------------------------ c
c -------------------------------------------------------------------- c

      do ni = 2,4,1
         do nj = 1,4,1
            xmu1=0.D0
            xmu2=0.D0
            xmu3=amneut(nj)**2/amneut(ni)**2
      
            if(nj.ge.ni) then
               xneutup(ni,nj) = 0.D0
            else
               if(amneut(ni).gt.amneut(nj)) then
                  call SD_integ2(SD_neutup,SD_ax,SD_bx,SD_ay,SD_by,
     .                        xmu1,xmu2,xmu3,nx1t,ny1t,sum)
                  xneutup(ni,nj) = sum/64.D0/(2*pi)**3*amneut(ni)
                  xneutup(ni,nj) = 3.D0*xneutup(ni,nj)
               else
                  xneutup(ni,nj) = 0.D0
               endif
            endif
         enddo
      enddo  

      do i=1,4,1
         xneutup(1,i) = 0.D0
      end do

c -------------------------------------------------------------------- c
c -------------------- neutralino down downbar ----------------------- c
c -------------------------------------------------------------------- c

      do ni = 2,4,1
         do nj = 1,4,1
            xmu1=0.D0
            xmu2=0.D0
            xmu3=amneut(nj)**2/amneut(ni)**2
      
            if(nj.ge.ni) then
               xneutdow(ni,nj) = 0.D0
            else
               if(amneut(ni).gt.amneut(nj)) then
                  call SD_integ2(SD_neutdow,SD_ax,SD_bx,SD_ay,SD_by,
     .                        xmu1,xmu2,xmu3,nx1t,ny1t,sum)
                  xneutdow(ni,nj) = sum/64.D0/(2*pi)**3*amneut(ni)
                  xneutdow(ni,nj) = 3.D0*xneutdow(ni,nj)
               else
                  xneutdow(ni,nj) = 0.D0
               endif
            endif
         enddo
      enddo  

      do i=1,4,1
         xneutdow(1,i) = 0.D0
      end do

c -------------------------------------------------------------------- c
c --------------------- neutralino charm charmbar -------------------- c
c -------------------------------------------------------------------- c

      do ni = 1,4,1
         xneutch(1,ni) = xneutup(1,ni)
         xneutch(2,ni) = xneutup(2,ni)
         xneutch(3,ni) = xneutup(3,ni)
         xneutch(4,ni) = xneutup(4,ni)
      end do

c -------------------------------------------------------------------- c
c ----------------- neutralino strange strangebar -------------------- c
c -------------------------------------------------------------------- c

      do ni = 1,4,1
         xneutst(1,ni) = xneutdow(1,ni)
         xneutst(2,ni) = xneutdow(2,ni)
         xneutst(3,ni) = xneutdow(3,ni)
         xneutst(4,ni) = xneutdow(4,ni)
      end do

c -------------------------------------------------------------------- c
c ----------------------- neutralino top topbar ---------------------- c
c -------------------------------------------------------------------- c

      do ni = 2,4,1
         do nj = 1,4,1
            xmu1=amt**2/amneut(ni)**2
            xmu2=amt**2/amneut(ni)**2
            xmu3=amneut(nj)**2/amneut(ni)**2

            if(nj.ge.ni) then
               xneuttop(ni,nj) = 0.D0
            else
               if(amneut(ni).gt.(2.D0*amt+amneut(nj))) then
                  call SD_integ2(SD_neuttop,SD_ax,SD_bx,SD_ay,SD_by,
     .                        xmu1,xmu2,xmu3,nx1t,ny1t,sum)
                  xneuttop(ni,nj) = sum/64.D0/(2*pi)**3*amneut(ni)  
                  xneuttop(ni,nj) = 3.D0*xneuttop(ni,nj)
               else
                  xneuttop(ni,nj) = 0.D0
               endif
            endif
         enddo
      enddo

      do i=1,4,1
         xneuttop(1,i) = 0.D0
      end do

c -------------------------------------------------------------------- c
c -------------------------- neutralino b bbar ----------------------- c
c -------------------------------------------------------------------- c

      do ni = 2,4,1
         do nj = 1,4,1
            xmu1=amb**2/amneut(ni)**2
            xmu2=amb**2/amneut(ni)**2
            xmu3=amneut(nj)**2/amneut(ni)**2

            if(nj.ge.ni) then
               xneutbot(ni,nj) = 0.D0
            else
               if(amneut(ni).gt.(2.D0*amb+amneut(nj))) then
                  call SD_integ2(SD_neutbot,SD_ax,SD_bx,SD_ay,SD_by,
     .                        xmu1,xmu2,xmu3,nx1t,ny1t,sum)
                  xneutbot(ni,nj) = sum/64.D0/(2*pi)**3*amneut(ni)  
                  xneutbot(ni,nj) = 3.D0*xneutbot(ni,nj)
               else
                  xneutbot(ni,nj) = 0.D0
               endif
            endif
         enddo
      enddo

      do i=1,4,1
         xneutbot(1,i) = 0.D0
      end do

c -------------------------------------------------------------------- c
c ------------------------ chargino- e+ nuebar ----------------------- c
c -------------------------------------------------------------------- c

      do ni = 1,4,1
         do nj = 1,2,1     
            xmu1=0.D0
            xmu2=0.D0
            xmu3=amchar(nj)**2/amneut(ni)**2

            if(amneut(ni).gt.amchar(nj)) then
               call SD_integ2(SD_chelne,SD_ax,SD_bx,SD_ay,SD_by,xmu1,
     .                     xmu2,xmu3,nx1t,ny1t,sum)
               xchelne(ni,nj) = sum/64.D0/(2*pi)**3*amneut(ni)
            else
               xchelne(ni,nj) = 0.D0
            endif
         end do
      end do

c -------------------------------------------------------------------- c
c ---------------------- chargino- mu+ numubar ----------------------- c
c -------------------------------------------------------------------- c

      do ni=1,4,1
         do nj=1,2,1
            xchmunmu(ni,nj) = xchelne(ni,nj)
         end do
      end do

c -------------------------------------------------------------------- c
c --------------------- chargino- tau+ nutaubar ---------------------- c
c -------------------------------------------------------------------- c

      do ni = 1,4,1
         do nj = 1,2,1     
            xmu1=0.D0
            xmu2=amtau**2/amneut(ni)**2
            xmu3=amchar(nj)**2/amneut(ni)**2

            if(amneut(ni).gt.(amchar(nj)+amtau)) then
               call SD_integ2(SD_chtauntau,SD_ax,SD_bx,SD_ay,SD_by,
     .                     xmu1,xmu2,xmu3,nx1t,ny1t,sum)
               xchtauntau(ni,nj) = sum/64.D0/(2*pi)**3*amneut(ni)
            else
               xchtauntau(ni,nj) = 0.D0
            endif
         end do
      end do

c -------------------------------------------------------------------- c
c ------------------------ chargino- up downbar ---------------------- c
c -------------------------------------------------------------------- c

      do ni = 1,4,1
         do nj = 1,2,1     
            xmu1=0.D0
            xmu2=0.D0
            xmu3=amchar(nj)**2/amneut(ni)**2

            if(amneut(ni).gt.amchar(nj)) then
               call SD_integ2(SD_chubd,SD_ax,SD_bx,SD_ay,SD_by,xmu1,
     .                     xmu2,xmu3,nx1t,ny1t,sum)
               xchubdow(ni,nj) = 3.D0*sum/64.D0/(2*pi)**3*amneut(ni)
            else
               xchubdow(ni,nj) = 0.D0
            endif
         end do
      end do

c -------------------------------------------------------------------- c
c --------------------- chargino- charm strangebar ------------------- c
c -------------------------------------------------------------------- c

      do ni=1,4,1
         do nj=1,2,1
            xchcbs(ni,nj) = xchubdow(ni,nj)
         end do
      end do

c -------------------------------------------------------------------- c
c ---------------------- chargino- top bottombar --------------------- c
c -------------------------------------------------------------------- c

      do ni = 1,4,1
         do nj = 1,2,1     
            xmu1=amt**2/amneut(ni)**2
            xmu2=amb**2/amneut(ni)**2
            xmu3=amchar(nj)**2/amneut(ni)**2

            if(amneut(ni).gt.(amchar(nj)+amt+amb)) then
               call SD_integ2(SD_chtbb,SD_ax,SD_bx,SD_ay,SD_by,xmu1,
     .                     xmu2,xmu3,nx1t,ny1t,sum)
               xchtbb(ni,nj) = 3.D0*sum/64.D0/(2*pi)**3*amneut(ni)
            else
               xchtbb(ni,nj) = 0.D0
            endif
         end do
      end do

      end

c ==================================================================== c
c ============================ gluino up upbar ======================= c
c ==================================================================== c

      double precision function SD_xgluiup(x1,x2)

      implicit double precision (a-h,m,o-z)

      dimension amneut(4),xmneut(4),amchar(2)
      dimension gtr(2),gtl(2),gbr(2),gbl(2),gur(2),gul(2),gdr(2),gdl(2)
      dimension dsup(2),dsupb(2)
      dimension ado(2,4),bdo(2,4),aup(2,4),bup(2,4)

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_indices/ni,nj
      COMMON/SD_gluino/mgluino
      COMMON/SD_break/au,ad,al,amu
      COMMON/SD_squarkud/asup1,asup2,asdown1,asdown2
      COMMON/SD_coup21/gtr,gtl,gbr,gbl,gur,gul,gdr,gdl
      COMMON/SD_coup10/aup,bup,ado,bdo
      COMMON/SD_coupewsb/alsew,g2ew,g1ew
      COMMON/SD_runcoupscale/scalechoice,scaleofcoupling,inumloop

      external SD_alphascall

c --- the running couplings ---

      if(scalechoice.eq.1.D0) then
         gs21 = alsew*4.D0*pi
         gs22 = gs21
      elseif(scalechoice.eq.2.D0) then         
         gs21 = SD_alphascall(amneut(ni),inumloop)*4.D0*pi
         gs22 = gs21
      elseif(scalechoice.eq.3.D0) then
         gs21 = SD_alphascall(scaleofcoupling,inumloop)*4.D0*pi
         gs22 = gs21
      endif

      xmuneut1 = mgluino**2/amneut(ni)**2

      x3 = 2.D0-x1-x2
      y1 = 1.D0-xmuneut1-x1
      y2 = 1.D0-xmuneut1-x2
      y3 = 1.D0+xmuneut1-x3

c -------------------------------------------------------------------- c
c                               sup exchange
c -------------------------------------------------------------------- c

      xmusup1 = asup1**2/amneut(ni)**2
      xmusup2 = asup2**2/amneut(ni)**2

      dsup(1)  = 1.D0-x1-xmusup1
      dsup(2)  = 1.D0-x1-xmusup2
      dsupb(1) = 1.D0-x2-xmusup1
      dsupb(2) = 1.D0-x2-xmusup2

      SD_xgluiup=0.D0

      if (dabs(mgluino).le.amneut(ni)) then
         do i=1,2
            do k=1,2
               SD_xgluiup=SD_xgluiup
     .              +g2*gs21/dsup(i)/dsup(k)*x1*y1
     .              *(aup(i,ni)*aup(k,ni)+bup(i,ni)*bup(k,ni))
     .              *(gur(i)*gur(k)+gul(i)*gul(k))
     .              +g2*gs22/dsupb(k)/dsupb(i)*x2*y2
     .              *(aup(i,ni)*aup(k,ni)+bup(i,ni)*bup(k,ni))*
     .               (gur(i)*gur(k)+gul(i)*gul(k))
     .              +g2*dsqrt(gs21)*dsqrt(gs22)/dsupb(i)/dsup(k)
     .              *( ( aup(i,ni)*bup(k,ni)*gur(i)*gul(k)
     .                 + gur(k)*gul(i)*aup(k,ni)*bup(i,ni))
     .                 *(-x1*y1-x2*y2+x3*y3)
     .               +2.D0*mgluino/xmneut(ni)*y3*
     .               ( aup(i,ni)*aup(k,ni)*gul(k)*gul(i)
     .                +gur(i)*gur(k)*bup(k,ni)*bup(i,ni)))
            enddo
         enddo
      else 
         SD_xgluiup=0.D0	
      endif

      end

c ==================================================================== c
c =========================== gluino down downbar ==================== c
c ==================================================================== c

      double precision function SD_xgluido(x1,x2)

      implicit double precision (a-h,m,o-z)

      dimension amneut(4),xmneut(4),amchar(2)
      dimension gtr(2),gtl(2),gbr(2),gbl(2),gur(2),gul(2),gdr(2),gdl(2)
      dimension dsdo(2),dsdob(2)
      dimension ado(2,4),bdo(2,4),aup(2,4),bup(2,4)

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_indices/ni,nj
      COMMON/SD_gluino/mgluino
      COMMON/SD_break/au,ad,al,amu
      COMMON/SD_squarkud/asup1,asup2,asdown1,asdown2
      COMMON/SD_coup21/gtr,gtl,gbr,gbl,gur,gul,gdr,gdl
      COMMON/SD_coup10/aup,bup,ado,bdo
      COMMON/SD_coupewsb/alsew,g2ew,g1ew
      COMMON/SD_runcoupscale/scalechoice,scaleofcoupling,inumloop

      external SD_alphascall

c --- the running couplings ---

      if(scalechoice.eq.1.D0) then
         gs21 = alsew*4.D0*pi
         gs22 = gs21
      elseif(scalechoice.eq.2.D0) then         
         gs21 = SD_alphascall(amneut(ni),inumloop)*4.D0*pi
         gs22 = gs21
      elseif(scalechoice.eq.3.D0) then
         gs21 = SD_alphascall(scaleofcoupling,inumloop)*4.D0*pi
         gs22 = gs21
      endif

      xmuneut1 = mgluino**2/amneut(ni)**2

      x3 = 2.D0-x1-x2
      y1 = 1.D0-xmuneut1-x1
      y2 = 1.D0-xmuneut1-x2
      y3 = 1.D0+xmuneut1-x3

c -------------------------------------------------------------------- c
c                             sdown exchange
c -------------------------------------------------------------------- c

      xmusdo1 = asdown1**2/amneut(ni)**2
      xmusdo2 = asdown2**2/amneut(ni)**2

      dsdo(1)  = 1.D0-x1-xmusdo1
      dsdo(2)  = 1.D0-x1-xmusdo2
      dsdob(1) = 1.D0-x2-xmusdo1
      dsdob(2) = 1.D0-x2-xmusdo2

      SD_xgluido=0.D0

      if (dabs(mgluino).le.amneut(ni)) then
         do i=1,2
            do k=1,2
               SD_xgluido=SD_xgluido
     .              +g2*gs21/dsdo(i)/dsdo(k)*x1*y1
     .              *(ado(i,ni)*ado(k,ni)+bdo(i,ni)*bdo(k,ni))
     .              *(gdr(i)*gdr(k)+gdl(i)*gdl(k))
     .              +g2*gs22/dsdob(k)/dsdob(i)*x2*y2
     .              *(ado(i,ni)*ado(k,ni)+bdo(i,ni)*bdo(k,ni))*
     .               (gdr(i)*gdr(k)+gdl(i)*gdl(k))
     .              +g2*dsqrt(gs21)*dsqrt(gs22)/dsdob(i)/dsdo(k)
     .              *( ( ado(i,ni)*bdo(k,ni)*gdr(i)*gdl(k)
     .                 + gdr(k)*gdl(i)*ado(k,ni)*bdo(i,ni))
     .                 *(-x1*y1-x2*y2+x3*y3)
     .               +2.D0*mgluino/xmneut(ni)*y3*
     .               ( ado(i,ni)*ado(k,ni)*gdl(k)*gdl(i)
     .                +gdr(i)*gdr(k)*bdo(k,ni)*bdo(i,ni)))
            enddo
         enddo
      else
         SD_xgluido=0.D0
      endif

      end

c ==================================================================== c
c ========================== gluino top topbar ======================= c
c ==================================================================== c

      double precision function SD_xgluitop(x1,x2)

      implicit double precision (a-h,m,o-z)
  
      dimension amneut(4),xmneut(4),amchar(2)
      dimension gtr(2),gtl(2),gbr(2),gbl(2),gur(2),gul(2),gdr(2),gdl(2)
      dimension dst(2),dstb(2),sgn(4)
      dimension atopr(2,4),btopr(2,4)

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_indices/ni,nj
      COMMON/SD_gluino/mgluino
      COMMON/SD_break/au,ad,al,amu
      COMMON/SD_coup21/gtr,gtl,gbr,gbl,gur,gul,gdr,gdl
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2
      COMMON/SD_fermion/amt,amb,amtau
      COMMON/SD_scala/scalb,scalt
      COMMON/SD_yukawa/ytewsb,ybewsb,ytauewsb
      COMMON/SD_coupewsb/alsew,g2ew,g1ew
      COMMON/SD_runcoupscale/scalechoice,scaleofcoupling,inumloop

      external SD_alphascall

c --- the running couplings ---

      if(scalechoice.eq.1.D0) then
         gs21 = alsew*4.D0*pi
         gs22 = gs21
      elseif(scalechoice.eq.2.D0) then         
         gs21 = SD_alphascall(amneut(ni),inumloop)*4.D0*pi
         gs22 = gs21
      elseif(scalechoice.eq.3.D0) then
         gs21 = SD_alphascall(scaleofcoupling,inumloop)*4.D0*pi
         gs22 = gs21
      endif

      if(scalechoice.eq.1.D0) then
         scalb = ybewsb/dsqrt(g2)
         scalt = ytewsb/dsqrt(g2)
      elseif(scalechoice.eq.2.D0) then         
         call SD_runmass(amneut(ni),0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      elseif(scalechoice.eq.3.D0) then
         call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      endif

      call SD_neutstoptop(atopr,btopr)

c --- some definitions ---

      do i=1,4,1
         sgn(i) = 1.D0
         if(xmneut(i).gt.0.D0) then
            sgn(i) = 1.D0
         elseif(xmneut(i).lt.0.D0) then
            sgn(i) = -1.D0
         endif
      enddo

      xmuneut1 = mgluino**2/amneut(ni)**2

c -------------------------------------------------------------------- c
c                              stop exchange
c -------------------------------------------------------------------- c

      xmust1   = ast1**2/amneut(ni)**2
      xmust2   = ast2**2/amneut(ni)**2
      xmut     = amt**2/amneut(ni)**2

      dst(1)  = 1.D0-x1-xmust1+xmut
      dst(2)  = 1.D0-x1-xmust2+xmut
      dstb(1) = 1.D0-x2-xmust1+xmut
      dstb(2) = 1.D0-x2-xmust2+xmut

      SD_xgluitop = 0.D0
      
c --- mass dependence included ---

      uh = 1.D0-x1+xmut
      th = 1.D0-x2+xmut

      if ((dabs(mgluino)+2.D0*amt).le.amneut(ni)) then
         do i=1,2
            do k=1,2
               SD_xgluitop=SD_xgluitop
     .              +g2*gs21/dst(k)/dst(i)*(
     .               (atopr(i,ni)*btopr(k,ni)+btopr(i,ni)*atopr(k,ni))*
     .               (gtr(i)*gtr(k)+gtl(i)*gtl(k))*
     .               2.D0*dsqrt(xmut)*sgn(ni)*(uh-xmut-xmuneut1)+
     .               (atopr(i,ni)*atopr(k,ni)+btopr(i,ni)*btopr(k,ni))*
     .               (gtr(i)*gtr(k)+gtl(i)*gtl(k))*
     .               (xmut*(-xmut-xmuneut1+2.D0*uh-1.D0)+uh*(-uh+
     .                xmuneut1+1.D0)-xmuneut1)+
     .               (atopr(k,ni)*btopr(i,ni)+btopr(k,ni)*atopr(i,ni))*
     .               (gtr(k)*gtl(i)+gtr(i)*gtl(k))*mgluino/xmneut(ni)*
     .               xmut*(-4.D0)+
     .               (atopr(k,ni)*atopr(i,ni)+btopr(k,ni)*btopr(i,ni))*
     .               (gtr(k)*gtl(i)+gtr(i)*gtl(k))*mgluino/xmneut(ni)*
     .               dsqrt(xmut)*sgn(ni)*2.D0*(uh-xmut-1.D0))
     .              +g2*gs22/dstb(k)/dstb(i)*(
     .               (atopr(i,ni)*btopr(k,ni)+btopr(i,ni)*atopr(k,ni))*
     .               (gtr(i)*gtl(k)+gtr(k)*gtl(i))*mgluino/xmneut(ni)*
     .               xmut*(-4.D0)+
     .               (atopr(i,ni)*atopr(k,ni)+btopr(i,ni)*btopr(k,ni))*
     .               (gtr(i)*gtl(k)+gtr(k)*gtl(i))*mgluino/xmneut(ni)*
     .               dsqrt(xmut)*sgn(ni)*2.D0*(th-xmut-1.D0)+
     .               (atopr(i,ni)*btopr(k,ni)+atopr(k,ni)*btopr(i,ni))*
     .               (gtr(i)*gtr(k)+gtl(k)*gtl(i))*
     .               dsqrt(xmut)*sgn(ni)*2.D0*(th-xmuneut1-xmut)+
     .               (atopr(i,ni)*atopr(k,ni)+btopr(k,ni)*btopr(i,ni))*
     .               (gtr(i)*gtr(k)+gtl(k)*gtl(i))*(xmut*(2.D0*th-1.D0
     .               -xmut-xmuneut1)+th*(-th+xmuneut1+1.D0)-xmuneut1))
     .              -2.D0*g2*dsqrt(gs21)*dsqrt(gs22)/dst(k)/dstb(i)*(
     .               (gtr(k)*gtr(i)*atopr(k,ni)*atopr(i,ni)
     .               +gtl(k)*gtl(i)*btopr(k,ni)*btopr(i,ni))*
     .               mgluino/xmneut(ni)*xmut*(-2.D0)+
     .               (gtr(k)*gtr(i)*atopr(k,ni)*btopr(i,ni)
     .               +gtl(k)*gtl(i)*btopr(k,ni)*atopr(i,ni))*
     .               mgluino/xmneut(ni)*dsqrt(xmut)*sgn(ni)*
     .               (th-xmut-1.D0)+
     .               (gtr(k)*gtr(i)*atopr(i,ni)*btopr(k,ni)+
     .                gtl(k)*gtl(i)*btopr(i,ni)*atopr(k,ni))*
     .               mgluino/xmneut(ni)*dsqrt(xmut)*sgn(ni)*
     .               (uh-xmut-1.D0)+
     .               (gtr(k)*gtr(i)*btopr(i,ni)*btopr(k,ni)+
     .                gtl(k)*gtl(i)*atopr(i,ni)*atopr(k,ni))*
     .               mgluino/xmneut(ni)*(uh+th-xmuneut1-1.D0)+
     .               (gtr(k)*gtl(i)*atopr(i,ni)*btopr(k,ni)+
     .                gtl(k)*gtr(i)*atopr(k,ni)*btopr(i,ni))*
     .               xmut*(uh+th-2.D0*xmut)+
     .               (gtr(k)*gtl(i)*btopr(i,ni)*btopr(k,ni)+
     .               gtl(k)*gtr(i)*atopr(k,ni)*atopr(i,ni))*
     .               dsqrt(xmut)*sgn(ni)*(uh-xmuneut1-xmut)+
     .               (gtr(k)*gtl(i)*atopr(i,ni)*atopr(k,ni)+
     .               gtl(k)*gtr(i)*btopr(k,ni)*btopr(i,ni))*
     .               dsqrt(xmut)*sgn(ni)*(th-xmut-xmuneut1)+
     .               (gtr(k)*gtl(i)*atopr(k,ni)*btopr(i,ni)+
     .                gtl(k)*gtr(i)*atopr(i,ni)*btopr(k,ni))*
     .               (uh*th-xmut**2-xmuneut1))
            enddo
         enddo
      else 
         SD_xgluitop=0.D0	
      endif

      end

c ==================================================================== c
c =========================== gluino b bbar ========================== c
c ==================================================================== c

      double precision function SD_xgluibot(x1,x2)

      implicit double precision (a-h,m,o-z)

      dimension amneut(4),xmneut(4),amchar(2)
      dimension gtr(2),gtl(2),gbr(2),gbl(2),gur(2),gul(2),gdr(2),gdl(2)
      dimension dsbo(2),dsbob(2),sgn(4)
      dimension abot(2,4),bbot(2,4)

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_indices/ni,nj
      COMMON/SD_gluino/mgluino
      COMMON/SD_break/au,ad,al,amu
      COMMON/SD_coup21/gtr,gtl,gbr,gbl,gur,gul,gdr,gdl
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2
      COMMON/SD_fermion/amt,amb,amtau
      COMMON/SD_scala/scalb,scalt
      COMMON/SD_yukawa/ytewsb,ybewsb,ytauewsb
      COMMON/SD_coupewsb/alsew,g2ew,g1ew
      COMMON/SD_runcoupscale/scalechoice,scaleofcoupling,inumloop

      external SD_alphascall

c --- the running couplings ---

      if(scalechoice.eq.1.D0) then
         gs21 = alsew*4.D0*pi
         gs22 = gs21
      elseif(scalechoice.eq.2.D0) then         
         gs21 = SD_alphascall(amneut(ni),inumloop)*4.D0*pi
         gs22 = gs21
      elseif(scalechoice.eq.3.D0) then
         gs21 = SD_alphascall(scaleofcoupling,inumloop)*4.D0*pi
         gs22 = gs21
      endif

      if(scalechoice.eq.1.D0) then
         scalb = ybewsb/dsqrt(g2)
         scalt = ytewsb/dsqrt(g2)
      elseif(scalechoice.eq.2.D0) then         
         call SD_runmass(amneut(ni),0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      elseif(scalechoice.eq.3.D0) then
         call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      endif

      call SD_neutsbotbot(abot,bbot)

c --- some definitions ---

      do i=1,4,1
         sgn(i) = 1.D0
         if(xmneut(i).gt.0.D0) then
            sgn(i) = 1.D0
         elseif(xmneut(i).lt.0.D0) then
            sgn(i) = -1.D0
         endif
      enddo

      xmuneut1 = mgluino**2/amneut(ni)**2

c -------------------------------------------------------------------- c
c 			    sbottom exchange
c -------------------------------------------------------------------- c

      xmusb1   = asb1**2/amneut(ni)**2
      xmusb2   = asb2**2/amneut(ni)**2
      xmub     = amb**2/amneut(ni)**2

      dsbo(1)  = 1.D0-x1-xmusb1+xmub
      dsbo(2)  = 1.D0-x1-xmusb2+xmub
      dsbob(1) = 1.D0-x2-xmusb1+xmub
      dsbob(2) = 1.D0-x2-xmusb2+xmub

      SD_xgluibot = 0.D0

c --- mass dependence included ---

      uh = 1.D0-x1+xmub
      th = 1.D0-x2+xmub

      if ((dabs(mgluino)+2.D0*amb).le.amneut(ni)) then
         do i=1,2
            do k=1,2
               SD_xgluibot=SD_xgluibot
     .              +g2*gs21/dsbo(k)/dsbo(i)*(
     .               (abot(i,ni)*bbot(k,ni)+bbot(i,ni)*abot(k,ni))*
     .               (gbr(i)*gbr(k)+gbl(i)*gbl(k))*
     .               2.D0*dsqrt(xmub)*sgn(ni)*(uh-xmub-xmuneut1)+
     .               (abot(i,ni)*abot(k,ni)+bbot(i,ni)*bbot(k,ni))*
     .               (gbr(i)*gbr(k)+gbl(i)*gbl(k))*
     .               (xmub*(-xmub-xmuneut1+2.D0*uh-1.D0)+uh*(-uh+
     .                xmuneut1+1.D0)-xmuneut1)+
     .               (abot(k,ni)*bbot(i,ni)+bbot(k,ni)*abot(i,ni))*
     .               (gbr(k)*gbl(i)+gbr(i)*gbl(k))*mgluino/xmneut(ni)*
     .               xmub*(-4.D0)+
     .               (abot(k,ni)*abot(i,ni)+bbot(k,ni)*bbot(i,ni))*
     .               (gbr(k)*gbl(i)+gbr(i)*gbl(k))*mgluino/xmneut(ni)*
     .               dsqrt(xmub)*sgn(ni)*2.D0*(uh-xmub-1.D0))
     .              +g2*gs22/dsbob(k)/dsbob(i)*(
     .               (abot(i,ni)*bbot(k,ni)+bbot(i,ni)*abot(k,ni))*
     .               (gbr(i)*gbl(k)+gbr(k)*gbl(i))*mgluino/xmneut(ni)*
     .               xmub*(-4.D0)+
     .               (abot(i,ni)*abot(k,ni)+bbot(i,ni)*bbot(k,ni))*
     .               (gbr(i)*gbl(k)+gbr(k)*gbl(i))*mgluino/xmneut(ni)*
     .               dsqrt(xmub)*sgn(ni)*2.D0*(th-xmub-1.D0)+
     .               (abot(i,ni)*bbot(k,ni)+abot(k,ni)*bbot(i,ni))*
     .               (gbr(i)*gbr(k)+gbl(k)*gbl(i))*
     .               dsqrt(xmub)*sgn(ni)*2.D0*(th-xmuneut1-xmub)+
     .               (abot(i,ni)*abot(k,ni)+bbot(k,ni)*bbot(i,ni))*
     .               (gbr(i)*gbr(k)+gbl(k)*gbl(i))*(xmub*(2.D0*th-1.D0
     .               -xmub-xmuneut1)+th*(-th+xmuneut1+1.D0)-xmuneut1))
     .              -2.D0*g2*dsqrt(gs21)*dsqrt(gs22)/dsbo(k)/dsbob(i)*(
     .               (gbr(k)*gbr(i)*abot(k,ni)*abot(i,ni)
     .               +gbl(k)*gbl(i)*bbot(k,ni)*bbot(i,ni))*
     .               mgluino/xmneut(ni)*xmub*(-2.D0)+
     .               (gbr(k)*gbr(i)*abot(k,ni)*bbot(i,ni)
     .               +gbl(k)*gbl(i)*bbot(k,ni)*abot(i,ni))*
     .               mgluino/xmneut(ni)*dsqrt(xmub)*
     .               sgn(ni)*(th-xmub-1.D0)+
     .               (gbr(k)*gbr(i)*abot(i,ni)*bbot(k,ni)+
     .                gbl(k)*gbl(i)*bbot(i,ni)*abot(k,ni))*
     .               mgluino/xmneut(ni)*dsqrt(xmub)*sgn(ni)*
     .               (uh-xmub-1.D0)+
     .               (gbr(k)*gbr(i)*bbot(i,ni)*bbot(k,ni)+
     .                gbl(k)*gbl(i)*abot(i,ni)*abot(k,ni))*
     .               mgluino/xmneut(ni)*(uh+th-xmuneut1-1.D0)+
     .               (gbr(k)*gbl(i)*abot(i,ni)*bbot(k,ni)+
     .                gbl(k)*gbr(i)*abot(k,ni)*bbot(i,ni))*
     .               xmub*(uh+th-2.D0*xmub)+
     .               (gbr(k)*gbl(i)*bbot(i,ni)*bbot(k,ni)+
     .               gbl(k)*gbr(i)*abot(k,ni)*abot(i,ni))*
     .               dsqrt(xmub)*sgn(ni)*(uh-xmuneut1-xmub)+
     .               (gbr(k)*gbl(i)*abot(i,ni)*abot(k,ni)+
     .               gbl(k)*gbr(i)*bbot(k,ni)*bbot(i,ni))*
     .               dsqrt(xmub)*sgn(ni)*(th-xmub-xmuneut1)+
     .               (gbr(k)*gbl(i)*abot(k,ni)*bbot(i,ni)+
     .                gbl(k)*gbr(i)*abot(i,ni)*bbot(k,ni))*
     .               (uh*th-xmub**2-xmuneut1))
            enddo
         enddo
      else 
         SD_xgluibot=0.D0	
      endif

      end

c ==================================================================== c
c =========================  neutralino up upbar ===================== c
c ==================================================================== c

      double precision function SD_neutup(x1,x2)

      implicit double precision (a-h,m,o-z)
      integer k,ni,nj

      dimension amneut(4),xmneut(4),amchar(2)
      dimension dsup(2),dsupb(2)
      dimension opl(2,2),opr(2,2),oppl(4,4),oppr(4,4)
      dimension aup(2,4),bup(2,4),ado(2,4),bdo(2,4)

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_squarkud/asup1,asup2,asdown1,asdown2
      COMMON/SD_indices/ni,nj
      COMMON/SD_coup4/opl,opr,oppl,oppr
      COMMON/SD_coup10/aup,bup,ado,bdo
      COMMON/SD_coup17/azztoptop,vzztoptop,azztautau,vzztautau,
     .                 azzneutneut,vzzneutneut,azzbotbot,vzzbotbot
      COMMON/SD_mwmzpole/amwp,amzp

      xmuneut1 = amneut(nj)**2/amneut(ni)**2

      x3 = 2.D0-x1-x2
      y1 = 1.D0-xmuneut1-x1
      y2 = 1.D0-xmuneut1-x2
      y3 = 1.D0+xmuneut1-x3

c -------------------------------------------------------------------- c
c                              sup exchange
c -------------------------------------------------------------------- c

      xmusup1 = asup1**2/amneut(ni)**2
      xmusup2 = asup2**2/amneut(ni)**2

      dsup(1)  = 1.D0-x1-xmusup1
      dsup(2)  = 1.D0-x1-xmusup2
      dsupb(1) = 1.D0-x2-xmusup1
      dsupb(2) = 1.D0-x2-xmusup2

      xneutsup=0.D0

      if (amneut(nj).le.amneut(ni)) then
         do i=1,2
            do k=1,2
               xneutsup=xneutsup
     .              +g2**2/dsup(i)/dsup(k)*x1*y1
     .              *(aup(i,ni)*aup(k,ni)+bup(i,ni)*bup(k,ni))
     .              *(aup(i,nj)*aup(k,nj)+bup(i,nj)*bup(k,nj))
     .              +g2**2/dsupb(k)/dsupb(i)*x2*y2
     .              *(aup(i,ni)*aup(k,ni)+bup(i,ni)*bup(k,ni))
     .              *(aup(i,nj)*aup(k,nj)+bup(i,nj)*bup(k,nj))
     .              +g2**2/dsupb(k)/dsup(i)
     .              *( ( aup(i,ni)*bup(k,ni)*aup(k,nj)*bup(i,nj)
     .                 + aup(i,nj)*bup(k,nj)*aup(k,ni)*bup(i,ni))
     .                 *(-x1*y1-x2*y2+x3*y3)
     .               +2.D0*xmneut(nj)/xmneut(ni)*y3*
     .               ( aup(i,ni)*aup(k,ni)*aup(k,nj)*aup(i,nj)
     .                +bup(i,nj)*bup(k,nj)*bup(k,ni)*bup(i,ni)))
            enddo
         enddo
      else
         xneutsup=0.D0
      endif

c -------------------------------------------------------------------- c
c                                Z exchange
c -------------------------------------------------------------------- c

      xmuz = amzp**2/amneut(ni)**2
      dz   = y3-xmuz

      xneutzup=0.D0

      if (amneut(nj).le.amneut(ni)) then
         xneutzup=g2**2*4.D0/dz**2*
     .        (((azztoptop+vzztoptop)**2*oppl(ni,nj)**2
     .        +(azztoptop-vzztoptop)**2*oppr(ni,nj)**2)*x2*y2
     .        +((azztoptop+vzztoptop)**2*oppr(ni,nj)**2
     .        +(azztoptop-vzztoptop)**2*oppl(ni,nj)**2)*x1*y1
     .        -4.D0*xmneut(nj)/xmneut(ni)*oppl(ni,nj)*oppr(ni,nj)
     .        *(azztoptop**2+vzztoptop**2)*y3 )
      else
         xneutzup=0.D0
      endif

c -------------------------------------------------------------------- c
c                            Z-sup interference
c -------------------------------------------------------------------- c
	
      xneutzsup=0.D0

      if (amneut(nj).le.amneut(ni)) then
         do i=1,2
            xneutzsup=xneutzsup-g2**2*4.D0/dsup(i)/dz
     .    *((aup(i,ni)*aup(i,nj)*oppr(ni,nj)*(azztoptop+vzztoptop)+
     .     bup(i,ni)*bup(i,nj)*oppl(ni,nj)*(-azztoptop+vzztoptop))*x1*y1
     .    -(aup(i,nj)*aup(i,ni)*oppl(ni,nj)*(azztoptop+vzztoptop)
     .    +bup(i,nj)*bup(i,ni)*oppr(ni,nj)*(-azztoptop+vzztoptop)
     .     )*xmneut(nj)/xmneut(ni)*y3)
     .    +g2**2*4.D0/dsupb(i)/dz
     .    *((aup(i,ni)*aup(i,nj)*oppl(ni,nj)*(azztoptop+vzztoptop)+
     .     bup(i,ni)*bup(i,nj)*oppr(ni,nj)*(-azztoptop+vzztoptop))*x2*y2
     .    -(aup(i,nj)*aup(i,ni)*oppr(ni,nj)*(azztoptop+vzztoptop)
     .    +bup(i,nj)*bup(i,ni)*oppl(ni,nj)*(-azztoptop+vzztoptop)
     .     )*xmneut(nj)/xmneut(ni)*y3)
         enddo
      else
         xneutzsup=0.D0
      endif

c -------------------------------------------------------------------- c

      SD_neutup = xneutsup+xneutzup+xneutzsup

      end

c ==================================================================== c
c ======================  neutralino down downbar ==================== c
c ==================================================================== c

      double precision function SD_neutdow(x1,x2)

      implicit double precision (a-h,m,o-z)
      integer k,ni,nj

      dimension amneut(4),xmneut(4),amchar(2)
      dimension dsdo(2),dsdob(2)
      dimension opl(2,2),opr(2,2),oppl(4,4),oppr(4,4)
      dimension aup(2,4),bup(2,4),ado(2,4),bdo(2,4)

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_squarkud/asup1,asup2,asdown1,asdown2
      COMMON/SD_indices/ni,nj
      COMMON/SD_coup4/opl,opr,oppl,oppr
      COMMON/SD_coup10/aup,bup,ado,bdo
      COMMON/SD_coup17/azztoptop,vzztoptop,azztautau,vzztautau,
     .                 azzneutneut,vzzneutneut,azzbotbot,vzzbotbot
      COMMON/SD_mwmzpole/amwp,amzp

      xmuneut1 = amneut(nj)**2/amneut(ni)**2

      x3 = 2.D0-x1-x2
      y1 = 1.D0-xmuneut1-x1
      y2 = 1.D0-xmuneut1-x2
      y3 = 1.D0+xmuneut1-x3

c -------------------------------------------------------------------- c
c                            sdown exchange
c -------------------------------------------------------------------- c

      xmusdo1 = asdown1**2/amneut(ni)**2
      xmusdo2 = asdown2**2/amneut(ni)**2

      dsdo(1)  = 1.D0-x1-xmusdo1
      dsdo(2)  = 1.D0-x1-xmusdo2
      dsdob(1) = 1.D0-x2-xmusdo1
      dsdob(2) = 1.D0-x2-xmusdo2

      xneutsdow=0.D0

      if (amneut(nj).le.amneut(ni)) then
         do i=1,2
            do k=1,2
               xneutsdow=xneutsdow
     .              +g2**2/dsdo(i)/dsdo(k)*x1*y1
     .              *(ado(i,ni)*ado(k,ni)+bdo(i,ni)*bdo(k,ni))
     .              *(ado(i,nj)*ado(k,nj)+bdo(i,nj)*bdo(k,nj))
     .              +g2**2/dsdob(k)/dsdob(i)*x2*y2
     .              *(ado(i,ni)*ado(k,ni)+bdo(i,ni)*bdo(k,ni))*
     .               (ado(i,nj)*ado(k,nj)+bdo(i,nj)*bdo(k,nj))
     .              +g2**2/dsdob(k)/dsdo(i)
     .              *( ( ado(i,ni)*bdo(k,ni)*ado(k,nj)*bdo(i,nj)
     .                 + ado(i,nj)*bdo(k,nj)*ado(k,ni)*bdo(i,ni))
     .                *(-x1*y1-x2*y2+x3*y3)
     .               + 2.D0*xmneut(nj)/xmneut(ni)*y3*
     .               ( ado(i,ni)*ado(k,ni)*ado(k,nj)*ado(i,nj)
     .               + bdo(i,nj)*bdo(k,nj)*bdo(k,ni)*bdo(i,ni)))
            enddo
         enddo
      else
         xneutsdow=0.D0
      endif

c -------------------------------------------------------------------- c
c                               Z exchange
c -------------------------------------------------------------------- c

      xmuz = amzp**2/amneut(ni)**2
      dz   = y3-xmuz

      if (amneut(nj).le.amneut(ni)) then
         xneutzdow=g2**2*4.D0/dz**2*
     .        (((azzbotbot+vzzbotbot)**2*oppl(ni,nj)**2
     .        +(azzbotbot-vzzbotbot)**2*oppr(ni,nj)**2)*x2*y2
     .        +((azzbotbot+vzzbotbot)**2*oppr(ni,nj)**2
     .        +(azzbotbot-vzzbotbot)**2*oppl(ni,nj)**2)*x1*y1
     .        -4.D0*xmneut(nj)/xmneut(ni)*oppl(ni,nj)*oppr(ni,nj)
     .        *(azzbotbot**2+vzzbotbot**2)*y3 )
      else
         xneutzdow=0.D0
      endif

c -------------------------------------------------------------------- c
c                           Z-sdown interference
c -------------------------------------------------------------------- c
	
      xneutzsdow=0.D0

      if (amneut(nj).le.amneut(ni)) then
         do i=1,2
            xneutzsdow=xneutzsdow-g2**2*4.D0/dsdo(i)/dz
     .           *((ado(i,ni)*ado(i,nj)*oppr(ni,nj)*
     .           (azzbotbot+vzzbotbot)+
     .           bdo(i,ni)*bdo(i,nj)*oppl(ni,nj)*
     .           (-azzbotbot+vzzbotbot))*x1*y1
     .           -(ado(i,nj)*ado(i,ni)*oppl(ni,nj)*
     .            (azzbotbot+vzzbotbot)
     .           +bdo(i,nj)*bdo(i,ni)*oppr(ni,nj)*
     .            (-azzbotbot+vzzbotbot)
     .           )*xmneut(nj)/xmneut(ni)*y3)
     .           +g2**2*4.D0/dsdob(i)/dz
     .           *((ado(i,ni)*ado(i,nj)*oppl(ni,nj)*
     .           (azzbotbot+vzzbotbot)+
     .           bdo(i,ni)*bdo(i,nj)*oppr(ni,nj)*
     .           (-azzbotbot+vzzbotbot))*x2*y2
     .           -(ado(i,nj)*ado(i,ni)*oppr(ni,nj)*
     .            (azzbotbot+vzzbotbot)
     .           +bdo(i,nj)*bdo(i,ni)*oppl(ni,nj)*
     .            (-azzbotbot+vzzbotbot)
     .           )*xmneut(nj)/xmneut(ni)*y3)
         enddo
      else
         xneutzsdow=0.D0
      endif

c -------------------------------------------------------------------- c

      SD_neutdow = xneutsdow+xneutzdow+xneutzsdow

      end

c ==================================================================== c
c =======================  neutralino top topbar ===================== c
c ==================================================================== c

      double precision function SD_neuttop(x1,x2)

      implicit double precision (a-h,m,o-z)
      integer k,ni,nj

      dimension amneut(4),xmneut(4),amchar(2)
      dimension ahl(4,4),ahh(4,4),aa(4,4)
      dimension opl(2,2),opr(2,2),oppl(4,4),oppr(4,4)
      dimension atopr(2,4),btopr(2,4)
      dimension atopr1(2,4),btopr1(2,4),atopr2(2,4),btopr2(2,4)
      dimension sgn(4)
      dimension dst(2),dstb(2)

      COMMON/SD_scala/scalb,scalt
      COMMON/SD_yukawa/ytewsb,ybewsb,ytauewsb
      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_hmass/ama,aml,amh,amch,amar
      COMMON/SD_fermion/amt,amb,amtau
      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2
      COMMON/SD_indices/ni,nj
      COMMON/SD_coup1/ahl,ahh,aa
      COMMON/SD_coup4/opl,opr,oppl,oppr
      COMMON/SD_coup17/azztoptop,vzztoptop,azztautau,vzztautau,
     .                 azzneutneut,vzzneutneut,azzbotbot,vzzbotbot
      COMMON/SD_runcoupscale/scalechoice,scaleofcoupling,inumloop
      COMMON/SD_mwmzpole/amwp,amzp

c --- the running couplings ---

      if(scalechoice.eq.1.D0) then
         scalb = ybewsb/dsqrt(g2)
         scalt = ytewsb/dsqrt(g2)
      elseif(scalechoice.eq.2.D0) then         
         call SD_runmass(amneut(ni),0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      elseif(scalechoice.eq.3.D0) then
         call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      endif

      call SD_neutstoptop(atopr,btopr)
      do i=1,2,1
         do j=1,4,1
            atopr1(i,j)=atopr(i,j)
            btopr1(i,j)=btopr(i,j)
            atopr2(i,j)=atopr(i,j)
            btopr2(i,j)=btopr(i,j)
         end do
      end do

      call SD_phitoptop(hlttr,hhttr,hattr)

c --- several definitions ---

      do i=1,4,1
         sgn(i) = 1.D0
         if(xmneut(i).ge.0.D0) then
            sgn(i) = 1.D0
         elseif(xmneut(i).lt.0.D0) then
            sgn(i) = -1.D0
         endif
      enddo

      xmuneut1 = amneut(nj)**2/amneut(ni)**2
      xmust1   = ast1**2/amneut(ni)**2
      xmust2   = ast2**2/amneut(ni)**2
      xmut     = amt**2/amneut(ni)**2

      x3 = 2.D0-x1-x2
      y3 = 1.D0+xmuneut1-x3

      uh = 1.D0-x1+xmut
      th = 1.D0-x2+xmut

      vzz = vzztoptop
      azz = azztoptop

c -------------------------------------------------------------------- c
c                            stop exchange
c -------------------------------------------------------------------- c

      dst(1)  = 1.D0-x1-xmust1+xmut
      dst(2)  = 1.D0-x1-xmust2+xmut
      dstb(1) = 1.D0-x2-xmust1+xmut
      dstb(2) = 1.D0-x2-xmust2+xmut
      
      xneutstop=0.D0

c ---- final state masses included ----

      if ((amneut(nj)+2.D0*amt).le.amneut(ni)) then
         do i=1,2
            do k=1,2
               xneutstop=xneutstop
     .          +g2**2/dst(k)/dst(i)*(
     .           (atopr1(i,ni)*btopr1(k,ni)+btopr1(i,ni)*atopr1(k,ni))*
     .           (atopr1(i,nj)*btopr1(k,nj)+btopr1(i,nj)*atopr1(k,nj))*
     .           xmneut(nj)/xmneut(ni)*xmut*(-4.D0)+
     .           (atopr1(i,ni)*atopr1(k,ni)+btopr1(i,ni)*btopr1(k,ni))*
     .           (atopr1(i,nj)*btopr1(k,nj)+btopr1(i,nj)*atopr1(k,nj))*
     .           xmneut(nj)/xmneut(ni)*dsqrt(xmut)*sgn(ni)*2.D0*
     .           (uh-xmut-1.D0)+
     .           (atopr1(i,ni)*btopr1(k,ni)+btopr1(i,ni)*atopr1(k,ni))*
     .           (atopr1(i,nj)*atopr1(k,nj)+btopr1(i,nj)*btopr1(k,nj))*
     .           dsqrt(xmut)*sgn(ni)*2.D0*(uh-xmut-xmuneut1)+
     .           (atopr1(i,ni)*atopr1(k,ni)+btopr1(i,ni)*btopr1(k,ni))*
     .           (atopr1(i,nj)*atopr1(k,nj)+btopr1(i,nj)*btopr1(k,nj))*
     .           (-uh**2+uh*(1.D0+xmuneut1+2.D0*xmut)-(xmuneut1+xmut)*
     .           (1.D0+xmut)))
     .           +g2**2/dstb(k)/dstb(i)*(
     .           (atopr2(i,ni)*btopr2(k,ni)+btopr2(i,ni)*atopr2(k,ni))*
     .           (atopr2(i,nj)*btopr2(k,nj)+btopr2(i,nj)*atopr2(k,nj))*
     .           xmneut(nj)/xmneut(ni)*xmut*(-4.D0)+
     .           (atopr2(i,ni)*atopr2(k,ni)+btopr2(i,ni)*btopr2(k,ni))*
     .           (atopr2(i,nj)*btopr2(k,nj)+btopr2(i,nj)*atopr2(k,nj))*
     .           xmneut(nj)/xmneut(ni)*dsqrt(xmut)*sgn(ni)*2.D0*
     .           (th-xmut-1.D0)+
     .           (atopr2(i,ni)*btopr2(k,ni)+btopr2(i,ni)*atopr2(k,ni))*
     .           (atopr2(i,nj)*atopr2(k,nj)+btopr2(i,nj)*btopr2(k,nj))*
     .           dsqrt(xmut)*sgn(ni)*2.D0*(th-xmut-xmuneut1)+
     .           (atopr2(i,ni)*atopr2(k,ni)+btopr2(i,ni)*btopr2(k,ni))*
     .           (atopr2(i,nj)*atopr2(k,nj)+btopr2(i,nj)*btopr2(k,nj))*
     .           (-th**2+th*(1.D0+xmuneut1+2.D0*xmut)-(xmuneut1+xmut)*
     .           (1.D0+xmut)))
     .           -2.D0*g2**2/dst(k)/dstb(i)*(
     .           (btopr2(i,ni)*btopr1(k,ni)*atopr2(i,nj)*atopr1(k,nj)
     .           +atopr2(i,ni)*atopr1(k,ni)*btopr2(i,nj)*btopr1(k,nj))*
     .           xmneut(nj)/xmneut(ni)*xmut*(-2.D0)+
     .           (atopr2(i,ni)*btopr1(k,ni)*atopr2(i,nj)*atopr1(k,nj)
     .           +atopr1(k,ni)*btopr2(i,ni)*btopr2(i,nj)*btopr1(k,nj))*
     .           xmneut(nj)/xmneut(ni)*dsqrt(xmut)*sgn(ni)*
     .           (th-xmut-1.D0)+
     .           (atopr1(k,ni)*btopr2(i,ni)*atopr2(i,nj)*atopr1(k,nj)
     .           +atopr2(i,ni)*btopr1(k,ni)*btopr2(i,nj)*btopr1(k,nj))*
     .           xmneut(nj)/xmneut(ni)*dsqrt(xmut)*sgn(ni)*
     .           (uh-xmut-1.D0)+
     .           (atopr1(k,ni)*atopr2(i,ni)*atopr2(i,nj)*atopr1(k,nj)
     .           +btopr2(i,ni)*btopr1(k,ni)*btopr2(i,nj)*btopr1(k,nj))*
     .           xmneut(nj)/xmneut(ni)*(uh+th-xmuneut1-1.D0)+
     .           (atopr1(k,ni)*btopr2(i,ni)*atopr1(k,nj)*btopr2(i,nj)
     .           +btopr1(k,ni)*atopr2(i,ni)*atopr2(i,nj)*btopr1(k,nj))*
     .           xmut*(uh+th-2.D0*xmut)+
     .           (atopr1(k,ni)*atopr2(i,ni)*atopr1(k,nj)*btopr2(i,nj)
     .           +btopr1(k,ni)*btopr2(i,ni)*atopr2(i,nj)*btopr1(k,nj))*
     .           dsqrt(xmut)*sgn(ni)*(uh-xmut-xmuneut1)+
     .           (btopr1(k,ni)*btopr2(i,ni)*atopr1(k,nj)*btopr2(i,nj)
     .           +atopr1(k,ni)*atopr2(i,ni)*atopr2(i,nj)*btopr1(k,nj))*
     .           dsqrt(xmut)*sgn(ni)*(th-xmut-xmuneut1)+
     .           (btopr1(k,ni)*atopr2(i,ni)*atopr1(k,nj)*btopr2(i,nj)
     .           +atopr1(k,ni)*btopr2(i,ni)*atopr2(i,nj)*btopr1(k,nj))*
     .           (uh*th-xmut**2-xmuneut1))
            enddo
         enddo         
      else
         xneutstop=0.D0
      endif

c -------------------------------------------------------------------- c
c 	                     Z exchange
c -------------------------------------------------------------------- c

      xmuz = amzp**2/amneut(ni)**2
      dz   = y3-xmuz
      
      xneutztop=0.D0
 
c ---- final state masses included ----

      rh = xmuneut1+2.D0*xmut-th-uh+1.D0
      sh = (xmuneut1-th-uh+1.D0)*2.D0*xmut+4.D0*xmut**2
      rk = xmuneut1*(2.D0*xmut-th-uh+4.D0)+2.D0*xmut-uh-th

      if ((amneut(nj)+2.D0*amt).le.amneut(ni)) then
         xneutztop=xneutztop+g2**2/dz**2*(
     .    oppl(ni,nj)*oppr(ni,nj)*(vzz**2-azz**2)*
     .    xmneut(nj)/xmneut(ni)*xmut*(-16.D0/xmuz**2*rh**2+
     .    32.D0/xmuz*rh-64.D0)+
     .    oppl(ni,nj)*oppr(ni,nj)*(vzz**2+azz**2)*
     .    xmneut(nj)/xmneut(ni)*(8.D0/xmuz**2*rh*sh-16.D0/xmuz*sh
     .    -16.D0*(xmuneut1-uh-th+1.D0))+
     .    (oppl(ni,nj)**2+oppr(ni,nj)**2)*(vzz**2-azz**2)*
     .    xmut*(4.D0/xmuz**2*rh*rk-8.D0/xmuz*rk+8.D0*(uh+th-2.D0*xmut))
     .    +(oppl(ni,nj)**2+oppr(ni,nj)**2)*(vzz**2+azz**2)*
     .    (-2.D0/xmuz**2*rk*sh+8.D0/xmuz*(xmuneut1*(2.D0*xmut**2+
     .    4.D0*xmut-xmut*(th+uh))+2.D0*xmut**2-xmut*(uh+th))+4.D0*(
     .    xmuneut1*(uh+th-2.D0*xmut-2.D0)+2.D0*xmut*(uh+th-1.D0)
     .    -2.D0*xmut**2+th*(-th+1.D0)+uh*(-uh+1.D0)))+
     .    (oppl(ni,nj)**2-oppr(ni,nj)**2)*vzz*azz*8.D0*(
     .    xmuneut1*(th-uh)+2.D0*xmut*(th-uh)+th*(-th+1.D0)+uh*(uh-1.D0))
     .    )
      else
         xneutztop=0.D0
      endif

c -------------------------------------------------------------------- c
c                              Hl exchange
c -------------------------------------------------------------------- c

      xmuhl = aml**2/amneut(ni)**2
      dhl   = y3-xmuhl
      
      xneuthl=0.D0
  
c ---- final state masses included ----

      if ((amneut(nj)+2.D0*amt).le.amneut(ni)) then
         xneuthl=g2**2/dhl**2*hlttr**2*ahl(ni,nj)**2*(
     .    xmneut(nj)/xmneut(ni)*xmut*(-32.D0)+
     .    xmneut(nj)/xmneut(ni)*16.D0*(1.D0+xmuneut1-th-uh)+
     .    xmut*16.D0*(2.D0*xmut-th-uh)+
     .    8.D0*(xmuneut1*(uh+th-2.D0*xmut)+2.D0*xmut*(uh+th-1.D0)
     .    -(th+uh)**2+uh+th))
      else
         xneuthl=0.D0
      endif

c -------------------------------------------------------------------- c
c 			     HH exhange
c -------------------------------------------------------------------- c

      xmuhh = amh**2/amneut(ni)**2
      dhh   = y3-xmuhh

      xneuthh=0.D0

c ---- final state masses included ----

      if ((amneut(nj)+2.D0*amt).le.amneut(ni)) then
         xneuthh=g2**2/dhh**2*hhttr**2*ahh(ni,nj)**2*(
     .    xmneut(nj)/xmneut(ni)*xmut*(-32.D0)+
     .    xmneut(nj)/xmneut(ni)*16.D0*(1.D0+xmuneut1-th-uh)+
     .    xmut*16.D0*(2.D0*xmut-th-uh)+
     .    8.D0*(xmuneut1*(uh+th-2.D0*xmut)+2.D0*xmut*(uh+th-1.D0)
     .    -(th+uh)**2+uh+th))
      else
         xneuthh=0.D0
      endif

c -------------------------------------------------------------------- c
c                            HA exhange
c -------------------------------------------------------------------- c

      xmuha = ama**2/amneut(ni)**2
      da    = y3-xmuha
      
      xneuta=0.D0

c ---- final state masses included ----

      if ((amneut(nj)+2.D0*amt).le.amneut(ni)) then
         xneuta=g2**2/da**2*hattr**2*aa(ni,nj)**2*(
     .    xmneut(nj)/xmneut(ni)*xmut*(-32.D0)+
     .    xmneut(nj)/xmneut(ni)*(-16.D0)*(1.D0+xmuneut1-th-uh)+
     .    xmut*(-16.D0)*(2.D0*xmut-th-uh)+
     .    8.D0*(xmuneut1*(uh+th-2.D0*xmut)+2.D0*xmut*(uh+th-1.D0)
     .    -(th+uh)**2+uh+th))
      else
         xneuta=0.D0
      endif

c ------------------------------------------------------------------- c
c                         interference h-H
c ------------------------------------------------------------------- c

      xneuthhhl = 0.D0

c ---- final state masses included ----

      if((amneut(nj)+2.D0*amt).le.amneut(ni)) then
        xneuthhhl =2.D0*g2**2/dhh/dhl*hlttr*hhttr*(
     .   xmneut(nj)/xmneut(ni)*xmut*(-32.D0)+
     .   xmneut(nj)/xmneut(ni)*16.D0*(1.D0+xmuneut1-uh-th)+
     .   xmut*16.D0*(2.D0*xmut-th-uh)+
     .   8.D0*(xmuneut1*(uh+th-2.D0*xmut)+2.D0*xmut*(uh+th-1.D0)+th+uh
     .   -(th+uh)**2))*ahh(ni,nj)*ahl(ni,nj)
      else
         xneuthhhl =0.D0
      endif

c -------------------------------------------------------------------- c
c    	                 interference Z-stop
c -------------------------------------------------------------------- c

      xneutzstop=0.D0
 
c ---- final state masses included ----

      if ((amneut(nj)+2.D0*amt).le.amneut(ni)) then
         do i=1,2
            xneutzstop=xneutzstop
     .      +g2**2/dst(i)/dz*oppl(ni,nj)*(
     .      ((atopr1(i,ni)*atopr1(i,nj)-btopr1(i,ni)*btopr1(i,nj))*vzz-
     .       (atopr1(i,ni)*atopr1(i,nj)+btopr1(i,ni)*btopr1(i,nj))*azz)*
     .      xmneut(nj)/xmneut(ni)*xmut*(
     .      1/xmuz*(-4.D0)*(1.D0+xmuneut1+2.D0*xmut-uh-th)+16.D0) +
     .      ((atopr1(i,ni)*atopr1(i,nj)-btopr1(i,ni)*btopr1(i,nj))*vzz+
     .       (atopr1(i,ni)*atopr1(i,nj)+btopr1(i,ni)*btopr1(i,nj))*azz)*
     .      xmneut(nj)/xmneut(ni)*(2.D0/xmuz*((xmuneut1+1.D0-uh-th)*
     .      2.D0*xmut+4.D0*xmut**2)+4.D0*(1.D0+xmuneut1-uh-th)) +
     .      ((btopr1(i,ni)*btopr1(i,nj)-atopr1(i,ni)*atopr1(i,nj))*vzz+
     .       (btopr1(i,ni)*btopr1(i,nj)+atopr1(i,ni)*atopr1(i,nj))*azz)*
     .      xmut*(2.D0/xmuz*(xmuneut1*(2.D0*xmut-th-uh+4.D0)+2.D0*xmut
     .      -th-uh)+4.D0*(2.D0*xmut-th-uh)) +
     .      ((btopr1(i,ni)*btopr1(i,nj)-atopr1(i,ni)*atopr1(i,nj))*vzz-
     .       (btopr1(i,ni)*btopr1(i,nj)+atopr1(i,ni)*atopr1(i,nj))*azz)*
     .      (2.D0/xmuz*(xmuneut1*(-2.D0*xmut**2+xmut*th-2.D0*xmut+xmut*
     .       uh-2.D0*xmut)+xmut*(-2.D0*xmut+uh)+xmut*th)+4.D0*(
     .      xmuneut1*(xmut-uh+1.D0)+xmut*(xmut-uh)+xmut*(1.D0-uh)+uh**2
     .      -uh)) + 
     .      (atopr1(i,nj)*btopr1(i,ni)*(vzz+azz)-
     .       atopr1(i,ni)*btopr1(i,nj)*(vzz-azz))*
     .      xmneut(nj)/xmneut(ni)*dsqrt(xmut)*sgn(ni)*(2.D0/xmuz*
     .      (xmuneut1*(1.D0+xmut-uh)+1.D0+xmut*(xmut-uh)+xmut*
     .      (xmut-th-2.D0*uh+3.D0)+th*(uh-1.D0)+uh*(uh-2.D0))+
     .      4.D0*(1.D0+xmut-th)) +
     .      (atopr1(i,nj)*btopr1(i,ni)*(vzz-azz)-
     .       atopr1(i,ni)*btopr1(i,nj)*(vzz+azz))*
     .      xmneut(nj)/xmneut(ni)*dsqrt(xmut)*sgn(ni)*
     .      (2.D0/xmuz*(xmuneut1*(-1.D0-xmut+uh)-1.D0+xmut*(-1.D0+uh)
     .      +uh*(2.D0-th-uh)+th+xmut*(-2.D0*xmut+th+2.D0*uh-2.D0))+
     .      8.D0*(1.D0+xmut-uh)) +
     .      (atopr1(i,ni)*btopr1(i,nj)*(vzz-azz)-
     .       atopr1(i,nj)*btopr1(i,ni)*(vzz+azz))*dsqrt(xmut)*sgn(ni)*(
     .      (-2.D0)/xmuz*(xmuneut1-uh+xmut)*(xmuneut1+2.D0*xmut-th-uh
     .      +1.D0)+8.D0*(xmuneut1+xmut-uh)) +
     .      (atopr1(i,ni)*btopr1(i,nj)*(vzz+azz)-
     .       atopr1(i,nj)*btopr1(i,ni)*(vzz-azz))*dsqrt(xmut)*sgn(ni)*(
     .      2.D0/xmuz*(xmuneut1*(xmuneut1+3.D0*xmut-th-2.D0*uh+1.D0)+
     .      xmut*(2.D0*xmut-th-2.D0*uh)+xmut*(1.D0-uh)+uh*th+uh**2-uh)+
     .      4.D0*(xmuneut1+xmut-th)) )
     .      -g2**2/dstb(i)/dz*oppl(ni,nj)*(
     .      ((-atopr2(i,ni)*atopr2(i,nj)+btopr2(i,ni)*btopr2(i,nj))*vzz+
     .       (atopr2(i,ni)*atopr2(i,nj)+btopr2(i,ni)*btopr2(i,nj))*azz)*
     .      xmneut(nj)/xmneut(ni)*xmut*(
     .      1/xmuz*(-4.D0)*(1.D0+xmuneut1+2.D0*xmut-uh-th)+16.D0) +
     .      ((-atopr2(i,ni)*atopr2(i,nj)+btopr2(i,ni)*btopr2(i,nj))*vzz-
     .       (atopr2(i,ni)*atopr2(i,nj)+btopr2(i,ni)*btopr2(i,nj))*azz)*
     .      xmneut(nj)/xmneut(ni)*(2.D0/xmuz*(2.D0*xmut*(xmuneut1+1.D0
     .      -th-uh)+4.D0*xmut**2)+4.D0*(1.D0+xmuneut1-uh-th)) +
     .      ((atopr2(i,ni)*atopr2(i,nj)-btopr2(i,ni)*btopr2(i,nj))*vzz-
     .       (atopr2(i,ni)*atopr2(i,nj)+btopr2(i,ni)*btopr2(i,nj))*azz)*
     .      xmut*(2.D0/xmuz*(xmuneut1*(2.D0*xmut-th-uh+4.D0)+2.D0*xmut
     .      -th-uh)+4.D0*(2.D0*xmut-th-uh)) +
     .      ((atopr2(i,ni)*atopr2(i,nj)-btopr2(i,ni)*btopr2(i,nj))*vzz+
     .       (atopr2(i,ni)*atopr2(i,nj)+btopr2(i,ni)*btopr2(i,nj))*azz)*
     .      (2.D0/xmuz*(xmuneut1*(-2.D0*xmut**2+xmut*th-2.D0*xmut+xmut*
     .       uh-2.D0*xmut)+xmut*(-2.D0*xmut+uh)+xmut*th)+4.D0*(
     .      xmuneut1*(xmut-th+1.D0)+xmut*(xmut-th)+xmut*(1.D0-th)+th**2
     .      -th)) + 
     .      (atopr2(i,nj)*btopr2(i,ni)*(-vzz-azz)+
     .       atopr2(i,ni)*btopr2(i,nj)*(vzz-azz))*
     .      xmneut(nj)/xmneut(ni)*dsqrt(xmut)*sgn(ni)*
     .      (2.D0/xmuz*(xmuneut1*(1.D0+xmut-th)+1.D0+xmut*(2.D0*xmut
     .      -2.D0*th-uh+3.D0)+th*(th-xmut+uh-2.D0)-uh)+4.D0*(1.D0+xmut
     .      -uh)) +
     .      (atopr2(i,nj)*btopr2(i,ni)*(-vzz+azz)+
     .       atopr2(i,ni)*btopr2(i,nj)*(vzz+azz))*
     .      xmneut(nj)/xmneut(ni)*dsqrt(xmut)*sgn(ni)*
     .      (2.D0/xmuz*(xmuneut1*(-1.D0-xmut+th)-1.D0+xmut*(-xmut+th
     .      -1.D0)+xmut*(2.D0*th+uh-2.D0-xmut)-th*(th+uh)+2.D0*th+uh)+
     .      8.D0*(1.D0+xmut-th)) +
     .      (atopr2(i,ni)*btopr2(i,nj)*(-vzz+azz)+
     .       atopr2(i,nj)*btopr2(i,ni)*(vzz+azz))*dsqrt(xmut)*sgn(ni)*(
     .      2.D0/xmuz*(xmuneut1*(-xmuneut1-3.D0*xmut+2.D0*th+uh-1.D0)
     .      +xmut*(-2.D0*xmut+2.D0*th+uh-1.D0)+th*(xmut-th-uh+1.D0))
     .      +8.D0*(xmuneut1+xmut-th)) +
     .      (atopr2(i,ni)*btopr2(i,nj)*(-vzz-azz)+
     .       atopr2(i,nj)*btopr2(i,ni)*(vzz-azz))*dsqrt(xmut)*sgn(ni)*(
     .      2.D0/xmuz*(xmuneut1*(xmuneut1+3.D0*xmut-uh-2.D0*th+1.D0)+
     .      xmut*(xmut-th+1.D0)+xmut*(xmut-2.D0*th-uh)+uh*th+th**2-th)+
     .      4.D0*(xmuneut1+xmut-uh)) )
         enddo
      else
         xneutzstop=0.D0
      endif

c -------------------------------------------------------------------- c
c                        interference Hl-stop
c -------------------------------------------------------------------- c

      xneuthlstop=0.D0	

c ---- final state masses included ----

      if ((amneut(nj)+2.D0*amt).le.amneut(ni)) then
         do i=1,2
            xneuthlstop=xneuthlstop
     .       +2.D0*g2**2/dhl/dst(i)*(hlttr/dsqrt(2.D0))*
     .       (-2.D0)*ahl(ni,nj)*(
     .       (atopr1(i,nj)*atopr1(i,ni)+btopr1(i,ni)*btopr1(i,nj))*(
     .       dsqrt(xmut)*sgn(ni)*(xmuneut1+xmut-uh) +
     .       dsqrt(xmut)*sgn(ni)*(-xmuneut1-xmut+th) +
     .       xmneut(nj)/xmneut(ni)*dsqrt(xmut)*sgn(ni)*(-1.D0-xmut+th) +
     .       xmneut(nj)/xmneut(ni)*dsqrt(xmut)*sgn(ni)*(1.D0+xmut-uh) )
     .       +(atopr1(i,nj)*btopr1(i,ni)+atopr1(i,ni)*btopr1(i,nj))*(
     .       xmneut(nj)/xmneut(ni)*(-1.D0-xmuneut1+uh+th) +
     .       2.D0*xmneut(nj)/xmneut(ni)*xmut +
     .       xmut*(-2.D0*xmut+th+uh) +
     .       (uh**2+uh*th-uh*(1.D0+2.D0*xmut+xmuneut1)+xmut+xmuneut1*
     .       xmut)) ) 
     .       +2.D0*g2**2/dhl/dstb(i)*(hlttr/dsqrt(2.D0))*
     .       (-2.D0)*ahl(ni,nj)*(
     .       (atopr2(i,nj)*atopr2(i,ni)+btopr2(i,ni)*btopr2(i,nj))*(
     .       dsqrt(xmut)*sgn(ni)*(uh-xmuneut1-xmut) +
     .       dsqrt(xmut)*sgn(ni)*(-th+xmut+xmuneut1) +
     .       dsqrt(xmut)*sgn(ni)*xmneut(nj)/xmneut(ni)*(-th+1.D0+xmut) +
     .       dsqrt(xmut)*sgn(ni)*xmneut(nj)/xmneut(ni)*(uh-1.D0-xmut)) +
     .       (atopr2(i,nj)*btopr2(i,ni)+atopr2(i,ni)*btopr2(i,nj))*(
     .       2.D0*xmut*xmneut(nj)/xmneut(ni) +
     .       (uh*th+th**2-th*(1.D0+2.D0*xmut+xmuneut1)+xmut+
     .       xmut*xmuneut1) +
     .       xmneut(nj)/xmneut(ni)*(uh+th-xmuneut1-1.D0) +
     .       xmut*(uh+th-2.D0*xmut)) )
         enddo
      else
         xneuthlstop=0.D0
      endif

c -------------------------------------------------------------------- c
c                      interference HH-stop
c -------------------------------------------------------------------- c

      xneuthhstop=0.D0	

c ---- final state masses included ----

      if ((amneut(nj)+2.D0*amt).le.amneut(ni)) then
         do i=1,2
            xneuthhstop=xneuthhstop
     .       +2.D0*g2**2/dhh/dst(i)*(hhttr/dsqrt(2.D0))*
     .       (-2.D0)*ahh(ni,nj)*(
     .       (atopr1(i,nj)*atopr1(i,ni)+btopr1(i,ni)*btopr1(i,nj))*(
     .       dsqrt(xmut)*sgn(ni)*(xmuneut1+xmut-uh) +
     .       dsqrt(xmut)*sgn(ni)*(-xmuneut1-xmut+th) +
     .       xmneut(nj)/xmneut(ni)*dsqrt(xmut)*sgn(ni)*(-1.D0-xmut+th) +
     .       xmneut(nj)/xmneut(ni)*dsqrt(xmut)*sgn(ni)*(1.D0+xmut-uh) ) 
     .       +(atopr1(i,nj)*btopr1(i,ni)+atopr1(i,ni)*btopr1(i,nj))*(
     .       xmneut(nj)/xmneut(ni)*(-1.D0-xmuneut1+uh+th) +
     .       2.D0*xmneut(nj)/xmneut(ni)*xmut +
     .       xmut*(-2.D0*xmut+th+uh) +
     .       (uh**2+uh*th-uh*(1.D0+2.D0*xmut+xmuneut1)+xmut+xmuneut1*
     .       xmut)) ) 
     .       +2.D0*g2**2/dhh/dstb(i)*(hhttr/dsqrt(2.D0))*
     .       (-2.D0)*ahh(ni,nj)*(
     .       (atopr2(i,nj)*atopr2(i,ni)+btopr2(i,ni)*btopr2(i,nj))*(
     .       dsqrt(xmut)*sgn(ni)*(uh-xmuneut1-xmut) +
     .       dsqrt(xmut)*sgn(ni)*(-th+xmut+xmuneut1) +
     .       dsqrt(xmut)*sgn(ni)*xmneut(nj)/xmneut(ni)*(-th+1.D0+xmut) +
     .       dsqrt(xmut)*sgn(ni)*xmneut(nj)/xmneut(ni)*(uh-1.D0-xmut)) +
     .       (atopr2(i,nj)*btopr2(i,ni)+atopr2(i,ni)*btopr2(i,nj))*(
     .       2.D0*xmut*xmneut(nj)/xmneut(ni) +
     .       (uh*th+th**2-th*(1.D0+2.D0*xmut+xmuneut1)+xmut+
     .       xmut*xmuneut1) +
     .       xmneut(nj)/xmneut(ni)*(uh+th-xmuneut1-1.D0) +
     .       xmut*(uh+th-2.D0*xmut)) )
         enddo
      else
         xneuthhstop=0.D0
      endif

c -------------------------------------------------------------------- c
c 	                 interference HA-stop
c -------------------------------------------------------------------- c

      xneutastop=0.D0	
      
c ---- final state masses included ----

      if ((amneut(nj)+2.D0*amt).le.amneut(ni)) then
         do i=1,2
            xneutastop=xneutastop
     .       +2.D0*g2**2/da/dst(i)*(hattr/dsqrt(2.D0))*
     .       2.D0*aa(ni,nj)*(
     .       (atopr1(i,nj)*atopr1(i,ni)+btopr1(i,ni)*btopr1(i,nj))*(
     .       dsqrt(xmut)*sgn(ni)*(xmuneut1+xmut-uh) +
     .       dsqrt(xmut)*sgn(ni)*(-xmuneut1-xmut+th)*(-1.D0) +
     .       xmneut(nj)/xmneut(ni)*dsqrt(xmut)*sgn(ni)*(-1.D0-xmut+th)*
     .       (-1.D0) +
     .       xmneut(nj)/xmneut(ni)*dsqrt(xmut)*sgn(ni)*(1.D0+xmut-uh) ) 
     .       +(atopr1(i,nj)*btopr1(i,ni)+atopr1(i,ni)*btopr1(i,nj))*(
     .       xmneut(nj)/xmneut(ni)*(-1.D0-xmuneut1+uh+th)*(-1.D0) +
     .       2.D0*xmneut(nj)/xmneut(ni)*xmut +
     .       xmut*(-2.D0*xmut+th+uh)*(-1.D0) +
     .       (uh**2+uh*th-uh*(1.D0+2.D0*xmut+xmuneut1)+xmut+xmuneut1*
     .       xmut)) ) 
     .       +2.D0*g2**2/da/dstb(i)*(hattr/dsqrt(2.D0))*
     .       2.D0*aa(ni,nj)*(
     .       (atopr2(i,nj)*atopr2(i,ni)+btopr2(i,ni)*btopr2(i,nj))*(
     .       dsqrt(xmut)*sgn(ni)*(uh-xmuneut1-xmut)*(-1.D0) +
     .       dsqrt(xmut)*sgn(ni)*(-th+xmut+xmuneut1) +
     .       dsqrt(xmut)*sgn(ni)*xmneut(nj)/xmneut(ni)*(-th+1.D0+xmut) +
     .       dsqrt(xmut)*sgn(ni)*xmneut(nj)/xmneut(ni)*(uh-1.D0-xmut)*
     .       (-1.D0)) +
     .       (atopr2(i,nj)*btopr2(i,ni)+atopr2(i,ni)*btopr2(i,nj))*(
     .       2.D0*xmut*xmneut(nj)/xmneut(ni) +
     .       (uh*th+th**2-th*(1.D0+2.D0*xmut+xmuneut1)+xmut+
     .       xmut*xmuneut1) +
     .       xmneut(nj)/xmneut(ni)*(uh+th-xmuneut1-1.D0)*(-1.D0) +
     .       xmut*(uh+th-2.D0*xmut)*(-1.D0)) )
         enddo
      else
         xneutastop=0.D0
      endif

c -------------------------------------------------------------------- c
c 	                interference Z and H/h/A
c -------------------------------------------------------------------- c

      xneutza=0.D0	

      if ((amneut(nj)+amt+amt).le.amneut(ni)) then      
         xneutza=xneutza-4.D0*g2**2/da/dz*azz*
     .    hattr/dsqrt(2.D0)*2.D0*aa(ni,nj)*oppl(ni,nj)*(
     .    xmneut(nj)/xmneut(ni)*dsqrt(xmut)*sgn(ni)*(
     .    4.D0/xmuz*(2.D0+xmuneut1*(2.D0*xmut-th-uh+2.D0)+xmut*(-uh-th
     .    +1.D0+xmut)+xmut*(3.D0*xmut-3.D0*(th+uh)+5.D0)+(th+uh)**2
     .    -3.D0*(th+uh))+
     .    4.D0*(th-xmut-1.D0)+
     .    4.D0*(uh-xmut-1.D0))
     .    -dsqrt(xmut)*sgn(ni)*(
     .    4.D0/xmuz*(-2.D0*xmuneut1**2+xmuneut1*(-6.D0*xmut+
     .    3.D0*(th+uh)-2.D0)+xmut*(-xmut+th+uh-1.D0)+xmut*(-3.D0*xmut
     .    +3.D0*(uh+th)-1.D0)-(th+uh)**2+(th+uh))+
     .    4.D0*(xmuneut1+xmut-uh)+
     .    4.D0*(xmuneut1+xmut-th)) )
      else
         xneutza=0.D0
      endif

c -------------------------------------------------------------------- c

      SD_neuttop=xneutztop+xneuthl+xneuthh+xneuthhhl+xneuta+xneutstop
     .       +xneutzstop+xneuthlstop+xneuthhstop+xneutastop+xneutza

      end

c ==================================================================== c
c =========================  neutralino b bbar ======================= c
c ==================================================================== c

      double precision function SD_neutbot(x1,x2)

      implicit double precision (a-h,m,o-z)
      integer k,ni,nj

      dimension amneut(4),xmneut(4),amchar(2)
      dimension ahl(4,4),ahh(4,4),aa(4,4)
      dimension opl(2,2),opr(2,2),oppl(4,4),oppr(4,4)
      dimension abot(2,4),bbot(2,4)
      dimension abot1(2,4),bbot1(2,4),abot2(2,4),bbot2(2,4)
      dimension sgn(4)
      dimension dsbo(2),dsbob(2)

      COMMON/SD_scala/scalb,scalt
      COMMON/SD_yukawa/ytewsb,ybewsb,ytauewsb
      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_hmass/ama,aml,amh,amch,amar
      COMMON/SD_fermion/amt,amb,amtau
      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2
      COMMON/SD_indices/ni,nj
      COMMON/SD_coup1/ahl,ahh,aa
      COMMON/SD_coup4/opl,opr,oppl,oppr
      COMMON/SD_coup17/azztoptop,vzztoptop,azztautau,vzztautau,
     .                 azzneutneut,vzzneutneut,azzbotbot,vzzbotbot
      COMMON/SD_runcoupscale/scalechoice,scaleofcoupling,inumloop
      COMMON/SD_mwmzpole/amwp,amzp

c --- the running couplings ---

      if(scalechoice.eq.1.D0) then
         scalb = ybewsb/dsqrt(g2)
         scalt = ytewsb/dsqrt(g2)
      elseif(scalechoice.eq.2.D0) then         
         call SD_runmass(amneut(ni),0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      elseif(scalechoice.eq.3.D0) then
         call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      endif

      call SD_neutsbotbot(abot,bbot)
      do i=1,2,1
         do j=1,4,1
            abot1(i,j)=abot(i,j)
            bbot1(i,j)=bbot(i,j)
            abot2(i,j)=abot(i,j)
            bbot2(i,j)=bbot(i,j)
         end do
      end do

      call SD_phibotbot(hlbbr,hhbbr,habbr)

c --- several definitions

      do i=1,4,1
         sgn(i) = 1.D0
         if(xmneut(i).ge.0.D0) then
            sgn(i) = 1.D0
         elseif(xmneut(i).lt.0.D0) then
            sgn(i) = -1.D0
         endif
      enddo

      xmuneut1 = amneut(nj)**2/amneut(ni)**2
      xmub     = amb**2/amneut(ni)**2

      x3 = 2.D0-x1-x2
      y3 = 1.D0+xmuneut1-x3
      
      uh = 1.D0-x1+xmub
      th = 1.D0-x2+xmub

      vzz = vzzbotbot
      azz = azzbotbot

c -------------------------------------------------------------------- c
c 	                    sbottom exchange
c -------------------------------------------------------------------- c

      xmusb1 = asb1**2/amneut(ni)**2
      xmusb2 = asb2**2/amneut(ni)**2

      dsbo(1)  = 1.D0-x1-xmusb1+xmub
      dsbo(2)  = 1.D0-x1-xmusb2+xmub
      dsbob(1) = 1.D0-x2-xmusb1+xmub
      dsbob(2) = 1.D0-x2-xmusb2+xmub
      
      xneutsbot=0.D0

c ---- final state masses included ----

      if((amneut(nj)+2.D0*amb).le.amneut(ni)) then
         do i=1,2
            do k=1,2
               xneutsbot=xneutsbot
     .          +g2**2/dsbo(k)/dsbo(i)*(
     .           (abot1(i,ni)*bbot1(k,ni)+bbot1(i,ni)*abot1(k,ni))*
     .           (abot1(i,nj)*bbot1(k,nj)+bbot1(i,nj)*abot1(k,nj))*
     .           xmneut(nj)/xmneut(ni)*xmub*(-4.D0)+
     .           (abot1(i,ni)*abot1(k,ni)+bbot1(i,ni)*bbot1(k,ni))*
     .           (abot1(i,nj)*bbot1(k,nj)+bbot1(i,nj)*abot1(k,nj))*
     .           xmneut(nj)/xmneut(ni)*dsqrt(xmub)*sgn(ni)*2.D0*
     .           (uh-xmub-1.D0)+
     .           (abot1(i,ni)*bbot1(k,ni)+bbot1(i,ni)*abot1(k,ni))*
     .           (abot1(i,nj)*abot1(k,nj)+bbot1(i,nj)*bbot1(k,nj))*
     .           dsqrt(xmub)*sgn(ni)*2.D0*(uh-xmub-xmuneut1)+
     .           (abot1(i,ni)*abot1(k,ni)+bbot1(i,ni)*bbot1(k,ni))*
     .           (abot1(i,nj)*abot1(k,nj)+bbot1(i,nj)*bbot1(k,nj))*
     .           (-uh**2+uh*(1.D0+xmuneut1+2.D0*xmub)-(xmuneut1+xmub)*
     .           (1.D0+xmub)))
     .           +g2**2/dsbob(k)/dsbob(i)*(
     .           (abot2(i,ni)*bbot2(k,ni)+bbot2(i,ni)*abot2(k,ni))*
     .           (abot2(i,nj)*bbot2(k,nj)+bbot2(i,nj)*abot2(k,nj))*
     .           xmneut(nj)/xmneut(ni)*xmub*(-4.D0)+
     .           (abot2(i,ni)*abot2(k,ni)+bbot2(i,ni)*bbot2(k,ni))*
     .           (abot2(i,nj)*bbot2(k,nj)+bbot2(i,nj)*abot2(k,nj))*
     .           xmneut(nj)/xmneut(ni)*dsqrt(xmub)*sgn(ni)*2.D0*
     .           (th-xmub-1.D0)+
     .           (abot2(i,ni)*bbot2(k,ni)+bbot2(i,ni)*abot2(k,ni))*
     .           (abot2(i,nj)*abot2(k,nj)+bbot2(i,nj)*bbot2(k,nj))*
     .           dsqrt(xmub)*sgn(ni)*2.D0*(th-xmub-xmuneut1)+
     .           (abot2(i,ni)*abot2(k,ni)+bbot2(i,ni)*bbot2(k,ni))*
     .           (abot2(i,nj)*abot2(k,nj)+bbot2(i,nj)*bbot2(k,nj))*
     .           (-th**2+th*(1.D0+xmuneut1+2.D0*xmub)-(xmuneut1+xmub)*
     .           (1.D0+xmub)))
     .           -2.D0*g2**2/dsbo(k)/dsbob(i)*(
     .           (bbot2(i,ni)*bbot1(k,ni)*abot2(i,nj)*abot1(k,nj)
     .           +abot2(i,ni)*abot1(k,ni)*bbot2(i,nj)*bbot1(k,nj))*
     .           xmneut(nj)/xmneut(ni)*xmub*(-2.D0)+
     .           (abot2(i,ni)*bbot1(k,ni)*abot2(i,nj)*abot1(k,nj)
     .           +abot1(k,ni)*bbot2(i,ni)*bbot2(i,nj)*bbot1(k,nj))*
     .           xmneut(nj)/xmneut(ni)*dsqrt(xmub)*sgn(ni)*
     .           (th-xmub-1.D0)+
     .           (abot1(k,ni)*bbot2(i,ni)*abot2(i,nj)*abot1(k,nj)
     .           +abot2(i,ni)*bbot1(k,ni)*bbot2(i,nj)*bbot1(k,nj))*
     .           xmneut(nj)/xmneut(ni)*dsqrt(xmub)*sgn(ni)*
     .           (uh-xmub-1.D0)+
     .           (abot1(k,ni)*abot2(i,ni)*abot2(i,nj)*abot1(k,nj)
     .           +bbot2(i,ni)*bbot1(k,ni)*bbot2(i,nj)*bbot1(k,nj))*
     .           xmneut(nj)/xmneut(ni)*(uh+th-xmuneut1-1.D0)+
     .           (abot1(k,ni)*bbot2(i,ni)*abot1(k,nj)*bbot2(i,nj)
     .           +bbot1(k,ni)*abot2(i,ni)*abot2(i,nj)*bbot1(k,nj))*
     .           xmub*(uh+th-2.D0*xmub)+
     .           (abot1(k,ni)*abot2(i,ni)*abot1(k,nj)*bbot2(i,nj)
     .           +bbot1(k,ni)*bbot2(i,ni)*abot2(i,nj)*bbot1(k,nj))*
     .           dsqrt(xmub)*sgn(ni)*(uh-xmub-xmuneut1)+
     .           (bbot1(k,ni)*bbot2(i,ni)*abot1(k,nj)*bbot2(i,nj)
     .           +abot1(k,ni)*abot2(i,ni)*abot2(i,nj)*bbot1(k,nj))*
     .           dsqrt(xmub)*sgn(ni)*(th-xmub-xmuneut1)+
     .           (bbot1(k,ni)*abot2(i,ni)*abot1(k,nj)*bbot2(i,nj)
     .           +abot1(k,ni)*bbot2(i,ni)*abot2(i,nj)*bbot1(k,nj))*
     .           (uh*th-xmub**2-xmuneut1))
            enddo
         enddo         
      else
         xneutsbot=0.D0
      endif

c -------------------------------------------------------------------- c
c 			        Z exchange
c -------------------------------------------------------------------- c

      xmuz = amzp**2/amneut(ni)**2
      dz   = y3-xmuz
      
      xneutzbot=0.D0

c ---- final state masses included ----

      rh = xmuneut1+2.D0*xmub-th-uh+1.D0
      sh = (xmuneut1-th-uh+1.D0)*2.D0*xmub+4.D0*xmub**2
      rk = xmuneut1*(2.D0*xmub-th-uh+4.D0)+2.D0*xmub-uh-th

      if((amneut(nj)+2.D0*amb).le.amneut(ni)) then
         xneutzbot=xneutzbot+g2**2/dz**2*(
     .    oppl(ni,nj)*oppr(ni,nj)*(vzz**2-azz**2)*
     .    xmneut(nj)/xmneut(ni)*xmub*(-16.D0/xmuz**2*rh**2+
     .    32.D0/xmuz*rh-64.D0)+
     .    oppl(ni,nj)*oppr(ni,nj)*(vzz**2+azz**2)*
     .    xmneut(nj)/xmneut(ni)*(8.D0/xmuz**2*rh*sh-16.D0/xmuz*sh
     .    -16.D0*(xmuneut1-uh-th+1.D0))+
     .    (oppl(ni,nj)**2+oppr(ni,nj)**2)*(vzz**2-azz**2)*
     .    xmub*(4.D0/xmuz**2*rh*rk-8.D0/xmuz*rk+8.D0*(uh+th-2.D0*xmub))
     .    +(oppl(ni,nj)**2+oppr(ni,nj)**2)*(vzz**2+azz**2)*
     .    (-2.D0/xmuz**2*rk*sh+8.D0/xmuz*(xmuneut1*(2.D0*xmub**2+
     .    4.D0*xmub-xmub*(th+uh))+2.D0*xmub**2-xmub*(uh+th))+4.D0*(
     .    xmuneut1*(uh+th-2.D0*xmub-2.D0)+2.D0*xmub*(uh+th-1.D0)
     .    -2.D0*xmub**2+th*(-th+1.D0)+uh*(-uh+1.D0)))+
     .    (oppl(ni,nj)**2-oppr(ni,nj)**2)*vzz*azz*8.D0*(
     .    xmuneut1*(th-uh)+2.D0*xmub*(th-uh)+th*(-th+1.D0)+uh*(uh-1.D0))
     .    )
      else
         xneutzbot=0.D0
      endif

c -------------------------------------------------------------------- c
c                             Hl exchange
c -------------------------------------------------------------------- c

      xmuhl = aml**2/amneut(ni)**2
      dhl   = y3-xmuhl
      
      xneuthl=0.D0
  
c ---- final state masses included ----

      if((amneut(nj)+2.D0*amb).le.amneut(ni)) then
         xneuthl=g2**2/dhl**2*hlbbr**2*ahl(ni,nj)**2*(
     .    xmneut(nj)/xmneut(ni)*xmub*(-32.D0)+
     .    xmneut(nj)/xmneut(ni)*16.D0*(1.D0+xmuneut1-th-uh)+
     .    xmub*16.D0*(2.D0*xmub-th-uh)+
     .    8.D0*(xmuneut1*(uh+th-2.D0*xmub)+2.D0*xmub*(uh+th-1.D0)
     .    -(th+uh)**2+uh+th))
      else
         xneuthl=0.D0
      endif

c -------------------------------------------------------------------- c
c                              HH exhange
c -------------------------------------------------------------------- c

      xmuhh = amh**2/amneut(ni)**2
      dhh   = y3-xmuhh

      xneuthh=0.D0

c ---- final state masses included ----

      if((amneut(nj)+2.D0*amb).le.amneut(ni)) then
         xneuthh=g2**2/dhh**2*hhbbr**2*ahh(ni,nj)**2*(
     .    xmneut(nj)/xmneut(ni)*xmub*(-32.D0)+
     .    xmneut(nj)/xmneut(ni)*16.D0*(1.D0+xmuneut1-th-uh)+
     .    xmub*16.D0*(2.D0*xmub-th-uh)+
     .    8.D0*(xmuneut1*(uh+th-2.D0*xmub)+2.D0*xmub*(uh+th-1.D0)
     .    -(th+uh)**2+uh+th))
      else
         xneuthh=0.D0
      endif

c -------------------------------------------------------------------- c
c                              HA exhange
c -------------------------------------------------------------------- c

      xmuha = ama**2/amneut(ni)**2
      da    = y3-xmuha
      
      xneuta=0.D0

c ---- final state masses included ----

      if((amneut(nj)+2.D0*amb).le.amneut(ni)) then
         xneuta=g2**2/da**2*habbr**2*aa(ni,nj)**2*(
     .    xmneut(nj)/xmneut(ni)*xmub*(-32.D0)+
     .    xmneut(nj)/xmneut(ni)*(-16.D0)*(1.D0+xmuneut1-th-uh)+
     .    xmub*(-16.D0)*(2.D0*xmub-th-uh)+
     .    8.D0*(xmuneut1*(uh+th-2.D0*xmub)+2.D0*xmub*(uh+th-1.D0)
     .    -(th+uh)**2+uh+th))
      else
         xneuta=0.D0
      endif

c -------------------------------------------------------------------- c
c 	                     interference h-H
c -------------------------------------------------------------------- c

      xneuthhhl = 0.D0

c ---- final state masses included ----

      if((amneut(nj)+2.D0*amb).le.amneut(ni)) then
        xneuthhhl =2.D0*g2**2/dhh/dhl*hlbbr*hhbbr*(
     .   xmneut(nj)/xmneut(ni)*xmub*(-32.D0)+
     .   xmneut(nj)/xmneut(ni)*16.D0*(1.D0+xmuneut1-uh-th)+
     .   xmub*16.D0*(2.D0*xmub-th-uh)+
     .   8.D0*(xmuneut1*(uh+th-2.D0*xmub)+2.D0*xmub*(uh+th-1.D0)+th+uh
     .   -(th+uh)**2))*ahh(ni,nj)*ahl(ni,nj)
      else
         xneuthhhl =0.D0
      endif

c -------------------------------------------------------------------- c
c 	                 interference Z-sbottom
c -------------------------------------------------------------------- c

      xneutzsbot=0.D0

c ---- final state masses included ----

      if((amneut(nj)+2.D0*amb).le.amneut(ni)) then
         do i=1,2
            xneutzsbot=xneutzsbot
     .      +g2**2/dsbo(i)/dz*oppl(ni,nj)*(
     .      ((abot1(i,ni)*abot1(i,nj)-bbot1(i,ni)*bbot1(i,nj))*vzz-
     .       (abot1(i,ni)*abot1(i,nj)+bbot1(i,ni)*bbot1(i,nj))*azz)*
     .      xmneut(nj)/xmneut(ni)*xmub*(
     .      1/xmuz*(-4.D0)*(1.D0+xmuneut1+2.D0*xmub-uh-th)+16.D0) +
     .      ((abot1(i,ni)*abot1(i,nj)-bbot1(i,ni)*bbot1(i,nj))*vzz+
     .       (abot1(i,ni)*abot1(i,nj)+bbot1(i,ni)*bbot1(i,nj))*azz)*
     .      xmneut(nj)/xmneut(ni)*(2.D0/xmuz*((xmuneut1+1.D0-uh-th)*
     .      2.D0*xmub+4.D0*xmub**2)+4.D0*(1.D0+xmuneut1-uh-th)) +
     .      ((bbot1(i,ni)*bbot1(i,nj)-abot1(i,ni)*abot1(i,nj))*vzz+
     .       (bbot1(i,ni)*bbot1(i,nj)+abot1(i,ni)*abot1(i,nj))*azz)*
     .      xmub*(2.D0/xmuz*(xmuneut1*(2.D0*xmub-th-uh+4.D0)+2.D0*xmub
     .      -th-uh)+4.D0*(2.D0*xmub-th-uh)) +
     .      ((bbot1(i,ni)*bbot1(i,nj)-abot1(i,ni)*abot1(i,nj))*vzz-
     .       (bbot1(i,ni)*bbot1(i,nj)+abot1(i,ni)*abot1(i,nj))*azz)*
     .      (2.D0/xmuz*(xmuneut1*(-2.D0*xmub**2+xmub*th-2.D0*xmub+xmub*
     .       uh-2.D0*xmub)+xmub*(-2.D0*xmub+uh)+xmub*th)+4.D0*(
     .      xmuneut1*(xmub-uh+1.D0)+xmub*(xmub-uh)+xmub*(1.D0-uh)+uh**2
     .      -uh)) + 
     .      (abot1(i,nj)*bbot1(i,ni)*(vzz+azz)-
     .       abot1(i,ni)*bbot1(i,nj)*(vzz-azz))*
     .      xmneut(nj)/xmneut(ni)*dsqrt(xmub)*sgn(ni)*
     .      (2.D0/xmuz*(xmuneut1*(1.D0+xmub-uh)+1.D0+xmub*(xmub-uh)+
     .      xmub*(xmub-th-2.D0*uh+3.D0)+th*(uh-1.D0)+uh*(uh-2.D0))+
     .      4.D0*(1.D0+xmub-th)) +
     .      (abot1(i,nj)*bbot1(i,ni)*(vzz-azz)-
     .       abot1(i,ni)*bbot1(i,nj)*(vzz+azz))*
     .      xmneut(nj)/xmneut(ni)*dsqrt(xmub)*sgn(ni)*(2.D0/xmuz*
     .      (xmuneut1*(-1.D0-xmub+uh)-1.D0+xmub*(-1.D0+uh)+uh*(2.D0-th
     .      -uh)+th+xmub*(-2.D0*xmub+th+2.D0*uh-2.D0))+8.D0*(1.D0+xmub-
     .      uh)) +
     .      (abot1(i,ni)*bbot1(i,nj)*(vzz-azz)-
     .       abot1(i,nj)*bbot1(i,ni)*(vzz+azz))*dsqrt(xmub)*sgn(ni)*(
     .      (-2.D0)/xmuz*(xmuneut1-uh+xmub)*(xmuneut1+2.D0*xmub-th-uh
     .      +1.D0)+8.D0*(xmuneut1+xmub-uh)) +
     .      (abot1(i,ni)*bbot1(i,nj)*(vzz+azz)-
     .       abot1(i,nj)*bbot1(i,ni)*(vzz-azz))*dsqrt(xmub)*sgn(ni)*(
     .      2.D0/xmuz*(xmuneut1*(xmuneut1+3.D0*xmub-th-2.D0*uh+1.D0)+
     .      xmub*(2.D0*xmub-th-2.D0*uh)+xmub*(1.D0-uh)+uh*th+uh**2-uh)+
     .      4.D0*(xmuneut1+xmub-th)) )
     .      -g2**2/dsbob(i)/dz*oppl(ni,nj)*(
     .      ((-abot2(i,ni)*abot2(i,nj)+bbot2(i,ni)*bbot2(i,nj))*vzz+
     .       (abot2(i,ni)*abot2(i,nj)+bbot2(i,ni)*bbot2(i,nj))*azz)*
     .      xmneut(nj)/xmneut(ni)*xmub*(
     .      1/xmuz*(-4.D0)*(1.D0+xmuneut1+2.D0*xmub-uh-th)+16.D0) +
     .      ((-abot2(i,ni)*abot2(i,nj)+bbot2(i,ni)*bbot2(i,nj))*vzz-
     .       (abot2(i,ni)*abot2(i,nj)+bbot2(i,ni)*bbot2(i,nj))*azz)*
     .      xmneut(nj)/xmneut(ni)*(2.D0/xmuz*(2.D0*xmub*(xmuneut1+1.D0
     .      -th-uh)+4.D0*xmub**2)+4.D0*(1.D0+xmuneut1-uh-th)) +
     .      ((abot2(i,ni)*abot2(i,nj)-bbot2(i,ni)*bbot2(i,nj))*vzz-
     .       (abot2(i,ni)*abot2(i,nj)+bbot2(i,ni)*bbot2(i,nj))*azz)*
     .      xmub*(2.D0/xmuz*(xmuneut1*(2.D0*xmub-th-uh+4.D0)+2.D0*xmub
     .      -th-uh)+4.D0*(2.D0*xmub-th-uh)) +
     .      ((abot2(i,ni)*abot2(i,nj)-bbot2(i,ni)*bbot2(i,nj))*vzz+
     .       (abot2(i,ni)*abot2(i,nj)+bbot2(i,ni)*bbot2(i,nj))*azz)*
     .      (2.D0/xmuz*(xmuneut1*(-2.D0*xmub**2+xmub*th-2.D0*xmub+xmub*
     .       uh-2.D0*xmub)+xmub*(-2.D0*xmub+uh)+xmub*th)+4.D0*(
     .      xmuneut1*(xmub-th+1.D0)+xmub*(xmub-th)+xmub*(1.D0-th)+th**2
     .      -th)) + 
     .      (abot2(i,nj)*bbot2(i,ni)*(-vzz-azz)+
     .       abot2(i,ni)*bbot2(i,nj)*(vzz-azz))*
     .      xmneut(nj)/xmneut(ni)*dsqrt(xmub)*sgn(ni)*(2.D0/xmuz*
     .      (xmuneut1*(1.D0+xmub-th)+1.D0+xmub*(2.D0*xmub-2.D0*th-uh+
     .      3.D0)+th*(th-xmub+uh-2.D0)-uh)+4.D0*(1.D0+xmub-uh)) +
     .      (abot2(i,nj)*bbot2(i,ni)*(-vzz+azz)+
     .       abot2(i,ni)*bbot2(i,nj)*(vzz+azz))*
     .      xmneut(nj)/xmneut(ni)*dsqrt(xmub)*sgn(ni)*(2.D0/xmuz*
     .      (xmuneut1*(-1.D0-xmub+th)-1.D0+xmub*(-xmub+th-1.D0)+xmub*
     .      (2.D0*th+uh-2.D0-xmub)-th*(th+uh)+2.D0*th+uh)+8.D0*(1.D0
     .      +xmub-th)) +
     .      (abot2(i,ni)*bbot2(i,nj)*(-vzz+azz)+
     .       abot2(i,nj)*bbot2(i,ni)*(vzz+azz))*dsqrt(xmub)*sgn(ni)*(
     .      2.D0/xmuz*(xmuneut1*(-xmuneut1-3.D0*xmub+2.D0*th+uh-1.D0)
     .      +xmub*(-2.D0*xmub+2.D0*th+uh-1.D0)+th*(xmub-th-uh+1))
     .      +8.D0*(xmuneut1+xmub-th)) +
     .      (abot2(i,ni)*bbot2(i,nj)*(-vzz-azz)+
     .       abot2(i,nj)*bbot2(i,ni)*(vzz-azz))*dsqrt(xmub)*sgn(ni)*(
     .      2.D0/xmuz*(xmuneut1*(xmuneut1+3.D0*xmub-uh-2.D0*th+1.D0)+
     .      xmub*(xmub-th+1.D0)+xmub*(xmub-2.D0*th-uh)+uh*th+th**2-th)+
     .      4.D0*(xmuneut1+xmub-uh)) )
         enddo
      else
         xneutzsbot=0.D0
      endif

c -------------------------------------------------------------------- c
c 			interference Hl-sbottom
c -------------------------------------------------------------------- c

      xneuthlsbot=0.D0	

c ---- final state masses included ----

      if((amneut(nj)+2.D0*amb).le.amneut(ni)) then
         do i=1,2
            xneuthlsbot=xneuthlsbot
     .       +2.D0*g2**2/dhl/dsbo(i)*(hlbbr/dsqrt(2.D0))*
     .       (-2.D0)*ahl(ni,nj)*(
     .       (abot1(i,nj)*abot1(i,ni)+bbot1(i,ni)*bbot1(i,nj))*(
     .       dsqrt(xmub)*sgn(ni)*(xmuneut1+xmub-uh) +
     .       dsqrt(xmub)*sgn(ni)*(-xmuneut1-xmub+th) +
     .       xmneut(nj)/xmneut(ni)*dsqrt(xmub)*sgn(ni)*(-1.D0-xmub+th) +
     .       xmneut(nj)/xmneut(ni)*dsqrt(xmub)*sgn(ni)*(1.D0+xmub-uh) )
     .       +(abot1(i,nj)*bbot1(i,ni)+abot1(i,ni)*bbot1(i,nj))*(
     .       xmneut(nj)/xmneut(ni)*(-1.D0-xmuneut1+uh+th) +
     .       2.D0*xmneut(nj)/xmneut(ni)*xmub +
     .       xmub*(-2.D0*xmub+th+uh) +
     .       (uh**2+uh*th-uh*(1.D0+2.D0*xmub+xmuneut1)+xmub+xmuneut1*
     .       xmub)) ) 
     .       +2.D0*g2**2/dhl/dsbob(i)*(hlbbr/dsqrt(2.D0))*
     .       (-2.D0)*ahl(ni,nj)*(
     .       (abot2(i,nj)*abot2(i,ni)+bbot2(i,ni)*bbot2(i,nj))*(
     .       dsqrt(xmub)*sgn(ni)*(uh-xmuneut1-xmub) +
     .       dsqrt(xmub)*sgn(ni)*(-th+xmub+xmuneut1) +
     .       dsqrt(xmub)*sgn(ni)*xmneut(nj)/xmneut(ni)*(-th+1.D0+xmub) +
     .       dsqrt(xmub)*sgn(ni)*xmneut(nj)/xmneut(ni)*(uh-1.D0-xmub)) +
     .       (abot2(i,nj)*bbot2(i,ni)+abot2(i,ni)*bbot2(i,nj))*(
     .       2.D0*xmub*xmneut(nj)/xmneut(ni) +
     .       (uh*th+th**2-th*(1.D0+2.D0*xmub+xmuneut1)+xmub+
     .       xmub*xmuneut1) +
     .       xmneut(nj)/xmneut(ni)*(uh+th-xmuneut1-1.D0) +
     .       xmub*(uh+th-2.D0*xmub)) )
         enddo
      else
         xneuthlsbot=0.D0
      endif

c -------------------------------------------------------------------- c
c                         interference HH-sbottom
c -------------------------------------------------------------------- c

      xneuthhsbot=0.D0	

c ---- final state masses included ----

      if((amneut(nj)+2.D0*amb).le.amneut(ni)) then
         do i=1,2
            xneuthhsbot=xneuthhsbot
     .       +2.D0*g2**2/dhh/dsbo(i)*(hhbbr/dsqrt(2.D0))*
     .       (-2.D0)*ahh(ni,nj)*(
     .       (abot1(i,nj)*abot1(i,ni)+bbot1(i,ni)*bbot1(i,nj))*(
     .       dsqrt(xmub)*sgn(ni)*(xmuneut1+xmub-uh) +
     .       dsqrt(xmub)*sgn(ni)*(-xmuneut1-xmub+th) +
     .       xmneut(nj)/xmneut(ni)*dsqrt(xmub)*sgn(ni)*(-1.D0-xmub+th) +
     .       xmneut(nj)/xmneut(ni)*dsqrt(xmub)*sgn(ni)*(1.D0+xmub-uh) ) 
     .       +(abot1(i,nj)*bbot1(i,ni)+abot1(i,ni)*bbot1(i,nj))*(
     .       xmneut(nj)/xmneut(ni)*(-1.D0-xmuneut1+uh+th) +
     .       2.D0*xmneut(nj)/xmneut(ni)*xmub +
     .       xmub*(-2.D0*xmub+th+uh) +
     .       (uh**2+uh*th-uh*(1.D0+2.D0*xmub+xmuneut1)+xmub+xmuneut1*
     .       xmub)) ) 
     .       +2.D0*g2**2/dhh/dsbob(i)*(hhbbr/dsqrt(2.D0))*
     .       (-2.D0)*ahh(ni,nj)*(
     .       (abot2(i,nj)*abot2(i,ni)+bbot2(i,ni)*bbot2(i,nj))*(
     .       dsqrt(xmub)*sgn(ni)*(uh-xmuneut1-xmub) +
     .       dsqrt(xmub)*sgn(ni)*(-th+xmub+xmuneut1) +
     .       dsqrt(xmub)*sgn(ni)*xmneut(nj)/xmneut(ni)*(-th+1.D0+xmub) +
     .       dsqrt(xmub)*sgn(ni)*xmneut(nj)/xmneut(ni)*(uh-1.D0-xmub)) +
     .       (abot2(i,nj)*bbot2(i,ni)+abot2(i,ni)*bbot2(i,nj))*(
     .       2.D0*xmub*xmneut(nj)/xmneut(ni) +
     .       (uh*th+th**2-th*(1.D0+2.D0*xmub+xmuneut1)+xmub+
     .       xmub*xmuneut1) +
     .       xmneut(nj)/xmneut(ni)*(uh+th-xmuneut1-1.D0) +
     .       xmub*(uh+th-2.D0*xmub)) )
         enddo
      else
         xneuthhsbot=0.D0
      endif

c -------------------------------------------------------------------- c
c                        interference HA-sbottom
c -------------------------------------------------------------------- c

      xneutasbot=0.D0	

c ---- final state masses included ----

      if((amneut(nj)+2.D0*amb).le.amneut(ni)) then
         do i=1,2
            xneutasbot=xneutasbot
     .       +2.D0*g2**2/da/dsbo(i)*(habbr/dsqrt(2.D0))*
     .       2.D0*aa(ni,nj)*(
     .       (abot1(i,nj)*abot1(i,ni)+bbot1(i,ni)*bbot1(i,nj))*(
     .       dsqrt(xmub)*sgn(ni)*(xmuneut1+xmub-uh) +
     .       dsqrt(xmub)*sgn(ni)*(-xmuneut1-xmub+th)*(-1.D0) +
     .       xmneut(nj)/xmneut(ni)*dsqrt(xmub)*sgn(ni)*(-1.D0-xmub+th)*
     .       (-1.D0) +
     .       xmneut(nj)/xmneut(ni)*dsqrt(xmub)*sgn(ni)*(1.D0+xmub-uh) ) 
     .       +(abot1(i,nj)*bbot1(i,ni)+abot1(i,ni)*bbot1(i,nj))*(
     .       xmneut(nj)/xmneut(ni)*(-1.D0-xmuneut1+uh+th)*(-1.D0) +
     .       2.D0*xmneut(nj)/xmneut(ni)*xmub +
     .       xmub*(-2.D0*xmub+th+uh)*(-1.D0) +
     .       (uh**2+uh*th-uh*(1.D0+2.D0*xmub+xmuneut1)+xmub+xmuneut1*
     .       xmub)) ) 
     .       +2.D0*g2**2/da/dsbob(i)*(habbr/dsqrt(2.D0))*
     .       2.D0*aa(ni,nj)*(
     .       (abot2(i,nj)*abot2(i,ni)+bbot2(i,ni)*bbot2(i,nj))*(
     .       dsqrt(xmub)*sgn(ni)*(uh-xmuneut1-xmub)*(-1.D0) +
     .       dsqrt(xmub)*sgn(ni)*(-th+xmub+xmuneut1) +
     .       dsqrt(xmub)*sgn(ni)*xmneut(nj)/xmneut(ni)*(-th+1.D0+xmub) +
     .       dsqrt(xmub)*sgn(ni)*xmneut(nj)/xmneut(ni)*(uh-1.D0-xmub)*
     .       (-1.D0)) +
     .       (abot2(i,nj)*bbot2(i,ni)+abot2(i,ni)*bbot2(i,nj))*(
     .       2.D0*xmub*xmneut(nj)/xmneut(ni) +
     .       (uh*th+th**2-th*(1.D0+2.D0*xmub+xmuneut1)+xmub+
     .       xmub*xmuneut1) +
     .       xmneut(nj)/xmneut(ni)*(uh+th-xmuneut1-1.D0)*(-1.D0) +
     .       xmub*(uh+th-2.D0*xmub)*(-1.D0)) )
         enddo
      else
         xneutasbot=0.D0
      endif

c -------------------------------------------------------------------- c
c 	                interference Z and H/h/A
c -------------------------------------------------------------------- c

      xneutza=0.D0	

      if((amneut(nj)+2.D0*amb).le.amneut(ni)) then      
         xneutza=-4.D0*g2**2/da/dz*azz*
     .    habbr/dsqrt(2.D0)*2.D0*aa(ni,nj)*oppl(ni,nj)*(
     .    xmneut(nj)/xmneut(ni)*dsqrt(xmub)*sgn(ni)*(
     .    4.D0/xmuz*(2.D0+xmuneut1*(2.D0*xmub-th-uh+2.D0)+xmub*(-uh-th
     .    +1.D0+xmub)+xmub*(3.D0*xmub-3.D0*(th+uh)+5.D0)+(th+uh)**2
     .    -3.D0*(th+uh))+
     .    4.D0*(th-xmub-1.D0)+
     .    4.D0*(uh-xmub-1.D0))
     .    -dsqrt(xmub)*sgn(ni)*(
     .    4.D0/xmuz*(-2.D0*xmuneut1**2+xmuneut1*(-6.D0*xmub+
     .    3.D0*(th+uh)-2.D0)+xmub*(-xmub+th+uh-1.D0)+xmub*(-3.D0*xmub
     .    +3.D0*(uh+th)-1.D0)-(th+uh)**2+(th+uh))+
     .    4.D0*(xmuneut1+xmub-uh)+
     .    4.D0*(xmuneut1+xmub-th)) )
      else
         xneutza=0.D0
      endif

c -------------------------------------------------------------------- c

      SD_neutbot=xneutzbot+xneuthl+xneuthh+xneuthhhl+xneuta+xneutsbot
     .        +xneutzsbot+xneuthlsbot+xneuthhsbot+xneutasbot+xneutza

      end

c ==================================================================== c
c =========================  neutralino e+ e- ======================== c
c ==================================================================== c

      double precision function SD_neutel(x1,x2)

      implicit double precision (a-h,m,o-z)
      integer k

      dimension amneut(4),xmneut(4),amchar(2)
      dimension opl(2,2),opr(2,2),oppl(4,4),oppr(4,4)
      dimension dsel(2),dselb(2)
      dimension ae(2,4),be(2,4),ato(2,4),bto(2,4),anu(2,4),bnu(2,4),
     .          antau(2,4),bntau(2,4)

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_sfermionetau/ase1,ase2,astau1,astau2
      COMMON/SD_indices/ni,nj
      COMMON/SD_coup4/opl,opr,oppl,oppr
      COMMON/SD_coup8/ae,be,ato,bto,anu,bnu,antau,bntau      
      COMMON/SD_coup17/azztoptop,vzztoptop,azztautau,vzztautau,
     .                 azzneutneut,vzzneutneut,azzbotbot,vzzbotbot
      COMMON/SD_mwmzpole/amwp,amzp

      xmuneut1 = amneut(nj)**2/amneut(ni)**2

      x3 = 2.D0-x1-x2
      y1 = 1.D0-xmuneut1-x1
      y2 = 1.D0-xmuneut1-x2
      y3 = 1.D0+xmuneut1-x3

c -------------------------------------------------------------------- c
c                          selectron exchange
c -------------------------------------------------------------------- c

      xmusel1 = ase1**2/amneut(ni)**2
      xmusel2 = ase2**2/amneut(ni)**2

      dsel(1)  = 1-x1-xmusel1
      dsel(2)  = 1-x1-xmusel2
      dselb(1) = 1-x2-xmusel1
      dselb(2) = 1-x2-xmusel2
      
      xneutsel=0.D0

      if (amneut(nj).le.amneut(ni)) then
         do i=1,2
            do k=1,2
               xneutsel=xneutsel
     .              +g2**2/dsel(k)/dsel(i)*x1*y1*
     .               (ae(i,ni)*ae(k,ni)+be(i,ni)*be(k,ni))*
     .               (ae(i,nj)*ae(k,nj)+be(i,nj)*be(k,nj))
     .              +g2**2/dselb(k)/dselb(i)*x2*y2*
     .               (ae(i,ni)*ae(k,ni)+be(i,ni)*be(k,ni))*
     .               (ae(i,nj)*ae(k,nj)+be(i,nj)*be(k,nj))
     .              +g2**2/dselb(k)/dsel(i)*
     .               ( ( ae(i,ni)*be(k,ni)*ae(k,nj)*be(i,nj)
     .                  +ae(i,nj)*be(k,nj)*ae(k,ni)*be(i,ni))
     .                 *(-x1*y1-x2*y2+x3*y3)
     .                +2.D0*xmneut(nj)/xmneut(ni)*y3*
     .                 ( ae(i,ni)*ae(k,ni)*ae(k,nj)*ae(i,nj)
     .                  +be(i,nj)*be(k,nj)*be(k,ni)*be(i,ni)))
            enddo
         enddo
      else
         xneutsel=0.D0
      endif

c -------------------------------------------------------------------- c
c                              Z exchange
c -------------------------------------------------------------------- c

      xmuz = amzp**2/amneut(ni)**2
      dz   = y3-xmuz
      
      xneutzel=0.D0

      if (amneut(nj).le.amneut(ni)) then
         xneutzel=g2**2*4.D0/dz**2*
     .        (((azztautau+vzztautau)**2*oppl(ni,nj)**2
     .        + (azztautau-vzztautau)**2*oppr(ni,nj)**2)*x2*y2
     .        +((azztautau+vzztautau)**2*oppr(ni,nj)**2
     .        + (azztautau-vzztautau)**2*oppl(ni,nj)**2)*x1*y1
     .        -4.D0*xmneut(nj)/xmneut(ni)*oppl(ni,nj)*oppr(ni,nj)
     .        *(azztautau**2+vzztautau**2)*y3 )
      else
         xneutzel=0.D0
      endif
	
c -------------------------------------------------------------------- c
c                        Z-selectron interference
c -------------------------------------------------------------------- c

      xneutzsel=0.D0

      if (amneut(nj).le.amneut(ni)) then
         do i=1,2
           xneutzsel=xneutzsel-g2**2*4.D0/dsel(i)/dz
     .      *((ae(i,ni)*ae(i,nj)*oppr(ni,nj)*(azztautau+vzztautau)+
     .         be(i,ni)*be(i,nj)*oppl(ni,nj)*
     .        (-azztautau+vzztautau))*x1*y1
     .       -(ae(i,nj)*ae(i,ni)*oppl(ni,nj)*(azztautau+vzztautau)
     .        +be(i,nj)*be(i,ni)*oppr(ni,nj)*(-azztautau+vzztautau)
     .          )*xmneut(nj)/xmneut(ni)*y3)
     .        +g2**2*4.d0/dselb(i)/dz
     .      *((ae(i,ni)*ae(i,nj)*oppl(ni,nj)*(azztautau+vzztautau)+
     .         be(i,ni)*be(i,nj)*oppr(ni,nj)*
     .         (-azztautau+vzztautau))*x2*y2
     .        -(ae(i,nj)*ae(i,ni)*oppr(ni,nj)*(azztautau+vzztautau)
     .         +be(i,nj)*be(i,ni)*oppl(ni,nj)*
     .          (-azztautau+vzztautau)
     .          )*xmneut(nj)/xmneut(ni)*y3)
         enddo
      else
         xneutzsel=0.D0
      endif

c -------------------------------------------------------------------- c

      SD_neutel = xneutsel+xneutzel+xneutzsel

      end

c ==================================================================== c
c =======================  neutralino tau+ tau- ====================== c
c ==================================================================== c

      double precision function SD_neuttau(x1,x2)

      implicit double precision (a-h,m,o-z)
      integer k

      dimension amneut(4),xmneut(4),amchar(2)
      dimension opl(2,2),opr(2,2),oppl(4,4),oppr(4,4)
      dimension dsto(2),dstob(2)
      dimension ahl(4,4),ahh(4,4),aa(4,4)
      dimension sgn(4)
      dimension ae(2,4),be(2,4),ato(2,4),bto(2,4),anu(2,4),bnu(2,4),
     .          antau(2,4),bntau(2,4)

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_mixang/a,tanbeta
      COMMON/SD_hmass/ama,aml,amh,amch,amar
      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_fermion/amt,amb,amtau
      COMMON/SD_sfermionetau/ase1,ase2,astau1,astau2
      COMMON/SD_indices/ni,nj
      COMMON/SD_yukawa/yt,yb,ytau
      COMMON/SD_coup1/ahl,ahh,aa
      COMMON/SD_coup4/opl,opr,oppl,oppr
      COMMON/SD_coup8/ae,be,ato,bto,anu,bnu,antau,bntau      
      COMMON/SD_coup17/azztoptop,vzztoptop,azztautau,vzztautau,
     .                 azzneutneut,vzzneutneut,azzbotbot,vzzbotbot
      COMMON/SD_mwmzpole/amwp,amzp

c --- several definitions ---

      ytauc = ytau/dsqrt(g2)

      do i=1,4,1
         sgn(i) = 1.D0
         if(xmneut(i).ge.0.D0) then
            sgn(i) = 1.D0
         elseif(xmneut(i).lt.0.D0) then
            sgn(i) = -1.D0
         endif
      enddo

      bet = datan(tanbeta)
      b   = bet 

      vzz = vzztautau
      azz = azztautau

      xmuneut1 = amneut(nj)**2/amneut(ni)**2
      xmustau1 = astau1**2/amneut(ni)**2
      xmustau2 = astau2**2/amneut(ni)**2
      xmutau   = amtau**2/amneut(ni)**2

      x3 = 2.D0-x1-x2
      y3 = 1.D0+xmuneut1-x3

      uh = 1.D0-x1+xmutau
      th = 1.D0-x2+xmutau

c -------------------------------------------------------------------- c
c                              stau exchange 
c -------------------------------------------------------------------- c

      dsto(1)  = 1.D0-x1-xmustau1+xmutau
      dsto(2)  = 1.D0-x1-xmustau2+xmutau
      dstob(1) = 1.D0-x2-xmustau1+xmutau
      dstob(2) = 1.D0-x2-xmustau2+xmutau
      
      xneutstau = 0.D0
  
c ---- final state masses included ----

      if ((amneut(nj)+2.D0*amtau).le.amneut(ni)) then
         do i=1,2
            do k=1,2
               xneutstau=xneutstau
     .          +g2**2/dsto(k)/dsto(i)*(
     .           (ato(i,ni)*bto(k,ni)+bto(i,ni)*ato(k,ni))*
     .           (ato(i,nj)*bto(k,nj)+bto(i,nj)*ato(k,nj))*
     .           xmneut(nj)/xmneut(ni)*xmutau*(-4.D0)+
     .           (ato(i,ni)*ato(k,ni)+bto(i,ni)*bto(k,ni))*
     .           (ato(i,nj)*bto(k,nj)+bto(i,nj)*ato(k,nj))*
     .           xmneut(nj)/xmneut(ni)*dsqrt(xmutau)*sgn(ni)*2.D0*
     .           (uh-xmutau-1.D0)+
     .           (ato(i,ni)*bto(k,ni)+bto(i,ni)*ato(k,ni))*
     .           (ato(i,nj)*ato(k,nj)+bto(i,nj)*bto(k,nj))*
     .           dsqrt(xmutau)*sgn(ni)*2.D0*(uh-xmutau-xmuneut1)+
     .           (ato(i,ni)*ato(k,ni)+bto(i,ni)*bto(k,ni))*
     .           (ato(i,nj)*ato(k,nj)+bto(i,nj)*bto(k,nj))*
     .           (-uh**2+uh*(1.D0+xmuneut1+2.D0*xmutau)-
     .           (xmuneut1+xmutau)*(1.D0+xmutau)))
     .           +g2**2/dstob(k)/dstob(i)*(
     .           (ato(i,ni)*bto(k,ni)+bto(i,ni)*ato(k,ni))*
     .           (ato(i,nj)*bto(k,nj)+bto(i,nj)*ato(k,nj))*
     .           xmneut(nj)/xmneut(ni)*xmutau*(-4.D0)+
     .           (ato(i,ni)*ato(k,ni)+bto(i,ni)*bto(k,ni))*
     .           (ato(i,nj)*bto(k,nj)+bto(i,nj)*ato(k,nj))*
     .           xmneut(nj)/xmneut(ni)*dsqrt(xmutau)*sgn(ni)*2.D0*
     .           (th-xmutau-1.D0)+
     .           (ato(i,ni)*bto(k,ni)+bto(i,ni)*ato(k,ni))*
     .           (ato(i,nj)*ato(k,nj)+bto(i,nj)*bto(k,nj))*
     .           dsqrt(xmutau)*sgn(ni)*2.D0*(th-xmutau-xmuneut1)+
     .           (ato(i,ni)*ato(k,ni)+bto(i,ni)*bto(k,ni))*
     .           (ato(i,nj)*ato(k,nj)+bto(i,nj)*bto(k,nj))*
     .           (-th**2+th*(1.D0+xmuneut1+2.D0*xmutau)-
     .           (xmuneut1+xmutau)*(1.D0+xmutau)))
     .           -2.D0*g2**2/dsto(k)/dstob(i)*(
     .           (bto(i,ni)*bto(k,ni)*ato(i,nj)*ato(k,nj)
     .           +ato(i,ni)*ato(k,ni)*bto(i,nj)*bto(k,nj))*
     .           xmneut(nj)/xmneut(ni)*xmutau*(-2.D0)+
     .           (ato(i,ni)*bto(k,ni)*ato(i,nj)*ato(k,nj)
     .           +ato(k,ni)*bto(i,ni)*bto(i,nj)*bto(k,nj))*
     .           xmneut(nj)/xmneut(ni)*dsqrt(xmutau)*sgn(ni)*
     .           (th-xmutau-1.D0)+
     .           (ato(k,ni)*bto(i,ni)*ato(i,nj)*ato(k,nj)
     .           +ato(i,ni)*bto(k,ni)*bto(i,nj)*bto(k,nj))*
     .           xmneut(nj)/xmneut(ni)*dsqrt(xmutau)*sgn(ni)*
     .           (uh-xmutau-1.D0)+
     .           (ato(k,ni)*ato(i,ni)*ato(i,nj)*ato(k,nj)
     .           +bto(i,ni)*bto(k,ni)*bto(i,nj)*bto(k,nj))*
     .           xmneut(nj)/xmneut(ni)*(uh+th-xmuneut1-1.D0)+
     .           (ato(k,ni)*bto(i,ni)*ato(k,nj)*bto(i,nj)
     .           +bto(k,ni)*ato(i,ni)*ato(i,nj)*bto(k,nj))*
     .           xmutau*(uh+th-2.D0*xmutau)+
     .           (ato(k,ni)*ato(i,ni)*ato(k,nj)*bto(i,nj)
     .           +bto(k,ni)*bto(i,ni)*ato(i,nj)*bto(k,nj))*
     .           dsqrt(xmutau)*sgn(ni)*(uh-xmutau-xmuneut1)+
     .           (bto(k,ni)*bto(i,ni)*ato(k,nj)*bto(i,nj)
     .           +ato(k,ni)*ato(i,ni)*ato(i,nj)*bto(k,nj))*
     .           dsqrt(xmutau)*sgn(ni)*(th-xmutau-xmuneut1)+
     .           (bto(k,ni)*ato(i,ni)*ato(k,nj)*bto(i,nj)
     .           +ato(k,ni)*bto(i,ni)*ato(i,nj)*bto(k,nj))*
     .           (uh*th-xmutau**2-xmuneut1))
            enddo
         enddo         
      else
         xneutstau=0.D0
      endif

c -------------------------------------------------------------------- c
c 	                         Z exchange
c -------------------------------------------------------------------- c

      xmuz = amzp**2/amneut(ni)**2
      dz   = y3-xmuz

      xneutztau=0.D0

c ---- final state masses included ----

      rh = xmuneut1+2.D0*xmutau-th-uh+1.D0
      sh = (xmuneut1-th-uh+1.D0)*2.D0*xmutau+4.D0*xmutau**2
      rk = xmuneut1*(2.D0*xmutau-th-uh+4.D0)+2.D0*xmutau-uh-th

      if ((amneut(nj)+2.D0*amtau).le.amneut(ni)) then
         xneutztau=xneutztau+g2**2/dz**2*(
     .    oppl(ni,nj)*oppr(ni,nj)*(vzz**2-azz**2)*
     .    xmneut(nj)/xmneut(ni)*xmutau*(-16.D0/xmuz**2*rh**2+
     .    32.D0/xmuz*rh-64.D0)+
     .    oppl(ni,nj)*oppr(ni,nj)*(vzz**2+azz**2)*
     .    xmneut(nj)/xmneut(ni)*(8.D0/xmuz**2*rh*sh-16.D0/xmuz*sh
     .    -16.D0*(xmuneut1-uh-th+1.D0))+
     .    (oppl(ni,nj)**2+oppr(ni,nj)**2)*(vzz**2-azz**2)*
     .    xmutau*(4.D0/xmuz**2*rh*rk-8.D0/xmuz*rk+8.D0*(uh+th-
     .    2.D0*xmutau))
     .    +(oppl(ni,nj)**2+oppr(ni,nj)**2)*(vzz**2+azz**2)*
     .    (-2.D0/xmuz**2*rk*sh+8.D0/xmuz*(xmuneut1*(2.D0*xmutau**2+
     .    4.D0*xmutau-xmutau*(th+uh))+2.D0*xmutau**2-xmutau*(uh+th))+
     .    4.D0*(xmuneut1*(uh+th-2.D0*xmutau-2.D0)+2.D0*xmutau*(uh+th-
     .    1.D0)-2.D0*xmutau**2+th*(-th+1.D0)+uh*(-uh+1.D0)))+
     .    (oppl(ni,nj)**2-oppr(ni,nj)**2)*vzz*azz*8.D0*(
     .    xmuneut1*(th-uh)+2.D0*xmutau*(th-uh)+th*(-th+1.D0)+uh*(uh-
     .    1.D0)))
      else
         xneutztau=0.D0
      endif

c -------------------------------------------------------------------- c
c                               Hl exchange
c -------------------------------------------------------------------- c

      xmuhl = aml**2/amneut(ni)**2
      dhl   = y3-xmuhl

      xneuthl=0.D0

c ---- final state masses included ----

      if((amneut(nj)+2.D0*amtau).le.amneut(ni)) then
         xneuthl=g2**2/dhl**2*(ytauc*dsin(a))**2*ahl(ni,nj)**2*(
     .    xmneut(nj)/xmneut(ni)*xmutau*(-32.D0)+
     .    xmneut(nj)/xmneut(ni)*16.D0*(1.D0+xmuneut1-th-uh)+
     .    xmutau*16.D0*(2.D0*xmutau-th-uh)+
     .    8.D0*(xmuneut1*(uh+th-2.D0*xmutau)+2.D0*xmutau*(uh+th-1.D0)
     .    -(th+uh)**2+uh+th))
      else
         xneuthl=0.D0
      endif

c -------------------------------------------------------------------- c
c                              HH exchange
c -------------------------------------------------------------------- c

      xmuhh = amh**2/amneut(ni)**2
      dhh   = y3-xmuhh
      
      xneuthh=0.D0

c ---- final state masses included ----

      if((amneut(nj)+2.D0*amtau).le.amneut(ni)) then
         xneuthh=g2**2/dhh**2*(ytauc*dcos(a))**2*ahh(ni,nj)**2*(
     .    xmneut(nj)/xmneut(ni)*xmutau*(-32.D0)+
     .    xmneut(nj)/xmneut(ni)*16.D0*(1.D0+xmuneut1-th-uh)+
     .    xmutau*16.D0*(2.D0*xmutau-th-uh)+
     .    8.D0*(xmuneut1*(uh+th-2.D0*xmutau)+2.D0*xmutau*(uh+th-1.D0)
     .    -(th+uh)**2+uh+th))
      else
         xneuthh=0.D0
      endif

c -------------------------------------------------------------------- c
c                              HA exchange
c -------------------------------------------------------------------- c

      xmuha = ama**2/amneut(ni)**2
      da    = y3-xmuha
      
      xneuta=0.D0

c ---- final state masses included ----

      if((amneut(nj)+2.D0*amtau).le.amneut(ni)) then
         xneuta=g2**2/da**2*(ytauc*dsin(b))**2*aa(ni,nj)**2*(
     .    xmneut(nj)/xmneut(ni)*xmutau*(-32.D0)+
     .    xmneut(nj)/xmneut(ni)*(-16.D0)*(1.D0+xmuneut1-th-uh)+
     .    xmutau*(-16.D0)*(2.D0*xmutau-th-uh)+
     .    8.D0*(xmuneut1*(uh+th-2.D0*xmutau)+2.D0*xmutau*(uh+th-1.D0)
     .    -(th+uh)**2+uh+th))
      else
         xneuta=0.D0
      endif

c -------------------------------------------------------------------- c
c 	                     interference h-H
c -------------------------------------------------------------------- c

      xneuthhhl = 0.D0

c ---- final state masses included ----

      if((amneut(nj)+2.D0*amtau).le.amneut(ni)) then
        xneuthhhl =2.D0*g2**2/dhh/dhl*ytauc*dcos(a)*ytauc*(-dsin(a))*(
     .   xmneut(nj)/xmneut(ni)*xmutau*(-32.D0)+
     .   xmneut(nj)/xmneut(ni)*16.D0*(1.D0+xmuneut1-uh-th)+
     .   xmutau*16.D0*(2.D0*xmutau-th-uh)+
     .   8.D0*(xmuneut1*(uh+th-2.D0*xmutau)+2.D0*xmutau*(uh+th-1.D0)
     .   +th+uh-(th+uh)**2))*ahh(ni,nj)*ahl(ni,nj)
      else
         xneuthhhl =0.D0
      endif

c -------------------------------------------------------------------- c
c                           Z-stau interference
c -------------------------------------------------------------------- c

      xneutzstau=0.D0

c ---- final state masses included ----

      if((amneut(nj)+2.D0*amtau).le.amneut(ni)) then
         do i=1,2
            xneutzstau=xneutzstau
     .      +g2**2/dsto(i)/dz*oppl(ni,nj)*(
     .      ((ato(i,ni)*ato(i,nj)-bto(i,ni)*bto(i,nj))*vzz-
     .       (ato(i,ni)*ato(i,nj)+bto(i,ni)*bto(i,nj))*azz)*
     .      xmneut(nj)/xmneut(ni)*xmutau*(
     .      1/xmuz*(-4.D0)*(1.D0+xmuneut1+2.D0*xmutau-uh-th)+16.D0) +
     .      ((ato(i,ni)*ato(i,nj)-bto(i,ni)*bto(i,nj))*vzz+
     .       (ato(i,ni)*ato(i,nj)+bto(i,ni)*bto(i,nj))*azz)*
     .      xmneut(nj)/xmneut(ni)*(2.D0/xmuz*((xmuneut1+1.D0-uh-th)*
     .      2.D0*xmutau+4.D0*xmutau**2)+4.D0*(1.D0+xmuneut1-uh-th)) +
     .      ((bto(i,ni)*bto(i,nj)-ato(i,ni)*ato(i,nj))*vzz+
     .       (bto(i,ni)*bto(i,nj)+ato(i,ni)*ato(i,nj))*azz)*
     .      xmutau*(2.D0/xmuz*(xmuneut1*(2.D0*xmutau-th-uh+4.D0)+
     .      2.D0*xmutau-th-uh)+4.D0*(2.D0*xmutau-th-uh)) +
     .      ((bto(i,ni)*bto(i,nj)-ato(i,ni)*ato(i,nj))*vzz-
     .       (bto(i,ni)*bto(i,nj)+ato(i,ni)*ato(i,nj))*azz)*
     .      (2.D0/xmuz*(xmuneut1*(-2.D0*xmutau**2+xmutau*th-
     .      2.D0*xmutau+xmutau*uh-2.D0*xmutau)+xmutau*(-2.D0*xmutau+uh)
     .      +xmutau*th)+4.D0*(xmuneut1*(xmutau-uh+1.D0)+xmutau*
     .      (xmutau-uh)+xmutau*(1.D0-uh)+uh**2-uh)) + 
     .      (ato(i,nj)*bto(i,ni)*(vzz+azz)-
     .       ato(i,ni)*bto(i,nj)*(vzz-azz))*
     .      xmneut(nj)/xmneut(ni)*dsqrt(xmutau)*sgn(ni)*(2.D0/xmuz*
     .      (xmuneut1*(1.D0+xmutau-uh)+1.D0+xmutau*(xmutau-uh)+xmutau*
     .      (xmutau-th-2.D0*uh+3.D0)+th*(uh-1.D0)+uh*(uh-2.D0))+
     .      4.D0*(1.D0+xmutau-th)) +
     .      (ato(i,nj)*bto(i,ni)*(vzz-azz)-
     .       ato(i,ni)*bto(i,nj)*(vzz+azz))*
     .      xmneut(nj)/xmneut(ni)*dsqrt(xmutau)*sgn(ni)*
     .      (2.D0/xmuz*(xmuneut1*(-1.D0-xmutau+uh)-1.D0+xmutau*(-1.D0
     .      +uh)+uh*(2.D0-th-uh)+th+xmutau*(-2.D0*xmutau+th+2.D0*uh
     .      -2.D0))+8.D0*(1.D0+xmutau-uh)) +
     .      (ato(i,ni)*bto(i,nj)*(vzz-azz)-
     .       ato(i,nj)*bto(i,ni)*(vzz+azz))*dsqrt(xmutau)*sgn(ni)*(
     .      (-2.D0)/xmuz*(xmuneut1-uh+xmutau)*(xmuneut1+2.D0*xmutau-th
     .      -uh+1.D0)+8.D0*(xmuneut1+xmutau-uh)) +
     .      (ato(i,ni)*bto(i,nj)*(vzz+azz)-
     .       ato(i,nj)*bto(i,ni)*(vzz-azz))*dsqrt(xmutau)*sgn(ni)*(
     .      2.D0/xmuz*(xmuneut1*(xmuneut1+3.D0*xmutau-th-2.D0*uh+1.D0)+
     .      xmutau*(2.D0*xmutau-th-2.D0*uh)+xmutau*(1.D0-uh)+uh*th+
     .      uh**2-uh)+4.D0*(xmuneut1+xmutau-th)) )
     .      -g2**2/dstob(i)/dz*oppl(ni,nj)*(
     .      ((-ato(i,ni)*ato(i,nj)+bto(i,ni)*bto(i,nj))*vzz+
     .       (ato(i,ni)*ato(i,nj)+bto(i,ni)*bto(i,nj))*azz)*
     .      xmneut(nj)/xmneut(ni)*xmutau*(
     .      1/xmuz*(-4.D0)*(1.D0+xmuneut1+2.D0*xmutau-uh-th)+16.D0) +
     .      ((-ato(i,ni)*ato(i,nj)+bto(i,ni)*bto(i,nj))*vzz-
     .       (ato(i,ni)*ato(i,nj)+bto(i,ni)*bto(i,nj))*azz)*
     .      xmneut(nj)/xmneut(ni)*(2.D0/xmuz*(2.D0*xmutau*(xmuneut1+1.D0
     .      -th-uh)+4.D0*xmutau**2)+4.D0*(1.D0+xmuneut1-uh-th)) +
     .      ((ato(i,ni)*ato(i,nj)-bto(i,ni)*bto(i,nj))*vzz-
     .       (ato(i,ni)*ato(i,nj)+bto(i,ni)*bto(i,nj))*azz)*
     .      xmutau*(2.D0/xmuz*(xmuneut1*(2.D0*xmutau-th-uh+4.D0)+
     .      2.D0*xmutau-th-uh)+4.D0*(2.D0*xmutau-th-uh)) +
     .      ((ato(i,ni)*ato(i,nj)-bto(i,ni)*bto(i,nj))*vzz+
     .       (ato(i,ni)*ato(i,nj)+bto(i,ni)*bto(i,nj))*azz)*
     .      (2.D0/xmuz*(xmuneut1*(-2.D0*xmutau**2+xmutau*th
     .      -2.D0*xmutau+xmutau*uh-2.D0*xmutau)+xmutau*(-2.D0*xmutau
     .      +uh)+xmutau*th)+4.D0*(xmuneut1*(xmutau-th+1.D0)+xmutau*
     .      (xmutau-th)+xmutau*(1.D0-th)+th**2-th)) + 
     .      (ato(i,nj)*bto(i,ni)*(-vzz-azz)+
     .       ato(i,ni)*bto(i,nj)*(vzz-azz))*
     .      xmneut(nj)/xmneut(ni)*dsqrt(xmutau)*sgn(ni)*
     .      (2.D0/xmuz*(xmuneut1*(1.D0+xmutau-th)+1.D0+xmutau*
     .      (2.D0*xmutau-2.D0*th-uh+3.D0)+th*(th-xmutau+uh-2.D0)-uh)+
     .      4.D0*(1.D0+xmutau-uh)) +
     .      (ato(i,nj)*bto(i,ni)*(-vzz+azz)+
     .       ato(i,ni)*bto(i,nj)*(vzz+azz))*
     .      xmneut(nj)/xmneut(ni)*dsqrt(xmutau)*sgn(ni)*
     .      (2.D0/xmuz*(xmuneut1*(-1.D0-xmutau+th)-1.D0+xmutau*
     .      (-xmutau+th-1.D0)+xmutau*(2.D0*th+uh-2.D0-xmutau)
     .      -th*(th+uh)+2.D0*th+uh)+
     .      8.D0*(1.D0+xmutau-th)) +
     .      (ato(i,ni)*bto(i,nj)*(-vzz+azz)+
     .       ato(i,nj)*bto(i,ni)*(vzz+azz))*dsqrt(xmutau)*sgn(ni)*(
     .      2.D0/xmuz*(xmuneut1*(-xmuneut1-3.D0*xmutau+2.D0*th+uh-1.D0)
     .      +xmutau*(-2.D0*xmutau+2.D0*th+uh-1.D0)+th*(xmutau-th-uh+1))
     .      +8.D0*(xmuneut1+xmutau-th)) +
     .      (ato(i,ni)*bto(i,nj)*(-vzz-azz)+
     .       ato(i,nj)*bto(i,ni)*(vzz-azz))*dsqrt(xmutau)*sgn(ni)*(
     .      2.D0/xmuz*(xmuneut1*(xmuneut1+3.D0*xmutau-uh-2.D0*th+1.D0)+
     .      xmutau*(xmutau-th+1.D0)+xmutau*(xmutau-2.D0*th-uh)+
     .      uh*th+th**2-th)+4.D0*(xmuneut1+xmutau-uh)) )
         enddo
      else
         xneutzstau=0.D0
      endif

c -------------------------------------------------------------------- c
c                           Hl-stau interference
c -------------------------------------------------------------------- c

      xneuthlstau=0.D0	

c ---- final state masses included ----

      if ((amneut(nj)+2.D0*amtau).le.amneut(ni)) then
         do i=1,2
            xneuthlstau=xneuthlstau
     .       +2.D0*g2**2/dhl/dsto(i)*(ytauc*(-dsin(a))/dsqrt(2.D0))*
     .       (-2.D0)*ahl(ni,nj)*(
     .       (ato(i,nj)*ato(i,ni)+bto(i,ni)*bto(i,nj))*(
     .       dsqrt(xmutau)*sgn(ni)*(xmuneut1+xmutau-uh) +
     .       dsqrt(xmutau)*sgn(ni)*(-xmuneut1-xmutau+th) +
     .       xmneut(nj)/xmneut(ni)*dsqrt(xmutau)*sgn(ni)*
     .       (-1.D0-xmutau+th) +
     .       xmneut(nj)/xmneut(ni)*dsqrt(xmutau)*sgn(ni)*
     .       (1.D0+xmutau-uh) )
     .       +(ato(i,nj)*bto(i,ni)+ato(i,ni)*bto(i,nj))*(
     .       xmneut(nj)/xmneut(ni)*(-1.D0-xmuneut1+uh+th) +
     .       2.D0*xmneut(nj)/xmneut(ni)*xmutau +
     .       xmutau*(-2.D0*xmutau+th+uh) +
     .       (uh**2+uh*th-uh*(1.D0+2.D0*xmutau+xmuneut1)+xmutau+
     .       xmuneut1*xmutau)) ) 
     .       +2.D0*g2**2/dhl/dstob(i)*(ytauc*(-dsin(a))/dsqrt(2.D0))*
     .       (-2.D0)*ahl(ni,nj)*(
     .       (ato(i,nj)*ato(i,ni)+bto(i,ni)*bto(i,nj))*(
     .       dsqrt(xmutau)*sgn(ni)*(uh-xmuneut1-xmutau) +
     .       dsqrt(xmutau)*sgn(ni)*(-th+xmutau+xmuneut1) +
     .       dsqrt(xmutau)*sgn(ni)*xmneut(nj)/xmneut(ni)*(-th+1.D0+
     .       xmutau) +
     .       dsqrt(xmutau)*sgn(ni)*xmneut(nj)/xmneut(ni)*(uh-1.D0-
     .       xmutau)) +
     .       (ato(i,nj)*bto(i,ni)+ato(i,ni)*bto(i,nj))*(
     .       2.D0*xmutau*xmneut(nj)/xmneut(ni) +
     .       (uh*th+th**2-th*(1.D0+2.D0*xmutau+xmuneut1)+xmutau+
     .       xmutau*xmuneut1) +
     .       xmneut(nj)/xmneut(ni)*(uh+th-xmuneut1-1.D0) +
     .       xmutau*(uh+th-2.D0*xmutau)) )
         enddo
      else
         xneuthlstau=0.D0
      endif

c -------------------------------------------------------------------- c
c                            HH-stau interference
c -------------------------------------------------------------------- c
      
      xneuthhstau=0.D0	

c ---- final state masses included ----

      if ((amneut(nj)+2.D0*amtau).le.amneut(ni)) then
         do i=1,2
            xneuthhstau=xneuthhstau
     .       +2.D0*g2**2/dhh/dsto(i)*(ytauc*dcos(a)/dsqrt(2.D0))*
     .       (-2.D0)*ahh(ni,nj)*(
     .       (ato(i,nj)*ato(i,ni)+bto(i,ni)*bto(i,nj))*(
     .       dsqrt(xmutau)*sgn(ni)*(xmuneut1+xmutau-uh) +
     .       dsqrt(xmutau)*sgn(ni)*(-xmuneut1-xmutau+th) +
     .       xmneut(nj)/xmneut(ni)*dsqrt(xmutau)*sgn(ni)*(-1.D0-xmutau
     .       +th) +
     .       xmneut(nj)/xmneut(ni)*dsqrt(xmutau)*sgn(ni)*(1.D0+xmutau
     .       -uh) ) 
     .       +(ato(i,nj)*bto(i,ni)+ato(i,ni)*bto(i,nj))*(
     .       xmneut(nj)/xmneut(ni)*(-1.D0-xmuneut1+uh+th) +
     .       2.D0*xmneut(nj)/xmneut(ni)*xmutau +
     .       xmutau*(-2.D0*xmutau+th+uh) +
     .       (uh**2+uh*th-uh*(1.D0+2.D0*xmutau+xmuneut1)+xmutau+
     .       xmuneut1*xmutau)) ) 
     .       +2.D0*g2**2/dhh/dstob(i)*(ytauc*dcos(a)/dsqrt(2.D0))*
     .       (-2.D0)*ahh(ni,nj)*(
     .       (ato(i,nj)*ato(i,ni)+bto(i,ni)*bto(i,nj))*(
     .       dsqrt(xmutau)*sgn(ni)*(uh-xmuneut1-xmutau) +
     .       dsqrt(xmutau)*sgn(ni)*(-th+xmutau+xmuneut1) +
     .       dsqrt(xmutau)*sgn(ni)*xmneut(nj)/xmneut(ni)*(-th+1.D0+
     .       xmutau) +
     .       dsqrt(xmutau)*sgn(ni)*xmneut(nj)/xmneut(ni)*(uh-1.D0-
     .       xmutau)) +
     .       (ato(i,nj)*bto(i,ni)+ato(i,ni)*bto(i,nj))*(
     .       2.D0*xmutau*xmneut(nj)/xmneut(ni) +
     .       (uh*th+th**2-th*(1.D0+2.D0*xmutau+xmuneut1)+xmutau+
     .       xmutau*xmuneut1) +
     .       xmneut(nj)/xmneut(ni)*(uh+th-xmuneut1-1.D0) +
     .       xmutau*(uh+th-2.D0*xmutau)) )
         enddo
      else
         xneuthhstau=0.D0
      endif

c -------------------------------------------------------------------- c
c 			   HA-stau interference
c -------------------------------------------------------------------- c

      xneutastau=0.D0	

c ---- final state masses included ----

      if ((amneut(nj)+2.D0*amtau).le.amneut(ni)) then
         do i=1,2
            xneutastau=xneutastau
     .       +2.D0*g2**2/da/dsto(i)*((-ytauc*dsin(b))/dsqrt(2.D0))*
     .       2.D0*aa(ni,nj)*(
     .       (ato(i,nj)*ato(i,ni)+bto(i,ni)*bto(i,nj))*(
     .       dsqrt(xmutau)*sgn(ni)*(xmuneut1+xmutau-uh) +
     .       dsqrt(xmutau)*sgn(ni)*(-xmuneut1-xmutau+th)*(-1.D0) +
     .       xmneut(nj)/xmneut(ni)*dsqrt(xmutau)*sgn(ni)*(-1.D0-xmutau
     .       +th)*(-1.D0) +
     .       xmneut(nj)/xmneut(ni)*dsqrt(xmutau)*sgn(ni)*(1.D0+xmutau
     .       -uh) ) 
     .       +(ato(i,nj)*bto(i,ni)+ato(i,ni)*bto(i,nj))*(
     .       xmneut(nj)/xmneut(ni)*(-1.D0-xmuneut1+uh+th)*(-1.D0) +
     .       2.D0*xmneut(nj)/xmneut(ni)*xmutau +
     .       xmutau*(-2.D0*xmutau+th+uh)*(-1.D0) +
     .       (uh**2+uh*th-uh*(1.D0+2.D0*xmutau+xmuneut1)+xmutau+
     .       xmuneut1*xmutau)) ) 
     .       +2.D0*g2**2/da/dstob(i)*((-ytauc*dsin(b))/dsqrt(2.D0))*
     .       2.D0*aa(ni,nj)*(
     .       (ato(i,nj)*ato(i,ni)+bto(i,ni)*bto(i,nj))*(
     .       dsqrt(xmutau)*sgn(ni)*(uh-xmuneut1-xmutau)*(-1.D0) +
     .       dsqrt(xmutau)*sgn(ni)*(-th+xmutau+xmuneut1) +
     .       dsqrt(xmutau)*sgn(ni)*xmneut(nj)/xmneut(ni)*(-th+1.D0+
     .       xmutau) +
     .       dsqrt(xmutau)*sgn(ni)*xmneut(nj)/xmneut(ni)*(uh-1.D0-
     .       xmutau)*(-1.D0)) +
     .       (ato(i,nj)*bto(i,ni)+ato(i,ni)*bto(i,nj))*(
     .       2.D0*xmutau*xmneut(nj)/xmneut(ni) +
     .       (uh*th+th**2-th*(1.D0+2.D0*xmutau+xmuneut1)+xmutau+
     .       xmutau*xmuneut1) +
     .       xmneut(nj)/xmneut(ni)*(uh+th-xmuneut1-1.D0)*(-1.D0) +
     .       xmutau*(uh+th-2.D0*xmutau)*(-1.D0)) )
         enddo
      else
         xneutastau=0.D0
      endif

c -------------------------------------------------------------------- c
c 	                interference Z and H/h/A
c -------------------------------------------------------------------- c

      xneutza=0.D0	

      if ((amneut(nj)+2.D0*amtau).le.amneut(ni)) then      
         xneutza=xneutza-4.D0*g2**2/da/dz*azz*
     .    (-ytauc*dsin(b))/dsqrt(2.D0)*2.D0*aa(ni,nj)*oppl(ni,nj)*(
     .    xmneut(nj)/xmneut(ni)*dsqrt(xmutau)*sgn(ni)*(
     .    4.D0/xmuz*(2.D0+xmuneut1*(2.D0*xmutau-th-uh+2.D0)+xmutau*
     .    (-uh-th+1.D0+xmutau)+xmutau*(3.D0*xmutau-3.D0*(th+uh)+5.D0)
     .    +(th+uh)**2-3.D0*(th+uh))+
     .    4.D0*(th-xmutau-1.D0)+4.D0*(uh-xmutau-1.D0))
     .    -dsqrt(xmutau)*sgn(ni)*(
     .    4.D0/xmuz*(-2.D0*xmuneut1**2+xmuneut1*(-6.D0*xmutau+
     .    3.D0*(th+uh)-2.D0)+xmutau*(-xmutau+th+uh-1.D0)+xmutau*
     .    (-3.D0*xmutau+3.D0*(uh+th)-1.D0)-(th+uh)**2+(th+uh))+
     .    4.D0*(xmuneut1+xmutau-uh)+4.D0*(xmuneut1+xmutau-th)) )
      else
         xneutza=0.D0
      endif

c -------------------------------------------------------------------- c

      SD_neuttau = xneutstau+xneutztau+xneuthl+xneuthh+xneuta+xneuthhhl+
     .             xneutzstau+xneuthlstau+xneuthhstau+xneutastau+xneutza

      end

c ==================================================================== c
c =====================  neutralino nu_e nu_ebar ===================== c
c ==================================================================== c

      double precision function SD_neutnue(x1,x2)

      implicit double precision (a-h,m,o-z)
      integer k

      dimension amneut(4),xmneut(4),amchar(2)
      dimension opl(2,2),opr(2,2),oppl(4,4),oppr(4,4)
      dimension dsnl(2),dsnlb(2)
      dimension ae(2,4),be(2,4),ato(2,4),bto(2,4),anu(2,4),bnu(2,4),
     .          antau(2,4),bntau(2,4),anue(2,4),bnue(2,4)

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_sneutrino/asne1,asne2,asntau1,asntau2
      COMMON/SD_indices/ni,nj
      COMMON/SD_coup4/opl,opr,oppl,oppr
      COMMON/SD_coup8/ae,be,ato,bto,anu,bnu,antau,bntau      
      COMMON/SD_coup17/azztoptop,vzztoptop,azztautau,vzztautau,
     .                 azzneutneut,vzzneutneut,azzbotbot,vzzbotbot
      COMMON/SD_mwmzpole/amwp,amzp

      xmuneut1 = amneut(nj)**2/amneut(ni)**2

      x3 = 2.D0-x1-x2
      y1 = 1.D0-xmuneut1-x1
      y2 = 1.D0-xmuneut1-x2
      y3 = 1.D0+xmuneut1-x3

      do i = 1,4,1
         anue(1,i) = anu(1,i)
         anue(2,i) = anu(2,i)
         bnue(1,i) = bnu(1,i)
         bnue(2,i) = bnu(2,i)
      end do

c -------------------------------------------------------------------- c
c                           snu_e exchange
c -------------------------------------------------------------------- c

      xmusnl1 = asne1**2/amneut(ni)**2
      xmusnl2 = asne2**2/amneut(ni)**2

      dsnl(1)  = 1.D0-x1-xmusnl1
      dsnl(2)  = 1.D0-x1-xmusnl2
      dsnlb(1) = 1.D0-x2-xmusnl1
      dsnlb(2) = 1.D0-x2-xmusnl2
      
      xneutsnl=0.D0

      if (amneut(nj).le.amneut(ni)) then
         do i=1,2
            do k=1,2
               xneutsnl=xneutsnl
     .              +g2**2/dsnl(k)/dsnl(i)*x1*y1*
     .               (anue(i,ni)*anue(k,ni)+bnue(i,ni)*bnue(k,ni))*
     .               (anue(i,nj)*anue(k,nj)+bnue(i,nj)*bnue(k,nj))
     .              +g2**2/dsnlb(k)/dsnlb(i)*x2*y2*
     .               (anue(i,ni)*anue(k,ni)+bnue(i,ni)*bnue(k,ni))*
     .               (anue(i,nj)*anue(k,nj)+bnue(i,nj)*bnue(k,nj))
     .              +g2**2/dsnlb(k)/dsnl(i)*
     .               ( ( anue(i,ni)*bnue(k,ni)*anue(k,nj)*bnue(i,nj)
     .                  +anue(i,nj)*bnue(k,nj)*anue(k,ni)*bnue(i,ni))
     .                 *(-x1*y1-x2*y2+x3*y3)
     .                +2.D0*xmneut(nj)/xmneut(ni)*y3*
     .                ( anue(i,ni)*anue(k,ni)*anue(k,nj)*anue(i,nj)
     .                 +bnue(i,nj)*bnue(k,nj)*bnue(k,ni)*bnue(i,ni)))
            enddo
         enddo
      else
         xneutsnl=0.D0
      endif

c -------------------------------------------------------------------- c
c                             Z exchange
c -------------------------------------------------------------------- c

      xmuz = amzp**2/amneut(ni)**2
      dz   = y3-xmuz
      
      xneutznl=0.D0

      if (amneut(nj).le.amneut(ni)) then
         xneutznl=g2**2*4.D0/dz**2*
     .        (((azzneutneut+vzzneutneut)**2*oppl(ni,nj)**2
     .        + (azzneutneut-vzzneutneut)**2*oppr(ni,nj)**2)*x2*y2
     .        +((azzneutneut+vzzneutneut)**2*oppr(ni,nj)**2
     .        + (azzneutneut-vzzneutneut)**2*oppl(ni,nj)**2)*x1*y1
     .        -4.D0*xmneut(nj)/xmneut(ni)*oppl(ni,nj)*oppr(ni,nj)
     .        *(azzneutneut**2+vzzneutneut**2)*y3 )
      else
         xneutznl=0.D0
      endif
	
c -------------------------------------------------------------------- c
c                          Z-snue interference
c -------------------------------------------------------------------- c

      xneutzsnl=0.D0

      if (amneut(nj).le.amneut(ni)) then
         do i=1,2
            xneutzsnl=xneutzsnl-g2**2*4.D0/dsnl(i)/dz*
     .           ((anue(i,ni)*anue(i,nj)*oppr(ni,nj)*
     .           (azzneutneut+vzzneutneut)+
     .           bnue(i,ni)*bnue(i,nj)*oppl(ni,nj)*
     .           (-azzneutneut+vzzneutneut))*x1*y1
     .           -(anue(i,nj)*anue(i,ni)*oppl(ni,nj)*
     .           (azzneutneut+vzzneutneut)
     .           +bnue(i,nj)*bnue(i,ni)*oppr(ni,nj)*
     .           (-azzneutneut+vzzneutneut))*xmneut(nj)/xmneut(ni)*y3)
     .           +g2**2*4.d0/dsnlb(i)/dz
     .           *((anue(i,ni)*anue(i,nj)*oppl(ni,nj)*
     .           (azzneutneut+vzzneutneut)+bnue(i,ni)*bnue(i,nj)*
     .           oppr(ni,nj)*(-azzneutneut+vzzneutneut))*x2*y2
     .           -(anue(i,nj)*anue(i,ni)*oppr(ni,nj)*
     .           (azzneutneut+vzzneutneut)
     .           +bnue(i,nj)*bnue(i,ni)*oppl(ni,nj)*
     .           (-azzneutneut+vzzneutneut))*xmneut(nj)/xmneut(ni)*y3)
         enddo
      else
         xneutzsnl=0.D0
      endif

c ----------------------------------------------------------------- c

      SD_neutnue = xneutsnl+xneutznl+xneutzsnl

      end

c ==================================================================== c
c ===================  neutralino nu_tau nu_taubar =================== c
c ==================================================================== c

      double precision function SD_neutnutau(x1,x2)

      implicit double precision (a-h,m,o-z)
      integer k

      dimension amneut(4),xmneut(4),amchar(2)
      dimension opl(2,2),opr(2,2),oppl(4,4),oppr(4,4)
      dimension dsnt(2),dsntb(2)
      dimension ae(2,4),be(2,4),ato(2,4),bto(2,4),anu(2,4),bnu(2,4),
     .          antau(2,4),bntau(2,4)

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_sneutrino/asne1,asne2,asntau1,asntau2
      COMMON/SD_indices/ni,nj
      COMMON/SD_coup4/opl,opr,oppl,oppr
      COMMON/SD_coup8/ae,be,ato,bto,anu,bnu,antau,bntau      
      COMMON/SD_coup17/azztoptop,vzztoptop,azztautau,vzztautau,
     .                 azzneutneut,vzzneutneut,azzbotbot,vzzbotbot
      COMMON/SD_mwmzpole/amwp,amzp

      xmuneut1 = amneut(nj)**2/amneut(ni)**2

      x3 = 2.D0-x1-x2
      y1 = 1.D0-xmuneut1-x1
      y2 = 1.D0-xmuneut1-x2
      y3 = 1.D0+xmuneut1-x3

c -------------------------------------------------------------------- c
c                           snu_tau exchange
c -------------------------------------------------------------------- c

      xmusnt1 = asntau1**2/amneut(ni)**2
      xmusnt2 = asntau2**2/amneut(ni)**2

      dsnt(1)  = 1.D0-x1-xmusnt1
      dsnt(2)  = 1.D0-x1-xmusnt2
      dsntb(1) = 1.D0-x2-xmusnt1
      dsntb(2) = 1.D0-x2-xmusnt2
      
      xneutsnt=0.D0

      if (amneut(nj).le.amneut(ni)) then
         do i=1,2
            do k=1,2
               xneutsnt=xneutsnt
     .           +g2**2/dsnt(k)/dsnt(i)*x1*y1*
     .            (antau(i,ni)*antau(k,ni)+bntau(i,ni)*bntau(k,ni))*
     .            (antau(i,nj)*antau(k,nj)+bntau(i,nj)*bntau(k,nj))
     .           +g2**2/dsntb(k)/dsntb(i)*x2*y2*
     .            (antau(i,ni)*antau(k,ni)+bntau(i,ni)*bntau(k,ni))*
     .            (antau(i,nj)*antau(k,nj)+bntau(i,nj)*bntau(k,nj))
     .           +g2**2/dsntb(k)/dsnt(i)*
     .            ( ( antau(i,ni)*bntau(k,ni)*antau(k,nj)*bntau(i,nj)
     .              + antau(i,nj)*bntau(k,nj)*antau(k,ni)*bntau(i,ni))
     .              *(-x1*y1-x2*y2+x3*y3)
     .            +2.D0*xmneut(nj)/xmneut(ni)*y3*
     .            ( antau(i,ni)*antau(k,ni)*antau(k,nj)*antau(i,nj)
     .             +bntau(i,nj)*bntau(k,nj)*bntau(k,ni)*bntau(i,ni)))
            enddo
         enddo
      else
         xneutsnt=0.D0
      endif

c -------------------------------------------------------------------- c
c                             Z exchange
c -------------------------------------------------------------------- c

      xmuz = amzp**2/amneut(ni)**2
      dz   = y3-xmuz
      
      xneutznt=0.D0

      if (amneut(nj).le.amneut(ni)) then
         xneutznt=g2**2*4.D0/dz**2*
     .        (((azzneutneut+vzzneutneut)**2*oppl(ni,nj)**2
     .        + (azzneutneut-vzzneutneut)**2*oppr(ni,nj)**2)*x2*y2
     .        +((azzneutneut+vzzneutneut)**2*oppr(ni,nj)**2
     .        + (azzneutneut-vzzneutneut)**2*oppl(ni,nj)**2)*x1*y1
     .        -4.D0*xmneut(nj)/xmneut(ni)*oppl(ni,nj)*oppr(ni,nj)
     .        *(azzneutneut**2+vzzneutneut**2)*y3 )
      else
         xneutznt=0.D0
      endif
	
c -------------------------------------------------------------------- c
c                      Z-selectron interference
c -------------------------------------------------------------------- c

      xneutzsnt=0.D0

      if (amneut(nj).le.amneut(ni)) then
         do i=1,2
            xneutzsnt=xneutzsnt-g2**2*4.D0/dsnt(i)/dz
     .           *((antau(i,ni)*antau(i,nj)*oppr(ni,nj)
     .           *(azzneutneut+vzzneutneut)+
     .           bntau(i,ni)*bntau(i,nj)*oppl(ni,nj)*
     .           (-azzneutneut+vzzneutneut))*x1*y1
     .           -(antau(i,nj)*antau(i,ni)*oppl(ni,nj)*
     .           (azzneutneut+vzzneutneut)
     .           +bntau(i,nj)*bntau(i,ni)*oppr(ni,nj)*
     .           (-azzneutneut+vzzneutneut)
     .           )*xmneut(nj)/xmneut(ni)*y3)
     .           +g2**2*4.d0/dsntb(i)/dz
     .           *((antau(i,ni)*antau(i,nj)*oppl(ni,nj)*     
     .           (azzneutneut+vzzneutneut)+
     .           bntau(i,ni)*bntau(i,nj)*oppr(ni,nj)*
     .           (-azzneutneut+vzzneutneut))*x2*y2
     .           -(antau(i,nj)*antau(i,ni)*oppr(ni,nj)*
     .           (azzneutneut+vzzneutneut)
     .           +bntau(i,nj)*bntau(i,ni)*oppl(ni,nj)*
     .           (-azzneutneut+vzzneutneut)
     .           )*xmneut(nj)/xmneut(ni)*y3)
         enddo
      else
         xneutzsnt=0.D0
      endif

c -------------------------------------------------------------------- c

      SD_neutnutau = xneutsnt+xneutznt+xneutzsnt

      end

c ==================================================================== c
c =========================  chargino- e+ nu_e ======================= c
c ==================================================================== c

      double precision function SD_chelne(x1,x2)

      implicit double precision (a-h,o-z)
      integer k

      dimension amneut(4),xmneut(4),amchar(2)
      dimension dsel(2),dsne(2)
      dimension ae(2,4),be(2,4),ato(2,4),bto(2,4),anu(2,4),bnu(2,4),
     .          antau(2,4),bntau(2,4)
      dimension ale(2,2),altau(2,2),alsne(2,2),blsne(2,2),alsnt(2,2),
     .          blsnt(2,2),ble(2,2)
      dimension ql(4,2),qr(4,2),or(4,2),ol(4,2)

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_sfermionetau/ase1,ase2,astau1,astau2
      COMMON/SD_sneutrino/asne1,asne2,asntau1,asntau2
      COMMON/SD_indices/ni,nj
      COMMON/SD_coup3/ql,qr,ol,or
      COMMON/SD_coup5/ale,altau,alsne,blsne,alsnt,blsnt
      COMMON/SD_coup8/ae,be,ato,bto,anu,bnu,antau,bntau      
      COMMON/SD_coup18/awff,vwff
      COMMON/SD_mwmzpole/amwp,amzp

      xmuneut1 = amchar(nj)**2/amneut(ni)**2

      x3 = 2.D0-x1-x2
      y1 = 1.D0-xmuneut1-x1
      y2 = 1.D0-xmuneut1-x2
      y3 = 1.D0+xmuneut1-x3

      do i=1,2,1
         ble(1,i) = 0.D0
         ble(2,i) = 0.D0
      end do

c -------------------------------------------------------------------- c
c                        sfermion exchange
c -------------------------------------------------------------------- c

      xmusel1 = ase1**2/amneut(ni)**2
      xmusel2 = ase2**2/amneut(ni)**2
      xmusn1  = asne1**2/amneut(ni)**2
      xmusn2  = asne2**2/amneut(ni)**2

      dsel(1) = 1.D0-x2-xmusel1
      dsel(2) = 1.D0-x2-xmusel2
      dsne(1) = 1.D0-x1-xmusn1
      dsne(2) = 1.D0-x1-xmusn2
      
      xneutsf=0.D0

      if(amchar(nj).le.amneut(ni)) then
         do i=1,2
            do k=1,2
               xneutsf=xneutsf
     .              +g2**2/dsel(k)/dsel(i)*x2*y2*
     .              (ae(i,ni)*ae(k,ni)+be(i,ni)*be(k,ni))*
     .              (ale(i,nj)*ale(k,nj)+ble(i,nj)*ble(k,nj))
     .              +g2**2/dsne(k)/dsne(i)*x1*y1*
     .              (anu(i,ni)*anu(k,ni)+bnu(i,ni)*bnu(k,ni))*
     .              (alsne(i,nj)*alsne(k,nj)+blsne(i,nj)*blsne(k,nj))
     .              +g2**2/dsne(i)/dsel(k)*
     .              (( anu(i,ni)*be(k,ni)*ale(k,nj)*blsne(i,nj)
     .                +alsne(i,nj)*ble(k,nj)*ae(k,ni)*bnu(i,ni))
     .              *(-x1*y1-x2*y2+x3*y3)
     .              +2.D0*amchar(nj)/xmneut(ni)*y3*
     .              ( ae(k,ni)*anu(i,ni)*alsne(i,nj)*ale(k,nj)
     .              + ble(k,nj)*blsne(i,nj)*bnu(i,ni)*be(k,ni)))
            enddo
         enddo
      else
         xneutsf=0.D0
      endif

c -------------------------------------------------------------------- c
c                             W+ exchange
c -------------------------------------------------------------------- c

      xmuw = amwp**2/amneut(ni)**2
      dw   = y3-xmuw
      
      if(amchar(nj).le.amneut(ni)) then
         xneutwel=g2**2*4.D0/dw**2*
     .        (4.D0*vwff**2*or(ni,nj)**2*x2*y2
     .        +4.D0*vwff**2*ol(ni,nj)**2*x1*y1
     .        -8.D0*amchar(nj)/xmneut(ni)*ol(ni,nj)*or(ni,nj)*
     .        vwff**2*y3 )
      else
         xneutwel=0.D0
      endif
	
c -------------------------------------------------------------------- c
c                        W+-sfermion interference
c -------------------------------------------------------------------- c

      xneutwsf=0.D0

      if(amchar(nj).le.amneut(ni)) then
         do i=1,2
            xneutwsf=xneutwsf-g2**2*4.D0/dsel(i)/dw
     .      *(ae(i,ni)*ale(i,nj)*or(ni,nj)*2.D0*vwff*x2*y2
     .       -ale(i,nj)*ae(i,ni)*ol(ni,nj)*2.D0*vwff*
     .        amchar(nj)/xmneut(ni)*y3)
     .       +g2**2*4.d0/dsne(i)/dw
     .      *(anu(i,ni)*alsne(i,nj)*ol(ni,nj)*2.D0*vwff*x1*y1
     .       -alsne(i,nj)*anu(i,ni)*or(ni,nj)*2.D0*vwff*
     .        amchar(nj)/xmneut(ni)*y3)
         enddo
      else
         xneutwsf=0.D0
      endif

c -------------------------------------------------------------------- c

      SD_chelne = xneutsf+xneutwel+xneutwsf

      end

c ==================================================================== c
c =======================  chargino- tau+ nu_tau ===================== c
c ==================================================================== c

      double precision function SD_chtauntau(x1,x2)

      implicit double precision (a-h,m,o-z)
      integer k

      dimension ahl(4,4),ahh(4,4),aa(4,4)
      dimension amneut(4),xmneut(4),amchar(2)
      dimension dstau(2),dsntau(2),sgn(4)
      dimension ae(2,4),be(2,4),ato(2,4),bto(2,4),anu(2,4),bnu(2,4),
     .          antau(2,4),bntau(2,4)
      dimension ale(2,2),alto(2,2),alsne(2,2),blsne(2,2),alsnt(2,2),
     .          blsnt(2,2),blto(2,2)
      dimension ql(4,2),qr(4,2),or(4,2),ol(4,2)

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_hmass/ama,aml,amh,amch,amar
      COMMON/SD_fermion/amt,amb,amtau
      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_sfermionetau/ase1,ase2,astau1,astau2
      COMMON/SD_sneutrino/asne1,asne2,asntau1,asntau2
      COMMON/SD_indices/ni,nj
      COMMON/SD_coup1/ahl,ahh,aa
      COMMON/SD_coup3/ql,qr,ol,or
      COMMON/SD_coup5/ale,alto,alsne,blsne,alsnt,blsnt
      COMMON/SD_coup8/ae,be,ato,bto,anu,bnu,antau,bntau      
      COMMON/SD_coup15/achtop,vchtop,achtau,vchtau
      COMMON/SD_coup18/awff,vwff
      COMMON/SD_mwmzpole/amwp,amzp

c --- the neutrino mass ---
      amne = 0.D0

c --- several definitions ---

      do i=1,4,1
         sgn(i) = 1.D0
         if(xmneut(i).gt.0.D0) then
            sgn(i) = 1.D0
         elseif(xmneut(i).lt.0.D0) then
            sgn(i) = -1.D0
         endif
      enddo

      xmuneut1 = amchar(nj)**2/amneut(ni)**2
      xmutau   = amtau**2/amneut(ni)**2
      xmun     = amne**2/amneut(ni)**2
      xmustau1 = astau1**2/amneut(ni)**2
      xmustau2 = astau2**2/amneut(ni)**2
      xmusnt1  = asntau1**2/amneut(ni)**2
      xmusnt2  = asntau2**2/amneut(ni)**2

      x3 = 2.D0-x1-x2
      y3 = 1.D0+xmuneut1-x3

      do j=1,2,1
         blto(1,j) = 0.D0
         blto(2,j) = 0.D0
      end do

c -------------------------------------------------------------------- c
c                        sfermion exchange
c -------------------------------------------------------------------- c

      dsntau(1) = 1.D0-x1-xmusnt1+xmun
      dsntau(2) = 1.D0-x1-xmusnt2+xmun
      dstau(1)  = 1.D0-x2-xmustau1+xmutau
      dstau(2)  = 1.D0-x2-xmustau2+xmutau
      
      uh = 1.D0-x1+xmun
      th = 1.D0-x2+xmutau

      xneutsf=0.D0

c --- with mass dependence ---

      if((amchar(nj)+amtau).le.amneut(ni)) then
         do i=1,2
            do k=1,2
               xneutsf=xneutsf
     .          +g2**2/dstau(k)/dstau(i)*(
     .          (ato(i,ni)*ato(k,ni)+bto(i,ni)*bto(k,ni))*
     .          (alto(i,nj)*alto(k,nj)+blto(i,nj)*blto(k,nj))*
     .          (xmuneut1*(th-xmutau-1.D0)+xmun*(th-1.D0)+xmutau*(-xmun
     .          +th)+th*(-th+1.D0))+
     .          (ato(i,ni)*ato(k,ni)+bto(i,ni)*bto(k,ni))*
     .          (alto(i,nj)*blto(k,nj)+blto(i,nj)*alto(k,nj))*
     .          amchar(nj)/xmneut(ni)*dsqrt(xmun)*sgn(ni)*2.D0*
     .          (th-xmutau-1.D0)
     .          +(ato(i,ni)*bto(k,ni)+bto(i,ni)*ato(k,ni))*
     .          (alto(i,nj)*alto(k,nj)+blto(i,nj)*blto(k,nj))*
     .          dsqrt(xmutau)*sgn(ni)*2.D0*(th-xmun-xmuneut1)+
     .          (ato(i,ni)*bto(k,ni)+bto(i,ni)*ato(k,ni))*
     .          (alto(i,nj)*blto(k,nj)+blto(i,nj)*alto(k,nj))*
     .          amchar(nj)/xmneut(ni)*dsqrt(xmun*xmutau)*(-4.D0) )
     .          +g2**2/dsntau(k)/dsntau(i)*(
     .          (antau(i,ni)*antau(k,ni)+bntau(i,ni)*bntau(k,ni))*
     .          (alsnt(i,nj)*alsnt(k,nj)+blsnt(i,nj)*blsnt(k,nj))*
     .          (xmuneut1*(-xmun+uh-1.D0)+xmun*(uh-xmutau)+xmutau*
     .          (uh-1.D0)+uh*(-uh+1.D0))+
     .          (antau(i,ni)*antau(k,ni)+bntau(i,ni)*bntau(k,ni))*
     .          (alsnt(i,nj)*blsnt(k,nj)+blsnt(i,nj)*alsnt(k,nj))*
     .          amchar(nj)/xmneut(ni)*dsqrt(xmutau)*sgn(ni)*2.D0*
     .          (uh-xmun-1.D0)
     .          +(antau(i,ni)*bntau(k,ni)+bntau(i,ni)*antau(k,ni))*
     .          (alsnt(i,nj)*alsnt(k,nj)+blsnt(i,nj)*blsnt(k,nj))*
     .          dsqrt(xmun)*sgn(ni)*2.D0*(uh-xmutau-xmuneut1)+
     .          (antau(i,ni)*bntau(k,ni)+bntau(i,ni)*antau(k,ni))*
     .          (alsnt(i,nj)*blsnt(k,nj)+blsnt(i,nj)*alsnt(k,nj))*
     .          dsqrt(xmun*xmutau)*amchar(nj)/xmneut(ni)*(-4.D0))
     .          -2.D0*g2**2/dsntau(k)/dstau(i)*(
     .          (alsnt(k,nj)*alto(i,nj)*ato(i,ni)*antau(k,ni)+
     .           blsnt(k,nj)*blto(i,nj)*bto(i,ni)*bntau(k,ni))*
     .          amchar(nj)/xmneut(ni)*(uh+th-1.D0-xmuneut1)+
     .          (alsnt(k,nj)*blto(i,nj)*ato(i,ni)*bntau(k,ni)+
     .           blsnt(k,nj)*alto(i,nj)*bto(i,ni)*antau(k,ni))*
     .          (uh*th-xmun*xmutau-xmuneut1)+
     .          (alsnt(k,nj)*alto(i,nj)*ato(i,ni)*bntau(k,ni)+
     .           blsnt(k,nj)*blto(i,nj)*bto(i,ni)*antau(k,ni))*
     .          amchar(nj)/xmneut(ni)*dsqrt(xmun)*sgn(ni)*
     .          (th-xmutau-1.D0)+
     .          (alsnt(k,nj)*alto(i,nj)*bto(i,ni)*antau(k,ni)+
     .           blsnt(k,nj)*blto(i,nj)*ato(i,ni)*bntau(k,ni))*
     .          amchar(nj)/xmneut(ni)*dsqrt(xmutau)*sgn(ni)*
     .          (uh-xmun-1.D0)+
     .          (alsnt(k,nj)*blto(i,nj)*ato(i,ni)*antau(k,ni)+
     .           blsnt(k,nj)*alto(i,nj)*bto(i,ni)*bntau(k,ni))*
     .          dsqrt(xmun)*sgn(ni)*(-xmuneut1-xmutau+uh)+
     .          (alsnt(k,nj)*blto(i,nj)*bto(i,ni)*bntau(k,ni)+
     .           blsnt(k,nj)*alto(i,nj)*ato(i,ni)*antau(k,ni))*
     .          dsqrt(xmutau)*sgn(ni)*(-xmuneut1-xmun+th)+
     .          (alsnt(k,nj)*alto(i,nj)*bto(i,ni)*bntau(k,ni)+
     .           blsnt(k,nj)*blto(i,nj)*ato(i,ni)*antau(k,ni))*
     .          amchar(nj)/xmneut(ni)*dsqrt(xmun*xmutau)*(-2.D0)+
     .          (alsnt(k,nj)*blto(i,nj)*bto(i,ni)*antau(k,ni)+
     .           blsnt(k,nj)*alto(i,nj)*ato(i,ni)*bntau(k,ni))*
     .          dsqrt(xmun*xmutau)*(uh+th-xmun-xmutau) )
             enddo
         enddo
      else
         xneutsf=0.D0
      endif

c -------------------------------------------------------------------- c
c                             W+ exchange
c -------------------------------------------------------------------- c

      xmuw = amwp**2/amneut(ni)**2
      dw   = y3-xmuw
      
c --- with mass dependence
      
      if((amchar(nj)+amtau).le.amneut(ni)) then
         xneutwtau=g2**2*16.D0/dw**2*vwff**2*(
     .        (ol(ni,nj)**2+or(ni,nj)**2)*(-xmuneut1-xmutau*xmun)
     .        +ol(ni,nj)**2*(xmuneut1*(uh-xmun)+uh*(xmutau+xmun)
     .         -xmutau-uh**2+uh)
     .        +or(ni,nj)**2*(xmuneut1*(th-xmutau)+th*(xmutau+xmun)
     .         -xmun-th**2+th) 
     .        +2.D0*amchar(nj)/xmneut(ni)*ol(ni,nj)*or(ni,nj)*
     .         (uh+th-1.D0-xmuneut1)
     .        +1.D0/xmuw**2*amchar(nj)/xmneut(ni)*ol(ni,nj)*
     .         or(ni,nj)*
     .         (xmuneut1**2*(xmutau+xmun)+xmuneut1*(xmutau**2+xmun**2
     .          +6.D0*xmutau*xmun)+(th+uh-1.D0)*(-2.D0*xmuneut1*xmun
     .          -2.D0*xmuneut1*xmutau-xmutau**2-xmun**2-6.D0*xmun*
     .          xmutau)+(xmun+xmutau)*(2.D0*uh*th-2.D0*th-2.D0*uh
     .          +1.D0+uh**2+th**2+4.D0*xmutau*xmun))
     .        +1.D0/4.D0/xmuw**2*(ol(ni,nj)**2+or(ni,nj)**2)*
     .         (xmuneut1**2*(xmun+xmutau)*(th+uh-xmun-xmutau-4.D0)
     .         +xmuneut1*((xmutau+xmun)*(6.D0*(uh+th)-th**2-uh**2-
     .          4.D0-2.D0*uh*th-2.D0*xmutau-2.D0*xmun)+6.D0*xmutau*xmun*
     .          (uh+th-2.D0)-4.D0*xmutau*xmun*(xmutau+xmun+1.D0)
     .          +(xmutau**2+xmun**2)*(uh+th))
     .         +xmun**2*(-4.D0*xmutau+uh+th-1.D0)
     .         +xmutau**2*(-4.D0*xmun+uh+th-1.D0)
     .         +xmutau*xmun*(6.D0*th+6.D0*uh-2.D0)
     .         +(xmun+xmutau)*(-th**2-uh**2+uh+th-2.D0*uh*th))
     .        +2.D0/xmuw*amchar(nj)/xmneut(ni)*ol(ni,nj)*or(ni,nj)*
     .         (-xmuneut1*(xmutau+xmun)-4.D0*xmutau*xmun+
     .          (xmutau+xmun)*(uh+th-1.D0))
     .        +1.D0/xmuw*(ol(ni,nj)**2+or(ni,nj)**2)*(
     .         xmuneut1*(2.D0*xmutau*xmun+2.D0*xmutau+2.D0*xmun
     .         -xmun*th-xmutau*uh)-xmutau*th-xmun*uh+2.D0*xmutau*xmun) )
      else
         xneutwtau=0.D0
      endif

c -------------------------------------------------------------------- c
c                            H+ exchange
c -------------------------------------------------------------------- c

      xmuch = amch**2/amneut(ni)**2
      dh    = y3-xmuch

c --- with mass dependence ---

      if((amchar(nj)+amtau).le.amneut(ni)) then
         xneuthtau=2.D0*g2**2/dh**2*(
     .     (ql(ni,nj)**2+qr(ni,nj)**2)*(vchtau**2+achtau**2)*
     .     ((1.D0+xmuneut1+xmun+xmutau)*(uh+th)-(uh+th)**2-(1.D0
     .     +xmuneut1)*(xmun+xmutau))+
     .     (ql(ni,nj)**2+qr(ni,nj)**2)*(vchtau**2-achtau**2)*(-2.D0)*
     .     dsqrt(xmun*xmutau)*(uh+th-xmun-xmutau)+
     .     4.D0*ql(ni,nj)*qr(ni,nj)*amchar(nj)/xmneut(ni)*
     .     (vchtau**2+achtau**2)*(1.D0+xmuneut1-uh-th)+
     .     4.D0*ql(ni,nj)*qr(ni,nj)*amchar(nj)/xmneut(ni)*
     .     (vchtau**2-achtau**2)*(-2.D0)*dsqrt(xmun*xmutau) )
      else
         xneuthtau=0.D0
      endif
	
c -------------------------------------------------------------------- c
c                        W+-sfermion interference
c -------------------------------------------------------------------- c

      xneutwsf=0.D0

c --- with mass dependence

      if((amchar(nj)+amtau).le.amneut(ni)) then
         do i=1,2
            xneutwsf=xneutwsf+g2**2*4.D0/dsntau(i)/dw*vwff*
     .      (2.D0*antau(i,ni)*alsnt(i,nj)*ol(ni,nj)*
     .       (xmuneut1*(-xmun+uh-1.D0)+uh*(xmun+xmutau)-xmun*xmutau
     .        -xmutau+uh*(1.D0-uh))+
     .       2.D0*antau(i,ni)*alsnt(i,nj)*or(ni,nj)*
     .       amchar(nj)/xmneut(ni)*(uh+th-xmuneut1-1.D0)+
     .       2.D0*bntau(i,ni)*alsnt(i,nj)*or(ni,nj)*dsqrt(xmun)*sgn(ni)*
     .       amchar(nj)/xmneut(ni)*(th-xmutau-1.D0)+
     .       4.D0*antau(i,ni)*blsnt(i,nj)*ol(ni,nj)*
     .       dsqrt(xmutau)*sgn(ni)*amchar(nj)/xmneut(ni)*(uh-xmun-1.D0)+
     .       4.D0*bntau(i,ni)*alsnt(i,nj)*ol(ni,nj)*dsqrt(xmun)*sgn(ni)*
     .       (uh-xmuneut1-xmutau)+
     .       2.D0*antau(i,ni)*blsnt(i,nj)*or(ni,nj)*dsqrt(xmutau)*
     .       sgn(ni)*(th-xmuneut1-xmun)+
     .       2.D0*bntau(i,ni)*blsnt(i,nj)*or(ni,nj)*dsqrt(xmun*xmutau)*
     .       (uh+th-xmun-xmutau)+
     .       8.D0*bntau(i,ni)*blsnt(i,nj)*ol(ni,nj)*(-1.D0)*
     .       dsqrt(xmun*xmutau)*amchar(nj)/xmneut(ni)+
     .       1.D0/xmuw*antau(i,ni)*alsnt(i,nj)*ol(ni,nj)*
     .       (xmun*(xmuneut1*(xmutau-th+2.D0)+xmutau-uh)+
     .        xmutau*(xmuneut1*(xmun-uh+2.D0)+xmun-th))+
     .       1.D0/xmuw*antau(i,ni)*alsnt(i,nj)*or(ni,nj)*
     .       amchar(nj)/xmneut(ni)*(xmuneut1*(-xmun-xmutau)+xmun*(th+uh
     .       -1.D0-2.D0*xmutau)+xmutau*(th+uh-1.D0-2.D0*xmun))+
     .       1.D0/xmuw*bntau(i,ni)*alsnt(i,nj)*or(ni,nj)*
     .       dsqrt(xmun)*sgn(ni)*amchar(nj)/xmneut(ni)*(xmuneut1*
     .       (-xmun+uh-1.D0)+xmun*(-xmutau+uh)+xmutau*(-xmutau+th+
     .       2.D0*uh-3.D0)+th*(1.D0-uh)+uh*(2.D0-uh)-1.D0)+
     .       1.D0/xmuw*antau(i,ni)*blsnt(i,nj)*ol(ni,nj)*
     .       dsqrt(xmutau)*sgn(ni)*amchar(nj)/xmneut(ni)*(xmuneut1*
     .       (xmun-uh+1.D0)+xmun*(xmun-th-2.D0*uh+2.D0)+xmutau*(xmun-
     .       uh+1.D0)+uh*th-th+uh**2-2.D0*uh+1.D0)+
     .       1.D0/xmuw*bntau(i,ni)*alsnt(i,nj)*ol(ni,nj)*
     .       dsqrt(xmun)*sgn(ni)*
     .       (xmuneut1**2+xmuneut1*(xmun+2.D0*xmutau-th-2.D0*uh+1.D0)
     .        +xmun*(xmutau-uh)+xmutau*(xmutau-th-2.D0*uh+1.D0)+uh*
     .        (th+uh-1.D0))+
     .       1.D0/xmuw*antau(i,ni)*blsnt(i,nj)*or(ni,nj)*
     .       dsqrt(xmutau)*sgn(ni)*(-xmuneut1**2+xmuneut1*(-3.D0*xmun+
     .       th+2.D0*uh-1.D0)+xmun*(-xmun+th+2.D0*uh)+xmutau*(-xmun+uh
     .       -1.D0)+uh*(-th-uh+1.D0))+
     .       2.D0/xmuw*bntau(i,ni)*blsnt(i,nj)*ol(ni,nj)*
     .       dsqrt(xmun*xmutau)*amchar(nj)/xmneut(ni)*(xmuneut1+xmun+
     .       xmutau-uh-th+1.D0)+
     .       1.D0/xmuw*bntau(i,ni)*blsnt(i,nj)*or(ni,nj)*
     .       dsqrt(xmun*xmutau)*(xmuneut1*(-xmun-xmutau+th+uh-4.D0)
     .       -xmun-xmutau+th+uh))
     .       -g2**2*4.D0/dstau(i)/dw*vwff*(
     .       2.D0*ato(i,ni)*alto(i,nj)*or(ni,nj)*(xmuneut1*(-xmutau
     .       +th-1.D0)+th*(xmun+xmutau)-xmun*xmutau-xmun+th*(1.D0-th))
     .       +2.D0*ato(i,ni)*alto(i,nj)*ol(ni,nj)*
     .       amchar(nj)/xmneut(ni)*(uh+th-xmuneut1-1.D0)+
     .       4.D0*ato(i,ni)*blto(i,nj)*or(ni,nj)*amchar(nj)/xmneut(ni)*
     .       dsqrt(xmun)*sgn(ni)*(th-xmutau-1.D0)+
     .       2.D0*bto(i,ni)*alto(i,nj)*ol(ni,nj)*amchar(nj)/xmneut(ni)*
     .       dsqrt(xmutau)*sgn(ni)*(uh-xmun-1.D0)+
     .       2.D0*ato(i,ni)*blto(i,nj)*ol(ni,nj)*dsqrt(xmun)*sgn(ni)*
     .       (uh-xmutau-xmuneut1)+
     .       4.D0*bto(i,ni)*alto(i,nj)*or(ni,nj)*dsqrt(xmutau)*sgn(ni)*
     .       (th-xmun-xmuneut1)+
     .       2.D0*bto(i,ni)*blto(i,nj)*ol(ni,nj)*dsqrt(xmutau*xmun)*
     .       (uh+th-xmun-xmutau)+
     .       8.D0*bto(i,ni)*blto(i,nj)*or(ni,nj)*dsqrt(xmutau*xmun)*
     .       amchar(nj)/xmneut(ni)*(-1.D0)+
     .       1.D0/xmuw*ato(i,ni)*alto(i,nj)*or(ni,nj)*(xmutau*
     .       (xmuneut1*(xmun-uh+2.D0)+xmun-th)+xmun*(xmuneut1*
     .       (xmutau-th+2.D0)+xmutau-uh))+
     .       1.D0/xmuw*ato(i,ni)*alto(i,nj)*ol(ni,nj)*
     .       amchar(nj)/xmneut(ni)*(xmuneut1*(-xmun-xmutau)+xmun*(uh
     .       +th-1.D0-2.D0*xmutau)+xmutau*(uh+th-1.D0-2.D0*xmun))+ 
     .       1.D0/xmuw*ato(i,ni)*blto(i,nj)*or(ni,nj)*
     .       amchar(nj)/xmneut(ni)*dsqrt(xmun)*sgn(ni)*(xmuneut1*
     .       (xmutau-th+1.D0)+xmutau*(xmutau-2.D0*th-uh+2.D0)+xmun*
     .       (xmutau-th+1.D0)+uh*th-uh+th**2-2.D0*th+1.D0)+
     .       1.D0/xmuw*bto(i,ni)*alto(i,nj)*ol(ni,nj)*
     .       amchar(nj)/xmneut(ni)*dsqrt(xmutau)*sgn(ni)*(xmuneut1*
     .       (-xmutau+th-1.D0)+xmutau*(-xmun+th)+xmun*(-xmun+2.D0*th+
     .       uh-3.D0)+uh*(-th+1.D0)+th*(2.D0-th)-1.D0)+
     .       1.D0/xmuw*ato(i,ni)*blto(i,nj)*ol(ni,nj)*
     .       dsqrt(xmun)*sgn(ni)*(-xmuneut1**2+xmuneut1*(-3.D0*xmutau+
     .       2.D0*th+uh-1.D0)+xmutau*(-xmutau+2.D0*th+uh)+xmun*
     .       (-xmutau+th-1.D0)+th*(-th-uh+1.D0))+
     .       1.D0/xmuw*bto(i,ni)*alto(i,nj)*or(ni,nj)*
     .       dsqrt(xmutau)*sgn(ni)*(
     .       xmuneut1**2+xmuneut1*(2.D0*xmun+xmutau-2.D0*th-uh+1.D0)
     .       +xmutau*(xmun-th)+xmun*(xmun-2.D0*th-uh+1.D0)+th*(th+uh
     .       -1.D0))+
     .       1.D0/xmuw*bto(i,ni)*blto(i,nj)*ol(ni,nj)*
     .       dsqrt(xmun*xmutau)*(xmuneut1*(-xmun-xmutau+th+uh-4.D0)+uh
     .       +th-xmun-xmutau)+
     .       2.D0/xmuw*bto(i,ni)*blto(i,nj)*or(ni,nj)*
     .       amchar(nj)/xmneut(ni)*dsqrt(xmun*xmutau)*(xmuneut1+xmun
     .       +xmutau-th-uh+1.D0))
         enddo
      else
         xneutwsf=0.D0
      endif

c -------------------------------------------------------------------- c
c                        H+ sfermion interference
c -------------------------------------------------------------------- c

      xneuthsf = 0.D0

c --- with mass dependence ---

      if((amchar(nj)+amtau).le.amneut(ni)) then
         do i=1,2
            xneuthsf=xneuthsf+2.D0*g2**2/dh/dsntau(i)*(
     .       (alsnt(i,nj)*bntau(i,ni)*qr(ni,nj)*(vchtau+achtau)
     .       +antau(i,ni)*blsnt(i,nj)*ql(ni,nj)*(vchtau-achtau))*
     .       amchar(nj)/xmneut(ni)*(uh+th-xmuneut1-1.D0)+
     .       (alsnt(i,nj)*bntau(i,ni)*ql(ni,nj)*(vchtau+achtau)
     .       +antau(i,ni)*blsnt(i,nj)*qr(ni,nj)*(vchtau-achtau))*
     .       (xmuneut1*(xmun-uh)+uh*(-xmun-xmutau)+xmutau+uh*
     .        (th+uh-1.D0))+
     .       (alsnt(i,nj)*antau(i,ni)*qr(ni,nj)*(vchtau+achtau)
     .       +bntau(i,ni)*blsnt(i,nj)*ql(ni,nj)*(vchtau-achtau))*
     .       amchar(nj)/xmneut(ni)*dsqrt(xmun)*sgn(ni)*
     .       (-xmutau+th-1.D0)+
     .       (alsnt(i,nj)*antau(i,ni)*qr(ni,nj)*(vchtau-achtau)
     .       +bntau(i,ni)*blsnt(i,nj)*ql(ni,nj)*(vchtau+achtau))*
     .       amchar(nj)/xmneut(ni)*dsqrt(xmutau)*sgn(ni)*(xmun-uh+1.D0)+
     .       (alsnt(i,nj)*antau(i,ni)*ql(ni,nj)*(vchtau+achtau)
     .       +bntau(i,ni)*blsnt(i,nj)*qr(ni,nj)*(vchtau-achtau))*
     .       dsqrt(xmun)*sgn(ni)*(xmuneut1+xmutau-uh)+
     .       (alsnt(i,nj)*antau(i,ni)*ql(ni,nj)*(vchtau-achtau)
     .       +bntau(i,ni)*blsnt(i,nj)*qr(ni,nj)*(vchtau+achtau))*
     .       dsqrt(xmutau)*sgn(ni)*(-xmuneut1-xmun+th)+
     .       (alsnt(i,nj)*bntau(i,ni)*qr(ni,nj)*(vchtau-achtau)
     .       +antau(i,ni)*blsnt(i,nj)*ql(ni,nj)*(vchtau+achtau))*
     .       amchar(nj)/xmneut(ni)*dsqrt(xmun*xmutau)*2.D0+
     .       (alsnt(i,nj)*bntau(i,ni)*ql(ni,nj)*(vchtau-achtau)
     .       +antau(i,ni)*blsnt(i,nj)*qr(ni,nj)*(vchtau+achtau))*
     .       dsqrt(xmun*xmutau)*(-xmun-xmutau+uh+th) )
     .       +2.D0*g2**2/dh/dstau(i)*(
     .       (alto(i,nj)*bto(i,ni)*ql(ni,nj)*(vchtau-achtau)
     .       +blto(i,nj)*ato(i,ni)*qr(ni,nj)*(vchtau+achtau))*
     .       amchar(nj)/xmneut(ni)*(uh+th-1.D0-xmuneut1)+
     .       (alto(i,nj)*bto(i,ni)*qr(ni,nj)*(vchtau-achtau)
     .       +blto(i,nj)*ato(i,ni)*ql(ni,nj)*(vchtau+achtau))*
     .       (xmuneut1*(xmutau-th)+xmun*(1.D0-th)+th*
     .       (-xmutau+th+uh-1.D0))+
     .       (alto(i,nj)*ato(i,ni)*ql(ni,nj)*(vchtau+achtau)
     .       +blto(i,nj)*bto(i,ni)*qr(ni,nj)*(vchtau-achtau))*
     .       amchar(nj)/xmneut(ni)*dsqrt(xmun)*sgn(ni)*(xmutau-th+1.D0)+
     .       (alto(i,nj)*ato(i,ni)*ql(ni,nj)*(vchtau-achtau)
     .       +blto(i,nj)*bto(i,ni)*qr(ni,nj)*(vchtau+achtau))*
     .       amchar(nj)/xmneut(ni)*dsqrt(xmutau)*sgn(ni)*(uh-xmun-1.D0)+
     .       (alto(i,nj)*ato(i,ni)*qr(ni,nj)*(vchtau+achtau)
     .       +blto(i,nj)*bto(i,ni)*ql(ni,nj)*(vchtau-achtau))*
     .       dsqrt(xmun)*sgn(ni)*(uh-xmuneut1-xmutau)+
     .       (alto(i,nj)*ato(i,ni)*qr(ni,nj)*(vchtau-achtau)
     .       +blto(i,nj)*bto(i,ni)*ql(ni,nj)*(vchtau+achtau))*
     .       dsqrt(xmutau)*sgn(ni)*(xmun+xmuneut1-th)+
     .       (alto(i,nj)*bto(i,ni)*ql(ni,nj)*(vchtau+achtau)
     .       +blto(i,nj)*ato(i,ni)*qr(ni,nj)*(vchtau-achtau))*
     .       amchar(nj)/xmneut(ni)*dsqrt(xmun*xmutau)*2.D0+
     .       (alto(i,nj)*bto(i,ni)*qr(ni,nj)*(vchtau+achtau)
     .       +blto(i,nj)*ato(i,ni)*ql(ni,nj)*(vchtau-achtau))*
     .       dsqrt(xmun*xmutau)*(uh+th-xmun-xmutau) )
         end do
      else
         xneuthsf=0.D0
      endif

c -------------------------------------------------------------------- c
c                           H+ W- interference
c -------------------------------------------------------------------- c

      if((amchar(nj)+amtau).le.amneut(ni)) then
            xneuthw=-g2**2/dw/dh*vwff*(
     .       (ql(ni,nj)*or(ni,nj)+qr(ni,nj)*ol(ni,nj))*(vchtau+achtau)*
     .       amchar(nj)/xmneut(ni)*dsqrt(xmun)*sgn(ni)*8.D0*
     .       (1.D0-th+xmutau)
     .      +(ql(ni,nj)*or(ni,nj)+qr(ni,nj)*ol(ni,nj))*(vchtau-achtau)*
     .       amchar(nj)/xmneut(ni)*dsqrt(xmutau)*sgn(ni)*8.D0*
     .       (-1.D0+uh-xmun)
     .      +(ql(ni,nj)*ol(ni,nj)+qr(ni,nj)*or(ni,nj))*(vchtau+achtau)*
     .       dsqrt(xmun)*sgn(ni)*8.D0*(uh-xmuneut1-xmutau)
     .      +(ql(ni,nj)*ol(ni,nj)+qr(ni,nj)*or(ni,nj))*(vchtau-achtau)*
     .       dsqrt(xmutau)*sgn(ni)*8.D0*(xmun+xmuneut1-th)+
     .      1.D0/xmuw*(
     .      (ql(ni,nj)*or(ni,nj)+qr(ni,nj)*ol(ni,nj))*(vchtau+achtau)*
     .      amchar(nj)/xmneut(ni)*dsqrt(xmun)*sgn(ni)*4.D0*(
     .      xmuneut1*(uh+th-xmun-xmutau-2.D0)+xmun*(uh+th-2.D0*xmutau
     .      -1.D0)+xmutau*(-2.D0*xmutau+3.D0*(th+uh)-5.D0)+th*(3.D0
     .      -2.D0*uh-th)+uh*(3.D0-uh)-2.D0)+
     .      (ql(ni,nj)*or(ni,nj)+qr(ni,nj)*ol(ni,nj))*(vchtau-achtau)*
     .      amchar(nj)/xmneut(ni)*dsqrt(xmutau)*sgn(ni)*4.D0*(
     .      xmuneut1*(-uh-th+xmun+xmutau+2.D0)+xmutau*(-uh-th+1.D0+
     .      2.D0*xmun)+xmun*(2.D0*xmun-3.D0*(th+uh)+5.D0)+uh*(uh-3.D0
     .      +2.D0*th)+th*(th-3.D0)+2.D0)+
     .      (ql(ni,nj)*ol(ni,nj)+qr(ni,nj)*or(ni,nj))*(vchtau+achtau)*
     .      dsqrt(xmun)*sgn(ni)*4.D0*(xmuneut1*(2.D0*xmuneut1+xmun+
     .      5.D0*xmutau-3.D0*(th+uh)+2.D0)+xmun*(2.D0*xmutau-th-uh+
     .      1.D0)+xmutau*(2.D0*xmutau-3.D0*(uh+th)+1.D0)+th*(th+2.D0*uh
     .      -1.D0)+uh*(uh-1.D0))+
     .      (ql(ni,nj)*ol(ni,nj)+qr(ni,nj)*or(ni,nj))*(vchtau-achtau)*
     .      dsqrt(xmutau)*sgn(ni)*4.D0*(xmuneut1*(-2.D0*xmuneut1-5.D0*
     .      xmun-xmutau+3.D0*(uh+th)-2.D0)+xmutau*(th+uh-1.D0-2.D0*
     .      xmun)+xmun*(-2.D0*xmun+3.D0*(th+uh)-1.D0)+uh*(-uh+1.D0
     .      -2.D0*th)+th*(1.D0-th)) ) )
      else
         xneuthw=0.D0
      endif

c -------------------------------------------------------------------- c

      SD_chtauntau = xneutsf+xneutwtau+xneuthtau+xneutwsf+xneuthsf+
     .               xneuthw

      end

c ==================================================================== c
c =======================  chargino- up downbar ====================== c
c ==================================================================== c

      double precision function SD_chubd(x1,x2)

      implicit double precision (a-h,m,o-z)
      integer k

      dimension aup(2,4),bup(2,4),ado(2,4),bdo(2,4)
      dimension alup(2,2),aldo(2,2),blup(2,2),bldo(2,2)
      dimension amneut(4),xmneut(4),amchar(2)
      dimension dsd(2),dsu(2)
      dimension ql(4,2),qr(4,2),or(4,2),ol(4,2)

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_squarkud/asup1,asup2,asdown1,asdown2
      COMMON/SD_indices/ni,nj
      COMMON/SD_coup3/ql,qr,ol,or
      COMMON/SD_coup7/alup,aldo
      COMMON/SD_coup10/aup,bup,ado,bdo
      COMMON/SD_coup18/awff,vwff
      COMMON/SD_mwmzpole/amwp,amzp

      xmuneut1 = amchar(nj)**2/amneut(ni)**2

      x3 = 2.D0-x1-x2
      y1 = 1.D0-xmuneut1-x1
      y2 = 1.D0-xmuneut1-x2
      y3 = 1.D0+xmuneut1-x3

      do i=1,2,1
         bldo(1,i) = 0.D0
         bldo(2,i) = 0.D0
         blup(1,i) = 0.D0
         blup(2,i) = 0.D0
      end do

c -------------------------------------------------------------------- c
c                          sfermion exchange
c -------------------------------------------------------------------- c

      xmusd1 = asdown1**2/amneut(ni)**2
      xmusd2 = asdown2**2/amneut(ni)**2
      xmusu1 = asup1**2/amneut(ni)**2
      xmusu2 = asup2**2/amneut(ni)**2

      dsd(1) = 1.D0-x2-xmusd1
      dsd(2) = 1.D0-x2-xmusd2
      dsu(1) = 1.D0-x1-xmusu1
      dsu(2) = 1.D0-x1-xmusu2
      
      xneutsf=0.D0

      if(amchar(nj).le.amneut(ni)) then
         do i=1,2
            do k=1,2
               xneutsf=xneutsf
     .              +g2**2/dsd(k)/dsd(i)*x2*y2*
     .              (ado(i,ni)*ado(k,ni)+bdo(i,ni)*bdo(k,ni))*
     .              (aldo(i,nj)*aldo(k,nj)+bldo(i,nj)*bldo(k,nj))
     .              +g2**2/dsu(k)/dsu(i)*x1*y1*
     .              (aup(i,ni)*aup(k,ni)+bup(i,ni)*bup(k,ni))*
     .              (alup(i,nj)*alup(k,nj)+blup(i,nj)*blup(k,nj))
     .              +g2**2/dsu(i)/dsd(k)*
     .              (( ado(k,ni)*bup(i,ni)*alup(i,nj)*bldo(k,nj)
     .                +aldo(k,nj)*blup(i,nj)*aup(i,ni)*bdo(k,ni))
     .              *(-x1*y1-x2*y2+x3*y3)
     .              +2.D0*amchar(nj)/xmneut(ni)*y3*
     .              ( ado(k,ni)*aup(i,ni)*alup(i,nj)*aldo(k,nj)
     .              + bldo(k,nj)*blup(i,nj)*bup(i,ni)*bdo(k,ni)))
            enddo
         enddo
      else
         xneutsf=0.D0
      endif

c -------------------------------------------------------------------- c
c                             W+ exchange
c -------------------------------------------------------------------- c

      xmuw = amwp**2/amneut(ni)**2
      dw   = y3-xmuw
      
      if(amchar(nj).le.amneut(ni)) then
         xneutw=g2**2*4.D0/dw**2*
     .        (4.D0*vwff**2*or(ni,nj)**2*x2*y2
     .        +4.D0*vwff**2*ol(ni,nj)**2*x1*y1
     .        -8.D0*amchar(nj)/xmneut(ni)*
     .        ol(ni,nj)*or(ni,nj)*vwff**2*y3 )
      else
         xneutw=0.D0
      endif
	
c -------------------------------------------------------------------- c
c                        W+-sfermion interference
c -------------------------------------------------------------------- c

      xneutwsf=0.D0

      if(amchar(nj).le.amneut(ni)) then
         do i=1,2
            xneutwsf=xneutwsf-g2**2*4.D0/dsd(i)/dw
     .           *(ado(i,ni)*aldo(i,nj)*or(ni,nj)*2.D0*vwff*x2*y2
     .            -aldo(i,nj)*ado(i,ni)*ol(ni,nj)*2.D0*vwff*
     .            amchar(nj)/xmneut(ni)*y3)
     .           +g2**2*4.d0/dsu(i)/dw
     .           *(aup(i,ni)*alup(i,nj)*ol(ni,nj)*2.D0*vwff*x1*y1
     .            -alup(i,nj)*aup(i,ni)*or(ni,nj)*2.D0*vwff*
     .            amchar(nj)/xmneut(ni)*y3)
         enddo
      else
         xneutwsf=0.D0
      endif

c -------------------------------------------------------------------- c

      SD_chubd = xneutsf+xneutw+xneutwsf

      end

c ==================================================================== c
c =====================  chargino- top bottombar ===================== c
c ==================================================================== c

      double precision function SD_chtbb(x1,x2)

      implicit double precision (a-h,m,o-z)
      integer k

      dimension amneut(4),xmneut(4),amchar(2)
      dimension dsbot(2),dstop(2),sgn(4)
      dimension atopr(2,4),btopr(2,4)
      dimension abot(2,4),bbot(2,4)
      dimension alsbot(2,2),aksbot(2,2),alstor(2,2),akstor(2,2)
      dimension ql(4,2),qr(4,2),or(4,2),ol(4,2)

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_hmass/ama,aml,amh,amch,amar
      COMMON/SD_fermion/amt,amb,amtau
      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2
      COMMON/SD_indices/ni,nj
      COMMON/SD_scala/scalb,scalt
      COMMON/SD_yukawa/ytewsb,ybewsb,ytauewsb
      COMMON/SD_coup3/ql,qr,ol,or
      COMMON/SD_coup18/awff,vwff
      COMMON/SD_runcoupscale/scalechoice,scaleofcoupling,inumloop
      COMMON/SD_mwmzpole/amwp,amzp

c --- the running couplings ---

      if(scalechoice.eq.1.D0) then
         scalb = ybewsb/dsqrt(g2)
         scalt = ytewsb/dsqrt(g2)
      elseif(scalechoice.eq.2.D0) then         
         call SD_runmass(amneut(ni),0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      elseif(scalechoice.eq.3.D0) then
         call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      endif

      call SD_neutstoptop(atopr,btopr)
      call SD_neutsbotbot(abot,bbot) 
      call SD_charstopbot(alstor,akstor)
      call SD_charsbottop(alsbot,aksbot)
      call SD_hctopbbot(vchtopr,achtopr)

c --- several definitions ---

      do i=1,4,1
         sgn(i) = 1.D0
         if(xmneut(i).gt.0.D0) then
            sgn(i) = 1.D0
         elseif(xmneut(i).lt.0.D0) then
            sgn(i) = -1.D0
         endif
      enddo

      xmuneut1 = amchar(nj)**2/amneut(ni)**2
      xmut     = amt**2/amneut(ni)**2
      xmub     = amb**2/amneut(ni)**2

      uh = 1.D0-x1+xmut
      th = 1.D0-x2+xmub

      x3 = 2.D0-x1-x2
      y3 = 1.D0+xmuneut1-x3

c -------------------------------------------------------------------- c
c                          sfermion exchange
c -------------------------------------------------------------------- c

      xmusbot1 = asb1**2/amneut(ni)**2
      xmusbot2 = asb2**2/amneut(ni)**2
      xmustop1 = ast1**2/amneut(ni)**2
      xmustop2 = ast2**2/amneut(ni)**2

      dsbot(1) = 1-x2-xmusbot1+xmub
      dsbot(2) = 1-x2-xmusbot2+xmub
      dstop(1) = 1-x1-xmustop1+xmut
      dstop(2) = 1-x1-xmustop2+xmut
      
      xneutsf=0.D0

c --- with mass dependence ---

      if((amchar(nj)+amt+amb).le.amneut(ni)) then
         do i=1,2
            do k=1,2
               xneutsf=xneutsf
     .          +g2**2/dsbot(k)/dsbot(i)*(
     .          (abot(i,ni)*abot(k,ni)+bbot(i,ni)*bbot(k,ni))*
     .          (alsbot(i,nj)*alsbot(k,nj)+aksbot(i,nj)*aksbot(k,nj))*
     .          (xmuneut1*(th-xmub-1.D0)+xmut*(th-1.D0)+xmub*(-xmut
     .          +th)+th*(-th+1.D0))+
     .          (abot(i,ni)*abot(k,ni)+bbot(i,ni)*bbot(k,ni))*
     .          (alsbot(i,nj)*aksbot(k,nj)+aksbot(i,nj)*alsbot(k,nj))*
     .          amchar(nj)/xmneut(ni)*dsqrt(xmut)*sgn(ni)*2.D0*
     .          (th-xmub-1.D0)
     .          +(abot(i,ni)*bbot(k,ni)+bbot(i,ni)*abot(k,ni))*
     .          (alsbot(i,nj)*alsbot(k,nj)+aksbot(i,nj)*aksbot(k,nj))*
     .          dsqrt(xmub)*sgn(ni)*2.D0*(th-xmut-xmuneut1)+
     .          (abot(i,ni)*bbot(k,ni)+bbot(i,ni)*abot(k,ni))*
     .          (alsbot(i,nj)*aksbot(k,nj)+aksbot(i,nj)*alsbot(k,nj))*
     .          amchar(nj)/xmneut(ni)*dsqrt(xmut*xmub)*(-4.D0) )
     .          +g2**2/dstop(k)/dstop(i)*(
     .          (atopr(i,ni)*atopr(k,ni)+btopr(i,ni)*btopr(k,ni))*
     .          (alstor(i,nj)*alstor(k,nj)+akstor(i,nj)*akstor(k,nj))*
     .          (xmuneut1*(-xmut+uh-1.D0)+xmut*(uh-xmub)+xmub*
     .          (uh-1.D0)+uh*(-uh+1.D0))+
     .          (atopr(i,ni)*atopr(k,ni)+btopr(i,ni)*btopr(k,ni))*
     .          (alstor(i,nj)*akstor(k,nj)+akstor(i,nj)*alstor(k,nj))*
     .          amchar(nj)/xmneut(ni)*dsqrt(xmub)*sgn(ni)*2.D0*
     .          (uh-xmut-1.D0)
     .          +(atopr(i,ni)*btopr(k,ni)+btopr(i,ni)*atopr(k,ni))*
     .          (alstor(i,nj)*alstor(k,nj)+akstor(i,nj)*akstor(k,nj))*
     .          dsqrt(xmut)*sgn(ni)*2.D0*(uh-xmub-xmuneut1)+
     .          (atopr(i,ni)*btopr(k,ni)+btopr(i,ni)*atopr(k,ni))*
     .          (alstor(i,nj)*akstor(k,nj)+akstor(i,nj)*alstor(k,nj))*
     .          dsqrt(xmut*xmub)*amchar(nj)/xmneut(ni)*(-4.D0))
     .          -2.D0*g2**2/dstop(k)/dsbot(i)*(
     .          (alstor(k,nj)*alsbot(i,nj)*abot(i,ni)*atopr(k,ni)+
     .           akstor(k,nj)*aksbot(i,nj)*bbot(i,ni)*btopr(k,ni))*
     .          amchar(nj)/xmneut(ni)*(uh+th-1.D0-xmuneut1)+
     .          (alstor(k,nj)*aksbot(i,nj)*abot(i,ni)*btopr(k,ni)+
     .           akstor(k,nj)*alsbot(i,nj)*bbot(i,ni)*atopr(k,ni))*
     .          (uh*th-xmut*xmub-xmuneut1)+
     .          (alstor(k,nj)*alsbot(i,nj)*abot(i,ni)*btopr(k,ni)+
     .           akstor(k,nj)*aksbot(i,nj)*bbot(i,ni)*atopr(k,ni))*
     .          amchar(nj)/xmneut(ni)*dsqrt(xmut)*sgn(ni)*
     .          (th-xmub-1.D0)+
     .          (alstor(k,nj)*alsbot(i,nj)*bbot(i,ni)*atopr(k,ni)+
     .           akstor(k,nj)*aksbot(i,nj)*abot(i,ni)*btopr(k,ni))*
     .          amchar(nj)/xmneut(ni)*dsqrt(xmub)*sgn(ni)*
     .          (uh-xmut-1.D0)+
     .          (alstor(k,nj)*aksbot(i,nj)*abot(i,ni)*atopr(k,ni)+
     .           akstor(k,nj)*alsbot(i,nj)*bbot(i,ni)*btopr(k,ni))*
     .          dsqrt(xmut)*sgn(ni)*(-xmuneut1-xmub+uh)+
     .          (alstor(k,nj)*aksbot(i,nj)*bbot(i,ni)*btopr(k,ni)+
     .           akstor(k,nj)*alsbot(i,nj)*abot(i,ni)*atopr(k,ni))*
     .          dsqrt(xmub)*sgn(ni)*(-xmuneut1-xmut-th)+
     .          (alstor(k,nj)*alsbot(i,nj)*bbot(i,ni)*btopr(k,ni)+
     .           akstor(k,nj)*aksbot(i,nj)*abot(i,ni)*atopr(k,ni))*
     .          amchar(nj)/xmneut(ni)*dsqrt(xmut*xmub)*(-2.D0)+
     .          (alstor(k,nj)*aksbot(i,nj)*bbot(i,ni)*atopr(k,ni)+
     .           akstor(k,nj)*alsbot(i,nj)*abot(i,ni)*btopr(k,ni))*
     .          dsqrt(xmut*xmub)*(uh+th-xmut-xmub) )
             enddo
         enddo
      else
         xneutsf=0.D0
      endif

c -------------------------------------------------------------------- c
c                               W+ exchange
c -------------------------------------------------------------------- c

      xmuw = amwp**2/amneut(ni)**2
      dw   = y3-xmuw

c --- with mass dependence

      if((amchar(nj)+amt+amb).le.amneut(ni)) then
         xneutw=g2**2*16.D0/dw**2*vwff**2*(
     .        (ol(ni,nj)**2+or(ni,nj)**2)*(-xmuneut1-xmub*xmut)
     .        +ol(ni,nj)**2*(xmuneut1*(uh-xmut)+uh*(xmub+xmut)
     .         -xmub-uh**2+uh)
     .        +or(ni,nj)**2*(xmuneut1*(th-xmub)+th*(xmub+xmut)
     .         -xmut-th**2+th) 
     .        +2.D0*amchar(nj)/xmneut(ni)*ol(ni,nj)*or(ni,nj)*
     .         (uh+th-1.D0-xmuneut1)
     .        +1.D0/xmuw**2*amchar(nj)/xmneut(ni)*ol(ni,nj)*
     .         or(ni,nj)*
     .         (xmuneut1**2*(xmub+xmut)+xmuneut1*(xmub**2+xmut**2
     .          +6.D0*xmub*xmut)+(th+uh-1.D0)*(-2.D0*xmuneut1*xmut
     .          -2.D0*xmuneut1*xmub-xmub**2-xmut**2-6.D0*xmut*
     .          xmub)+(xmut+xmub)*(2.D0*uh*th-2.D0*th-2.D0*uh
     .          +1.D0+uh**2+th**2+4.D0*xmub*xmut))
     .        +1.D0/4.D0/xmuw**2*(ol(ni,nj)**2+or(ni,nj)**2)*
     .         (xmuneut1**2*(xmut+xmub)*(th+uh-xmut-xmub-4.D0)
     .         +xmuneut1*((xmub+xmut)*(6.D0*(uh+th)-th**2-uh**2-
     .          4.D0-2.D0*uh*th-2.D0*xmub-2.D0*xmut)+6.D0*xmub*xmut*
     .          (uh+th-2.D0)-4.D0*xmub*xmut*(xmub+xmut+1.D0)
     .          +(xmub**2+xmut**2)*(uh+th))
     .         +xmut**2*(-4.D0*xmub+uh+th-1.D0)
     .         +xmub**2*(-4.D0*xmut+uh+th-1.D0)
     .         +xmub*xmut*(6.D0*th+6.D0*uh-2.D0)
     .         +(xmut+xmub)*(-th**2-uh**2+uh+th-2.D0*uh*th))
     .        +2.D0/xmuw*amchar(nj)/xmneut(ni)*ol(ni,nj)*or(ni,nj)*
     .         (-xmuneut1*(xmub+xmut)-4.D0*xmub*xmut+
     .          (xmub+xmut)*(uh+th-1.D0))
     .        +1.D0/xmuw*(ol(ni,nj)**2+or(ni,nj)**2)*(
     .         xmuneut1*(2.D0*xmub*xmut+2.D0*xmub+2.D0*xmut
     .         -xmut*th-xmub*uh)-xmub*th-xmut*uh+2.D0*xmub*xmut) )
      else
         xneutw=0.D0
      endif

c -------------------------------------------------------------------- c
c                              H+ exchange
c -------------------------------------------------------------------- c

      xmuch = amch**2/amneut(ni)**2
      dh    = y3-xmuch

c --- with mass dependence ---

      if((amchar(nj)+amt+amb).le.amneut(ni)) then
         xneuth=2.D0*g2**2/dh**2*(
     .     (ql(ni,nj)**2+qr(ni,nj)**2)*(vchtopr**2+achtopr**2)*
     .     ((1.D0+xmuneut1+xmut+xmub)*(uh+th)-(uh+th)**2-(1.D0
     .     +xmuneut1)*(xmut+xmub))+
     .     (ql(ni,nj)**2+qr(ni,nj)**2)*(vchtopr**2-achtopr**2)*(-2.D0)*
     .     dsqrt(xmut*xmub)*(uh+th-xmut-xmub)+
     .     4.D0*ql(ni,nj)*qr(ni,nj)*amchar(nj)/xmneut(ni)*
     .     (vchtopr**2+achtopr**2)*(1.D0+xmuneut1-uh-th)+
     .     4.D0*ql(ni,nj)*qr(ni,nj)*amchar(nj)/xmneut(ni)*
     .     (vchtopr**2-achtopr**2)*(-2.D0)*dsqrt(xmut*xmub) )
      else
         xneuth=0.D0
      endif

c -------------------------------------------------------------------- c
c                         W+-sfermion interference
c -------------------------------------------------------------------- c

      xneutwsf=0.D0

c --- with mass dependence

      if((amchar(nj)+amt+amb).le.amneut(ni)) then
         do i=1,2
            xneutwsf=xneutwsf+g2**2*4.D0/dstop(i)/dw*vwff*
     .      (2.D0*atopr(i,ni)*alstor(i,nj)*ol(ni,nj)*
     .       (xmuneut1*(-xmut+uh-1.D0)+uh*(xmut+xmub)-xmut*xmub
     .        -xmub+uh*(1.D0-uh))+
     .       2.D0*atopr(i,ni)*alstor(i,nj)*or(ni,nj)*
     .       amchar(nj)/xmneut(ni)*(uh+th-xmuneut1-1.D0)+
     .       2.D0*btopr(i,ni)*alstor(i,nj)*or(ni,nj)*
     .       dsqrt(xmut)*sgn(ni)*amchar(nj)/xmneut(ni)*(th-xmub-1.D0)+
     .       4.D0*atopr(i,ni)*akstor(i,nj)*ol(ni,nj)*
     .       dsqrt(xmub)*sgn(ni)*amchar(nj)/xmneut(ni)*(uh-xmut-1.D0)+
     .       4.D0*btopr(i,ni)*alstor(i,nj)*ol(ni,nj)*
     .       dsqrt(xmut)*sgn(ni)*(uh-xmuneut1-xmub)+
     .       2.D0*atopr(i,ni)*akstor(i,nj)*or(ni,nj)*
     .       dsqrt(xmub)*sgn(ni)*(th-xmuneut1-xmut)+
     .       2.D0*btopr(i,ni)*akstor(i,nj)*or(ni,nj)*dsqrt(xmut*xmub)*
     .       (uh+th-xmut-xmub)+
     .       8.D0*btopr(i,ni)*akstor(i,nj)*ol(ni,nj)*(-1.D0)*
     .       dsqrt(xmut*xmub)*amchar(nj)/xmneut(ni)+
     .       1.D0/xmuw*atopr(i,ni)*alstor(i,nj)*ol(ni,nj)*
     .       (xmut*(xmuneut1*(xmub-th+2.D0)+xmub-uh)+
     .        xmub*(xmuneut1*(xmut-uh+2.D0)+xmut-th))+
     .       1.D0/xmuw*atopr(i,ni)*alstor(i,nj)*or(ni,nj)*
     .       amchar(nj)/xmneut(ni)*(xmuneut1*(-xmut-xmub)+xmut*(th+uh
     .       -1.D0-2.D0*xmub)+xmub*(th+uh-1.D0-2.D0*xmut))+
     .       1.D0/xmuw*btopr(i,ni)*alstor(i,nj)*or(ni,nj)*
     .       dsqrt(xmut)*sgn(ni)*
     .       amchar(nj)/xmneut(ni)*(xmuneut1*(-xmut+uh-1.D0)+xmut*
     .       (-xmub+uh)+xmub*(-xmub+th+2.D0*uh-3.D0)+th*(1.D0-uh)
     .       +uh*(2.D0-uh)-1.D0)+
     .       1.D0/xmuw*atopr(i,ni)*akstor(i,nj)*ol(ni,nj)*
     .       dsqrt(xmub)*sgn(ni)*
     .       amchar(nj)/xmneut(ni)*(xmuneut1*(xmut-uh+1.D0)+xmut*(
     .       xmut-th-2.D0*uh+2.D0)+xmub*(xmut-uh+1.D0)+uh*th-th+uh**2
     .       -2.D0*uh+1.D0)+
     .       1.D0/xmuw*btopr(i,ni)*alstor(i,nj)*ol(ni,nj)*
     .       dsqrt(xmut)*sgn(ni)*(xmuneut1**2+xmuneut1*(xmut+2.D0*xmub
     .       -th-2.D0*uh+1.D0)+xmut*(xmub-uh)+xmub*(xmub-th-2.D0*uh+
     .       1.D0)+uh*(th+uh-1.D0))+
     .       1.D0/xmuw*atopr(i,ni)*akstor(i,nj)*or(ni,nj)*
     .       dsqrt(xmub)*sgn(ni)*(-xmuneut1**2+xmuneut1*(-3.D0*xmut+th+
     .       2.D0*uh-1.D0)+xmut*(-xmut+th+2.D0*uh)+xmub*(-xmut+uh-1.D0)
     .       +uh*(-th-uh+1.D0))+
     .       2.D0/xmuw*btopr(i,ni)*akstor(i,nj)*ol(ni,nj)*
     .       dsqrt(xmut*xmub)*amchar(nj)/xmneut(ni)*(xmuneut1+xmut+
     .       xmub-uh-th+1.D0)+
     .       1.D0/xmuw*btopr(i,ni)*akstor(i,nj)*or(ni,nj)*
     .       dsqrt(xmut*xmub)*(xmuneut1*(-xmut-xmub+th+uh-4.D0)
     .       -xmut-xmub+th+uh))
     .       -g2**2*4.D0/dsbot(i)/dw*vwff*(
     .       2.D0*abot(i,ni)*alsbot(i,nj)*or(ni,nj)*(xmuneut1*(-xmub
     .       +th-1.D0)+th*(xmut+xmub)-xmut*xmub-xmut+th*(1.D0-th))
     .       +2.D0*abot(i,ni)*alsbot(i,nj)*ol(ni,nj)*
     .       amchar(nj)/xmneut(ni)*(uh+th-xmuneut1-1.D0)+
     .       4.D0*abot(i,ni)*aksbot(i,nj)*or(ni,nj)*
     .       amchar(nj)/xmneut(ni)*dsqrt(xmut)*sgn(ni)*(th-xmub-1.D0)+
     .       2.D0*bbot(i,ni)*alsbot(i,nj)*ol(ni,nj)*
     .       amchar(nj)/xmneut(ni)*dsqrt(xmub)*sgn(ni)*(uh-xmut-1.D0)+
     .       2.D0*abot(i,ni)*aksbot(i,nj)*ol(ni,nj)*dsqrt(xmut)*sgn(ni)*
     .       (uh-xmub-xmuneut1)+
     .       4.D0*bbot(i,ni)*alsbot(i,nj)*or(ni,nj)*dsqrt(xmub)*sgn(ni)*
     .       (th-xmut-xmuneut1)+
     .       2.D0*bbot(i,ni)*aksbot(i,nj)*ol(ni,nj)*dsqrt(xmub*xmut)*
     .       (uh+th-xmut-xmub)+
     .       8.D0*bbot(i,ni)*aksbot(i,nj)*or(ni,nj)*dsqrt(xmub*xmut)*
     .       amchar(nj)/xmneut(ni)*(-1.D0)+
     .       1.D0/xmuw*abot(i,ni)*alsbot(i,nj)*or(ni,nj)*(xmub*
     .       (xmuneut1*(xmut-uh+2.D0)+xmut-th)+xmut*(xmuneut1*
     .       (xmub-th+2.D0)+xmub-uh))+
     .       1.D0/xmuw*abot(i,ni)*alsbot(i,nj)*ol(ni,nj)*
     .       amchar(nj)/xmneut(ni)*(xmuneut1*(-xmut-xmub)+xmut*(uh
     .       +th-1.D0-2.D0*xmub)+xmub*(uh+th-1.D0-2.D0*xmut))+ 
     .       1.D0/xmuw*abot(i,ni)*aksbot(i,nj)*or(ni,nj)*
     .       amchar(nj)/xmneut(ni)*dsqrt(xmut)*sgn(ni)*(xmuneut1*
     .       (xmub-th+1.D0)+xmub*(xmub-2.D0*th-uh+2.D0)+xmut*(xmub-th
     .       +1.D0)+uh*th-uh+th**2-2.D0*th+1.D0)+
     .       1.D0/xmuw*bbot(i,ni)*alsbot(i,nj)*ol(ni,nj)*
     .       amchar(nj)/xmneut(ni)*dsqrt(xmub)*sgn(ni)*(xmuneut1*(-xmub+
     .       th-1.D0)+xmub*(-xmut+th)+xmut*(-xmut+2.D0*th+uh-3.D0)+
     .       uh*(-th+1.D0)+th*(2.D0-th)-1.D0)+
     .       1.D0/xmuw*abot(i,ni)*aksbot(i,nj)*ol(ni,nj)*
     .       dsqrt(xmut)*sgn(ni)*(-xmuneut1**2+xmuneut1*(-3.D0*xmub+
     .       2.D0*th+uh-1.D0)+xmub*(-xmub+2.D0*th+uh)+xmut*(-xmub+th-
     .       1.D0)+th*(-th-uh+1.D0))+
     .       1.D0/xmuw*bbot(i,ni)*alsbot(i,nj)*or(ni,nj)*
     .       dsqrt(xmub)*sgn(ni)*(xmuneut1**2+xmuneut1*(2.D0*xmut+xmub
     .       -2.D0*th-uh+1.D0)+xmub*(xmut-th)+xmut*(xmut-2.D0*th-uh+
     .       1.D0)+th*(th+uh-1.D0))+
     .       1.D0/xmuw*bbot(i,ni)*aksbot(i,nj)*ol(ni,nj)*
     .       dsqrt(xmut*xmub)*(xmuneut1*(-xmut-xmub+th+uh-4.D0)+uh
     .       +th-xmut-xmub)+
     .       2.D0/xmuw*bbot(i,ni)*aksbot(i,nj)*or(ni,nj)*
     .       amchar(nj)/xmneut(ni)*dsqrt(xmut*xmub)*(xmuneut1+xmut
     .       +xmub-th-uh+1.D0))
         enddo
      else
         xneutwsf=0.D0
      endif

c -------------------------------------------------------------------- c
c                          H+ sfermion interference
c -------------------------------------------------------------------- c
	
      xneuthsf = 0.D0

c --- with mass dependence ---

      if((amchar(nj)+amt+amb).le.amneut(ni)) then
         do i=1,2
            xneuthsf=xneuthsf+2.D0*g2**2/dh/dstop(i)*(
     .       (alstor(i,nj)*btopr(i,ni)*qr(ni,nj)*(vchtopr+achtopr)
     .       +atopr(i,ni)*akstor(i,nj)*ql(ni,nj)*(vchtopr-achtopr))*
     .       amchar(nj)/xmneut(ni)*(uh+th-xmuneut1-1.D0)+
     .       (alstor(i,nj)*btopr(i,ni)*ql(ni,nj)*(vchtopr+achtopr)
     .       +atopr(i,ni)*akstor(i,nj)*qr(ni,nj)*(vchtopr-achtopr))*
     .       (xmuneut1*(xmut-uh)+uh*(-xmut-xmub)+xmub+uh*
     .        (th+uh-1.D0))+
     .       (alstor(i,nj)*atopr(i,ni)*qr(ni,nj)*(vchtopr+achtopr)
     .       +btopr(i,ni)*akstor(i,nj)*ql(ni,nj)*(vchtopr-achtopr))*
     .       amchar(nj)/xmneut(ni)*dsqrt(xmut)*sgn(ni)*(-xmub+th-1.D0)+
     .       (alstor(i,nj)*atopr(i,ni)*qr(ni,nj)*(vchtopr-achtopr)
     .       +btopr(i,ni)*akstor(i,nj)*ql(ni,nj)*(vchtopr+achtopr))*
     .       amchar(nj)/xmneut(ni)*dsqrt(xmub)*sgn(ni)*(xmut-uh+1.D0)+
     .       (alstor(i,nj)*atopr(i,ni)*ql(ni,nj)*(vchtopr+achtopr)
     .       +btopr(i,ni)*akstor(i,nj)*qr(ni,nj)*(vchtopr-achtopr))*
     .       dsqrt(xmut)*sgn(ni)*(xmuneut1+xmub-uh)+
     .       (alstor(i,nj)*atopr(i,ni)*ql(ni,nj)*(vchtopr-achtopr)
     .       +btopr(i,ni)*akstor(i,nj)*qr(ni,nj)*(vchtopr+achtopr))*
     .       dsqrt(xmub)*sgn(ni)*(-xmuneut1-xmut+th)+
     .       (alstor(i,nj)*btopr(i,ni)*qr(ni,nj)*(vchtopr-achtopr)
     .       +atopr(i,ni)*akstor(i,nj)*ql(ni,nj)*(vchtopr+achtopr))*
     .       amchar(nj)/xmneut(ni)*dsqrt(xmut*xmub)*2.D0+
     .       (alstor(i,nj)*btopr(i,ni)*ql(ni,nj)*(vchtopr-achtopr)
     .       +atopr(i,ni)*akstor(i,nj)*qr(ni,nj)*(vchtopr+achtopr))*
     .       dsqrt(xmut*xmub)*(-xmut-xmub+uh+th) )
     .       +2.D0*g2**2/dh/dsbot(i)*(
     .       (alsbot(i,nj)*bbot(i,ni)*ql(ni,nj)*(vchtopr-achtopr)
     .       +aksbot(i,nj)*abot(i,ni)*qr(ni,nj)*(vchtopr+achtopr))*
     .       amchar(nj)/xmneut(ni)*(uh+th-1.D0-xmuneut1)+
     .       (alsbot(i,nj)*bbot(i,ni)*qr(ni,nj)*(vchtopr-achtopr)
     .       +aksbot(i,nj)*abot(i,ni)*ql(ni,nj)*(vchtopr+achtopr))*
     .       (xmuneut1*(xmub-th)+xmut*(1.D0-th)+th*
     .       (-xmub+th+uh-1.D0))+
     .       (alsbot(i,nj)*abot(i,ni)*ql(ni,nj)*(vchtopr+achtopr)
     .       +aksbot(i,nj)*bbot(i,ni)*qr(ni,nj)*(vchtopr-achtopr))*
     .       amchar(nj)/xmneut(ni)*dsqrt(xmut)*sgn(ni)*(xmub-th+1.D0)+
     .       (alsbot(i,nj)*abot(i,ni)*ql(ni,nj)*(vchtopr-achtopr)
     .       +aksbot(i,nj)*bbot(i,ni)*qr(ni,nj)*(vchtopr+achtopr))*
     .       amchar(nj)/xmneut(ni)*dsqrt(xmub)*sgn(ni)*(uh-xmut-1.D0)+
     .       (alsbot(i,nj)*abot(i,ni)*qr(ni,nj)*(vchtopr+achtopr)
     .       +aksbot(i,nj)*bbot(i,ni)*ql(ni,nj)*(vchtopr-achtopr))*
     .       dsqrt(xmut)*sgn(ni)*(uh-xmuneut1-xmub)+
     .       (alsbot(i,nj)*abot(i,ni)*qr(ni,nj)*(vchtopr-achtopr)
     .       +aksbot(i,nj)*bbot(i,ni)*ql(ni,nj)*(vchtopr+achtopr))*
     .       dsqrt(xmub)*sgn(ni)*(xmut+xmuneut1-th)+
     .       (alsbot(i,nj)*bbot(i,ni)*ql(ni,nj)*(vchtopr+achtopr)
     .       +aksbot(i,nj)*abot(i,ni)*qr(ni,nj)*(vchtopr-achtopr))*
     .       amchar(nj)/xmneut(ni)*dsqrt(xmut*xmub)*2.D0+
     .       (alsbot(i,nj)*bbot(i,ni)*qr(ni,nj)*(vchtopr+achtopr)
     .       +aksbot(i,nj)*abot(i,ni)*ql(ni,nj)*(vchtopr-achtopr))*
     .       dsqrt(xmut*xmub)*(uh+th-xmut-xmub) )
         end do
      else
         xneuthsf=0.D0
      endif

c -------------------------------------------------------------------- c
c                           H+ W- interference
c -------------------------------------------------------------------- c

      if((amchar(nj)+amt+amb).le.amneut(ni)) then
            xneuthw=-g2**2/dw/dh*vwff*(
     .     (ql(ni,nj)*or(ni,nj)+qr(ni,nj)*ol(ni,nj))*(vchtopr+achtopr)*
     .     amchar(nj)/xmneut(ni)*dsqrt(xmut)*sgn(ni)*8.D0*(1.D0-th+xmub)
     .     +(ql(ni,nj)*or(ni,nj)+qr(ni,nj)*ol(ni,nj))*(vchtopr-achtopr)*
     .     amchar(nj)/xmneut(ni)*dsqrt(xmub)*sgn(ni)*8.D0*(-1.D0+uh
     .     -xmut)
     .     +(ql(ni,nj)*ol(ni,nj)+qr(ni,nj)*or(ni,nj))*(vchtopr+achtopr)*
     .     dsqrt(xmut)*sgn(ni)*8.D0*(uh-xmuneut1-xmub)
     .     +(ql(ni,nj)*ol(ni,nj)+qr(ni,nj)*or(ni,nj))*(vchtopr-achtopr)*
     .     dsqrt(xmub)*sgn(ni)*8.D0*(xmut+xmuneut1-th)+
     .     1.D0/xmuw*(
     .     (ql(ni,nj)*or(ni,nj)+qr(ni,nj)*ol(ni,nj))*(vchtopr+achtopr)*
     .     amchar(nj)/xmneut(ni)*dsqrt(xmut)*sgn(ni)*4.D0*(
     .     xmuneut1*(uh+th-xmut-xmub-2.D0)+xmut*(uh+th-2.D0*xmub
     .     -1.D0)+xmub*(-2.D0*xmub+3.D0*(th+uh)-5.D0)+th*(3.D0
     .     -2.D0*uh-th)+uh*(3.D0-uh)-2.D0)+
     .     (ql(ni,nj)*or(ni,nj)+qr(ni,nj)*ol(ni,nj))*(vchtopr-achtopr)*
     .     amchar(nj)/xmneut(ni)*dsqrt(xmub)*sgn(ni)*4.D0*(
     .     xmuneut1*(-uh-th+xmut+xmub+2.D0)+xmub*(-uh-th+1.D0+
     .     2.D0*xmut)+xmut*(2.D0*xmut-3.D0*(th+uh)+5.D0)+uh*(uh-3.D0
     .     +2.D0*th)+th*(th-3.D0)+2.D0)+
     .     (ql(ni,nj)*ol(ni,nj)+qr(ni,nj)*or(ni,nj))*(vchtopr+achtopr)*
     .     dsqrt(xmut)*sgn(ni)*4.D0*(xmuneut1*(2.D0*xmuneut1+xmut+
     .     5.D0*xmub-3.D0*(th+uh)+2.D0)+xmut*(2.D0*xmub-th-uh+1.D0)+
     .     xmub*(2.D0*xmub-3.D0*(uh+th)+1.D0)+th*(th+2.D0*uh-1.D0)+uh*(
     .     uh-1.D0))+
     .     (ql(ni,nj)*ol(ni,nj)+qr(ni,nj)*or(ni,nj))*(vchtopr-achtopr)*
     .     dsqrt(xmub)*sgn(ni)*4.D0*(xmuneut1*(-2.D0*xmuneut1-5.D0*xmut
     .     -xmub+3.D0*(uh+th)-2.D0)+xmub*(th+uh-1.D0-2.D0*xmut)+
     .     xmut*(-2.D0*xmut+3.D0*(th+uh)-1.D0)+uh*(-uh+1.D0-2.D0*th)+
     .     th*(1.D0-th))) )
      else
         xneuthw=0.D0
      endif

c -------------------------------------------------------------------- c

      SD_chtbb = xneutsf+xneutw+xneuth+xneutwsf+xneuthsf+xneuthw

      end

c ==================================================================== c
c                         gluino 2-body decays                         c
c ==================================================================== c

      subroutine SD_glui2bod(gst1,gst2,gsb1,gsb2,gsupl,gsupr,gsdownl,
     .                       gsdownr,qcdgst1,qcdgst2,qcdgsb1,qcdgsb2,
     .                       qcdgsupl,qcdgsupr,qcdgsdownl,qcdgsdownr)
  
      implicit double precision (a-h,m,o-z)
      double precision SD_lamb,lamv,nf
      complex*16 SD_iint,SD_i2int,SD_jint,SD_kint

      dimension gtr(2),gtl(2),gbr(2),gbl(2),gur(2),gul(2),gdr(2),gdl(2)
      dimension amneut(4),amchar(2),xmneut(4)
      dimension u(2,2),v(2,2),z(4,4),zp(4,4)
      dimension aup(2,4),bup(2,4),ado(2,4),bdo(2,4)

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_gluino/mgluino
      COMMON/SD_fermion/amt,amb,amtau
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2
      COMMON/SD_squarkud/asup1,asup2,asdown1,asdown2
      COMMON/SD_sfmixang/thet,theb,thel,cu,su,cd,sd,ce,se
      COMMON/SD_weinberg/sw,cw
      COMMON/SD_mixmat/u,v,z,zp
      COMMON/SD_coupewsb/alsew,g2ew,g1ew
      COMMON/SD_coup10/aup,bup,ado,bdo
      COMMON/SD_coup21/gtr,gtl,gbr,gbl,gur,gul,gdr,gdl
      COMMON/SD_refscale/amuref
      COMMON/SD_runcoupscale/scalechoice,scaleofcoupling,inumloop

      external SD_alphascall
      external SD_iint,SD_i2int,SD_jint,SD_kint
      external SD_gamtop1,SD_gamtop2,SD_gamglui1,SD_gamglui2,
     .         SD_gamglui3,SD_gam11,SD_gam12,SD_gamvirt,SD_gamrealgl,
     .         SD_gamcfdec
      external SD_gama,SD_gamfcap,SD_gamf,SD_gamrendec

c -- the running alphas --

      if(scalechoice.eq.1.D0) then
         gs2 = alsew*4.D0*pi
         amurefer = amuref
      elseif(scalechoice.eq.2.D0) then         
         gs2 = SD_alphascall(mgluino,inumloop)*4.D0*pi
         amurefer = mgluino
      elseif(scalechoice.eq.3.D0) then
         gs2 = SD_alphascall(scaleofcoupling,inumloop)*4.D0*pi
         amurefer = scaleofcoupling
      endif

c -- the mass values needed in the QCD corrections --

      lamv = 1.D-15
      amuv = 1000.D20

c -------------------------------------------------------------------- c
c  gluino --> stop1 + top

      if((ast1+amt).le.mgluino) then
         gst1=gs2/2.D0*((gtl(1)**2+gtr(1)**2)*
     .        (mgluino**2-ast1**2+amt**2)
     .        +4*gtl(1)*gtr(1)*mgluino*amt)*
     .        SD_lamb(amt/mgluino,ast1/mgluino)
     .         /(16*pi*mgluino)
      else
         gst1=0.D0
      endif

c --- the QCD corrections ---

      if(mgluino.gt.(ast1+amt)) then
         amsq    = 2.D0*(asup1+asup2+asdown1+asdown2)/8.D0
         scalmur = amurefer
         alp     = gs2/(4.D0*pi)
         nf      = 6.D0
         qcdgst1 = 8.D0*pi*alp/3.D0/amt**2*gst1*
     .        SD_gamtop1(ast1,ast2,amt,mgluino,thet,1,amuv,lamv) -
     .        pi*alp**2*SD_lamb(amt/mgluino,ast1/mgluino)/
     .        (3.D0*amt**2*mgluino)*
     .        SD_gamtop2(ast1,ast2,amt,mgluino,thet,1,amuv) +
     .        4.D0*pi*alp/mgluino**2*gst1*(nf-2.D0)*
     .        SD_gamglui1(ast1,ast2,amsq,amt,mgluino,amuv) +
     .        2.D0*pi*alp/mgluino**2*gst1*
     .        SD_gamglui2(ast1,ast2,amt,thet,asb1,asb2,amb,theb,
     .                    mgluino,1,amuv) +
     .        4.D0*pi*alp*3.D0/mgluino**2*gst1*
     .        SD_gamglui3(mgluino,amuv,lamv) +
     .        8.D0*4.D0/3.D0*pi*alp*gst1*
     .        SD_gam11(ast1,ast2,amt,mgluino,thet,1,amuv,lamv) -
     .        8.D0/3.D0*pi*alp**2/mgluino*
     .        SD_lamb(amt/mgluino,ast1/mgluino)*
     .        SD_gam12(ast1,ast2,amt,mgluino,thet,1,amuv,lamv,scalmur) -
     .        3.D0/16.D0*alp**2*SD_lamb(amt/mgluino,ast1/mgluino)
     .        /mgluino*
     .        SD_gamvirt(ast1,ast2,amt,mgluino,thet,1,amuv,lamv) -
     .        3.D0/16.D0*ast1/mgluino*
     .        alp**2*SD_gamrealgl(ast1,amt,mgluino,thet,1,lamv) +
     .        alp/(4.D0*pi)*gst1*
     .        SD_gamcfdec(ast1,ast2,amt,asb1,asb2,amb,mgluino,amsq,amuv,
     .        scalmur)
      else
         qcdgst1 = 0.D0
      endif

c -------------------------------------------------------------------- c
c  gluino --> stop2 + top

      if((ast2+amt).le.mgluino) then
         gst2=gs2/2.d0*((gtl(2)**2+gtr(2)**2)*
     .        (mgluino**2-ast2**2+amt**2)
     .        +4*gtl(2)*gtr(2)*mgluino*amt)*
     .        SD_lamb(amt/mgluino,ast2/mgluino)
     .         /(16*pi*mgluino)
      else
         gst2=0.d0
      endif

c --- the QCD corrections ---

      if(mgluino.gt.(ast2+amt)) then
         amsq    = 2.D0*(asup1+asup2+asdown1+asdown2)/8.D0
         scalmur = amurefer
         alp     = gs2/(4.D0*pi)
         nf      = 6.D0
         qcdgst2 = 8.D0*pi*alp/3.D0/amt**2*gst2*
     .        SD_gamtop1(ast2,ast1,amt,mgluino,thet,2,amuv,lamv) -
     .        pi*alp**2*SD_lamb(amt/mgluino,ast2/mgluino)/
     .        (3.D0*amt**2*mgluino)*
     .        SD_gamtop2(ast2,ast1,amt,mgluino,thet,2,amuv) +
     .        4.D0*pi*alp/mgluino**2*gst2*(nf-2.D0)*
     .        SD_gamglui1(ast2,ast1,amsq,amt,mgluino,amuv) +
     .        2.D0*pi*alp/mgluino**2*gst2*
     .        SD_gamglui2(ast2,ast1,amt,thet,asb2,asb1,amb,theb,
     .                    mgluino,2,amuv) +
     .        4.D0*pi*alp*3.D0/mgluino**2*gst2*
     .        SD_gamglui3(mgluino,amuv,lamv) +
     .        8.D0*4.D0/3.D0*pi*alp*gst2*
     .        SD_gam11(ast2,ast1,amt,mgluino,thet,2,amuv,lamv) -
     .        8.D0/3.D0*pi*alp**2/mgluino*
     .        SD_lamb(amt/mgluino,ast2/mgluino)*
     .        SD_gam12(ast2,ast1,amt,mgluino,thet,2,amuv,lamv,scalmur) -
     .        3.D0/16.D0*alp**2*SD_lamb(amt/mgluino,ast2/mgluino)
     .        /mgluino*
     .        SD_gamvirt(ast2,ast1,amt,mgluino,thet,2,amuv,lamv) -
     .        3.D0/16.D0*ast2/mgluino*
     .        alp**2*SD_gamrealgl(ast2,amt,mgluino,thet,2,lamv) +
     .        alp/(4.D0*pi)*gst2*
     .        SD_gamcfdec(ast2,ast1,amt,asb2,asb1,amb,mgluino,amsq,amuv,
     .        scalmur)
      else
         qcdgst2 = 0.D0
      endif

c -------------------------------------------------------------------- c
c  gluino --> sbottom1 + bottom

      if((asb1+amb).le.mgluino) then
         gsb1=gs2/2.d0*((gbl(1)**2+gbr(1)**2)*
     .        (mgluino**2-asb1**2+amb**2)
     .        +4*gbl(1)*gbr(1)*mgluino*amb)*
     .        SD_lamb(amb/mgluino,asb1/mgluino)
     .         /(16*pi*mgluino)
      else
         gsb1=0.d0
      endif

c --- the QCD corrections ---

      if(mgluino.gt.(asb1+amb)) then
         amsq    = 2.D0*(asup1+asup2+asdown1+asdown2)/8.D0
         scalmur = amurefer
         alp     = gs2/(4.D0*pi)
         nf      = 6.D0
         qcdgsb1 = 8.D0*pi*alp/3.D0/amb**2*gsb1*
     .        SD_gamtop1(asb1,asb2,amb,mgluino,theb,1,amuv,lamv) -
     .        pi*alp**2*SD_lamb(amb/mgluino,asb1/mgluino)/
     .        (3.D0*amb**2*mgluino)*
     .        SD_gamtop2(asb1,asb2,amb,mgluino,theb,1,amuv) +
     .        4.D0*pi*alp/mgluino**2*gsb1*(nf-2.D0)*
     .        SD_gamglui1(ast1,ast2,amsq,amt,mgluino,amuv) +
     .        2.D0*pi*alp/mgluino**2*gsb1*
     .        SD_gamglui2(ast1,ast2,amt,thet,asb1,asb2,amb,theb,
     .                    mgluino,1,amuv) +
     .        4.D0*pi*alp*3.D0/mgluino**2*gsb1*
     .        SD_gamglui3(mgluino,amuv,lamv) +
     .        8.D0*4.D0/3.D0*pi*alp*gsb1*
     .        SD_gam11(asb1,asb2,amb,mgluino,theb,1,amuv,lamv) -
     .        8.D0/3.D0*pi*alp**2/mgluino*
     .        SD_lamb(amb/mgluino,asb1/mgluino)*
     .        SD_gam12(asb1,asb2,amb,mgluino,theb,1,amuv,lamv,scalmur) -
     .        3.D0/16.D0*alp**2*SD_lamb(amb/mgluino,asb1/mgluino)
     .        /mgluino*
     .        SD_gamvirt(asb1,asb2,amb,mgluino,theb,1,amuv,lamv) -
     .        3.D0/16.D0*asb1/mgluino*
     .        alp**2*SD_gamrealgl(asb1,amb,mgluino,theb,1,lamv) +
     .        alp/(4.D0*pi)*gsb1*
     .        SD_gamcfdec(ast1,ast2,amt,asb1,asb2,amb,mgluino,amsq,amuv,
     .        scalmur)
      else
         qcdgsb1 = 0.D0
      endif

c -------------------------------------------------------------------- c
c  gluino --> sbottom2 + bottom

      if((asb2+amb).le.mgluino) then
         gsb2=gs2/2.d0*((gbl(2)**2+gbr(2)**2)*
     .        (mgluino**2-asb2**2+amb**2)
     .        +4*gbl(2)*gbr(2)*mgluino*amb)*
     .        SD_lamb(amb/mgluino,asb2/mgluino)
     .         /(16*pi*mgluino)
      else
         gsb2=0.d0
      endif

c --- the QCD corrections ---

      if(mgluino.gt.(asb2+amb)) then
         amsq    = 2.D0*(asup1+asup2+asdown1+asdown2)/8.D0
         scalmur = amurefer
         alp     = gs2/(4.D0*pi)
         nf      = 6.D0
         qcdgsb2 = 8.D0*pi*alp/3.D0/amb**2*gsb2*
     .        SD_gamtop1(asb2,asb1,amb,mgluino,theb,2,amuv,lamv) -
     .        pi*alp**2*SD_lamb(amb/mgluino,asb2/mgluino)/
     .        (3.D0*amb**2*mgluino)*
     .        SD_gamtop2(asb2,asb1,amb,mgluino,theb,2,amuv) +
     .        4.D0*pi*alp/mgluino**2*gsb2*(nf-2.D0)*
     .        SD_gamglui1(ast2,ast1,amsq,amt,mgluino,amuv) +
     .        2.D0*pi*alp/mgluino**2*gsb2*
     .        SD_gamglui2(ast2,ast1,amt,thet,asb2,asb1,amb,theb,
     .                    mgluino,2,amuv) +
     .        4.D0*pi*alp*3.D0/mgluino**2*gsb2*
     .        SD_gamglui3(mgluino,amuv,lamv) +
     .        8.D0*4.D0/3.D0*pi*alp*gsb2*
     .        SD_gam11(asb2,asb1,amb,mgluino,theb,2,amuv,lamv) -
     .        8.D0/3.D0*pi*alp**2/mgluino*
     .        SD_lamb(amb/mgluino,asb2/mgluino)*
     .        SD_gam12(asb2,asb1,amb,mgluino,theb,2,amuv,lamv,scalmur) -
     .        3.D0/16.D0*alp**2*SD_lamb(amb/mgluino,asb2/mgluino)
     .        /mgluino*
     .        SD_gamvirt(asb2,asb1,amb,mgluino,theb,2,amuv,lamv) -
     .        3.D0/16.D0*asb2/mgluino*
     .        alp**2*SD_gamrealgl(asb2,amb,mgluino,theb,2,lamv) +
     .        alp/(4.D0*pi)*gsb2*
     .        SD_gamcfdec(ast2,ast1,amt,asb2,asb1,amb,mgluino,amsq,amuv,
     .        scalmur)
      else
         qcdgsb2 = 0.D0
      endif

c -------------------------------------------------------------------- c
c  gluino --> supl + up

      if(asup1.le.mgluino) then
         gsupl=gs2/2.d0*(gur(1)**2+gul(1)**2)*
     .        (mgluino**2-asup1**2)*
     .        SD_lamb(0.d0,asup1/mgluino)/(16*pi*mgluino)
      else
         gsupl=0.d0
      endif

c --- the QCD corrections ---

      if(asup1.le.mgluino) then
         scala = amurefer
         alp   = gs2/(4.D0*pi)
         ca    = 3.D0
         cf    = 4.D0/3.D0
         amsq  = 2.D0*(asup1+asup2+asdown1+asdown2)/8.D0
         rval  = mgluino**2/amsq**2

         qcdgsupl = gsupl*alp/pi*( ca*(SD_gama(rval)-pi**2) + 
     .        cf*(SD_gamfcap(rval)+pi**2) + 4.D0*SD_gamf(rval) + 
     .        2.D0*pi**2/mgluino**2*
     .        SD_gamglui2(ast1,ast2,amt,thet,asb1,asb2,amb,theb,mgluino,
     .        1,amsq) + 
     .        SD_gamrendec(amsq,ast1,ast2,amt,asb1,asb2,mgluino,scala) )
      else
         qcdgsupl = 0.D0
      endif

c -------------------------------------------------------------------- c
c  gluino --> supr + up

      if(asup2.le.mgluino) then
         gsupr=gs2/2.d0*(gul(2)**2+gur(2)**2)*
     .        (mgluino**2-asup2**2)*
     .        SD_lamb(0.d0,asup2/mgluino)/(16*pi*mgluino)
      else
         gsupr=0.d0
      endif

c --- the QCD corrections ---

      if(asup2.le.mgluino) then
         scala = amurefer
         alp   = gs2/(4.D0*pi)
         ca    = 3.D0
         cf    = 4.D0/3.D0
         amsq  = 2.D0*(asup1+asup2+asdown1+asdown2)/8.D0
         rval  = mgluino**2/amsq**2

         qcdgsupr = gsupr*alp/pi*( ca*(SD_gama(rval)-pi**2) + 
     .        cf*(SD_gamfcap(rval)+pi**2) + 4.D0*SD_gamf(rval) + 
     .        2.D0*pi**2/mgluino**2*
     .        SD_gamglui2(ast2,ast1,amt,thet,asb2,asb1,amb,theb,mgluino,
     .        2,amsq) + 
     .        SD_gamrendec(amsq,ast1,ast2,amt,asb1,asb2,mgluino,scala) )
      else
         qcdgsupr = 0.D0
      endif

c -------------------------------------------------------------------- c
c  gluino --> sdownl + down

      if(asdown1.le.mgluino) then
         gsdownl=gs2/2.d0*(gdl(1)**2+gdr(1)**2)*
     .        (mgluino**2-asdown1**2)*
     .        SD_lamb(0.d0,asdown1/mgluino)/(16*pi*mgluino)
      else
         gsdownl=0.d0
      endif

c --- the QCD corrections ---

      if(asdown1.le.mgluino) then
         scala = amurefer
         alp   = gs2/(4.D0*pi)
         ca    = 3.D0
         cf    = 4.D0/3.D0
         amsq  = 2.D0*(asup1+asup2+asdown1+asdown2)/8.D0
         rval  = mgluino**2/amsq**2

         qcdgsdownl = gsdownl*alp/pi*( ca*(SD_gama(rval)-pi**2) + 
     .        cf*(SD_gamfcap(rval)+pi**2) + 4.D0*SD_gamf(rval) + 
     .        2.D0*pi**2/mgluino**2*
     .        SD_gamglui2(ast1,ast2,amt,thet,asb1,asb2,amb,theb,mgluino,
     .        1,amsq) + 
     .        SD_gamrendec(amsq,ast1,ast2,amt,asb1,asb2,mgluino,scala) )
      else
         qcdgsdownl = 0.D0
      endif

c -------------------------------------------------------------------- c
c  gluino --> sdownr + down

      if(asdown2.le.mgluino) then
         gsdownr=gs2/2.d0*(gdl(2)**2+gdr(2)**2)*
     .        (mgluino**2-asdown2**2)*
     .        SD_lamb(0.d0,asdown2/mgluino)/(16*pi*mgluino)
      else
         gsdownr=0.d0
      endif

c --- the QCD corrections ---

      if(asdown2.le.mgluino) then
         scala = amurefer
         alp   = gs2/(4.D0*pi)
         ca    = 3.D0
         cf    = 4.D0/3.D0
         amsq  = 2.D0*(asup1+asup2+asdown1+asdown2)/8.D0
         rval  = mgluino**2/amsq**2

         qcdgsdownr = gsdownr*alp/pi*( ca*(SD_gama(rval)-pi**2) + 
     .        cf*(SD_gamfcap(rval)+pi**2) + 4.D0*SD_gamf(rval) + 
     .        2.D0*pi**2/mgluino**2*
     .        SD_gamglui2(ast2,ast1,amt,thet,asb2,asb1,amb,theb,mgluino,
     .        2,amsq) + 
     .        SD_gamrendec(amsq,ast1,ast2,amt,asb1,asb2,mgluino,scala) )
      else
         qcdgsdownr = 0.D0
      endif

      end

c ==================================================================== c
c             Radiative decays gluino -> neutralino_j gluon            c
c ==================================================================== c

      subroutine SD_gluiraddecay(glnjgluon)

      implicit double precision (a-h,m,o-z)
      dimension amneut(4),xmneut(4),amchar(2),glnjgluon(4),eps(4)

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_gluino/mgluino
      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_coupewsb/alsew,g2ew,g1ew
      COMMON/SD_runcoupscale/scalechoice,scaleofcoupling,inumloop

      external SD_gluicoupabcd,SD_gluicoupabcd0
      external SD_alphascall

c -- the coupling alphas --

      if(scalechoice.eq.1.D0) then
         gs2 = alsew*4.D0*pi
      elseif(scalechoice.eq.2.D0) then         
         gs2 = SD_alphascall(mgluino,inumloop)*4.D0*pi
      elseif(scalechoice.eq.3.D0) then
         gs2 = SD_alphascall(scaleofcoupling,inumloop)*4.D0*pi
      endif

      do j=1,4,1
         if(mgluino.gt.amneut(j)) then
            if(xmneut(j).ge.0.D0) then
               eps(j) = 1.D0
            else
               eps(j) = -1.D0
            endif

            gabcd  = SD_gluicoupabcd(xmneut(j),j)
            gabcd0 = SD_gluicoupabcd0(xmneut(j),j) 
            gijgluon = -dsqrt(g2)*gs2/32.D0/pi**2*eps(j)*mgluino*
     .           (gabcd+gabcd0)
            glnjgluon(j) = gijgluon**2*(mgluino**2-amneut(j)**2)**3/
     .                     8.D0/pi/mgluino**5*1.D0/4.D0
         else
            glnjgluon(j) = 0.D0
         endif
      enddo

      end

c -------------------------------------------------------------------- c

      double precision function SD_gluicoupabcd(xmnj,j)

      implicit double precision (a-h,m,o-z)
      complex*16 SD_iint,SD_i2int,SD_jint,SD_kint

      external SD_iint,SD_i2int,SD_jint,SD_kint

      dimension abot(2,4),bbot(2,4),atopr(2,4),btopr(2,4)
      dimension amneut(4),xmneut(4),amchar(2)
      dimension gul(2),gur(2),gdl(2),gdr(2),gtl(2),gtr(2),gbl(2),gbr(2)

      COMMON/SD_gluino/mgluino
      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_weinberg/sw,cw
      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_fermion/amt,amb,amtau
      COMMON/SD_scala/scalb,scalt
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2
      COMMON/SD_yukawa/ytewsb,ybewsb,ytauewsb
      COMMON/SD_runcoupscale/scalechoice,scaleofcoupling,inumloop
      COMMON/SD_coup21/gtr,gtl,gbr,gbl,gur,gul,gdr,gdl

c --- some definitions ---

      if(xmnj.le.0.D0) then
         epsj = -1.D0
      else
         epsj = 1.D0
      endif

      amnj = dabs(xmnj)

c --- the (non) running couplings ---

      if(scalechoice.eq.1.D0) then
         scalb = ybewsb/dsqrt(g2)
         scalt = ytewsb/dsqrt(g2)
      elseif(scalechoice.eq.2.D0) then         
         call SD_runmass(mgluino,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      elseif(scalechoice.eq.3.D0) then
         call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      endif

      call SD_neutsbotbot(abot,bbot)
      call SD_neutstoptop(atopr,btopr)

      SD_gluicoupabcd  = 0.D0

      do k=1,4,1
         if(k.eq.1) then
            mfer = amt
            mbos = ast1
            gl   = -dsqrt(2.D0)*atopr(1,j)
            gr   = -dsqrt(2.D0)*btopr(1,j)
            fl   = -2.D0*gtr(1)
            fr   = -2.D0*gtl(1)
            glfrgrfl = gl*fr-gr*fl
            glflgrfr = gl*fl-gr*fr
         elseif(k.eq.2) then
            mfer = amt
            mbos = ast2
            gl   = -dsqrt(2.D0)*atopr(2,j)
            gr   = -dsqrt(2.D0)*btopr(2,j)
            fl   = -2.D0*gtr(2)
            fr   = -2.D0*gtl(2)
            glfrgrfl = gl*fr-gr*fl
            glflgrfr = gl*fl-gr*fr
         elseif(k.eq.3) then
            mfer = amb
            mbos = asb1
            gl   = -dsqrt(2.D0)*abot(1,j)
            gr   = -dsqrt(2.D0)*bbot(1,j)
            fl   = -2.D0*gbr(1)
            fr   = -2.D0*gbl(1)
            glfrgrfl = gl*fr-gr*fl
            glflgrfr = gl*fl-gr*fr
         elseif(k.eq.4) then
            mfer = amb
            mbos = asb2
            gl   = -dsqrt(2.D0)*abot(2,j)
            gr   = -dsqrt(2.D0)*bbot(2,j)
            fl   = -2.D0*gbr(2)
            fr   = -2.D0*gbl(2)
            glfrgrfl = gl*fr-gr*fl
            glflgrfr = gl*fl-gr*fr
         endif

         SD_gluicoupabcd = SD_gluicoupabcd + ( 
     .        glfrgrfl*(mgluino*dreal((SD_i2int(mgluino,amnj,mfer,mbos)-
     .                                 SD_kint(mgluino,amnj,mfer,mbos)))
     .               -epsj*amnj*dreal(SD_kint(mgluino,amnj,mfer,mbos)))
     .        +mfer*glflgrfr*dreal(SD_iint(mgluino,amnj,mfer,mbos)) )
      end do

      return

      end

c -------------------------------------------------------------------- c

      double precision function SD_gluicoupabcd0(xmnj,j)

      implicit double precision (a-h,m,o-z)
      complex*16 SD_i2int0,SD_kint0,SD_iint

      external SD_i2int0,SD_kint0,SD_iint,SD_jint0

      dimension aup(2,4),bup(2,4),ado(2,4),bdo(2,4)
      dimension amneut(4),xmneut(4),amchar(2)
      dimension gul(2),gur(2),gdl(2),gdr(2),gtl(2),gtr(2),gbl(2),gbr(2)

      COMMON/SD_gluino/mgluino
      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_weinberg/sw,cw
      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_fermion/amt,amb,amtau
      COMMON/SD_squarkud/asup1,asup2,asdown1,asdown2
      COMMON/SD_coup10/aup,bup,ado,bdo
      COMMON/SD_coup21/gtr,gtl,gbr,gbl,gur,gul,gdr,gdl

c --- some definitions ---

      if(xmnj.le.0.D0) then
         epsj = -1.D0
      else
         epsj = 1.D0
      endif

      amnj = dabs(xmnj)

      amu = 1.D-2
      amd = 1.D-2

c --- the couplings ---

      SD_gluicoupabcd0  = 0.D0

      do k=1,4,1
         if(k.eq.1) then
            mfer = amu
            mbos = asup1
            gl   = -dsqrt(2.D0)*aup(1,j)
            gr   = -dsqrt(2.D0)*bup(1,j)
            fl   = -2.D0*gur(1)
            fr   = -2.D0*gul(1)
            glfrgrfl = gl*fr-gr*fl
            glflgrfr = gl*fl-gr*fr
         elseif(k.eq.2) then
            mfer = amu
            mbos = asup2
            gl   = -dsqrt(2.D0)*aup(2,j)
            gr   = -dsqrt(2.D0)*bup(2,j)
            fl   = -2.D0*gur(2)
            fr   = -2.D0*gul(2)
            glfrgrfl = gl*fr-gr*fl
            glflgrfr = gl*fl-gr*fr
         elseif(k.eq.3) then
            mfer = amd
            mbos = asdown1
            gl   = -dsqrt(2.D0)*ado(1,j)
            gr   = -dsqrt(2.D0)*bdo(1,j)
            fl   = -2.D0*gdr(1)
            fr   = -2.D0*gdl(1)
            glfrgrfl = gl*fr-gr*fl
            glflgrfr = gl*fl-gr*fr
         elseif(k.eq.4) then
            mfer = amd
            mbos = asdown2
            gl   = -dsqrt(2.D0)*ado(2,j)
            gr   = -dsqrt(2.D0)*bdo(2,j)
            fl   = -2.D0*gdr(2)
            fr   = -2.D0*gdl(2)
            glfrgrfl = gl*fr-gr*fl
            glflgrfr = gl*fl-gr*fr
         endif

         SD_gluicoupabcd0 = SD_gluicoupabcd0 + ( 
     .        glfrgrfl*(mgluino*dreal((SD_i2int0(mgluino,amnj,mbos)-
     .                                 SD_kint0(mgluino,amnj,mbos)))
     .                 -epsj*amnj*dreal(SD_kint0(mgluino,amnj,mbos)) ) )
      end do

      SD_gluicoupabcd0 = 2.D0*SD_gluicoupabcd0

      return

      end

c ==================================================================== c
c                         Gluino 3-body decays
c ==================================================================== c

      subroutine SD_xinteggo(xintegoup,xintegodn,xintegotp,xintegobt,
     .     xintegoud,xintegotb,xinteghcst1b,xintegwst1b,xintegocc) 

      implicit double precision (a-h,m,o-z)   	 
      integer ni,nj,nx1t,ny1t

      dimension xintegoup(4),xintegodn(4),xintegotp(4),xintegobt(4),
     .          xintegoud(2),xintegotb(2),xintegocc(2)
      dimension amneut(4),xmneut(4),amchar(2)

      external SD_goup,SD_godn,SD_gobt,SD_gotp,SD_goud,SD_gotb,
     .         SD_ghcst1b,SD_gwst1b,SD_gocc
      external SD_ay,SD_by,SD_ax,SD_bx
	
      COMMON/SD_nx1/nx1t,ny1t
      COMMON/SD_hmass/ama,aml,amh,amch,amar
      COMMON/SD_fermion/amt,amb,amtau
      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_gluino/mgluino
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2
      COMMON/SD_indices/ni,nj
      COMMON/SD_mwmzpole/amwp,amzp

c -------------------------------------------------------------------- c
c                    gluino into H+ + stop1 + b
c -------------------------------------------------------------------- c

      xmu1=amb**2/mgluino**2
      xmu2=ast1**2/mgluino**2
      xmu3=amch**2/mgluino**2

      if(mgluino.gt.(ast1+amch+amb)) then
         call SD_integ2(SD_ghcst1b,SD_ax,SD_bx,SD_ay,SD_by,xmu1,xmu2,
     .               xmu3,nx1t,ny1t,sum)
         xinteghcst1b=sum*mgluino/128.D0/(2.D0*pi)**3
      else
         xinteghcst1b=0.D0
      endif

c -------------------------------------------------------------------- c
c                    gluino into W+ + stop1 + b
c -------------------------------------------------------------------- c

      xmu1=amb**2/mgluino**2
      xmu2=ast1**2/mgluino**2
      xmu3=amwp**2/mgluino**2

      if(mgluino.gt.(ast1+amwp+amb)) then
         call SD_integ2(SD_gwst1b,SD_ax,SD_bx,SD_ay,SD_by,xmu1,xmu2,
     .               xmu3,nx1t,ny1t,sum)
         xintegwst1b=sum*mgluino/128.D0/(2.D0*pi)**3
      else
         xintegwst1b=0.D0
      endif

c -------------------------------------------------------------------- c
c               gluino --> neutralino_j + up + upbar
c -------------------------------------------------------------------- c

      do nj=1,4,1
         xmu1=0.D0
         xmu2=0.D0
         xmu3=amneut(nj)**2/mgluino**2

         if(mgluino.gt.amneut(nj)) then
            call SD_integ2(SD_goup,SD_ax,SD_bx,SD_ay,SD_by,xmu1,xmu2,
     .                  xmu3,nx1t,ny1t,sum)
            xintegoup(nj)=sum*mgluino/(2*pi)**3/8.d0/64.D0
         else 
            xintegoup(nj)=0.D0
         endif
      end do

c -------------------------------------------------------------------- c
c             gluino --> neutralino_j + down + downbar
c -------------------------------------------------------------------- c

      do nj=1,4,1
         xmu1=0.D0
         xmu2=0.D0
         xmu3=amneut(nj)**2/mgluino**2

         if(mgluino.gt.amneut(nj)) then
            call SD_integ2(SD_godn,SD_ax,SD_bx,SD_ay,SD_by,xmu1,xmu2,
     .                  xmu3,nx1t,ny1t,sum)
            xintegodn(nj)=sum*mgluino/(2*pi)**3/8.D0/64.D0
         else
            xintegodn(nj)=0.D0
         endif
      end do

c -------------------------------------------------------------------- c
c            gluino --> neutralino_j + bottom + bottombar
c -------------------------------------------------------------------- c

      do nj=1,4,1
         xmu1=amb**2/mgluino**2
         xmu2=amb**2/mgluino**2
         xmu3=amneut(nj)**2/mgluino**2

         if(mgluino.gt.(amneut(nj)+2.D0*amb)) then
            call SD_integ2(SD_gobt,SD_ax,SD_bx,SD_ay,SD_by,xmu1,xmu2,
     .                  xmu3,nx1t,ny1t,sum)
            xintegobt(nj)=sum*mgluino/(2*pi)**3/8.d0/64.D0
         else
            xintegobt(nj)=0.D0
         endif
      end do

c -------------------------------------------------------------------- c
c              gluino --> neutralino_j + top topbar
c -------------------------------------------------------------------- c

      do nj=1,4,1
         xmu1=amt**2/mgluino**2
         xmu2=amt**2/mgluino**2
         xmu3=amneut(nj)**2/mgluino**2

         if(mgluino.gt.(amneut(nj)+2.D0*amt)) then
            call SD_integ2(SD_gotp,SD_ax,SD_bx,SD_ay,SD_by,xmu1,xmu2,
     .                  xmu3,nx1t,ny1t,sum)
            xintegotp(nj)=sum*mgluino/(2*pi)**3/8.d0/64.D0
         else
            xintegotp(nj)=0.D0
         endif
      end do

c -------------------------------------------------------------------- c
c               gluino --> chargino_j- + up + downbar
c -------------------------------------------------------------------- c

      do nj=1,2,1
         xmu1=0.D0
         xmu2=0.D0
         xmu3=amchar(nj)**2/mgluino**2

         if(mgluino.gt.amchar(nj)) then
            call SD_integ2(SD_goud,SD_ax,SD_bx,SD_ay,SD_by,xmu1,xmu2,
     .                  xmu3,nx1t,ny1t,sum)
            xintegoud(nj)=sum*mgluino/(2*pi)**3/8.d0/64.D0
         else
            xintegoud(nj)=0.D0
         endif
      end do

c -------------------------------------------------------------------- c
c              gluino --> chargino_j- + top + bottombar
c -------------------------------------------------------------------- c

      do nj=1,2,1
         xmu1=amt**2/mgluino**2
         xmu2=amb**2/mgluino**2
         xmu3=amchar(nj)**2/mgluino**2

         if(mgluino.gt.(amchar(nj)+amt+amb)) then
            call SD_integ2(SD_gotb,SD_ax,SD_bx,SD_ay,SD_by,xmu1,xmu2,
     .                  xmu3,nx1t,ny1t,sum)
            xintegotb(nj)=sum*mgluino/(2*pi)**3/8.d0/64.D0
         else
            xintegotb(nj)=0.D0
         endif
      end do

c -------------------------------------------------------------------- c
c              gluino --> chargino_j- + top + bottombar
c -------------------------------------------------------------------- c

      do nj=1,2,1
         xmu1=amb**2/mgluino**2
         xmu2=amt**2/mgluino**2
         xmu3=amchar(nj)**2/mgluino**2

         if(mgluino.gt.(amchar(nj)+amt+amb)) then
            call SD_integ2(SD_gocc,SD_ax,SD_bx,SD_ay,SD_by,xmu1,xmu2,
     .                  xmu3,nx1t,ny1t,sum)
            xintegocc(nj)=sum*mgluino/(2*pi)**3/8.d0/64.D0
         else
            xintegocc(nj)=0.D0
         endif
      end do

      end 
 
c ==================================================================== c
c                    gluino --> H+ + stop1 + bottom
c ==================================================================== c

      double precision function SD_ghcst1b(x1,x2)

      implicit double precision (a-h,m,o-z)

      dimension dsb(2)
      dimension gtr(2),gtl(2),gbr(2),gbl(2),gur(2),gul(2),gdr(2),gdl(2)
      dimension gctb(2,2),chctb(2,2),gctbr(2,2)

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_hmass/ama,aml,amh,amch,amar
      COMMON/SD_fermion/amt,amb,amtau
      COMMON/SD_gluino/mgluino
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2
      COMMON/SD_coup21/gtr,gtl,gbr,gbl,gur,gul,gdr,gdl
      COMMON/SD_coup13/gctb,chctb
      COMMON/SD_coup15/achtop,vchtop,achtau,vchtau
      COMMON/SD_coupewsb/alsew,g2ew,g1ew
      COMMON/SD_runcoupscale/scalechoice,scaleofcoupling,inumloop
      COMMON/SD_scala/scalb,scalt
      COMMON/SD_yukawa/ytewsb,ybewsb,ytauewsb

      external SD_alphascall

      if(scalechoice.eq.1.D0) then
         gs2 = alsew*4.D0*pi
         scalb = ybewsb/dsqrt(g2)
         scalt = ytewsb/dsqrt(g2)
      elseif(scalechoice.eq.2.D0) then         
         gs2 = SD_alphascall(mgluino,inumloop)*4.D0*pi
         call SD_runmass(mgluino,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      elseif(scalechoice.eq.3.D0) then
         gs2 = SD_alphascall(scaleofcoupling,inumloop)*4.D0*pi
         call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      endif

      call SD_hctopbbot(vchtopr,achtopr)
      call SD_higgschudb(chtbrunr,chtbrunl)
      call SD_hcsbotstop(gctbr)

      xmusb1 = asb1**2/mgluino**2
      xmusb2 = asb2**2/mgluino**2
      xmust1 = ast1**2/mgluino**2
      xmub   = amb**2/mgluino**2
      xmut   = amt**2/mgluino**2
      xmuch  = amch**2/mgluino**2
      
      dsb(1) = 1-x1+xmub-xmusb1
      dsb(2) = 1-x1+xmub-xmusb2
      dt     = 1-x2+xmust1-xmut

      ac = -vchtopr+achtopr
      vc = -vchtopr-achtopr

c -------------------------------------------------------------------- c
c                             top exchange
c -------------------------------------------------------------------- c

      if(mgluino.gt.(amch+ast1+amb)) then
         ghctop=2.D0*g2*gs2/dt**2*
     .        ( 2.D0*dsqrt(xmut*xmub)*
     .        (gtr(1)**2+gtl(1)**2)*ac*vc*(2.D0-x2)+4.D0*dsqrt(xmub)*
     .        gtl(1)*gtr(1)*vc*ac*(1.D0-x2+xmust1+xmut)+2.D0*
     .        dsqrt(xmut)*gtr(1)*gtl(1)*(ac**2+vc**2)*(-xmuch-x2+
     .        xmub+xmust1+1.D0)+(gtl(1)**2*ac**2+gtr(1)**2*vc**2)*(
     .        x1*x2-xmust1*x1-x1+x2**2+x2*xmuch-x2*xmub-x2*xmust1
     .        -3.D0*x2-2.D0*xmuch+2.D0*xmub+2.D0*xmust1+2.D0)+
     .        (gtl(1)**2*vc**2+gtr(1)**2*ac**2)*xmut*x1 )
      else 
         ghctop=0.D0
      endif

c -------------------------------------------------------------------- c
c                           sbottom exchange
c -------------------------------------------------------------------- c

      ghcsbot = 0.D0

      if(mgluino.gt.(amch+ast1+amb)) then
         do i=1,2
            do k=1,2
               ghcsbot=ghcsbot+2.D0*gs2*g2/dsb(i)/dsb(k)*
     .              gctbr(1,i)*gctbr(1,k)*amw**2/mgluino**2*(
     .              (gbr(i)*gbr(k)+gbl(i)*gbl(k))*x1+
     .              2.D0*dsqrt(xmub)*(gbr(i)*gbl(k)+gbr(k)*gbl(i)) )
            enddo
         enddo
      else 
         ghcsbot=0.D0	
      endif

c -------------------------------------------------------------------- c
c                       sbottom top interference
c -------------------------------------------------------------------- c

      ghcsbtop = 0.D0

      if(mgluino.gt.(amch+ast1+amb)) then
         do i=1,2
            ghcsbtop=ghcsbtop
     .           -2.D0*gs2*g2*gctbr(1,i)*amw*2.D0/mgluino/dt/dsb(i)*(
     .           dsqrt(xmut)*x1*(gtr(1)*gbr(i)*ac+gtl(1)*gbl(i)*vc)
     .           +2.D0*dsqrt(xmub*xmut)*(gtr(1)*gbl(i)*ac+
     .           gbr(i)*gtl(1)*vc)+dsqrt(xmub)*(gtr(1)*gbr(i)*vc+
     .           gtl(1)*gbl(i)*ac)*(2.D0-x2)+(gtr(1)*gbl(i)*vc+
     .           gbr(i)*gtl(1)*ac)*(-xmuch-x2+xmub+xmust1+1.D0))
         enddo
      else 
         ghcsbtop=0.D0	
      endif


      SD_ghcst1b=ghctop+ghcsbot+ghcsbtop

      end

c ==================================================================== c
c                    gluino --> W+ + top + bottombar
c ==================================================================== c

      double precision function SD_gwst1b(x1,x2)

      implicit double precision (a-h,m,o-z)

      dimension dsb(2)
      dimension gtr(2),gtl(2),gbr(2),gbl(2),gur(2),gul(2),gdr(2),gdl(2)
      dimension gwtb(2,2),gwntau(2,2)

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_hmass/ama,aml,amh,amch,amar
      COMMON/SD_fermion/amt,amb,amtau
      COMMON/SD_gluino/mgluino
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2
      COMMON/SD_coup21/gtr,gtl,gbr,gbl,gur,gul,gdr,gdl
      COMMON/SD_coup20/gwtb,gwntau
      COMMON/SD_coupewsb/alsew,g2ew,g1ew
      COMMON/SD_runcoupscale/scalechoice,scaleofcoupling,inumloop
      COMMON/SD_mwmzpole/amwp,amzp

      external SD_alphascall

      if(scalechoice.eq.1.D0) then
         gs2 = alsew*4.D0*pi
      elseif(scalechoice.eq.2.D0) then         
         gs2 = SD_alphascall(mgluino,inumloop)*4.D0*pi
      elseif(scalechoice.eq.3.D0) then
         gs2 = SD_alphascall(scaleofcoupling,inumloop)*4.D0*pi
      endif

      vtb = 0.99915D0

      xmusb1 = asb1**2/mgluino**2
      xmusb2 = asb2**2/mgluino**2
      xmust1 = ast1**2/mgluino**2
      xmub   = amb**2/mgluino**2
      xmut   = amt**2/mgluino**2
      xmuw   = amwp**2/mgluino**2
      
      dsb(1) = 1-x1+xmub-xmusb1
      dsb(2) = 1-x1+xmub-xmusb2
      dt     = 1-x2+xmust1-xmut

c -------------------------------------------------------------------- c
c                              top exchange
c -------------------------------------------------------------------- c

      if(mgluino.gt.(amwp+ast1+amb)) then
         gwtop=2.D0*g2*gs2/dt**2*vtb**2/2.D0*( 
     .        2.D0*gtr(1)*gtl(1)*dsqrt(xmut)*
     .        ((1.D0-x2+xmub+xmust1-2.D0*xmuw)+1.D0/xmuw*
     .        (1.D0-x2+xmust1-xmub)**2) 
     .        +gtr(1)**2*(x1*xmut+
     .         xmut/xmuw*(1.D0-x2+xmust1-xmub-xmuw)*(2.D0-x1-x2))
     .        +gtl(1)**2*
     .        ( (1.D0-xmust1)*x1+(-2.D0+x2)*(-1.D0+x1+x2+
     .        xmuw-xmust1-xmub)+1.D0/xmuw*(1.D0-x2+xmust1-xmub-xmuw)*
     .        ((-2.D0+x2)*(1.D0-x1+xmub-xmust1-xmuw)+(1.D0-xmust1)*(
     .        2.D0-x1-x2))) )
      else 
         gwtop=0.D0
      endif

c -------------------------------------------------------------------- c
c                           sbottom exchange
c -------------------------------------------------------------------- c

      gwsbot = 0.D0

      if(mgluino.gt.(amwp+ast1+amb)) then
         do i=1,2
            do k=1,2
               gwsbot=gwsbot+gs2*g2/2.D0*gwtb(1,i)*gwtb(1,k)/dsb(i)
     .              /dsb(k)*2.D0*
     .              (2.D0*dsqrt(xmub)*(gbr(i)*gbl(k)+
     .              gbr(k)*gbl(i))+x1*(gbr(i)*gbr(k)+gbl(i)*gbl(k)))*
     .              (-(2.D0*(1.D0-x1+xmub)+2.D0*xmust1-xmuw)+
     .              1.D0/xmuw*(1.D0-x1+xmub-xmust1)**2)
            enddo
         enddo
      else 
         gwsbot=0.D0	
      endif

c -------------------------------------------------------------------- c
c                       sbottom top interference
c -------------------------------------------------------------------- c

      gwsbtop = 0.D0

      if(mgluino.gt.(amwp+ast1+amb)) then
         do i=1,2
            gwsbtop=gwsbtop+gs2*g2/2.D0*gwtb(1,i)*vtb*2.D0*2.D0*(
     .           gtr(1)*gbr(i)*dsqrt(xmub*xmut)*(2.D0*x2-1.D0/xmuw*(
     .           1.D0-x1+xmub-xmust1-xmuw)*(2.D0-x1-x2))+gbr(i)*
     .           gtl(1)*dsqrt(xmub)*(2.D0*x2-4.D0*xmust1-1.D0/xmuw*(
     .           1.D0-x2+xmust1-xmub+xmuw)*(1.D0-x1+xmub-xmust1
     .           -xmuw))+gtr(1)*gbl(i)*dsqrt(xmut)*(2.D0*x1-4.D0*xmub
     .           -1.D0/xmuw*(1.D0-x2+xmust1-xmub-xmuw)*(1.D0-x1+xmub
     .           -xmust1+xmuw))+gtl(1)*gbl(i)*(-2.D0-x1*x2-x1*xmust1
     .           +3.D0*x1+x2*xmub+2.D0*x2-4.D0*xmub-2.D0*xmust1+2.D0*
     .           xmuw+1.D0/xmuw*(1.D0-x1+xmub-xmust1)*(2.D0*xmub
     .           -x2*xmub+x1*x2-xmust1*x1-x1)) )
         enddo
      else 
         gwsbtop=0.D0	
      endif


      SD_gwst1b=gwtop+gwsbot+gwsbtop

      end

c ==================================================================== c
c                    gluino --> neutralino up upbar
c ==================================================================== c

      double precision function SD_goup(x1,x2)
	
      implicit double precision (a-h,m,o-z)
      integer ni,nj

      dimension amneut(4),amchar(2),xmneut(4)
      dimension dsup(2),dsupb(2)
      dimension gtr(2),gtl(2),gbr(2),gbl(2),gur(2),gul(2),gdr(2),gdl(2)
      dimension aup(2,4),bup(2,4),ado(2,4),bdo(2,4)

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_gluino/mgluino
      COMMON/SD_coup21/gtr,gtl,gbr,gbl,gur,gul,gdr,gdl
      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_coup10/aup,bup,ado,bdo
      COMMON/SD_squarkud/asup1,asup2,asdown1,asdown2
      COMMON/SD_indices/ni,nj
      COMMON/SD_coupewsb/alsew,g2ew,g1ew
      COMMON/SD_runcoupscale/scalechoice,scaleofcoupling,inumloop

      external SD_alphascall

      if(scalechoice.eq.1.D0) then
         gs2 = alsew*4.D0*pi
      elseif(scalechoice.eq.2.D0) then         
         gs2 = SD_alphascall(mgluino,inumloop)*4.D0*pi
      elseif(scalechoice.eq.3.D0) then
         gs2 = SD_alphascall(scaleofcoupling,inumloop)*4.D0*pi
      endif

      xmuneut1 = amneut(nj)**2/mgluino**2

      xmusup1 = asup1**2/mgluino**2
      xmusup2 = asup2**2/mgluino**2

      dsup(1)  = 1.D0-x1-xmusup1
      dsup(2)  = 1.D0-x1-xmusup2
      dsupb(1) = 1.D0-x2-xmusup1
      dsupb(2) = 1.D0-x2-xmusup2

      x3 = 2.D0-x1-x2
      y1 = 1.D0-xmuneut1-x1
      y2 = 1.D0-xmuneut1-x2
      y3 = 1.D0+xmuneut1-x3

      SD_goup=0.D0

      if (mgluino.gt.amneut(nj)) then
         do i=1,2
            do k=1,2
               SD_goup=SD_goup+4.D0*gs2*g2/dsup(i)/dsup(k)*2.D0*(
     .              (gur(i)*gur(k)+gul(i)*gul(k))*
     .              (aup(i,nj)*aup(k,nj)+bup(k,nj)*bup(i,nj))*
     .              x1*y1)
     .         +4.D0*gs2*g2/dsupb(i)/dsupb(k)*2.D0*(
     .              (gur(i)*gur(k)+gul(i)*gul(k))*
     .              (aup(i,nj)*aup(k,nj)+bup(k,nj)*bup(i,nj))*
     .              x2*y2)
     .         +4.D0*gs2*g2/dsup(i)/dsupb(k)*2.D0*(
     .         (aup(k,nj)*gur(k)*gul(i)*bup(i,nj)+gul(k)*
     .          aup(i,nj)*bup(k,nj)*gur(i))*(-x1*y1-x2*y2+x3*y3)
     .         +2.D0*(gul(k)*aup(k,nj)*gul(i)*aup(i,nj)+
     .                gur(k)*bup(k,nj)*gur(i)*bup(i,nj))*
     .          xmneut(nj)/mgluino*y3)
            enddo
         enddo
      else 
         SD_goup=0.d0	
      endif
	
      end

c ==================================================================== c
c                   gluino --> neutralino down downbar
c ==================================================================== c

      double precision function SD_godn(x1,x2)
	
      implicit double precision (a-h,m,o-z)
      integer ni,nj

      dimension amneut(4),amchar(2),xmneut(4)
      dimension dsdn(2),dsdnb(2)
      dimension gtr(2),gtl(2),gbr(2),gbl(2),gur(2),gul(2),gdr(2),gdl(2)
      dimension aup(2,4),bup(2,4),ado(2,4),bdo(2,4)

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_gluino/mgluino
      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_squarkud/asup1,asup2,asdown1,asdown2
      COMMON/SD_indices/ni,nj
      COMMON/SD_coup10/aup,bup,ado,bdo
      COMMON/SD_coup21/gtr,gtl,gbr,gbl,gur,gul,gdr,gdl
      COMMON/SD_coupewsb/alsew,g2ew,g1ew
      COMMON/SD_runcoupscale/scalechoice,scaleofcoupling,inumloop

      external SD_alphascall

      if(scalechoice.eq.1.D0) then
         gs2 = alsew*4.D0*pi
      elseif(scalechoice.eq.2.D0) then         
         gs2 = SD_alphascall(mgluino,inumloop)*4.D0*pi
      elseif(scalechoice.eq.3.D0) then
         gs2 = SD_alphascall(scaleofcoupling,inumloop)*4.D0*pi
      endif

      xmuneut1 = amneut(nj)**2/mgluino**2

      xmusd1 = asdown1**2/mgluino**2
      xmusd2 = asdown2**2/mgluino**2

      dsdn(1)  = 1-x1-xmusd1
      dsdn(2)  = 1-x1-xmusd2
      dsdnb(1) = 1-x2-xmusd1
      dsdnb(2) = 1-x2-xmusd2

      x3 = 2-x1-x2
      y1 = 1-xmuneut1-x1
      y2 = 1-xmuneut1-x2
      y3 = 1+xmuneut1-x3
    
      SD_godn=0.D0

      if (mgluino.gt.amneut(nj)) then
         do i=1,2
            do k=1,2
               SD_godn=SD_godn+4.D0*gs2*g2/dsdn(i)/dsdn(k)*2.D0*(
     .              (gdr(i)*gdr(k)+gdl(i)*gdl(k))*
     .              (ado(i,nj)*ado(k,nj)+bdo(k,nj)*bdo(i,nj))*
     .              x1*y1)
     .         +4.D0*gs2*g2/dsdnb(i)/dsdnb(k)*2.D0*(
     .              (gdr(i)*gdr(k)+gdl(i)*gdl(k))*
     .              (ado(i,nj)*ado(k,nj)+bdo(k,nj)*bdo(i,nj))*
     .              x2*y2)
     .         +4.D0*gs2*g2/dsdn(i)/dsdnb(k)*2.D0*(
     .         (ado(k,nj)*gdr(k)*gdl(i)*bdo(i,nj)+gdr(i)*
     .          ado(i,nj)*bdo(k,nj)*gdl(k))*(-x1*y1-x2*y2+x3*y3)
     .         +2.D0*(gdl(k)*ado(k,nj)*gdl(i)*ado(i,nj)+
     .                gdr(k)*bdo(k,nj)*gdr(i)*bdo(i,nj))*
     .          xmneut(nj)/mgluino*y3)
            enddo
         enddo
      else 
         SD_godn=0.d0	
      endif

      end

c ==================================================================== c
c                 gluino --> neutralino bottom bottombar
c ==================================================================== c

      double precision function SD_gobt(x1,x2)
	
      implicit double precision (a-h,m,o-z)
      integer ni,nj

      dimension amneut(4),amchar(2),xmneut(4)
      dimension dsb(2),dsbb(2)
      dimension gtr(2),gtl(2),gbr(2),gbl(2),gur(2),gul(2),gdr(2),gdl(2)
      dimension abot(2,4),bbot(2,4)
      dimension abot1(2,4),bbot1(2,4),abot2(2,4),bbot2(2,4)
	
      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_fermion/amt,amb,amtau
      COMMON/SD_gluino/mgluino
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2
      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_indices/ni,nj
      COMMON/SD_coup21/gtr,gtl,gbr,gbl,gur,gul,gdr,gdl
      COMMON/SD_scala/scalb,scalt
      COMMON/SD_yukawa/ytewsb,ybewsb,ytauewsb
      COMMON/SD_coupewsb/alsew,g2ew,g1ew
      COMMON/SD_runcoupscale/scalechoice,scaleofcoupling,inumloop

      external SD_alphascall

c -- the running couplings --

      if(scalechoice.eq.1.D0) then
         gs2 = alsew*4.D0*pi
      elseif(scalechoice.eq.2.D0) then         
         gs2 = SD_alphascall(mgluino,inumloop)*4.D0*pi
      elseif(scalechoice.eq.3.D0) then
         gs2 = SD_alphascall(scaleofcoupling,inumloop)*4.D0*pi
      endif

      if(scalechoice.eq.1.D0) then
         scalb = ybewsb/dsqrt(g2)
         scalt = ytewsb/dsqrt(g2)
      elseif(scalechoice.eq.2.D0) then         
         call SD_runmass(mgluino,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      elseif(scalechoice.eq.3.D0) then
         call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      endif

      call SD_neutsbotbot(abot,bbot)
      do i=1,2,1
         do j=1,4,1
            abot1(i,j)=abot(i,j)
            bbot1(i,j)=bbot(i,j)
            abot2(i,j)=abot(i,j)
            bbot2(i,j)=bbot(i,j)
         end do
      end do

c --- several definitions ---

      xmuneut1 = amneut(nj)**2/mgluino**2
     
      xmusb1 = asb1**2/mgluino**2
      xmusb2 = asb2**2/mgluino**2

      dsb(1)  = 1-x1-xmusb1+amb**2/mgluino**2
      dsb(2)  = 1-x1-xmusb2+amb**2/mgluino**2
      dsbb(1) = 1-x2-xmusb1+amb**2/mgluino**2
      dsbb(2) = 1-x2-xmusb2+amb**2/mgluino**2

      SD_gobt=0.D0
      
c --- formula with masses ---

      uh = 1.D0-x1+amb**2/mgluino**2
      th = 1.D0-x2+amb**2/mgluino**2
      xmub = amb**2/mgluino**2

      if(mgluino.gt.(amneut(nj)+2.D0*amb)) then 
         do i=1,2
            do k=1,2
               db11 = abot1(k,nj)*bbot1(i,nj)+abot1(i,nj)*bbot1(k,nj)
               db12 = abot1(k,nj)*abot1(i,nj)+bbot1(k,nj)*bbot1(i,nj)
               db21 = abot2(k,nj)*bbot2(i,nj)+abot2(i,nj)*bbot2(k,nj)
               db22 = abot2(k,nj)*abot2(i,nj)+bbot2(k,nj)*bbot2(i,nj)
               db3  = gbl(k)*gbr(i)+gbl(i)*gbr(k)
               db4  = gbl(i)*gbl(k)+gbr(i)*gbr(k)

               ab11 = db11*db3
               ab12 = db11*db4
               ab13 = db12*db3
               ab14 = db12*db4

               ab21 = db21*db3
               ab22 = db21*db4
               ab23 = db22*db3
               ab24 = db22*db4

               ab5 = abot1(k,nj)*bbot2(i,nj)*gbl(k)*gbr(i)+
     .               abot2(i,nj)*bbot1(k,nj)*gbl(i)*gbr(k)
               ab6 = abot2(i,nj)*bbot1(k,nj)*gbl(k)*gbl(i)+
     .               bbot2(i,nj)*abot1(k,nj)*gbr(k)*gbr(i)
               ab7 = bbot1(k,nj)*bbot2(i,nj)*gbl(i)*gbr(k)+
     .               abot1(k,nj)*abot2(i,nj)*gbr(i)*gbl(k)
               ab8 = abot1(k,nj)*abot2(i,nj)*gbr(k)*gbr(i)+
     .               bbot1(k,nj)*bbot2(i,nj)*gbl(i)*gbl(k)
               ab9 = abot2(i,nj)*bbot1(k,nj)*gbr(k)*gbr(i)+
     .               abot1(k,nj)*bbot2(i,nj)*gbl(i)*gbl(k)
               ab10 = abot1(k,nj)*bbot2(i,nj)*gbl(i)*gbr(k)+
     .                abot2(i,nj)*bbot1(k,nj)*gbl(k)*gbr(i)
               ab11 = abot1(k,nj)*abot2(i,nj)*gbl(k)*gbl(i)+
     .                bbot1(k,nj)*bbot2(i,nj)*gbr(i)*gbr(k)
               ab12 = bbot1(k,nj)*bbot2(i,nj)*gbl(k)*gbr(i)+
     .                abot1(k,nj)*abot2(i,nj)*gbr(k)*gbl(i)

               SD_gobt=SD_gobt
     .           +8.D0*gs2*g2/dsb(i)/dsb(k)*(
     .           -4.D0*ab11*xmneut(nj)/mgluino*xmub
     .           +2.D0*ab12*xmneut(nj)*amb/mgluino**2*(-xmub-1.D0+uh)
     .           +2.D0*ab13*amb/mgluino*(-xmub-xmuneut1+uh)
     .           +ab14*(-uh**2+uh*(1.D0+xmuneut1+2.D0*xmub)-
     .                 (xmuneut1+xmub)*(1.D0+xmub)) )
     .         +8.D0*gs2*g2/dsbb(i)/dsbb(k)*(
     .           -4.D0*ab21*xmneut(nj)/mgluino*xmub
     .           +2.D0*ab22*xmneut(nj)*amb/mgluino**2*(-xmub-1.D0+th)
     .           +2.D0*ab23*amb/mgluino*(-xmub-xmuneut1+th)
     .           +ab24*(-th**2+th*(1.D0+xmuneut1+2.D0*xmub)-
     .                 (xmuneut1+xmub)*(1.D0+xmub)) )
     .         -2.D0*8.D0*gs2*g2/dsb(k)/dsbb(i)*(
     .           ab5*xmub*(uh+th-2.D0*xmub) 
     .           +ab6*amb/mgluino*(th-xmuneut1-xmub) 
     .           +ab7*xmneut(nj)*amb/mgluino**2*(uh-xmub-1.D0) 
     .           -2.D0*ab8*xmneut(nj)/mgluino*xmub
     .           +ab9*amb/mgluino*(uh-xmuneut1-xmub)
     .           +ab10*(uh*th-xmuneut1-xmub**2)
     .           +ab11*xmneut(nj)/mgluino*(uh+th-xmuneut1-1.D0)
     .           +ab12*xmneut(nj)*amb/mgluino**2*(th-xmub-1.D0) )
            enddo
         enddo
      else 
         SD_gobt=0.D0	
      endif
      
      end

c ==================================================================== c
c                   gluino --> neutralino top topbar
c ==================================================================== c

      double precision function SD_gotp(x1,x2)
	
      implicit double precision (a-h,m,o-z)
      integer ni,nj

      dimension amneut(4),amchar(2),xmneut(4)
      dimension dst(2),dstb(2)
      dimension gtr(2),gtl(2),gbr(2),gbl(2),gur(2),gul(2),gdr(2),gdl(2)
      dimension atopr(2,4),btopr(2,4)
      dimension atopr1(2,4),btopr1(2,4),atopr2(2,4),btopr2(2,4)
	
      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_fermion/amt,amb,amtau
      COMMON/SD_gluino/mgluino
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2
      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_indices/ni,nj
      COMMON/SD_coup21/gtr,gtl,gbr,gbl,gur,gul,gdr,gdl
      COMMON/SD_scala/scalb,scalt
      COMMON/SD_yukawa/ytewsb,ybewsb,ytauewsb
      COMMON/SD_coupewsb/alsew,g2ew,g1ew
      COMMON/SD_runcoupscale/scalechoice,scaleofcoupling,inumloop

      external SD_alphascall

c -- the running couplings --

      if(scalechoice.eq.1.D0) then
         gs2 = alsew*4.D0*pi
      elseif(scalechoice.eq.2.D0) then         
         gs2 = SD_alphascall(mgluino,inumloop)*4.D0*pi
      elseif(scalechoice.eq.3.D0) then
         gs2 = SD_alphascall(scaleofcoupling,inumloop)*4.D0*pi
      endif

      if(scalechoice.eq.1.D0) then
         scalb = ybewsb/dsqrt(g2)
         scalt = ytewsb/dsqrt(g2)
      elseif(scalechoice.eq.2.D0) then         
         call SD_runmass(mgluino,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      elseif(scalechoice.eq.3.D0) then
         call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      endif

      call SD_neutstoptop(atopr,btopr)
      do i=1,2,1
         do j=1,4,1
            atopr1(i,j)=atopr(i,j)
            btopr1(i,j)=btopr(i,j)
            atopr2(i,j)=atopr(i,j)
            btopr2(i,j)=btopr(i,j)
         end do
      end do

c --- several definitions ---
  
      xmuneut1 = amneut(nj)**2/mgluino**2
     
      xmust1 = ast1**2/mgluino**2
      xmust2 = ast2**2/mgluino**2

      dst(1)  = 1-x1-xmust1+amt**2/mgluino**2
      dst(2)  = 1-x1-xmust2+amt**2/mgluino**2
      dstb(1) = 1-x2-xmust1+amt**2/mgluino**2
      dstb(2) = 1-x2-xmust2+amt**2/mgluino**2

      SD_gotp=0.D0
   
c --- formula with masses ---

      uh = 1.D0-x1+amt**2/mgluino**2
      th = 1.D0-x2+amt**2/mgluino**2
      xmut = amt**2/mgluino**2

      if(mgluino.gt.(amneut(nj)+2.D0*amt)) then 
         do i=1,2
            do k=1,2
              db11 = atopr1(k,nj)*btopr1(i,nj)+atopr1(i,nj)*btopr1(k,nj)
              db12 = atopr1(k,nj)*atopr1(i,nj)+btopr1(k,nj)*btopr1(i,nj)
              db21 = atopr2(k,nj)*btopr2(i,nj)+atopr2(i,nj)*btopr2(k,nj)
              db22 = atopr2(k,nj)*atopr2(i,nj)+btopr2(k,nj)*btopr2(i,nj)
               db3 = gtl(k)*gtr(i)+gtl(i)*gtr(k)
               db4 = gtl(i)*gtl(k)+gtr(i)*gtr(k)

               ab11 = db11*db3
               ab12 = db11*db4
               ab13 = db12*db3
               ab14 = db12*db4

               ab21 = db21*db3
               ab22 = db21*db4
               ab23 = db22*db3
               ab24 = db22*db4

               ab5 = atopr1(k,nj)*btopr2(i,nj)*gtl(k)*gtr(i)+
     .               atopr2(i,nj)*btopr1(k,nj)*gtl(i)*gtr(k)
               ab6 = atopr2(i,nj)*btopr1(k,nj)*gtl(k)*gtl(i)+
     .               btopr2(i,nj)*atopr1(k,nj)*gtr(k)*gtr(i)
               ab7 = btopr1(k,nj)*btopr2(i,nj)*gtl(i)*gtr(k)+
     .               atopr1(k,nj)*atopr2(i,nj)*gtr(i)*gtl(k)
               ab8 = atopr1(k,nj)*atopr2(i,nj)*gtr(k)*gtr(i)+
     .               btopr1(k,nj)*btopr2(i,nj)*gtl(i)*gtl(k)
               ab9 = atopr2(i,nj)*btopr1(k,nj)*gtr(k)*gtr(i)+
     .               atopr1(k,nj)*btopr2(i,nj)*gtl(i)*gtl(k)
               ab10 = atopr1(k,nj)*btopr2(i,nj)*gtl(i)*gtr(k)+
     .                atopr2(i,nj)*btopr1(k,nj)*gtl(k)*gtr(i)
               ab11 = atopr1(k,nj)*atopr2(i,nj)*gtl(k)*gtl(i)+
     .                btopr1(k,nj)*btopr2(i,nj)*gtr(i)*gtr(k)
               ab12 = btopr1(k,nj)*btopr2(i,nj)*gtl(k)*gtr(i)+
     .                atopr1(k,nj)*atopr2(i,nj)*gtr(k)*gtl(i)

               SD_gotp=SD_gotp
     .           +8.D0*gs2*g2/dst(i)/dst(k)*(
     .           -4.D0*ab11*xmneut(nj)/mgluino*xmut
     .           +2.D0*ab12*xmneut(nj)*amt/mgluino**2*(-xmut-1.D0+uh)
     .           +2.D0*ab13*amt/mgluino*(-xmut-xmuneut1+uh)
     .           +ab14*(-uh**2+uh*(1.D0+xmuneut1+2.D0*xmut)-
     .                 (xmuneut1+xmut)*(1.D0+xmut)) )
     .         +8.D0*gs2*g2/dstb(i)/dstb(k)*(
     .           -4.D0*ab21*xmneut(nj)/mgluino*xmut
     .           +2.D0*ab22*xmneut(nj)*amt/mgluino**2*(-xmut-1.D0+th)
     .           +2.D0*ab23*amt/mgluino*(-xmut-xmuneut1+th)
     .           +ab24*(-th**2+th*(1.D0+xmuneut1+2.D0*xmut)-
     .                 (xmuneut1+xmut)*(1.D0+xmut)) )
     .         -2.D0*8.D0*gs2*g2/dst(k)/dstb(i)*(
     .           ab5*xmut*(uh+th-2.D0*xmut) 
     .           +ab6*amt/mgluino*(th-xmuneut1-xmut) 
     .           +ab7*xmneut(nj)*amt/mgluino**2*(uh-xmut-1.D0) 
     .           -2.D0*ab8*xmneut(nj)/mgluino*xmut
     .           +ab9*amt/mgluino*(uh-xmuneut1-xmut)
     .           +ab10*(uh*th-xmuneut1-xmut**2)
     .           +ab11*xmneut(nj)/mgluino*(uh+th-xmuneut1-1.D0)
     .           +ab12*xmneut(nj)*amt/mgluino**2*(th-xmut-1.D0) )
            enddo
         enddo
      else 
         SD_gotp=0.D0	
      endif
 
      end

c ==================================================================== c
c                   gluino --> chargino- up downbar
c ==================================================================== c

      double precision function SD_goud(x1,x2)
	
      implicit double precision (a-h,m,o-z)
      integer ni,nj

      dimension amneut(4),amchar(2),xmneut(4)
      dimension dsup(2),dsdn(2)
      dimension gtr(2),gtl(2),gbr(2),gbl(2),gur(2),gul(2),gdr(2),gdl(2)
      dimension alup(2,2),aldo(2,2),blup(2,2),bldo(2,2)
	
      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_gluino/mgluino
      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_squarkud/asup1,asup2,asdown1,asdown2
      COMMON/SD_indices/ni,nj
      COMMON/SD_coup7/alup,aldo
      COMMON/SD_coup21/gtr,gtl,gbr,gbl,gur,gul,gdr,gdl
      COMMON/SD_coupewsb/alsew,g2ew,g1ew
      COMMON/SD_runcoupscale/scalechoice,scaleofcoupling,inumloop

      external SD_alphascall

      if(scalechoice.eq.1.D0) then
         gs2 = alsew*4.D0*pi
      elseif(scalechoice.eq.2.D0) then         
         gs2 = SD_alphascall(mgluino,inumloop)*4.D0*pi
      elseif(scalechoice.eq.3.D0) then
         gs2 = SD_alphascall(scaleofcoupling,inumloop)*4.D0*pi
      endif

      xmusdn1 = asdown1**2/mgluino**2
      xmusdn2 = asdown2**2/mgluino**2
      xmusup1 = asup1**2/mgluino**2
      xmusup2 = asup2**2/mgluino**2

      dsup(1)=1-x1-xmusup1
      dsup(2)=1-x1-xmusup2
      dsdn(1)=1-x2-xmusdn1
      dsdn(2)=1-x2-xmusdn2

      xmuchar1 = amchar(nj)**2/mgluino**2

      x3 = 2-x1-x2
      y1 = 1-xmuchar1-x1
      y2 = 1-xmuchar1-x2
      y3 = 1+xmuchar1-x3

      do i=1,2,1
         blup(1,i) = 0.D0
         blup(2,i) = 0.D0
         bldo(1,i) = 0.D0
         bldo(2,i) = 0.D0
      end do

      SD_goud=0.D0

      if (mgluino.gt.amchar(nj)) then
         do i=1,2
            do k=1,2
               SD_goud=SD_goud+4.D0*gs2*g2/dsdn(i)/dsdn(k)*2.D0*(
     .              (gdr(i)*gdr(k)+gdl(i)*gdl(k))*
     .              (aldo(i,nj)*aldo(k,nj)+
     .               bldo(k,nj)*bldo(i,nj))*x2*y2)
     .         +4.D0*gs2*g2/dsup(i)/dsup(k)*2.D0*(
     .              (gur(i)*gur(k)+gul(i)*gul(k))*
     .              (alup(i,nj)*alup(k,nj)+
     .               blup(k,nj)*blup(i,nj))*x1*y1)
     .         +4.D0*gs2*g2/dsdn(i)/dsup(k)*2.D0*(
     .         (blup(k,nj)*gdr(i)*gul(k)*aldo(i,nj)+gur(k)*
     .          bldo(i,nj)*alup(k,nj)*gdl(i))*(-x1*y1-x2*y2+x3*y3)
     .         +2.D0*(gul(k)*alup(k,nj)*gdl(i)*aldo(i,nj)+
     .                gur(k)*blup(k,nj)*gdr(i)*bldo(i,nj))*
     .          dsqrt(xmuchar1)*y3)
            enddo
         enddo
      else
         SD_goud=0.D0
      endif
      
      end

c ==================================================================== c
c                  gluino --> chargino- top bottombar
c ==================================================================== c

      double precision function SD_gotb(x1,x2)

      implicit double precision (a-h,m,o-z)
      integer ni,nj

      dimension amneut(4),amchar(2),xmneut(4)
      dimension dsbt(2),dstp(2)
      dimension gtr(2),gtl(2),gbr(2),gbl(2),gur(2),gul(2),gdr(2),gdl(2)
      dimension alsbot(2,2),aksbot(2,2),alstor(2,2),akstor(2,2)
	
      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_gluino/mgluino
      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2
      COMMON/SD_fermion/amt,amb,amtau
      COMMON/SD_indices/ni,nj
      COMMON/SD_scala/scalb,scalt
      COMMON/SD_yukawa/ytewsb,ybewsb,ytauewsb
      COMMON/SD_coup21/gtr,gtl,gbr,gbl,gur,gul,gdr,gdl
      COMMON/SD_coupewsb/alsew,g2ew,g1ew
      COMMON/SD_runcoupscale/scalechoice,scaleofcoupling,inumloop

      external SD_alphascall

c -- the running couplings --

      if(scalechoice.eq.1.D0) then
         gs2 = alsew*4.D0*pi
      elseif(scalechoice.eq.2.D0) then         
         gs2 = SD_alphascall(mgluino,inumloop)*4.D0*pi
      elseif(scalechoice.eq.3.D0) then
         gs2 = SD_alphascall(scaleofcoupling,inumloop)*4.D0*pi
      endif

      if(scalechoice.eq.1.D0) then
         scalb = ybewsb/dsqrt(g2)
         scalt = ytewsb/dsqrt(g2)
      elseif(scalechoice.eq.2.D0) then         
         call SD_runmass(mgluino,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      elseif(scalechoice.eq.3.D0) then
         call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      endif

      call SD_charstopbot(alstor,akstor)
      call SD_charsbottop(alsbot,aksbot)

c --- some definitions ---

      xmusb1 = asb1**2/mgluino**2
      xmusb2 = asb2**2/mgluino**2
      xmust1 = ast1**2/mgluino**2
      xmust2 = ast2**2/mgluino**2

      dstp(1)=1-x1-xmust1+amt**2/mgluino**2
      dstp(2)=1-x1-xmust2+amt**2/mgluino**2
      dsbt(1)=1-x2-xmusb1+amb**2/mgluino**2
      dsbt(2)=1-x2-xmusb2+amb**2/mgluino**2

      xmuchar1 = amchar(nj)**2/mgluino**2

      SD_gotb=0.D0
      
c --- the formula for massive final state fermions ---

      uh = 1.D0-x1+amt**2/mgluino**2
      th = 1.D0-x2+amb**2/mgluino**2
      xmub = amb**2/mgluino**2
      xmut = amt**2/mgluino**2

      if(mgluino.gt.(amchar(nj)+amb+amt)) then 
         do i=1,2
            do k=1,2
               db1 = alsbot(k,nj)*aksbot(i,nj)+alsbot(i,nj)*aksbot(k,nj)
               db2 = alsbot(k,nj)*alsbot(i,nj)+aksbot(k,nj)*aksbot(i,nj)
               db3 = gbl(k)*gbr(i)+gbl(i)*gbr(k)
               db4 = gbl(i)*gbl(k)+gbr(i)*gbr(k)

               ab1 = db1*db3
               ab2 = db1*db4
               ab3 = db2*db3
               ab4 = db2*db4

               dt1 = alstor(k,nj)*akstor(i,nj)+alstor(i,nj)*akstor(k,nj)
               dt2 = alstor(k,nj)*alstor(i,nj)+akstor(k,nj)*akstor(i,nj)
               dt3 = gtl(k)*gtr(i)+gtl(i)*gtr(k)
               dt4 = gtl(i)*gtl(k)+gtr(i)*gtr(k)

               at1 = dt1*dt3
               at2 = dt1*dt4
               at3 = dt2*dt3
               at4 = dt2*dt4

               ab5 = alstor(k,nj)*aksbot(i,nj)*gtl(k)*gbr(i)+
     .               alsbot(i,nj)*akstor(k,nj)*gbl(i)*gtr(k)
               ab6 = alstor(k,nj)*aksbot(i,nj)*gtr(k)*gbr(i)+
     .               akstor(k,nj)*alsbot(i,nj)*gtl(k)*gbl(i)
               ab7 = alstor(k,nj)*alsbot(i,nj)*gbr(i)*gtl(k)+
     .               akstor(k,nj)*aksbot(i,nj)*gbl(i)*gtr(k)
               ab8 = alstor(k,nj)*alsbot(i,nj)*gtr(k)*gbr(i)+
     .               akstor(k,nj)*aksbot(i,nj)*gbl(i)*gtl(k)
               ab9 = alstor(k,nj)*aksbot(i,nj)*gtl(k)*gbl(i)+
     .               alsbot(i,nj)*akstor(k,nj)*gbr(i)*gtr(k)
               ab10 = alstor(k,nj)*aksbot(i,nj)*gbl(i)*gtr(k)+
     .                alsbot(i,nj)*akstor(k,nj)*gtl(k)*gbr(i)
               ab11 = alstor(k,nj)*alsbot(i,nj)*gtl(k)*gbl(i)+
     .                akstor(k,nj)*aksbot(i,nj)*gbr(i)*gtr(k)
               ab12 = alstor(k,nj)*alsbot(i,nj)*gtr(k)*gbl(i)+
     .                akstor(k,nj)*aksbot(i,nj)*gtl(k)*gbr(i)

               SD_gotb=SD_gotb
     .           +8.D0*gs2*g2/dsbt(i)/dsbt(k)*(
     .           -4.D0*ab1*amchar(nj)/mgluino*amb*amt/mgluino**2
     .           +2.D0*ab2*amchar(nj)*amt/mgluino**2*(-xmub-1.D0+th)
     .           +2.D0*ab3*amb/mgluino*(-xmut-xmuchar1+th)
     .           +ab4*(-th**2+th*(1.D0+xmuchar1+xmub+xmut)-
     .                 (xmuchar1+xmut)*(1.D0+xmub)) )
     .         +8.D0*gs2*g2/dstp(i)/dstp(k)*(
     .           -4.D0*at1*amchar(nj)/mgluino*amb*amt/mgluino**2
     .           +2.D0*at2*amchar(nj)*amb/mgluino**2*(-xmut-1.D0+uh)
     .           +2.D0*at3*amt/mgluino*(-xmub-xmuchar1+uh)
     .           +at4*(-uh**2+uh*(1.D0+xmuchar1+xmub+xmut)-
     .                 (xmuchar1+xmub)*(1.D0+xmut)) )
     .         -2.D0*8.D0*gs2*g2/dsbt(i)/dstp(k)*(
     .           ab5*amb*amt/mgluino**2*(uh+th-xmub-xmut) 
     .           +ab6*amb/mgluino*(th-xmuchar1-xmut) 
     .           +ab7*amchar(nj)*amb/mgluino**2*(uh-xmut-1.D0) 
     .           -2.D0*ab8*amchar(nj)/mgluino*amt*amb/mgluino**2
     .           +ab9*amt/mgluino*(uh-xmuchar1-xmub)
     .           +ab10*(uh*th-xmuchar1-xmub*xmut)
     .           +ab11*amchar(nj)/mgluino*(uh+th-xmuchar1-1.D0)
     .           +ab12*amchar(nj)*amt/mgluino**2*(th-xmub-1.D0) )
            enddo
         enddo
      else 
         SD_gotb=0.D0	
      endif

      end

c----------------------------------------------------------------------c

      double precision function SD_gocc(x1,x2)

      implicit double precision (a-h,m,o-z)
      integer ni,nj

      dimension amneut(4),amchar(2),xmneut(4)
      dimension dsbt(2),dstp(2)
      dimension gtr(2),gtl(2),gbr(2),gbl(2),gur(2),gul(2),gdr(2),gdl(2)
      dimension alsbot(2,2),aksbot(2,2),alstor(2,2),akstor(2,2)
	
      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_gluino/mgluino
      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2
      COMMON/SD_fermion/amt,amb,amtau
      COMMON/SD_indices/ni,nj
      COMMON/SD_scala/scalb,scalt
      COMMON/SD_yukawa/ytewsb,ybewsb,ytauewsb
      COMMON/SD_coup21/gtr,gtl,gbr,gbl,gur,gul,gdr,gdl
      COMMON/SD_coupewsb/alsew,g2ew,g1ew
      COMMON/SD_runcoupscale/scalechoice,scaleofcoupling,inumloop

      external SD_alphascall

c -- the running couplings --

      if(scalechoice.eq.1.D0) then
         gs2 = alsew*4.D0*pi
      elseif(scalechoice.eq.2.D0) then         
         gs2 = SD_alphascall(mgluino,inumloop)*4.D0*pi
      elseif(scalechoice.eq.3.D0) then
         gs2 = SD_alphascall(scaleofcoupling,inumloop)*4.D0*pi
      endif

      if(scalechoice.eq.1.D0) then
         scalb = ybewsb/dsqrt(g2)
         scalt = ytewsb/dsqrt(g2)
      elseif(scalechoice.eq.2.D0) then         
         call SD_runmass(mgluino,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      elseif(scalechoice.eq.3.D0) then
         call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      endif
	
      call SD_charstopbot(alstor,akstor)
      call SD_charsbottop(alsbot,aksbot)

c --- some definitions ---

      xmusb1 = asb1**2/mgluino**2
      xmusb2 = asb2**2/mgluino**2
      xmust1 = ast1**2/mgluino**2
      xmust2 = ast2**2/mgluino**2

      dstp(1)=1-x2-xmust1+amt**2/mgluino**2
      dstp(2)=1-x2-xmust2+amt**2/mgluino**2
      dsbt(1)=1-x1-xmusb1+amb**2/mgluino**2
      dsbt(2)=1-x1-xmusb2+amb**2/mgluino**2

      xmuchar1 = amchar(nj)**2/mgluino**2

      SD_gocc=0.D0
      
c --- the formula for massive final state fermions ---

      uh = 1.D0-x1+amb**2/mgluino**2
      th = 1.D0-x2+amt**2/mgluino**2
      xmub = amb**2/mgluino**2
      xmut = amt**2/mgluino**2

      if(mgluino.gt.(amchar(nj)+amb+amt)) then 
         do i=1,2
            do k=1,2
               db1 = alsbot(k,nj)*aksbot(i,nj)+alsbot(i,nj)*aksbot(k,nj)
               db2 = alsbot(k,nj)*alsbot(i,nj)+aksbot(k,nj)*aksbot(i,nj)
               db3 = gbl(k)*gbr(i)+gbl(i)*gbr(k)
               db4 = gbl(i)*gbl(k)+gbr(i)*gbr(k)

               ab1 = db1*db3
               ab2 = db1*db4
               ab3 = db2*db3
               ab4 = db2*db4

               dt1 = alstor(k,nj)*akstor(i,nj)+alstor(i,nj)*akstor(k,nj)
               dt2 = alstor(k,nj)*alstor(i,nj)+akstor(k,nj)*akstor(i,nj)
               dt3 = gtl(k)*gtr(i)+gtl(i)*gtr(k)
               dt4 = gtl(i)*gtl(k)+gtr(i)*gtr(k)

               at1 = dt1*dt3
               at2 = dt1*dt4
               at3 = dt2*dt3
               at4 = dt2*dt4

               ab5 = alstor(k,nj)*aksbot(i,nj)*gtl(k)*gbr(i)+
     .               alsbot(i,nj)*akstor(k,nj)*gbl(i)*gtr(k)
               ab6 = alstor(k,nj)*aksbot(i,nj)*gtl(k)*gbl(i)+
     .               akstor(k,nj)*alsbot(i,nj)*gtr(k)*gbr(i)
               ab7 = alstor(k,nj)*alsbot(i,nj)*gbl(i)*gtr(k)+
     .               akstor(k,nj)*aksbot(i,nj)*gbr(i)*gtl(k)
               ab8 = alstor(k,nj)*alsbot(i,nj)*gtr(k)*gbr(i)+
     .               akstor(k,nj)*aksbot(i,nj)*gbl(i)*gtl(k)
               ab9 = alstor(k,nj)*aksbot(i,nj)*gtr(k)*gbr(i)+
     .               alsbot(i,nj)*akstor(k,nj)*gbl(i)*gtl(k)
               ab10 = alstor(k,nj)*aksbot(i,nj)*gbl(i)*gtr(k)+
     .                alsbot(i,nj)*akstor(k,nj)*gtl(k)*gbr(i)
               ab11 = alstor(k,nj)*alsbot(i,nj)*gtl(k)*gbl(i)+
     .                akstor(k,nj)*aksbot(i,nj)*gbr(i)*gtr(k)
               ab12 = alstor(k,nj)*alsbot(i,nj)*gtl(k)*gbr(i)+
     .                akstor(k,nj)*aksbot(i,nj)*gtr(k)*gbl(i)

               SD_gocc=SD_gocc
     .           +8.D0*gs2*g2/dsbt(i)/dsbt(k)*(
     .           -4.D0*ab1*amchar(nj)/mgluino*amb*amt/mgluino**2
     .           +2.D0*ab2*amchar(nj)*amt/mgluino**2*(-xmub-1.D0+uh)
     .           +2.D0*ab3*amb/mgluino*(-xmut-xmuchar1+uh)
     .           +ab4*(-uh**2+uh*(1.D0+xmuchar1+xmub+xmut)-
     .                 (xmuchar1+xmut)*(1.D0+xmub)) )
     .         +8.D0*gs2*g2/dstp(i)/dstp(k)*(
     .           -4.D0*at1*amchar(nj)/mgluino*amb*amt/mgluino**2
     .           +2.D0*at2*amchar(nj)*amb/mgluino**2*(-xmut-1.D0+th)
     .           +2.D0*at3*amt/mgluino*(-xmub-xmuchar1+th)
     .           +at4*(-th**2+th*(1.D0+xmuchar1+xmub+xmut)-
     .                 (xmuchar1+xmub)*(1.D0+xmut)) )
     .         -2.D0*8.D0*gs2*g2/dsbt(i)/dstp(k)*(
     .           ab5*amb*amt/mgluino**2*(uh+th-xmub-xmut) 
     .           +ab9*amb/mgluino*(uh-xmuchar1-xmut) 
     .           +ab12*amchar(nj)*amb/mgluino**2*(th-xmut-1.D0) 
     .           -2.D0*ab8*amchar(nj)/mgluino*amt*amb/mgluino**2
     .           +ab6*amt/mgluino*(th-xmuchar1-xmub)
     .           +ab10*(uh*th-xmuchar1-xmub*xmut)
     .           +ab11*amchar(nj)/mgluino*(uh+th-xmuchar1-1.D0)
     .           +ab7*amchar(nj)*amt/mgluino**2*(uh-xmub-1.D0) )
            enddo
         enddo
      else 
         SD_gocc=0.D0	
      endif

      end

c ==================================================================== c
c                         sup 2-body decays                            c
c ==================================================================== c

      subroutine SD_sup2bod(suplneutup,suprneutup,suplchardow,
     .                   suprchardow,suplglui,suprglui,qcdsuplneutup,
     .                   qcdsuprneutup,qcdsuplchardow,qcdsuprchardow,
     .                   qcdsuplglui,qcdsuprglui)

      implicit double precision (a-h,m,o-z)
      double precision SD_lamb
      dimension suplneutup(4),suprneutup(4),suplchardow(2),
     .          suprchardow(2),qcdsuplneutup(4),qcdsuprneutup(4),
     .          qcdsuplchardow(2),qcdsuprchardow(2)
      dimension alup(2,2),aldo(2,2)
      dimension aup(2,4),bup(2,4),ado(2,4),bdo(2,4)
      dimension amneut(4),xmneut(4),amchar(2)

      external SD_lamb
      external SD_alphascall
      external SD_ftotqcd
      external SD_gama,SD_gamfcap,SD_gamf,SD_gamglui2,SD_gamrendec

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_squarkud/asup1,asup2,asdown1,asdown2
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2
      COMMON/SD_gluino/mgluino
      COMMON/SD_sfmixang/thet,theb,thel,cum,sum,cdm,sdm,cem,sem
      COMMON/SD_fermion/amt,amb,amtau
      COMMON/SD_coup7/alup,aldo
      COMMON/SD_coup10/aup,bup,ado,bdo
      COMMON/SD_refscale/amuref
      COMMON/SD_coupewsb/alsew,g2ew,g1ew
      COMMON/SD_runcoupscale/scalechoice,scaleofcoupling,inumloop

c -- the running alphas --

      if(scalechoice.eq.1.D0) then
         gs21 = alsew*4.D0*pi
         gs22 = gs21
         amurefer = amuref
      elseif(scalechoice.eq.2.D0) then         
         gs21 = SD_alphascall(asup1,inumloop)*4.D0*pi
         gs22 = SD_alphascall(asup2,inumloop)*4.D0*pi
      elseif(scalechoice.eq.3.D0) then
         gs21 = SD_alphascall(scaleofcoupling,inumloop)*4.D0*pi
         gs22 = gs21
         amurefer = scaleofcoupling
      endif

c -------------------------------------------------------------------- c
c  supl -> chi0_1/chi0_2/chi0_3/chi0_4 + up

      do i=1,4,1
         if(amneut(i).le.asup1) then
            suplneutup(i)=g2*(aup(1,i)**2+bup(1,i)**2)*(asup1**2
     .           -amneut(i)**2)*SD_lamb(0.d0,amneut(i)/asup1)
     .           /(16*pi*asup1)
         else
            suplneutup(i)=0.d0
         endif
      end do

c --- the QCD corrections ---

      do i=1,4,1
         if(amneut(i).le.asup1) then
            qcdsuplneutup(i)=4.D0/3.D0*gs21/(4.D0*pi)/pi*
     .           suplneutup(i)*
     .           SD_ftotqcd(amneut(i)**2/asup1**2,mgluino**2/asup1**2)
         else
            qcdsuplneutup(i)=0.d0
         endif
      end do

c -------------------------------------------------------------------- c
c  supl -> chi+_1/chi+_2 + down

      do i=1,2,1
         if (amchar(i).le.asup1) then
            suplchardow(i)=g2*alup(1,i)**2*(asup1**2-amchar(i)**2)*
     .           SD_lamb(0.d0,amchar(i)/asup1)/(16*pi*asup1)
         else
            suplchardow(i)=0.d0
         endif
      end do

c --- the QCD corrections ---

      do i=1,2,1
         if(amchar(i).le.asup1) then
            qcdsuplchardow(i)=4.D0/3.D0*gs21/(4.D0*pi)/pi*
     .           suplchardow(i)*
     .           SD_ftotqcd(amchar(i)**2/asup1**2,mgluino**2/asup1**2)
         else
            qcdsuplchardow(i)=0.d0
         endif
      end do

c -------------------------------------------------------------------- c
c  supr -> chi0_1/chi0_2/chi0_3/chi0_4 + up

      do i=1,4,1
         if(amneut(i).le.asup2) then
            suprneutup(i)=g2*(aup(2,i)**2+bup(2,i)**2)*(asup2**2
     .           -amneut(i)**2)*SD_lamb(0.d0,amneut(i)/asup2)
     .           /(16*pi*asup2)
         else
            suprneutup(i)=0.d0
         endif
      end do

c --- the QCD corrections ---

      do i=1,4,1
         if(amneut(i).le.asup2) then
            qcdsuprneutup(i)=4.D0/3.D0*gs22/(4.D0*pi)/pi*
     .           suprneutup(i)*
     .           SD_ftotqcd(amneut(i)**2/asup2**2,mgluino**2/asup2**2)
         else
            qcdsuprneutup(i)=0.d0
         endif
      end do

c -------------------------------------------------------------------- c
c  supr -> chi+_1/chi+_2 + down

      do i=1,2,1
         if (amchar(i).le.asup2) then
            suprchardow(i)=g2*alup(2,i)**2*(asup2**2-amchar(i)**2)*
     .           SD_lamb(0.d0,amchar(i)/asup2)/(16*pi*asup2)
         else
            suprchardow(i)=0.d0
         endif
      end do

c --- the QCD corrections ---

      do i=1,2,1
         if(amchar(i).le.asup2) then
            qcdsuprchardow(i)=4.D0/3.D0*gs22/(4.D0*pi)/pi*
     .           suprchardow(i)*
     .           SD_ftotqcd(amchar(i)**2/asup2**2,mgluino**2/asup2**2)
         else
            qcdsuprchardow(i)=0.d0
         endif
      end do

c -------------------------------------------------------------------- c
c  supl --> gluino + up

      if(asup1.gt.mgluino) then
         suplglui = 8.D0*gs21*(asup1**2-mgluino**2)*
     .              SD_lamb(0.D0,mgluino/asup1)/(16.D0*pi*asup1)/3.D0 
      else
         suplglui = 0.D0
      endif

c --- the QCD corrections ---

      if(scalechoice.eq.2.D0) then
         amurefer = asup1
      endif

      if(asup1.gt.mgluino) then
         scala = amurefer
         alp   = gs21/(4.D0*pi)
         ca    = 3.D0
         cf    = 4.D0/3.D0
         amsq  = 2.D0*(asup1+asup2+asdown1+asdown2)/8.D0
         rval  = mgluino**2/amsq**2

         qcdsuplglui = suplglui*alp/pi*( ca*SD_gama(rval) + 
     .        cf*SD_gamfcap(rval) + 4.D0*SD_gamf(rval) + 
     .        2.D0*pi**2/mgluino**2*
     .        SD_gamglui2(ast1,ast2,amt,thet,asb1,asb2,amb,theb,mgluino,
     .        1,amsq) + 
     .        SD_gamrendec(amsq,ast1,ast2,amt,asb1,asb2,mgluino,scala) )
      else
         qcdsuplglui = 0.D0
      endif

c -------------------------------------------------------------------- c
c  supr --> gluino + up
      
      if(asup2.gt.mgluino) then
         suprglui = 8.D0*gs22*(asup2**2-mgluino**2)*
     .              SD_lamb(0.D0,mgluino/asup2)/(16.D0*pi*asup2)/3.D0
      else
         suprglui = 0.D0
      endif

c --- the QCD corrections ---

      if(scalechoice.eq.2.D0) then
         amurefer = asup2
      endif

      if(asup2.gt.mgluino) then
         scala = amurefer
         alp   = gs22/(4.D0*pi)
         ca    = 3.D0
         cf    = 4.D0/3.D0
         amsq  = 2.D0*(asup1+asup2+asdown1+asdown2)/8.D0
         rval  = mgluino**2/amsq**2

         qcdsuprglui = suprglui*alp/pi*( ca*SD_gama(rval) + 
     .        cf*SD_gamfcap(rval) + 4.D0*SD_gamf(rval) + 
     .        2.D0*pi**2/mgluino**2*
     .        SD_gamglui2(ast2,ast1,amt,thet,asb2,asb1,amb,theb,mgluino,
     .        2,amsq) + 
     .        SD_gamrendec(amsq,ast1,ast2,amt,asb1,asb2,mgluino,scala) )
      else
         qcdsuprglui = 0.D0
      endif

      end 

c ==================================================================== c
c                          sdown 2-body decays                         c
c ==================================================================== c

      subroutine SD_sdown2bod(sdowlneutdow,sdowlcharup,sdowrneutdow,
     .                     sdowrcharup,sdowlglui,sdowrglui,
     .                     qcdsdowlneutdow,qcdsdowlcharup,
     .                     qcdsdowrneutdow,qcdsdowrcharup,qcdsdowlglui,
     .                     qcdsdowrglui)

      implicit double precision (a-h,m,o-z)
      double precision SD_lamb

      dimension sdowlneutdow(4),sdowlcharup(2),sdowrneutdow(4),
     .          sdowrcharup(2),qcdsdowlneutdow(4),qcdsdowlcharup(2),
     .          qcdsdowrneutdow(4),qcdsdowrcharup(2)
      dimension amneut(4),xmneut(4),amchar(2)
      dimension aldo(2,2),alup(2,2)
      dimension ado(2,4),bdo(2,4),aup(2,4),bup(2,4)

      external SD_lamb
      external SD_alphascall
      external SD_ftotqcd
      external SD_gama,SD_gamfcap,SD_gamf,SD_gamglui2,SD_gamrendec

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_squarkud/asup1,asup2,asdown1,asdown2
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2
      COMMON/SD_gluino/mgluino
      COMMON/SD_sfmixang/thet,theb,thel,cum,sum,cdm,sdm,cem,sem
      COMMON/SD_fermion/amt,amb,amtau
      COMMON/SD_coup7/alup,aldo
      COMMON/SD_coup10/aup,bup,ado,bdo
      COMMON/SD_refscale/amuref
      COMMON/SD_coupewsb/alsew,g2ew,g1ew
      COMMON/SD_runcoupscale/scalechoice,scaleofcoupling,inumloop

c -- the running alphas --

      if(scalechoice.eq.1.D0) then
         gs21 = alsew*4.D0*pi
         gs22 = gs21
         amurefer = amuref
      elseif(scalechoice.eq.2.D0) then         
         gs21 = SD_alphascall(asdown1,inumloop)*4.D0*pi
         gs22 = SD_alphascall(asdown2,inumloop)*4.D0*pi
      elseif(scalechoice.eq.3.D0) then
         gs21 = SD_alphascall(scaleofcoupling,inumloop)*4.D0*pi
         gs22 = gs21
         amurefer = scaleofcoupling
      endif

c -------------------------------------------------------------------- c
c  sdownl -> chi0_1/chi0_2/chi0_3/chi0_4 + down

      do i=1,4,1
         if(amneut(i).le.asdown1) then
            sdowlneutdow(i)=g2*((ado(1,i)**2+bdo(1,i)**2)*
     .           (asdown1**2-amneut(i)**2)
     .           )*SD_lamb(0.d0,amneut(i)/asdown1)
     .           /(16*pi*asdown1)
         else
            sdowlneutdow(i)=0.D0
         endif
      end do

c --- the QCD corrections ---

      do i=1,4,1
         if(amneut(i).le.asdown1) then
            qcdsdowlneutdow(i)=4.D0/3.D0*gs21/(4.D0*pi)/pi*
     .         sdowlneutdow(i)*
     .         SD_ftotqcd(amneut(i)**2/asdown1**2,mgluino**2/asdown1**2)
         else
            qcdsdowlneutdow(i)=0.d0
         endif
      end do

c -------------------------------------------------------------------- c
c  sdownl -> chi-_1/chi-_2 up

      do i=1,2,1
         if(amchar(i).le.asdown1) then
            sdowlcharup(i)=g2*aldo(1,i)**2*
     .           (asdown1**2-amchar(i)**2)*
     .           SD_lamb(0.d0,amchar(i)/asdown1)/(16*pi*asdown1)
         else
            sdowlcharup(i)=0.D0
         endif
      end do

c --- the QCD corrections ---

      do i=1,2,1
         if(amchar(i).le.asdown1) then
            qcdsdowlcharup(i)=4.D0/3.D0*gs21/(4.D0*pi)/pi*
     .         sdowlcharup(i)*
     .         SD_ftotqcd(amchar(i)**2/asdown1**2,mgluino**2/asdown1**2)
         else
            qcdsdowlcharup(i)=0.D0
         endif
      end do

c -------------------------------------------------------------------- c
c  sdownr -> chi0_1/chi0_2/chi0_3/chi0_4 + down

      do i=1,4,1
         if(amneut(i).le.asdown2) then
            sdowrneutdow(i)=g2*((ado(2,i)**2+bdo(2,i)**2)*
     .           (asdown2**2-amneut(i)**2)
     .           )*SD_lamb(0.d0,amneut(i)/asdown2)
     .           /(16*pi*asdown2)
         else
            sdowrneutdow(i)=0.D0
         endif
      end do

c --- the QCD corrections ---

      do i=1,4,1
         if(amneut(i).le.asdown2) then
            qcdsdowrneutdow(i)=4.D0/3.D0*gs22/(4.D0*pi)/pi*
     .         sdowrneutdow(i)*
     .         SD_ftotqcd(amneut(i)**2/asdown2**2,mgluino**2/asdown2**2)
         else
            qcdsdowrneutdow(i)=0.d0
         endif
      end do

c -------------------------------------------------------------------- c
c  sdownr -> chi-_1/chi-_2 up

      do i=1,2,1
         if(amchar(i).le.asdown2) then
            sdowrcharup(i)=g2*aldo(2,i)**2*
     .           (asdown2**2-amchar(i)**2)*
     .           SD_lamb(0.d0,amchar(i)/asdown2)/(16*pi*asdown2)
         else
            sdowrcharup(i)=0.D0
         endif
      end do

c --- the QCD corrections ---

      do i=1,2,1
         if(amchar(i).le.asdown2) then
            qcdsdowrcharup(i)=4.D0/3.D0*gs22/(4.D0*pi)/pi*
     .         sdowrcharup(i)*
     .         SD_ftotqcd(amchar(i)**2/asdown2**2,mgluino**2/asdown2**2)
         else
            qcdsdowrcharup(i)=0.D0
         endif
      end do

c -------------------------------------------------------------------- c
c  sdownl --> gluino + down

      if(asdown1.gt.mgluino) then
         sdowlglui = 8.D0*gs21*(asdown1**2-mgluino**2)*
     .            SD_lamb(0.D0,mgluino/asdown1)/(16.D0*pi*asdown1)/3.D0 
      else
         sdowlglui = 0.D0
      endif

c --- the QCD corrections ---

      if(scalechoice.eq.2.D0) then
         amurefer = asdown1
      endif

      if(asdown1.gt.mgluino) then
         scala = amurefer
         alp   = gs21/(4.D0*pi)
         ca    = 3.D0
         cf    = 4.D0/3.D0
         amsq  = 2.D0*(asup1+asup2+asdown1+asdown2)/8.D0
         rval  = mgluino**2/amsq**2

         qcdsdowlglui = sdowlglui*alp/pi*( ca*SD_gama(rval) + 
     .        cf*SD_gamfcap(rval) + 4.D0*SD_gamf(rval) + 
     .        2.D0*pi**2/mgluino**2*
     .        SD_gamglui2(ast1,ast2,amt,thet,asb1,asb2,amb,theb,mgluino,
     .        1,amsq) + 
     .        SD_gamrendec(amsq,ast1,ast2,amt,asb1,asb2,mgluino,scala) )
      else
         qcdsdowlglui = 0.D0
      endif

c -------------------------------------------------------------------- c
c  sdownr --> gluino + down
      
      if(asdown2.gt.mgluino) then
         sdowrglui = 8.D0*gs22*(asdown2**2-mgluino**2)*
     .             SD_lamb(0.D0,mgluino/asdown2)/(16.D0*pi*asdown2)/3.D0
      else
         sdowrglui = 0.D0
      endif

c --- the QCD corrections ---

      if(scalechoice.eq.2.D0) then
         amurefer = asdown2
      endif

      if(asdown2.gt.mgluino) then
         scala = amurefer
         alp   = gs22/(4.D0*pi)
         ca    = 3.D0
         cf    = 4.D0/3.D0
         amsq  = 2.D0*(asup1+asup2+asdown1+asdown2)/8.D0
         rval  = mgluino**2/amsq**2

         qcdsdowrglui = sdowrglui*alp/pi*( ca*SD_gama(rval) + 
     .        cf*SD_gamfcap(rval) + 4.D0*SD_gamf(rval) + 
     .        2.D0*pi**2/mgluino**2*
     .        SD_gamglui2(ast2,ast1,amt,thet,asb2,asb1,amb,theb,mgluino,
     .        2,amsq) + 
     .        SD_gamrendec(amsq,ast1,ast2,amt,asb1,asb2,mgluino,scala) )
      else
         qcdsdowrglui = 0.D0
      endif

      end 

c ==================================================================== c
c                           stop 2-body decays                         c
c ==================================================================== c

      subroutine SD_st2bod(st1neutt,st2neutt,st1charb,st2charb,st1glui,
     .                  st2glui,st1hcsb,st2hl,st2hh,st2ha,st2hcsb,
     .                  st1wsb,st2wsb,st2ztop,qcdst1neut,qcdst2neut,
     .                  qcdst1charb,qcdst2charb,qcdst1glui,qcdst2glui,
     .                  qcdst1hcsb,qcdst2hcsb,qcdst2hl,qcdst2hh,
     .                  qcdst2ha,qcdst2ztop,qcdst1wsb,qcdst2wsb)

      implicit double precision (a-h,m,o-z)
      integer nj
      double precision SD_lamb,lamv,nf

      dimension st1neutt(4),st2neutt(4),st1charb(2),st2charb(2),
     .          st1hcsb(2),st2hcsb(2),st1wsb(2),st2wsb(2)
      dimension gmsb(2)
      dimension atopr(2,4),btopr(2,4)
      dimension amneut(4),amchar(2),xmneut(4)
      dimension alstor(2,2),akstor(2,2)
      dimension qcdst2hcsb(2),qcdst1hcsb(2),qcdst1neut(4),qcdst2neut(4),
     .          qcdst1charb(2),qcdst2charb(2)
      dimension gztt(2,2),gzbb(2,2),gztautau(2,2)
      dimension gwtb(2,2),gwntau(2,2)
      dimension gctbr(2,2),glttr(2,2),ghttr(2,2)
      dimension qcdst1wsb(2),qcdst2wsb(2)

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_gluino/mgluino
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2
      COMMON/SD_squarkud/asup1,asup2,asdown1,asdown2
      COMMON/SD_fermion/amt,amb,amtau
      COMMON/SD_hmass/ama,aml,amh,amch,amar
      COMMON/SD_sfmixang/thet,theb,thel,cum,sum,cdm,sdm,cem,sem
      COMMON/SD_coup19/gztt,gzbb,gztautau
      COMMON/SD_coup20/gwtb,gwntau
      COMMON/SD_scala/scalb,scalt
      COMMON/SD_yukawa/ytewsb,ybewsb,ytauewsb
      COMMON/SD_runmcalc/rmtc,rmbc,rmtauc
      COMMON/SD_mixang/alp_mssm,tanbeta
      COMMON/SD_coupewsb/alsew,g2ew,g1ew
      COMMON/SD_runcoupscale/scalechoice,scaleofcoupling,inumloop
      COMMON/SD_refscale/amuref
      COMMON/SD_mwmzpole/amwp,amzp
      COMMON/SD_weinberg/sw,cw

      external SD_lamb
      external SD_alphascall,SD_runmass,SD_yuk
      external SD_gltneut,SD_grtneut,SD_corrreali,SD_gltchar,SD_grtchar
      external SD_gamtop1,SD_gamtop2,SD_gamglui1,SD_gamglui2,
     .         SD_gamglui3,SD_gam11,SD_gam12,SD_gamvirt,SD_gamreal,
     .         SD_gamcfdec
      external SD_gvirtgl,SD_gvirtmix,SD_stopsbot1719,SD_dcounterhc,
     .         SD_realcorr
      external SD_topneut1719,SD_dcounterneut,SD_gvirtmixdiv

c -- the mass values needed for the QCD corrections --

      lamv = 1.D-15
      amuv = 1000.D20

c -- the sbottom mass --

      gmsb(1) = asb1
      gmsb(2) = asb2

c -- the running couplings --

      if(scalechoice.eq.1.D0) then
         gs21 = alsew*4.D0*pi
         gs22 = gs21
      elseif(scalechoice.eq.2.D0) then         
         gs21 = SD_alphascall(ast1,inumloop)*4.D0*pi
         gs22 = SD_alphascall(ast2,inumloop)*4.D0*pi
      elseif(scalechoice.eq.3.D0) then
         gs21 = SD_alphascall(scaleofcoupling,inumloop)*4.D0*pi
         gs22 = gs21
      endif

      if(scalechoice.eq.1.D0) then
         scalb    = ybewsb/dsqrt(g2)
         scalt    = ytewsb/dsqrt(g2)
         amurefer = amuref
      elseif(scalechoice.eq.3.D0) then
         call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
         scalb    = SD_yuk(2,runmb)
         scalt    = SD_yuk(1,runmt)
         amurefer = scaleofcoupling
      endif

c -------------------------------------------------------------------- c
c  stop1 --> chi0_1/chi0_2/chi0_3/chi0_4 + top

      if(scalechoice.eq.2.D0) then         
         call SD_runmass(ast1,0.D0,0.D0,runmb,runmt)
         scalb    = SD_yuk(2,runmb)
         scalt    = SD_yuk(1,runmt)
         amurefer = ast1
      endif

      call SD_neutstoptop(atopr,btopr)

      do i=1,4,1
         if(ast1.gt.(amneut(i)+amt)) then
            st1neutt(i)=g2*((atopr(1,i)**2+btopr(1,i)**2)*(ast1**2-
     .           amt**2-amneut(i)**2)-4.D0*atopr(1,i)*btopr(1,i)*
     .           amt*xmneut(i))*SD_lamb(amt/ast1,amneut(i)/ast1)
     .           /(16*pi*ast1)
         else
            st1neutt(i)=0.D0
         endif
      end do

c --- the QCD corrections ---

      amuvdiv = amuv/amurefer

      do j=1,4,1
         if(ast1.gt.(amneut(j)+amt)) then
            if(xmneut(j).le.0.D0) then
               jsign = 1
            else
               jsign = 0
            endif

            qcdst1neut(j) = -g2/24.D0/pi**2/ast1*gs21/(4.D0*pi)*
     .           ((btopr(1,j)*SD_gltneut(1,j,amuv,amuvdiv,lamv)+
     .             atopr(1,j)*SD_grtneut(1,j,amuv,amuvdiv,lamv))*
     .            (ast1**2-amt**2-amneut(j)**2)
     .           -2.D0*(btopr(1,j)*SD_grtneut(1,j,amuv,amuvdiv,lamv)
     .                 +atopr(1,j)*SD_gltneut(1,j,amuv,amuvdiv,lamv))*
     .           amt*xmneut(j))*SD_lamb(amt/ast1,amneut(j)/ast1) 
     .           +g2/(6.D0*pi**2*ast1)*gs21/(4.D0*pi)*
     .           SD_corrreali(amt,amneut(j),ast1,lamv,1,jsign,1,j,1)
         else
            qcdst1neut(j) = 0.D0
         endif
      end do
      
c -------------------------------------------------------------------- c
c  stop2 --> chi0_1/chi0_2/chi0_3/chi0_4 + top

      if(scalechoice.eq.2.D0) then         
         call SD_runmass(ast2,0.D0,0.D0,runmb,runmt)
         scalb    = SD_yuk(2,runmb)
         scalt    = SD_yuk(1,runmt)
         amurefer = ast2
      endif

      call SD_neutstoptop(atopr,btopr)

      do i=1,4,1
         if(ast2.gt.(amneut(i)+amt)) then
            st2neutt(i)=g2*((atopr(2,i)**2+btopr(2,i)**2)*(ast2**2-
     .           amt**2-amneut(i)**2)-4.D0*atopr(2,i)*btopr(2,i)*
     .           amt*xmneut(i))*SD_lamb(amt/ast2,amneut(i)/ast2)
     .           /(16*pi*ast2)
         else
            st2neutt(i)=0.D0
         endif
      end do

c --- the QCD corrections ---

      amuvdiv = amuv/amurefer

      do j=1,4,1
         if(ast2.gt.(amneut(j)+amt)) then
            if(xmneut(j).le.0.D0) then
               jsign = 1
            else
               jsign = 0
            endif

            qcdst2neut(j) = -g2/24.D0/pi**2/ast2*gs22/(4.D0*pi)*
     .           ((btopr(2,j)*SD_gltneut(2,j,amuv,amuvdiv,lamv)
     .            +atopr(2,j)*SD_grtneut(2,j,amuv,amuvdiv,lamv))*
     .           (ast2**2-amt**2-amneut(j)**2)
     .           -2.D0*(btopr(2,j)*SD_grtneut(2,j,amuv,amuvdiv,lamv)
     .                 +atopr(2,j)*SD_gltneut(2,j,amuv,amuvdiv,lamv))*
     .           amt*xmneut(j))*SD_lamb(amt/ast2,amneut(j)/ast2) 
     .           +g2/(6.D0*pi**2*ast2)*gs22/(4.D0*pi)*
     .           SD_corrreali(amt,amneut(j),ast2,lamv,1,jsign,2,j,1)
         else
            qcdst2neut(j) = 0.D0
         endif
      end do
      
c -------------------------------------------------------------------- c
c  stop1 --> chi+_1/chi+_2 + bottom

      if(scalechoice.eq.2.D0) then         
         call SD_runmass(ast1,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
         amurefer = ast1
      endif

      call SD_charstopbot(alstor,akstor)

      do i=1,2,1
         if(ast1.gt.(amchar(i)+amb)) then
            st1charb(i)=g2*((alstor(1,i)**2+akstor(1,i)**2)*
     .           (ast1**2-amb**2-amchar(i)**2)
     .           -4.D0*alstor(1,i)*akstor(1,i)*
     .           amb*amchar(i))*SD_lamb(amb/ast1,amchar(i)/ast1)
     .           /(16*pi*ast1)
         else
            st1charb(i)=0.D0
         endif
      end do

c --- the QCD corrections ---

      amuvdiv = amuv/amurefer

      do j=1,2,1
         if(ast1.gt.(amchar(j)+amb)) then
            jsign = 0

            qcdst1charb(j) = -g2/24.D0/pi**2/ast1*gs21/(4.D0*pi)*
     .           ((akstor(1,j)*SD_gltchar(1,j,amuv,amuvdiv,lamv)
     .            +alstor(1,j)*SD_grtchar(1,j,amuv,amuvdiv,lamv))*
     .           (ast1**2-amb**2-amchar(j)**2)
     .           -2.D0*(akstor(1,j)*SD_grtchar(1,j,amuv,amuvdiv,lamv)
     .                 +alstor(1,j)*SD_gltchar(1,j,amuv,amuvdiv,lamv))*
     .           amb*amchar(j))*SD_lamb(amb/ast1,amchar(j)/ast1) 
     .           +g2/(6.D0*pi**2*ast1)*gs21/(4.D0*pi)*
     .           SD_corrreali(amb,amchar(j),ast1,lamv,2,jsign,1,j,1)
         else
            qcdst1charb(j) = 0.D0
         endif
      end do

c -------------------------------------------------------------------- c
c  stop2 --> chi+_1/chi+_2 + bottom

      if(scalechoice.eq.2.D0) then         
         call SD_runmass(ast2,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
         amurefer = ast2
      endif

      call SD_charstopbot(alstor,akstor)

      do i=1,2,1
         if(ast2.gt.(amchar(i)+amb)) then
            st2charb(i)=g2*((alstor(2,i)**2+akstor(2,i)**2)*
     .           (ast2**2-amb**2-amchar(i)**2)
     .           -4.D0*alstor(2,i)*akstor(2,i)*
     .           amb*amchar(i))*SD_lamb(amb/ast2,amchar(i)/ast2)
     .           /(16*pi*ast2)
         else
            st2charb(i)=0.D0
         endif
      end do

c --- the QCD corrections ---

      amuvdiv = amuv/amurefer

      do j=1,2,1
         if(ast2.gt.(amchar(j)+amb)) then
            jsign = 0

            qcdst2charb(j) = -g2/24.D0/pi**2/ast2*gs22/(4.D0*pi)*
     .           ((akstor(2,j)*SD_gltchar(2,j,amuv,amuvdiv,lamv)
     .            +alstor(2,j)*SD_grtchar(2,j,amuv,amuvdiv,lamv))*
     .           (ast2**2-amb**2-amchar(j)**2)
     .           -2.D0*(akstor(2,j)*SD_grtchar(2,j,amuv,amuvdiv,lamv)
     .                 +alstor(2,j)*SD_gltchar(2,j,amuv,amuvdiv,lamv))*
     .           amb*amchar(j))*SD_lamb(amb/ast2,amchar(j)/ast2) 
     .           +g2/(6.D0*pi**2*ast2)*gs22/(4.D0*pi)*
     .           SD_corrreali(amb,amchar(j),ast2,lamv,2,jsign,2,j,1)
         else
            qcdst2charb(j) = 0.D0
         endif
      end do

c -------------------------------------------------------------------- c
c  stop1 --> gluino + top

      if(ast1.gt.(mgluino+amt)) then
         st1glui = 8.D0*gs21*(ast1**2-amt**2-mgluino**2+4.D0*amt*
     .        mgluino*dsin(thet)*dcos(thet))*
     .        SD_lamb(amt/ast1,mgluino/ast1)/(16.D0*pi*ast1)/3.D0 
      else
         st1glui = 0.D0
      endif

c --- the QCD corrections ---

      if(scalechoice.eq.2.D0) then         
         amurefer = ast1
      endif

      if(ast1.gt.(mgluino+amt)) then
         amsq    = 2.D0*(asup1+asup2+asdown1+asdown2)/8.D0
         scalmur = amurefer
         alp     = gs21/(4.D0*pi)
         nf      = 6.D0
         qcdst1glui = 8.D0*pi*alp/3.D0/amt**2*st1glui*
     .        SD_gamtop1(ast1,ast2,amt,mgluino,thet,1,amuv,lamv) +
     .        16.D0*pi*alp**2*SD_lamb(amt/ast1,mgluino/ast1)/
     .        (9.D0*amt**2*ast1)*
     .        SD_gamtop2(ast1,ast2,amt,mgluino,thet,1,amuv) +
     .        4.D0*pi*alp/mgluino**2*st1glui*(nf-2.D0)*
     .        SD_gamglui1(ast1,ast2,amsq,amt,mgluino,amuv) +
     .        2.D0*pi*alp/mgluino**2*st1glui*
     .        SD_gamglui2(ast1,ast2,amt,thet,asb1,asb2,amb,theb,
     .                    mgluino,1,amuv) +
     .        4.D0*pi*alp*3.D0/mgluino**2*st1glui*
     .        SD_gamglui3(mgluino,amuv,lamv) +
     .        8.D0*4.D0/3.D0*pi*alp*st1glui*
     .        SD_gam11(ast1,ast2,amt,mgluino,thet,1,amuv,lamv) +
     .        8.D0*16.D0/9.D0*pi*alp**2/ast1*
     .        SD_lamb(amt/ast1,mgluino/ast1)*
     .        SD_gam12(ast1,ast2,amt,mgluino,thet,1,amuv,lamv,scalmur) +
     .        alp**2*SD_lamb(amt/ast1,mgluino/ast1)/ast1*
     .        SD_gamvirt(ast1,ast2,amt,mgluino,thet,1,amuv,lamv) +
     .        alp**2*SD_gamreal(ast1,amt,mgluino,thet,1,lamv) +
     .        alp/(4.D0*pi)*st1glui*
     .        SD_gamcfdec(ast1,ast2,amt,asb1,asb2,amb,mgluino,amsq,amuv,
     .        scalmur)
      else
         qcdst1glui = 0.D0
      endif

c -------------------------------------------------------------------- c
c  stop2 --> gluino + top
      
      if(ast2.gt.(mgluino+amt)) then
         st2glui = 8.D0*gs22*((ast2**2-amt**2-mgluino**2)-4.D0*amt*
     .        mgluino*dsin(thet)*dcos(thet))*
     .        SD_lamb(amt/ast2,mgluino/ast2)/(16.D0*pi*ast2)/3.D0  
      else
         st2glui = 0.D0
      endif

c --- the QCD corrections ---

      if(scalechoice.eq.2.D0) then         
         amurefer = ast2
      endif

      if(ast2.gt.(mgluino+amt)) then
         amsq    = 2.D0*(asup1+asup2+asdown1+asdown2)/8.D0
         scalmur = amurefer
         alp     = gs22/(4.D0*pi)
         nf      = 6.D0
         qcdst2glui = 8.D0*pi*alp/3.D0/amt**2*st2glui*
     .        SD_gamtop1(ast2,ast1,amt,mgluino,thet,2,amuv,lamv) +
     .        16.D0*pi*alp**2*SD_lamb(amt/ast2,mgluino/ast2)/
     .        (9.D0*amt**2*ast2)*
     .        SD_gamtop2(ast2,ast1,amt,mgluino,thet,2,amuv) +
     .        4.D0*pi*alp/mgluino**2*st2glui*(nf-2.D0)*
     .        SD_gamglui1(ast2,ast1,amsq,amt,mgluino,amuv) +
     .        2.D0*pi*alp/mgluino**2*st2glui*
     .        SD_gamglui2(ast2,ast1,amt,thet,asb2,asb1,amb,theb,
     .                    mgluino,2,amuv) +
     .        4.D0*pi*alp*3.D0/mgluino**2*st2glui*
     .        SD_gamglui3(mgluino,amuv,lamv) +
     .        8.D0*4.D0/3.D0*pi*alp*st2glui*
     .        SD_gam11(ast2,ast1,amt,mgluino,thet,2,amuv,lamv) +
     .        8.D0*16.D0/9.D0*pi*alp**2/ast2*
     .        SD_lamb(amt/ast2,mgluino/ast2)*
     .        SD_gam12(ast2,ast1,amt,mgluino,thet,2,amuv,lamv,scalmur) +
     .        alp**2*SD_lamb(amt/ast2,mgluino/ast2)/ast2*
     .        SD_gamvirt(ast2,ast1,amt,mgluino,thet,2,amuv,lamv) +
     .        alp**2*SD_gamreal(ast2,amt,mgluino,thet,2,lamv) +
     .        alp/(4.D0*pi)*st2glui*
     .        SD_gamcfdec(ast2,ast1,amt,asb2,asb1,amb,mgluino,amsq,amuv,
     .        scalmur)
      else
         qcdst2glui = 0.D0
      endif

c -------------------------------------------------------------------- c
c  stop1 --> H+ + sbottom1/2

      if(scalechoice.eq.1.D0) then
         scalb = ybewsb/dsqrt(g2)
         scalt = ytewsb/dsqrt(g2)
         runmt = rmtc
         runmb = rmbc
         amurefer = amuref
      elseif(scalechoice.eq.2.D0) then         
         call SD_runmass(ast1,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
         amurefer = ast1
      elseif(scalechoice.eq.3.D0) then
         call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
         amurefer = scaleofcoupling
      endif

      call SD_hcsbotstop(gctbr)

      do i=1,2,1
         if(ast1.gt.(gmsb(i)+amch)) then
            st1hcsb(i)=g2*amw**2*gctbr(1,i)**2*
     .           SD_lamb(gmsb(i)/ast1,amch/ast1)/(16.D0*pi*ast1)
         else
            st1hcsb(i)=0.D0
         endif
      end do

c --- the QCD corrections ---

      amuvdiv = amuv/amurefer

      do nj=1,2,1
      alp = gs21/(4.D0*pi)
      if(ast1.gt.(gmsb(nj)+amch)) then
         delta11c = -dsqrt(2.D0)*amw**2*gctbr(1,nj)*
     .        SD_gvirtgl(ast1,amch,gmsb(nj),lamv,amuv)
         delta12c =  -dsqrt(2.D0)*amw**2*gctbr(1,3-nj)*
     .        1.D0/(gmsb(3-nj)**2-gmsb(nj)**2)*
     .        SD_gvirtmix(asb1,asb2,gmsb(nj),mgluino,runmb,theb,amuv)
     .        -dsqrt(2.D0)*amw**2*gctbr(2,nj)*
     .        1.D0/(ast2**2-ast1**2)*
     .        SD_gvirtmix(ast1,ast2,ast1,mgluino,runmt,thet,amuv)
         delta13c = SD_stopsbot1719(amuv,1,nj)
         delta14c = SD_dcounterhc(ast1,runmt,thet,1,gmsb(nj),runmb,
     .                         theb,nj,mgluino,amuv,amuvdiv,lamv,1,nj)
         delta15c = SD_realcorr(amch,ast1,gmsb(nj),lamv,4,0,1,nj,ast1)

         qcdst1hcsb(nj) = -g2*amw**2/(24.D0*dsqrt(2.D0)*pi*amw**2*
     .        ast1)*alp/pi*SD_lamb(gmsb(nj)/ast1,amch/ast1)*
     .        gctbr(1,nj)*(delta11c+delta12c+delta13c+delta14c+delta15c)
      else
         qcdst1hcsb(nj) = 0.D0
      endif
      end do

c -------------------------------------------------------------------- c
c stop2 -> Higgs + stop1 

      if(scalechoice.eq.1.D0) then
         scalb = ybewsb/dsqrt(g2)
         scalt = ytewsb/dsqrt(g2)
         runmt = rmtc
         runmb = rmbc
         amurefer = amuref
      elseif(scalechoice.eq.2.D0) then         
         call SD_runmass(ast2,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
         amurefer = ast2
      elseif(scalechoice.eq.3.D0) then
         call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
         amurefer = scaleofcoupling
      endif

c -------------------------------------------------------------------- c
c  stop2 --> h + stop1

      call SD_higgsst1st2(glttr,ghttr,gattr)

      if(ast2.gt.(ast1+aml)) then
         st2hl=g2*amz**4/amw**2*glttr(2,1)**2*
     .         SD_lamb(ast1/ast2,aml/ast2)/(16.D0*pi*ast2)
      else
         st2hl=0.D0
      endif

c --- the QCD corrections ---

      amuvdiv = amuv/amurefer

      if(ast2.gt.(ast1+aml)) then
         alp = gs22/(4.D0*pi)
         delta1l = -dsqrt(2.D0)*amz**2*glttr(2,1)*
     .        SD_gvirtgl(ast2,aml,ast1,lamv,amuv)
         delta2l =  -dsqrt(2.D0)*amz**2*glttr(2,2)*
     .        1.D0/(ast2**2-ast1**2)*
     .        SD_gvirtmix(ast1,ast2,ast1,mgluino,runmt,thet,amuv)
     .        -dsqrt(2.D0)*amz**2*glttr(1,1)*
     .        1.D0/(ast1**2-ast2**2)*
     .        SD_gvirtmix(ast1,ast2,ast2,mgluino,runmt,thet,amuv)
         delta3l = SD_topneut1719(1,amuv)
         delta4l = SD_dcounterneut(ast1,ast2,runmt,thet,mgluino,amuv,
     .                          amuvdiv,lamv,1,1)
         delta5l = SD_realcorr(aml,ast2,ast1,lamv,1,1,2,1,ast2)

         qcdst2hl = -g2*amz**2/(24.D0*dsqrt(2.D0)*pi*amw**2*ast2)*
     .        alp/pi*SD_lamb(ast1/ast2,aml/ast2)*glttr(2,1)*
     .        (delta1l+delta2l+delta3l+delta4l+delta5l)
      else
         qcdst2hl = 0.D0
      endif

c -------------------------------------------------------------------- c
c  stop2 --> H + stop1

      if(ast2.gt.(ast1+amh)) then
         st2hh=g2*amz**4/amw**2*ghttr(2,1)**2*
     .         SD_lamb(ast1/ast2,amh/ast2)/(16.D0*pi*ast2)
      else
         st2hh=0.D0
      endif

c --- the QCD corrections ---

      amuvdiv = amuv/amurefer

      if(ast2.gt.(ast1+amh)) then
         alp = gs22/(4.D0*pi)
         delta1h = -dsqrt(2.D0)*amz**2*ghttr(2,1)*
     .        SD_gvirtgl(ast2,amh,ast1,lamv,amuv)
         delta2h =  -dsqrt(2.D0)*amz**2*ghttr(2,2)*
     .        1.D0/(ast2**2-ast1**2)*
     .        SD_gvirtmix(ast1,ast2,ast1,mgluino,runmt,thet,amuv)
     .        -dsqrt(2.D0)*amz**2*ghttr(1,1)*
     .        1.D0/(ast1**2-ast2**2)*
     .        SD_gvirtmix(ast1,ast2,ast2,mgluino,runmt,thet,amuv)
         delta3h = SD_topneut1719(2,amuv)
         delta4h = SD_dcounterneut(ast1,ast2,runmt,thet,mgluino,amuv,
     .                          amuvdiv,lamv,1,2)
         delta5h = SD_realcorr(amh,ast2,ast1,lamv,2,1,2,1,ast2)

         qcdst2hh = -g2*amz**2/(24.D0*dsqrt(2.D0)*pi*amw**2*ast2)*
     .        alp/pi*SD_lamb(ast1/ast2,amh/ast2)*ghttr(2,1)*
     .        (delta1h+delta2h+delta3h+delta4h+delta5h)
      else
         qcdst2hh = 0.D0
      endif

c -------------------------------------------------------------------- c
c  stop2 --> A + stop1

      if(ast2.gt.(ast1+ama)) then
         st2ha=g2*amz**4/amw**2*gattr**2*
     .         SD_lamb(ast1/ast2,ama/ast2)/(16.D0*pi*ast2)
      else
         st2ha=0.D0
      endif

c --- the QCD corrections ---

      amuvdiv = amuv/amurefer

      if(ast2.gt.(ast1+ama)) then
         alp = gs22/(4.D0*pi)
         delta1a = dsqrt(2.D0)*amz**2*gattr*
     .        SD_gvirtgl(ast2,ama,ast1,lamv,amuv)
         delta2a = 0.D0 
         delta3a = SD_topneut1719(3,amuv)
         delta4a = SD_dcounterneut(ast1,ast2,runmt,thet,mgluino,amuv,
     .                          amuvdiv,lamv,1,3)
         delta5a = SD_realcorr(ama,ast2,ast1,lamv,3,1,2,1,ast2)

         qcdst2ha = g2*amz**2/(24.D0*dsqrt(2.D0)*pi*amw**2*ast2)*
     .        alp/pi*SD_lamb(ast1/ast2,ama/ast2)*gattr*
     .        (delta1a+delta2a+delta3a+delta4a+delta5a)
      else
         qcdst2ha = 0.D0
      endif

c -------------------------------------------------------------------- c
c  stop2 --> H+ + sbottom1/2

      if(scalechoice.eq.1.D0) then
         scalb = ybewsb/dsqrt(g2)
         scalt = ytewsb/dsqrt(g2)
         runmt = rmtc
         runmb = rmbc
         amurefer = amuref
      elseif(scalechoice.eq.2.D0) then         
         call SD_runmass(ast2,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
         amurefer = ast2
      elseif(scalechoice.eq.3.D0) then
         call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
         amurefer = scaleofcoupling
      endif

      call SD_hcsbotstop(gctbr)

      do i=1,2,1
         if(ast2.gt.(gmsb(i)+amch)) then
            st2hcsb(i)=g2*amw**2*gctbr(2,i)**2*
     .           SD_lamb(gmsb(i)/ast2,amch/ast2)/(16.D0*pi*ast2)
         else
            st2hcsb(i)=0.D0
         endif
      end do

c --- the QCD corrections ---

      amuvdiv = amuv/amurefer

      do nj=1,2,1
      if(ast2.gt.(gmsb(nj)+amch)) then
         alp = gs22/(4.D0*pi)
         delta21c = -dsqrt(2.D0)*amw**2*gctbr(2,nj)*
     .        SD_gvirtgl(ast2,amch,gmsb(nj),lamv,amuv)
         delta22c =  -dsqrt(2.D0)*amw**2*gctbr(2,3-nj)*
     .        1.D0/(gmsb(3-nj)**2-gmsb(nj)**2)*
     .        SD_gvirtmix(asb1,asb2,gmsb(nj),mgluino,runmb,theb,amuv)
     .        -dsqrt(2.D0)*amw**2*gctbr(1,nj)*
     .        1.D0/(ast1**2-ast2**2)*
     .        SD_gvirtmix(ast1,ast2,ast2,mgluino,runmt,thet,amuv)
         delta23c = SD_stopsbot1719(amuv,2,nj)
         delta24c = SD_dcounterhc(ast2,runmt,thet,2,gmsb(nj),runmb,
     .                         theb,nj,mgluino,amuv,amuvdiv,lamv,2,nj)
         delta25c = SD_realcorr(amch,ast2,gmsb(nj),lamv,4,0,2,nj,ast2)

         qcdst2hcsb(nj) = -g2*amw**2/(24.D0*dsqrt(2.D0)*pi*amw**2*
     .        ast2)*alp/pi*SD_lamb(gmsb(nj)/ast2,amch/ast2)*
     .        gctbr(2,nj)*(delta21c+delta22c+delta23c+delta24c+delta25c)

      else
         qcdst2hcsb(nj) = 0.D0
      endif
      end do

c -------------------------------------------------------------------- c
c  stop2 --> Z + stop1

      if(ast2.gt.(ast1+amzp)) then
         st2ztop=g2/64.D0/pi/cw**2/amzp**2*ast2**3*gztt(2,1)**2*
     .           SD_lamb(ast1/ast2,amzp/ast2)**3
      else
         st2ztop=0.D0
      endif

c --- the QCD corrections ---
      
      if(ast2.gt.(ast1+amzp)) then
         alp = gs22/(4.D0*pi)
         del1 = -alp/3.D0/pi*gztt(2,1)/2.D0/cw*
     .        SD_gluonvertex(ast2,ast1,amzp,lamv,amuv)
         del2 = -alp/3.D0/pi/cw*SD_gluinoZvertex(ast2,ast1,amzp,lamv,
     .        amuv,mgluino,amt,1.D0/2.D0,2.D0/3.D0,sw,thet)
         del3 = alp/pi*SD_wavefuncvertex(ast2,ast1,amt,amt,
     .     thet,thet,1.D0,1.D0,2,1,mgluino,lamv,amuv)
         del4 = alp/pi*SD_quarkmixZ(ast2,thet,1.D0/2.D0,2.D0/3.D0,ast1,
     .     ast2,amt,mgluino,amuv)
         del5 = SD_realgluonem(ast2,ast1,amzp,lamv)
         qcdst2ztop =  g2/16.D0/pi/amzp**2*ast2**3*(gztt(2,1)/2.D0/cw)*
     .        SD_lamb(ast1/ast2,amzp/ast2)**3*(2.D0*del1+2.D0*del2
     .        +2.D0*del3+2.D0*del4) + 
     .        g2/3.D0/pi**2/ast2*alp*(gztt(2,1)/(2.D0*cw))**2*del5
      else
         qcdst2ztop = 0.D0
      endif

c -------------------------------------------------------------------- c
c  stop1 --> W+ + sbottom1/2

      do i=1,2,1
         if(ast1.gt.(gmsb(i)+amwp)) then
            st1wsb(i)=g2/32.D0/pi/amwp**2*ast1**3*gwtb(1,i)**2*
     .                SD_lamb(gmsb(i)/ast1,amwp/ast1)**3
         else
            st1wsb(i)=0.D0
         endif
      end do

c -- the QCD corrections --

      do i=1,2,1
         if(ast1.gt.(gmsb(i)+amwp)) then
            alp = gs21/(4.D0*pi)
            del1 = -alp/3.D0/pi*gwtb(1,i)/dsqrt(2.D0)*
     .           SD_gluonvertex(ast1,gmsb(i),amwp,lamv,amuv)
            del2 = -dsqrt(2.D0)/3.D0*alp/pi*
     .           SD_gluinoWvertex(ast1,gmsb(i),amwp,lamv,amuv,mgluino,
     .           amt,amb,thet,theb,1,i)
            del3 = alp/pi*SD_wavefuncvertex(ast1,gmsb(i),amt,amb,
     .           thet,theb,2.D0,1.D0,1,i,mgluino,lamv,amuv)
            del4 = alp/pi*SD_quarkmixW(ast1,thet,1.D0/2.D0,2.D0/3.D0,
     .             ast1,ast2,amt,gmsb(i),theb,-1.D0/2.D0,-1.D0/3.D0,
     .             asb1,asb2,amb,1,i,mgluino,amuv)
            del5 = SD_realgluonem(ast1,gmsb(i),amwp,lamv)
            qcdst1wsb(i) = g2/16.D0/pi/amwp**2*ast1**3*
     .           (gwtb(1,i)/dsqrt(2.D0))*
     .           SD_lamb(gmsb(i)/ast1,amwp/ast1)**3*(2.D0*del1+2.D0*del2
     .           +2.D0*del3+2.D0*del4) + 
     .           g2/3.D0/pi**2/ast1*alp*(gwtb(1,i)/dsqrt(2.D0))**2*del5
         else
            qcdst1wsb(i) = 0.D0
         endif
      end do

c -------------------------------------------------------------------- c
c  stop2 --> W+ + sbottom1/2

      do i=1,2,1
         if(ast2.gt.(gmsb(i)+amwp)) then
            st2wsb(i)=g2/32.D0/pi/amwp**2*ast2**3*gwtb(2,i)**2*
     .                SD_lamb(gmsb(i)/ast2,amwp/ast2)**3
         else
            st2wsb(i)=0.D0
         endif
      end do

c -- the QCD corrections --

      do i=1,2,1
         if(ast2.gt.(gmsb(i)+amwp)) then
            alp = gs22/(4.D0*pi)
            del1 = -alp/3.D0/pi*gwtb(2,i)/dsqrt(2.D0)*
     .           SD_gluonvertex(ast2,gmsb(i),amwp,lamv,amuv)
            del2 = -dsqrt(2.D0)/3.D0*alp/pi*
     .           SD_gluinoWvertex(ast2,gmsb(i),amwp,lamv,amuv,mgluino,
     .           amt,amb,thet,theb,2,i)
            del3 = alp/pi*SD_wavefuncvertex(ast2,gmsb(i),amt,amb,
     .           thet,theb,2.D0,1.D0,2,i,mgluino,lamv,amuv)
            del4 = alp/pi*SD_quarkmixW(ast2,thet,1.D0/2.D0,2.D0/3.D0,
     .             ast1,ast2,amt,gmsb(i),theb,-1.D0/2.D0,-1.D0/3.D0,
     .             asb1,asb2,amb,2,i,mgluino,amuv)
            del5 = SD_realgluonem(ast2,gmsb(i),amwp,lamv)
            qcdst2wsb(i) = g2/16.D0/pi/amwp**2*ast2**3*
     .           (gwtb(2,i)/dsqrt(2.D0))*
     .           SD_lamb(gmsb(i)/ast2,amwp/ast2)**3*(2.D0*del1+2.D0*del2
     .           +2.D0*del3+2.D0*del4) + 
     .           g2/3.D0/pi**2/ast2*alp*(gwtb(2,i)/dsqrt(2.D0))**2*del5
         else
            qcdst2wsb(i) = 0.D0
         endif
      end do

      return 

      end

c ==================================================================== c
c  The decay stop1 -> charm photino
c  K.Hikasa and M.Kobayashi, Phys.Rev.D36 (1987) 724
c ==================================================================== c

      subroutine SD_hikasakob1(gamma,gammaup,gammagluino)

      implicit double precision (a-h,m,o-z)

      dimension amneut(4),xmneut(4),amchar(2)
      dimension u(2,2),v(2,2),z(4,4),zp(4,4)

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_mixang/alp_mssm,tanbeta
      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_gluino/mgluino
      COMMON/SD_hmass/ama,aml,amh,amch,amar
      COMMON/SD_fermion/amt,amb,amtau
      COMMON/SD_mixmat/u,v,z,zp
      COMMON/SD_weinberg/sw,cw
      COMMON/SD_sfmixang/thet,theb,thel,cum,sum,cdm,sdm,cem,sem
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2
      COMMON/SD_hikasakob/sdmuq,sdmhd2
      COMMON/SD_break/sdatop,sdabot,sdatau,sdmu
      COMMON/SD_break1/sdaup,sdadown,sdael
      COMMON/SD_hikasakob02/sdmsq,sdmbr,sdmdr
      COMMON/SD_runcoupscale/scalechoice,scaleofcoupling,inumloop
      COMMON/SD_yukawa/ytewsb,ybewsb,ytauewsb
      COMMON/SD_runmcalc/rmtc,rmbc,rmtauc
      COMMON/SD_coupewsb/alsew,g2ew,g1ew
      COMMON/SD_mwmzpole/amwp,amzp

      external SD_yuk,SD_alphascall

c -- the running couplings --

      if(scalechoice.eq.1.D0) then
         scalb = ybewsb/dsqrt(g2)
         scalt = ytewsb/dsqrt(g2)
         gs2 = alsew*4.D0*pi
      elseif(scalechoice.eq.2.D0) then
         call SD_runmass(ast1,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
         gs2 = SD_alphascall(ast1,inumloop)*4.D0*pi
      elseif(scalechoice.eq.3.D0) then
         call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
         gs2 = SD_alphascall(scaleofcoupling,inumloop)*4.D0*pi
      endif

c ----------------------------

      beta=datan(tanbeta)

      amh12=sdmhd2
      
      ct = dcos(thet)
      st = dsin(thet)

      amsc1=dsqrt(sdmuq**2+
     .      (0.5D0-2.D0/3.D0*sw**2)*amz**2*dcos(2.D0*beta))

      xktb = 0.99915D0
      xkcb = 0.041D0
      xkub = 0.0036D0
      amx  = 2.D16

      dl=-g2/16.D0/pi**2*log((amx/amwp)**2)*xktb*xkcb*scalb**2*
     .    (sdmuq**2+sdmbr**2+sdabot**2+amh12)

      dr=g2/16.D0/pi**2*log((amx/amwp)**2)*xktb*xkcb*scalb**2*amt*sdabot

      eps=-(dl*ct+dr*st)/(amsc1**2-ast1**2)

      f11c=-(2.D0/3.D0)*dsqrt(2.D0)*sw*zp(1,1)-dsqrt(2.D0)*(0.5D0-
     .     2.D0/3.D0*sw**2)*(zp(1,2)/cw)

c -- the decay stop1 -> neutralino1 charm --
      if(ast1.gt.amneut(1)) then
         gamma=g2/16.D0/pi*eps**2*f11c**2*ast1*
     .        (1.D0-amneut(1)**2/ast1**2)**2
      else
         gamma=0.D0
      endif

c -- the decay stop1 -> neutralino1 up --
      if(ast1.gt.amneut(1)) then
         gammaup=gamma*(xkub/xkcb)**2
      else
         gammaup=0.D0
      endif

c -- the decay stop1 -> gluino charm
      if(ast1.gt.mgluino) then
         gammagluino = 2.D0/3.D0*gs2/4.D0/pi*eps**2*ast1*
     .        (1.D0-mgluino**2/ast1**2)**2
      else
         gammagluino=0.D0
      endif

      end

c ==================================================================== c
c  The decay stop2 -> charm photino
c  adapted from K.Hikasa and M.Kobayashi, Phys.Rev.D36 (1987) 724
c ==================================================================== c

      subroutine SD_hikasakob2(gamma2)

      implicit double precision (a-h,m,o-z)
      dimension amneut(4),xmneut(4),amchar(2)
      dimension u(2,2),v(2,2),z(4,4),zp(4,4)

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_mixang/alp_mssm,tanbeta
      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_hmass/ama,aml,amh,amch,amar
      COMMON/SD_fermion/amt,amb,amtau
      COMMON/SD_mixmat/u,v,z,zp
      COMMON/SD_weinberg/sw,cw
      COMMON/SD_sfmixang/thet,theb,thel,cum,sum,cdm,sdm,cem,sem
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2
      COMMON/SD_hikasakob/sdmuq,sdmhd2
      COMMON/SD_break/sdatop,sdabot,sdatau,sdmu
      COMMON/SD_break1/sdaup,sdadown,sdael
      COMMON/SD_hikasakob02/sdmsq,sdmbr,sdmdr
      COMMON/SD_runcoupscale/scalechoice,scaleofcoupling,inumloop
      COMMON/SD_yukawa/ytewsb,ybewsb,ytauewsb
      COMMON/SD_mwmzpole/amwp,amzp

c -- the running couplings --

      if(scalechoice.eq.1.D0) then
         scalb = ybewsb/dsqrt(g2)
         scalt = ytewsb/dsqrt(g2)
      elseif(scalechoice.eq.2.D0) then
         call SD_runmass(ast2,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      elseif(scalechoice.eq.3.D0) then
         call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      endif

c ----------------------------

      beta=datan(tanbeta)

      amh12=sdmhd2
      
      ct=dcos(thet)
      st=dsin(thet)

      amsc1=dsqrt(sdmuq**2+(0.5d0-2.d0/3.d0*sw**2)*amz**2*
     .     dcos(2.d0*beta))
      
      xktb = 0.99915D0
      xkcb = 0.041D0
      amx  = 2.D16

      dl=-g2/16.d0/pi**2*log((amx/amwp)**2)*xktb*xkcb*scalb**2*
     .   (sdmuq**2+sdmbr**2+sdabot**2+amh12)
      
      dr=g2/16.D0/pi**2*log((amx/amwp)**2)*xktb*xkcb*scalb**2*amt*sdabot
      
      eps=-(-dl*st+dr*ct)/(amsc1**2-ast2**2)

      f11c=-(2.d0/3.d0)*dsqrt(2.d0)*sw*zp(1,1)-dsqrt(2.d0)*(0.5d0-
     .     2.d0/3.d0*sw**2)*(zp(1,2)/cw)

c -- the decay stop2 -> neutralino1 charm --            
      if(ast2.gt.amneut(1)) then
         gamma2=g2/16.d0/pi*eps**2*f11c**2*ast2*(1-amneut(1)**2
     .        /ast2**2)**2
      else
         gamma2=0.D0
      endif
      
      end

c ==================================================================== c
c                       The stop 3-body decays                         c
c ==================================================================== c

      subroutine SD_xintegstop(xintegstopw,xintegstoph,xintegststau,
     .     xintegstsntau,xintegstsel,xintegstsnel,xintegstbsbst,
     .     xintegstbbsbt,xintegsttausbnu,xintegstelsbnu,
     .     xintegstupsbdow,xintegst2st1tt,xintegst2st1bb,
     .     xintegst2st1uu,xintegst2st1dd,xintegst2st1ee,
     .     xintegst2st1nunu,xintegst2st1tautau,xintegst2st1startt)     

      implicit double precision (a-h,m,o-z)  
      integer nx1t,ny1t

      dimension xintegstopw(2,4),xintegstoph(2,4),xintegststau(2,2),
     .     xintegstsntau(2,2),xintegstsel(2,2),xintegstsnel(2),
     .     xintegstbsbst(2,2),xintegstbbsbt(2,2),
     .     xintegsttausbnu(2,2),xintegstelsbnu(2,2),
     .     xintegstupsbdow(2,2)
      dimension amneut(4),xmneut(4),amchar(2)
      dimension gmst(2),gmsb(2),gmsel(2),gmsne(2),gmstau(2),gmsnt(2)

      external SD_ay,SD_by,SD_ax,SD_bx
      external SD_stbchiw,SD_stbchihc,SD_stbnustau,SD_stbsnutau,
     .         SD_stbnusel,SD_stbsnuel,SD_stbsbstart,SD_stbbsbt,
     .         SD_sttausbnu,SD_stelsbnu,SD_st2st1tt,SD_st2st1bb,
     .         SD_st2st1uu,SD_st2st1dd,SD_st2st1ee,
     .         SD_st2st1nunu,SD_st2st1tautau,SD_st2st1startt

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_hmass/ama,aml,amh,amch,amar
      COMMON/SD_fermion/amt,amb,amtau
      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2
      COMMON/SD_sfermionetau/ase1,ase2,astau1,astau2
      COMMON/SD_sneutrino/asne1,asne2,asntau1,asntau2
      COMMON/SD_nx1/nx1t,ny1t
      COMMON/SD_indices/ni,nj
      COMMON/SD_mwmzpole/amwp,amzp

      gmst(1) = ast1
      gmst(2) = ast2
      gmsb(1) = asb1
      gmsb(2) = asb2

      gmstau(1) = astau1
      gmstau(2) = astau2
      gmsel(1)  = ase1
      gmsel(2)  = ase2
      gmsne(1)  = asne1
      gmsne(2)  = asne2
      gmsnt(1)  = asntau1
      gmsnt(2)  = asntau2

c -------------------------- stop1, stop2 decays --------------------- c

c -------------------------------------------------------------------- c
c -------------------------- neutralino_j b W+ ----------------------- c
c -------------------------------------------------------------------- c

      do ni=1,2,1
         do nj=1,4,1
            xmu1=amb**2/gmst(ni)**2
            xmu2=amneut(nj)**2/gmst(ni)**2
            xmu3=amwp**2/gmst(ni)**2

            if(gmst(ni).gt.(amneut(nj)+amwp+amb)) then
               call SD_integ2(SD_stbchiw,SD_ax,SD_bx,SD_ay,SD_by,xmu1,
     .                     xmu2,xmu3,nx1t,ny1t,sum)
               xintegstopw(ni,nj)=g2**2/32.D0/(2.D0*pi)**3*gmst(ni)*
     .                            sum
            else
               xintegstopw(ni,nj)=0.D0
            endif
         end do
      end do

c -------------------------------------------------------------------- c
c -------------------------- neutralino_j b H+ ----------------------- c
c -------------------------------------------------------------------- c

      do ni=1,2,1
         do nj=1,4,1
            xmu1=amb**2/gmst(ni)**2
            xmu2=amneut(nj)**2/gmst(ni)**2
            xmu3=amch**2/gmst(ni)**2

            if(gmst(ni).gt.(amneut(nj)+amch+amb)) then
               call SD_integ2(SD_stbchihc,SD_ax,SD_bx,SD_ay,SD_by,xmu1,
     .                     xmu2,xmu3,nx1t,ny1t,sum)
               xintegstoph(ni,nj)=g2**2/32.D0/(2.D0*pi)**3*gmst(ni)*
     .                            sum
            else
               xintegstoph(ni,nj)=0.D0
            endif
         end do
      end do

c -------------------------------------------------------------------- c
c ------------------------- b stau neutrino_tau ---------------------- c
c -------------------------------------------------------------------- c

      do ni=1,2,1
         do nj=1,2,1
            xmu1=amb**2/gmst(ni)**2
            xmu2=0.D0
            xmu3=gmstau(nj)**2/gmst(ni)**2

            if(gmst(ni).gt.(amb+gmstau(nj))) then
               call SD_integ2(SD_stbnustau,SD_ax,SD_bx,SD_ay,SD_by,xmu1,
     .                     xmu2,xmu3,nx1t,ny1t,sum)
               xintegststau(ni,nj)=g2**2/32.D0/(2.D0*pi)**3*gmst(ni)*
     .              sum
            else
               xintegststau(ni,nj)=0.D0
            endif
         end do
      end do

c -------------------------------------------------------------------- c
c ------------------------- b sneutrino_tau tau ---------------------- c
c -------------------------------------------------------------------- c

      do ni=1,2,1
         do nj=1,2,1
            xmu1=amb**2/gmst(ni)**2
            xmu2=amtau**2/gmst(ni)**2
            xmu3=gmsnt(nj)**2/gmst(ni)**2

            if(gmst(ni).gt.(gmsnt(nj)+amb+amtau)) then
               call SD_integ2(SD_stbsnutau,SD_ax,SD_bx,SD_ay,SD_by,xmu1,
     .                     xmu2,xmu3,nx1t,ny1t,sum)
               xintegstsntau(ni,nj)=g2**2/32.D0/(2.D0*pi)**3*
     .              gmst(ni)*sum
            else
               xintegstsntau(ni,nj)=0.D0
            endif
         end do
      end do

c -------------------------------------------------------------------- c
c ----------------------- b selectron neutrino_e --------------------- c
c -------------------------------------------------------------------- c

      do ni=1,2,1
         do nj=1,2,1
            xmu1=amb**2/gmst(ni)**2
            xmu2=0.D0
            xmu3=gmsel(nj)**2/gmst(ni)**2

            if(gmst(ni).gt.(gmsel(nj)+amb)) then
               call SD_integ2(SD_stbnusel,SD_ax,SD_bx,SD_ay,SD_by,xmu1,
     .                     xmu2,xmu3,nx1t,ny1t,sum)
               xintegstsel(ni,nj)=g2**2/32.D0/(2.D0*pi)**3*gmst(ni)*
     .              sum
            else
               xintegstsel(ni,nj)=0.D0
            endif
         end do
      end do

c -------------------------------------------------------------------- c
c ----------------------- b sneutrino_e electron --------------------- c
c -------------------------------------------------------------------- c

      do ni=1,2,1
         xmu1=amb**2/gmst(ni)**2
         xmu2=0.D0
         xmu3=gmsne(1)**2/gmst(ni)**2

         if(gmst(ni).gt.(gmsne(1)+amb)) then
            call SD_integ2(SD_stbsnuel,SD_ax,SD_bx,SD_ay,SD_by,xmu1,
     .                  xmu2,xmu3,nx1t,ny1t,sum)
            xintegstsnel(ni)=g2**2/32.D0/(2.D0*pi)**3*gmst(ni)*sum
         else
            xintegstsnel(ni)=0.D0
         endif
      end do

c -------------------------------------------------------------------- c
c ------------------------- sbottom_1/2* b top ----------------------- c
c -------------------------------------------------------------------- c

      do ni=1,2,1
         do nj=1,2,1
            xmu1=amb**2/gmst(ni)**2
            xmu2=amt**2/gmst(ni)**2
            xmu3=gmsb(nj)**2/gmst(ni)**2

            if(gmst(ni).gt.(amt+amb+gmsb(nj))) then
               call SD_integ2(SD_stbsbstart,SD_ax,SD_bx,SD_ay,SD_by,
     .                     xmu1,xmu2,xmu3,nx1t,ny1t,sum)
               xintegstbsbst(ni,nj)=1.D0/32.D0/(2.D0*pi)**3*gmst(ni)*sum
            else
               xintegstbsbst(ni,nj)=0.D0
            endif
         end do
      end do

c -------------------------------------------------------------------- c
c ------------------------ sbottom_1/2 bbar top ---------------------- c
c -------------------------------------------------------------------- c

      do ni=1,2,1
         do nj=1,2,1
            xmu1=amb**2/gmst(ni)**2
            xmu2=amt**2/gmst(ni)**2
            xmu3=gmsb(nj)**2/gmst(ni)**2

            if(gmst(ni).gt.(amt+amb+gmsb(nj))) then
               call SD_integ2(SD_stbbsbt,SD_ax,SD_bx,SD_ay,SD_by,xmu1,
     .                     xmu2,xmu3,nx1t,ny1t,sum)
               xintegstbbsbt(ni,nj)=1.D0/32.D0/(2.D0*pi)**3*gmst(ni)*
     .              sum
            else
               xintegstbbsbt(ni,nj)=0.D0
            endif
         end do
      end do

c -------------------------------------------------------------------- c
c ---------------------- sbottom_1/2 tau+ nu_tau --------------------- c
c -------------------------------------------------------------------- c

      do ni=1,2,1
         do nj=1,2,1
            xmu1=0.D0
            xmu2=amtau**2/gmst(ni)**2
            xmu3=gmsb(nj)**2/gmst(ni)**2

            if(gmst(ni).gt.(amtau+gmsb(nj))) then
               call SD_integ2(SD_sttausbnu,SD_ax,SD_bx,SD_ay,SD_by,
     .                     xmu1,xmu2,xmu3,nx1t,ny1t,sum)
               xintegsttausbnu(ni,nj)=g2**2/32.D0/(2.D0*pi)**3*
     .              gmst(ni)*sum
            else
               xintegsttausbnu(ni,nj)=0.D0
            endif
         end do
      end do

c -------------------------------------------------------------------- c
c --------------------- sbottom_1/2 electron+ nu_e ------------------- c
c -------------------------------------------------------------------- c

      do ni=1,2,1
         do nj=1,2,1
            xmu1=0.D0
            xmu2=0.D0
            xmu3=gmsb(nj)**2/gmst(ni)**2
            
            if(gmst(ni).gt.gmsb(nj)) then
               call SD_integ2(SD_stelsbnu,SD_ax,SD_bx,SD_ay,SD_by,
     .                     xmu1,xmu2,xmu3,nx1t,ny1t,sum)
               xintegstelsbnu(ni,nj)=g2**2/32.D0/(2.D0*pi)**3*
     .              gmst(ni)*sum
            else
               xintegstelsbnu(ni,nj)=0.D0
            endif
         end do
      end do

c -------------------------------------------------------------------- c
c ----------------------- sbottom_1/2 up downbar --------------------- c
c -------------------------------------------------------------------- c

      do ni=1,2,1
         do nj=1,2,1
            if(gmst(ni).gt.gmsb(nj)) then
               xintegstupsbdow(ni,nj)=3.D0*xintegstelsbnu(ni,nj)
            else
               xintegstupsbdow(ni,nj)=0.D0
            endif
         end do
      end do

c ----------------------------- stop2 decays ------------------------- c

c -------------------------------------------------------------------- c
c ---------------------------- stop1* t t ---------------------------- c
c -------------------------------------------------------------------- c

      xmu1=amt**2/gmst(2)**2
      xmu2=amt**2/gmst(2)**2
      xmu3=gmst(1)**2/gmst(2)**2

      if(gmst(2).gt.(gmst(1)+2.D0*amt)) then
         call SD_integ2(SD_st2st1startt,SD_ax,SD_bx,SD_ay,SD_by,xmu1,
     .               xmu2,xmu3,nx1t,ny1t,sum)
         xintegst2st1startt=1.D0/32.D0/(2.D0*pi)**3*gmst(2)*sum
      else 
         xintegst2st1startt=0.D0
      endif

c -------------------------------------------------------------------- c
c ---------------------------- stop1 t tbar -------------------------- c
c -------------------------------------------------------------------- c

      xmu1=amt**2/gmst(2)**2
      xmu2=amt**2/gmst(2)**2
      xmu3=gmst(1)**2/gmst(2)**2

      if(gmst(2).gt.(gmst(1)+2.D0*amt)) then
         call SD_integ2(SD_st2st1tt,SD_ax,SD_bx,SD_ay,SD_by,xmu1,
     .               xmu2,xmu3,nx1t,ny1t,sum)
         xintegst2st1tt=1.D0/32.D0/(2.D0*pi)**3*gmst(2)*sum
      else 
         xintegst2st1tt=0.D0
      endif

c -------------------------------------------------------------------- c
c ---------------------------- stop1 b bbar -------------------------- c
c -------------------------------------------------------------------- c

      xmu1=amb**2/gmst(2)**2
      xmu2=amb**2/gmst(2)**2
      xmu3=gmst(1)**2/gmst(2)**2

      if((gmst(1)+2.D0*amb).lt.gmst(2)) then
         call SD_integ2(SD_st2st1bb,SD_ax,SD_bx,SD_ay,SD_by,xmu1,
     .               xmu2,xmu3,nx1t,ny1t,sum)
         xintegst2st1bb=g2**2/32.D0/(2.D0*pi)**3*gmst(2)*sum*3.D0
      else 
         xintegst2st1bb=0.D0
      endif

c -------------------------------------------------------------------- c
c --------------------------- stop1 up upbar ------------------------- c
c -------------------------------------------------------------------- c

      xmu1=0.D0
      xmu2=0.D0
      xmu3=gmst(1)**2/gmst(2)**2

      if(gmst(2).gt.gmst(1)) then
         call SD_integ2(SD_st2st1uu,SD_ax,SD_bx,SD_ay,SD_by,xmu1,
     .               xmu2,xmu3,nx1t,ny1t,sum)
         xintegst2st1uu=g2**2/32.D0/(2.D0*pi)**3*gmst(2)*sum*3.D0
      else 
         xintegst2st1uu=0.D0
      endif

c -------------------------------------------------------------------- c
c ------------------------- stop1 down downbar ----------------------- c
c -------------------------------------------------------------------- c

      xmu1=0.D0
      xmu2=0.D0
      xmu3=gmst(1)**2/gmst(2)**2

      if(gmst(2).gt.gmst(1)) then
         call SD_integ2(SD_st2st1dd,SD_ax,SD_bx,SD_ay,SD_by,xmu1,
     .               xmu2,xmu3,nx1t,ny1t,sum)
         xintegst2st1dd=g2**2/32.D0/(2.D0*pi)**3*gmst(2)*sum*3.D0
      else 
         xintegst2st1dd=0.D0
      endif

c -------------------------------------------------------------------- c
c ----------------------------- stop1 e+ e- -------------------------- c
c -------------------------------------------------------------------- c

      xmu1=0.D0
      xmu2=0.D0
      xmu3=gmst(1)**2/gmst(2)**2

      if(gmst(2).gt.gmst(1)) then
         call SD_integ2(SD_st2st1ee,SD_ax,SD_bx,SD_ay,SD_by,xmu1,
     .               xmu2,xmu3,nx1t,ny1t,sum)
         xintegst2st1ee=g2**2/32.D0/(2.D0*pi)**3*gmst(2)*sum*1.D0
      else 
         xintegst2st1ee=0.D0
      endif

c -------------------------------------------------------------------- c
c ---------------------------- stop1 nu nubar ------------------------ c
c -------------------------------------------------------------------- c

      xmu1=0.D0
      xmu2=0.D0
      xmu3=gmst(1)**2/gmst(2)**2

      if(gmst(2).gt.gmst(1)) then
         call SD_integ2(SD_st2st1nunu,SD_ax,SD_bx,SD_ay,SD_by,xmu1,
     .               xmu2,xmu3,nx1t,ny1t,sum)
         xintegst2st1nunu=g2**2/32.D0/(2.D0*pi)**3*gmst(2)*sum*1.D0
      else 
         xintegst2st1nunu=0.D0
      endif

c -------------------------------------------------------------------- c
c --------------------------- stop1 tau+ tau- ------------------------ c
c -------------------------------------------------------------------- c

      xmu1=amtau**2/gmst(2)**2
      xmu2=amtau**2/gmst(2)**2
      xmu3=gmst(1)**2/gmst(2)**2

      if(gmst(2).gt.(gmst(1)+2.D0*amtau)) then
         call SD_integ2(SD_st2st1tautau,SD_ax,SD_bx,SD_ay,SD_by,xmu1,
     .               xmu2,xmu3,nx1t,ny1t,sum)
         xintegst2st1tautau=g2**2/32.D0/(2.D0*pi)**3*gmst(2)*sum*1.D0
      else 
         xintegst2st1tautau=0.D0
      endif

      end

c ==================================================================== c
c ========================== neutralino_j b W+ ======================= c
c ==================================================================== c

      double precision function SD_stbchiw(x1,x2)

      implicit double precision (a-h,m,o-z)

      dimension gmst(2),xmuchar(2),dsb(2),dchi(2)
      dimension amneut(4),amchar(2),xmneut(4)
      dimension gwtb(2,2),gwntau(2,2)
      dimension ql(4,2),qr(4,2),or(4,2),ol(4,2)
      dimension abot(2,4),bbot(2,4),atopr(2,4),btopr(2,4)
      dimension alstor(2,2),akstor(2,2)

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_fermion/amt,amb,amtau
      COMMON/SD_indices/ni,nj
      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2
      COMMON/SD_scala/scalb,scalt
      COMMON/SD_yukawa/ytewsb,ybewsb,ytauewsb
      COMMON/SD_coup3/ql,qr,ol,or
      COMMON/SD_coup20/gwtb,gwntau
      COMMON/SD_runcoupscale/scalechoice,scaleofcoupling,inumloop
      COMMON/SD_mwmzpole/amwp,amzp

      gmst(1)=ast1
      gmst(2)=ast2

c --- the running couplings ---

      if(scalechoice.eq.1.D0) then
         scalb = ybewsb/dsqrt(g2)
         scalt = ytewsb/dsqrt(g2)
      elseif(scalechoice.eq.2.D0) then         
         call SD_runmass(gmst(ni),0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      elseif(scalechoice.eq.3.D0) then
         call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      endif

      call SD_neutsbotbot(abot,bbot)
      call SD_neutstoptop(atopr,btopr)
      call SD_charstopbot(alstor,akstor)

c -----------------------------------------------

      vw=1.D0/dsqrt(2.D0)

      xmuw       = amwp**2/gmst(ni)**2
      xmut       = amt**2/gmst(ni)**2
      xmub       = amb**2/gmst(ni)**2
      xmuneut    = amneut(nj)**2/gmst(ni)**2
      xmusb1     = asb1**2/gmst(ni)**2
      xmusb2     = asb2**2/gmst(ni)**2
      xmuchar(1) = amchar(1)**2/gmst(ni)**2
      xmuchar(2) = amchar(2)**2/gmst(ni)**2

      x3=2.D0-x1-x2
      y1=(1.D0+xmuw-xmuneut-xmub-x3)/2.D0
      y2=(1.D0-xmuw+xmuneut-xmub-x2)/2.D0
      y3=(1.D0-xmuw-xmuneut+xmub-x1)/2.D0

      dt      = 1.D0-x2+xmuneut-xmut
      dsb(1)  = 1.D0-x3+xmuw-xmusb1
      dsb(2)  = 1.D0-x3+xmuw-xmusb2
      dchi(1) = 1.D0-x1+xmub-xmuchar(1)
      dchi(2) = 1.D0-x1+xmub-xmuchar(2)

c -------------------------------------------------------------------- c
c                           sbottom exchange
c -------------------------------------------------------------------- c
	
      stbchiwbb=0.D0

      do k=1,2
         do l=1,2
            stbchiwbb=stbchiwbb+gwtb(ni,k)*gwtb(ni,l)/dsb(k)/dsb(l)*
     .           1.D0/2.D0*8.D0*(
     .           (abot(k,nj)*abot(l,nj)+bbot(k,nj)*bbot(l,nj))*
     .           (-y1*(2.D0*y1+xmuneut+xmub)+y1/xmuw*(y2+y3)**2) +
     .           dsqrt(xmub)*xmneut(nj)/gmst(ni)*
     .           (abot(k,nj)*bbot(l,nj)+abot(l,nj)*bbot(k,nj))*
     .           (2.D0*y1+xmub+xmuneut-1.D0/xmuw*(y2+y3)**2) )
         enddo
      enddo

c -------------------------------------------------------------------- c
c                             top exchange
c -------------------------------------------------------------------- c

      stbchiwtt=vw**2/dt**2*( 
     .     dsqrt(xmut)*xmneut(nj)/gmst(ni)*atopr(ni,nj)*btopr(ni,nj)*
     .     (-4.D0)*(xmub+3.D0*y2+2.D0*y2**2/xmuw) +
     .     2.D0*btopr(ni,nj)**2*xmut*(y1+2.D0*y2*y3/xmuw) +
     .     2.D0*atopr(ni,nj)**2*(y1*(xmub-xmuw+4.D0*y2)+2.D0*y3*xmub+
     .     4.D0*y2*y3+1.D0/xmuw*(4.D0*y2**2*y1-2.D0*y2*y3*xmub)) )

c -------------------------------------------------------------------- c
c                           chargino exchange
c -------------------------------------------------------------------- c

      stbchiwchichi=0.D0

      do k=1,2
         do l=1,2
            stbchiwchichi=stbchiwchichi+2.D0/dchi(k)/dchi(l)*(
     .           (alstor(ni,k)*alstor(ni,l)*ol(nj,k)*ol(nj,l)+
     .            akstor(ni,k)*akstor(ni,l)*or(nj,k)*or(nj,l))*
     .           (4.D0*y3*(y1+y2+y1*y3/xmuw)+y1*(xmuneut-xmuw)
     .            +2.D0*xmuneut*y2*(1-y3/xmuw)) +
     .           dsqrt(xmuchar(k)*xmuchar(l))*
     .           (alstor(ni,k)*alstor(ni,l)*or(nj,k)*or(nj,l)+
     .            akstor(ni,k)*akstor(ni,l)*ol(nj,k)*ol(nj,l))*
     .           (y1+2.D0/xmuw*y2*y3) +
     .           (-3.D0)*(y1+y2)*xmneut(nj)/gmst(ni)*(
     .           (alstor(ni,k)*alstor(ni,l)*or(nj,k)*ol(nj,l)+
     .            akstor(ni,k)*akstor(ni,l)*ol(nj,k)*or(nj,l))*
     .           dsqrt(xmuchar(k)) +
     .           (alstor(ni,k)*alstor(ni,l)*or(nj,l)*ol(nj,k)+
     .            akstor(ni,k)*akstor(ni,l)*ol(nj,l)*or(nj,k))*
     .           dsqrt(xmuchar(l))) +
     .           (-1.D0)*(xmuneut+2.D0*y3**2/xmuw+3.D0*y3)*
     .           dsqrt(xmub)*(
     .           (alstor(ni,k)*akstor(ni,l)*or(nj,k)*or(nj,l)+
     .            akstor(ni,k)*alstor(ni,l)*ol(nj,k)*ol(nj,l))*
     .           dsqrt(xmuchar(k)) + 
     .           (alstor(ni,k)*akstor(ni,l)*ol(nj,l)*ol(nj,k)+
     .            akstor(ni,k)*alstor(ni,l)*or(nj,l)*or(nj,k))*
     .           dsqrt(xmuchar(l))) +
     .           3.D0*dsqrt(xmub)*xmneut(nj)/gmst(ni)*
     .           dsqrt(xmuchar(k))*dsqrt(xmuchar(l))*
     .           (alstor(ni,k)*akstor(ni,l)*ol(nj,l)*or(nj,k)+
     .            akstor(ni,k)*alstor(ni,l)*or(nj,l)*ol(nj,k)) +
     .           3.D0*dsqrt(xmub)*xmneut(nj)/gmst(ni)*
     .           (alstor(ni,k)*akstor(ni,l)*ol(nj,k)*or(nj,l)+
     .            akstor(ni,k)*alstor(ni,l)*or(nj,k)*ol(nj,l))*
     .           (xmuw+xmuneut+2.D0*y3) )
         enddo
      enddo

c -------------------------------------------------------------------- c
c                    chargino sbottom interference
c -------------------------------------------------------------------- c

      stbchiwchib=0.D0

      do k=1,2
         do i=1,2
            stbchiwchib=stbchiwchib+4.D0*gwtb(ni,i)/dsqrt(2.D0)/
     .           dsb(i)/dchi(k)*( 
     .           dsqrt(xmuchar(k))*xmneut(nj)/gmst(ni)*
     .           (alstor(ni,k)*abot(i,nj)*or(nj,k)+
     .            akstor(ni,k)*bbot(i,nj)*ol(nj,k))*
     .           (y1-y2/xmuw*(y2+y3)+xmub) +
     .           (alstor(ni,k)*abot(i,nj)*ol(nj,k)+
     .            akstor(ni,k)*bbot(i,nj)*or(nj,k))*
     .           ((y2+y3)*(xmuneut*y2-2.D0*y1*y3)/xmuw+y1*(2.D0*y1+y2
     .            -y3+xmuneut)+xmuneut*y2-xmub*(xmuneut+y3)) +
     .           dsqrt(xmub)*( xmneut(nj)/gmst(ni)*
     .           (abot(i,nj)*akstor(ni,k)*or(nj,k)
     .           +bbot(i,nj)*alstor(ni,k)*ol(nj,k)) +
     .           (abot(i,nj)*akstor(ni,k)*ol(nj,k)
     .           +bbot(i,nj)*alstor(ni,k)*or(nj,k))*dsqrt(xmuchar(k)))*
     .           (1.D0/xmuw*y3*(y2+y3)-xmuneut-y1) )
         end do
      end do

c -------------------------------------------------------------------- c
c                       top sbottom interference
c -------------------------------------------------------------------- c

      stbchiwbt=0.d0
        
      do i=1,2
         stbchiwbt=stbchiwbt+4.D0*vw*gwtb(ni,i)/dsqrt(2.D0)/dt/dsb(i)*(
     .        dsqrt(xmut)*xmneut(nj)/gmst(ni)*btopr(ni,nj)*abot(i,nj)*
     .        (y1+xmub-y2/xmuw*(y2+y3)) +
     .        atopr(ni,nj)*abot(i,nj)*(y1*y2*(1.D0+2.D0*(y2+y3)/xmuw)+
     .        xmuneut*y2-y1*y3-2.D0*y1**2-y1*xmub+xmub*(xmuneut-y3)+
     .        1.D0/xmuw*(-xmub*y2*y3-xmub*y3**2)) +
     .        dsqrt(xmub)*dsqrt(xmut)*btopr(ni,nj)*bbot(i,nj)*(-y1
     .        -xmuneut+1.D0/xmuw*y3*(y2+y3)) +
     .        dsqrt(xmub)*xmneut(nj)/gmst(ni)*atopr(ni,nj)*bbot(i,nj)*
     .        (y1+xmub-1.D0/xmuw*y2*(y2+y3)) )
      end do

c -------------------------------------------------------------------- c
c                      chargino top interference
c -------------------------------------------------------------------- c

      stbchiwchit=0.D0

      do i=1,2,1
         stbchiwchit=stbchiwchit+vw/dt/dchi(i)*( 
     .        dsqrt(xmuchar(i))*xmneut(nj)/gmst(ni)*
     .        atopr(ni,nj)*alstor(ni,i)*or(nj,i)*
     .        (-6.D0*y2-4.D0*y2**2/xmuw-2.D0*xmub) +
     .        atopr(ni,nj)*alstor(ni,i)*ol(nj,i)*2.D0*(
     .        y1*(2.D0*y3+2.D0*y2+4.D0*y1-xmuw)+y2*(4.D0*y3+xmuneut)
     .        -2.D0*y2*(2.D0*y1*y3-xmuneut*y2)/xmuw+
     .        2.D0*xmub/xmuw*y3**2-xmub*xmuneut+xmub*y3) +
     .        dsqrt(xmut)*xmneut(nj)/gmst(ni)*
     .        btopr(ni,nj)*alstor(ni,i)*ol(nj,i)*
     .        (-6.D0)*(y1+y2) +
     .        dsqrt(xmut*xmuchar(i))*alstor(ni,i)*btopr(ni,nj)*or(nj,i)
     .        *(2.D0*y1+4.D0/xmuw*y2*y3) +
     .        dsqrt(xmub*xmut)*btopr(ni,nj)*akstor(ni,i)*or(nj,i)*
     .        (-6.D0*y3-4.D0/xmuw*y3**2-2.D0*xmuneut) +
     .        6.D0*dsqrt(xmut*xmub*xmuchar(i))*xmneut(nj)/gmst(ni)*
     .        btopr(ni,nj)*akstor(ni,i)*ol(nj,i) +
     .        dsqrt(xmub*xmuchar(i))*atopr(ni,nj)*akstor(ni,i)*ol(nj,i)
     .        *(-6.D0)*(y1+y3) +
     .        dsqrt(xmub)*xmneut(nj)/gmst(ni)*
     .        atopr(ni,nj)*akstor(ni,i)*or(nj,i)*( 6.D0*xmuw+6.D0*y3+
     .        6.D0*y2+2.D0*y1+4.D0/xmuw*y2*y3) )
      end do

c -------------------------------------------------------------------- c

      SD_stbchiw=stbchiwbb+stbchiwtt+stbchiwchichi+2.D0*stbchiwchib+
     .           2.D0*stbchiwbt+2.D0*stbchiwchit

      end

c ==================================================================== c
c ========================== neutralino_j b H+ ======================= c
c ==================================================================== c

      double precision function SD_stbchihc(x1,x2)
	
      implicit double precision (a-h,m,o-z)

      dimension db(2),dchi(2),gmst(2),xmuchar(2),amchar(2),amneut(4),
     .          xmneut(4)
      dimension ql(4,2),qr(4,2),or(4,2),ol(4,2)
      dimension gctbr(2,2),abot(2,4),bbot(2,4),alstor(2,2),akstor(2,2)
      dimension atopr(2,4),btopr(2,4)

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_hmass/ama,aml,amh,amch,amar
      COMMON/SD_fermion/amt,amb,amtau
      COMMON/SD_indices/ni,nj
      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2
      COMMON/SD_scala/scalb,scalt
      COMMON/SD_yukawa/ytewsb,ybewsb,ytauewsb
      COMMON/SD_coup3/ql,qr,ol,or
      COMMON/SD_runcoupscale/scalechoice,scaleofcoupling,inumloop

      gmst(1)=ast1
      gmst(2)=ast2

c --- the running couplings ---

      if(scalechoice.eq.1.D0) then
         scalb = ybewsb/dsqrt(g2)
         scalt = ytewsb/dsqrt(g2)
      elseif(scalechoice.eq.2.D0) then         
         call SD_runmass(gmst(ni),0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      elseif(scalechoice.eq.3.D0) then
         call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      endif

      call SD_hcsbotstop(gctbr)
      call SD_neutsbotbot(abot,bbot)     
      call SD_neutstoptop(atopr,btopr)
      call SD_higgschudb(chtbrunr,chtbrunl)
      call SD_charstopbot(alstor,akstor)

c ------------------------------------------------------

      xmuch      = amch**2/gmst(ni)**2
      xmut       = amt**2/gmst(ni)**2
      xmub       = amb**2/gmst(ni)**2
      xmuw       = amw**2/gmst(ni)**2
      xmuneut    = amneut(nj)**2/gmst(ni)**2
      xmusb1     = asb1**2/gmst(ni)**2
      xmusb2     = asb2**2/gmst(ni)**2     
      xmuchar(1) = amchar(1)**2/gmst(ni)**2
      xmuchar(2) = amchar(2)**2/gmst(ni)**2

      x3=2.D0-x1-x2
      y1=(1.D0+xmuch-xmuneut-xmub-x3)/2.D0
      y2=(1.D0-xmuch+xmuneut-xmub-x2)/2.D0

      db(1)   = 1.D0-x3+xmuch-xmusb1
      db(2)   = 1.D0-x3+xmuch-xmusb2
      dt      = 1.D0-x2+xmuneut-xmut
      dchi(1) = 1.D0-x1+xmub-xmuchar(1)
      dchi(2) = 1.D0-x1+xmub-xmuchar(2)

c -------------------------------------------------------------------- c
c                           sbottom exchange
c -------------------------------------------------------------------- c

      stbchihcbb=0.D0

      do k=1,2,1
         do l=1,2,1
           stbchihcbb= stbchihcbb+gctbr(ni,k)*gctbr(ni,l)*xmuw/db(k)
     .           /db(l)*(
     .           (abot(k,nj)*abot(l,nj)+bbot(k,nj)*bbot(l,nj))*
     .           2.D0*y1 +
     .           (abot(k,nj)*bbot(l,nj)+bbot(k,nj)*abot(l,nj))*
     .           dsqrt(xmub)*xmneut(nj)/gmst(ni)*(-2.D0) )
        end do
      end do

c -------------------------------------------------------------------- c
c                              top exchange
c -------------------------------------------------------------------- c

      stbchihctt=1.D0/dt**2*( 
     .    dsqrt(xmut)*xmneut(nj)/gmst(ni)*
     .    (chtbrunr**2+chtbrunl**2)*atopr(ni,nj)*btopr(ni,nj)*
     .    2.D0*(2.D0*y1-x1) +
     .    (chtbrunr**2*atopr(ni,nj)**2+chtbrunl**2*btopr(ni,nj)**2)*
     .    (-2.D0*(xmuneut*x1-xmuneut*y1+y1)+x1*x2) +
     .    (chtbrunr**2*btopr(ni,nj)**2+chtbrunl**2*atopr(ni,nj)**2)*
     .    xmut*2.D0*y1 + 
     .    chtbrunr*chtbrunl*(atopr(ni,nj)**2+btopr(ni,nj)**2)*
     .    dsqrt(xmub*xmut)*2.D0*(x2-2.D0*xmuneut) +
     .    chtbrunr*chtbrunl*atopr(ni,nj)*btopr(ni,nj)*
     .    dsqrt(xmub)*xmneut(nj)/gmst(ni)*4.D0*(x2-xmuneut-xmut-1.D0) )

c -------------------------------------------------------------------- c
c                           chargino exchange
c -------------------------------------------------------------------- c

      stbchihchichi=0.D0

      do k=1,2
         do l=1,2
            stbchihchichi=stbchihchichi+1.D0/dchi(k)/dchi(l)*(
     .          (alstor(ni,k)*alstor(ni,l)*ql(nj,k)*ql(nj,l)+
     .           akstor(ni,k)*akstor(ni,l)*qr(nj,k)*qr(nj,l))*
     .          (x1*x2+2.D0*y1*(xmub-1.D0)-2.D0*x2*xmub) +
     .          dsqrt(xmuchar(k))*xmneut(nj)/gmst(ni)*
     .          (alstor(ni,k)*alstor(ni,l)*ql(nj,l)*qr(nj,k)+
     .           akstor(ni,k)*akstor(ni,l)*ql(nj,k)*qr(nj,l))*
     .          2.D0*(y1+y2) +
     .          dsqrt(xmuchar(l))*xmneut(nj)/gmst(ni)*
     .          (alstor(ni,k)*alstor(ni,l)*ql(nj,k)*qr(nj,l)+
     .           akstor(ni,k)*akstor(ni,l)*ql(nj,l)*qr(nj,k))*
     .          2.D0*(y1+y2) +
     .          dsqrt(xmuchar(k)*xmuchar(l))*
     .          (alstor(ni,k)*alstor(ni,l)*qr(nj,k)*qr(nj,l)+
     .           akstor(ni,k)*akstor(ni,l)*ql(nj,k)*ql(nj,l))*2.D0*y1 +
     .          dsqrt(xmub)*( dsqrt(xmuchar(k))*
     .          (alstor(ni,l)*akstor(ni,k)*ql(nj,k)*ql(nj,l)+
     .           akstor(ni,l)*alstor(ni,k)*qr(nj,k)*qr(nj,l)) +
     .          (alstor(ni,l)*akstor(ni,k)*qr(nj,k)*qr(nj,l)+
     .           akstor(ni,l)*alstor(ni,k)*ql(nj,k)*ql(nj,l))*
     .          dsqrt(xmuchar(l)) )*(2.D0*y1-x2) +
     .          dsqrt(xmuchar(k)*xmuchar(l)*xmub)*xmneut(nj)/gmst(ni)*
     .          (alstor(ni,l)*akstor(ni,k)*ql(nj,k)*qr(nj,l)+
     .           akstor(ni,l)*alstor(ni,k)*qr(nj,k)*ql(nj,l))*(-2.D0) +
     .          dsqrt(xmub)*xmneut(nj)/gmst(ni)*
     .          (alstor(ni,l)*akstor(ni,k)*qr(nj,k)*ql(nj,l)+
     .           akstor(ni,l)*alstor(ni,k)*ql(nj,k)*qr(nj,l))*
     .          2.D0*(-1.D0-xmub+x1) )
         enddo
      enddo

c -------------------------------------------------------------------- c
c                    chargino sbottom interference
c -------------------------------------------------------------------- c

      stbchihcchib=0.d0

      do k=1,2
         do l=1,2
            stbchihcchib=stbchihcchib+
     .          gctbr(ni,k)*dsqrt(xmuw)/db(k)/dchi(l)*(
     .          (alstor(ni,l)*abot(k,nj)*ql(nj,l)+
     .           akstor(ni,l)*bbot(k,nj)*qr(nj,l))*
     .          xmneut(nj)/gmst(ni)*(x1-2.D0*xmub) +
     .          (akstor(ni,l)*bbot(k,nj)*ql(nj,l)+
     .           alstor(ni,l)*abot(k,nj)*qr(nj,l))*dsqrt(xmuchar(l))*
     .          2.D0*y1 +
     .          (alstor(ni,l)*bbot(k,nj)*ql(nj,l)+
     .           akstor(ni,l)*abot(k,nj)*qr(nj,l))*dsqrt(xmub)*
     .          (2.D0*y1-x2) +
     .          (akstor(ni,l)*abot(k,nj)*ql(nj,l)+
     .           alstor(ni,l)*bbot(k,nj)*qr(nj,l))*dsqrt(xmub)*
     .          dsqrt(xmuchar(l))*xmneut(nj)/gmst(ni)*(-2.D0) )
         enddo
      enddo

c -------------------------------------------------------------------- c
c                       top sbottom interference
c -------------------------------------------------------------------- c

      stbchihcbt=0.d0

      do k=1,2
         stbchihcbt=stbchihcbt-gctbr(ni,k)*dsqrt(xmuw)/db(k)/dt*(
     .        dsqrt(xmut)*
     .        (atopr(ni,nj)*abot(k,nj)*chtbrunl+
     .         btopr(ni,nj)*bbot(k,nj)*chtbrunr)*2.D0*y1 +
     .        (btopr(ni,nj)*abot(k,nj)*chtbrunl+
     .         atopr(ni,nj)*bbot(k,nj)*chtbrunr)*xmneut(nj)/gmst(ni)*
     .        (2.D0*y1-x1) +
     .        (btopr(ni,nj)*bbot(k,nj)*chtbrunl+
     .         atopr(ni,nj)*abot(k,nj)*chtbrunr)*dsqrt(xmub)*
     .        (x2-2.D0*xmuneut) +
     .        (btopr(ni,nj)*abot(k,nj)*chtbrunr+
     .         atopr(ni,nj)*bbot(k,nj)*chtbrunl)*dsqrt(xmub*xmut)*
     .        xmneut(nj)/gmst(ni)*(-2.D0) )
      enddo

c -------------------------------------------------------------------- c
c                      chargino top interference
c -------------------------------------------------------------------- c

      stbchihcchit=0.d0

      do k=1,2
         stbchihcchit=stbchihcchit-1.D0/dchi(k)/dt*(
     .        dsqrt(xmut)*xmneut(nj)/gmst(ni)*
     .        (alstor(ni,k)*atopr(ni,nj)*ql(nj,k)*chtbrunl+
     .         akstor(ni,k)*btopr(ni,nj)*qr(nj,k)*chtbrunr)*
     .        (x1-2.D0*xmub) + 
     .        (alstor(ni,k)*btopr(ni,nj)*ql(nj,k)*chtbrunl+
     .         akstor(ni,k)*atopr(ni,nj)*qr(nj,k)*chtbrunr)*
     .        (xmuneut*(x1-2.D0*xmub)-x2*(x1-xmub)+2.D0*y1) + 
     .        dsqrt(xmut)*dsqrt(xmuchar(k))*
     .        (akstor(ni,k)*btopr(ni,nj)*ql(nj,k)*chtbrunr+
     .         alstor(ni,k)*atopr(ni,nj)*qr(nj,k)*chtbrunl)*2.D0*y1
     .        +dsqrt(xmuchar(k))*xmneut(nj)/gmst(ni)*
     .        (akstor(ni,k)*atopr(ni,nj)*ql(nj,k)*chtbrunr+
     .         alstor(ni,k)*btopr(ni,nj)*qr(nj,k)*chtbrunl)*
     .        (2.D0*y1-x1) +
     .        (akstor(ni,k)*btopr(ni,nj)*ql(nj,k)*chtbrunl+
     .         alstor(ni,k)*atopr(ni,nj)*qr(nj,k)*chtbrunr)*
     .        dsqrt(xmub)*dsqrt(xmuchar(k))*(x2-2.D0*xmuneut) +
     .        (alstor(ni,k)*btopr(ni,nj)*ql(nj,k)*chtbrunr+
     .         akstor(ni,k)*atopr(ni,nj)*qr(nj,k)*chtbrunl)*
     .        dsqrt(xmub*xmut)*(2.D0*y1-x2) + 
     .        (akstor(ni,k)*atopr(ni,nj)*ql(nj,k)*chtbrunl+
     .         alstor(ni,k)*btopr(ni,nj)*qr(nj,k)*chtbrunr)*
     .        dsqrt(xmut*xmub*xmuchar(k))*xmneut(nj)/gmst(ni)*(-2.D0) +
     .        (alstor(ni,k)*atopr(ni,nj)*ql(nj,k)*chtbrunr+
     .         akstor(ni,k)*btopr(ni,nj)*qr(nj,k)*chtbrunl)*
     .        dsqrt(xmub)*xmneut(nj)/gmst(ni)*
     .        (xmuch-xmub-xmuneut+1.D0) )
      enddo

c -------------------------------------------------------------------- c

      SD_stbchihc=stbchihcbb+stbchihctt+stbchihchichi+2.D0*stbchihcchib
     .            +2.D0*stbchihcbt+2.D0*stbchihcchit

      end

c ==================================================================== c
c ========================= b stau neutrino_tau ====================== c
c ==================================================================== c

      double precision function SD_stbnustau(x1,x2)

      implicit double precision (a-h,m,o-z)

      dimension gmst(2),amchar(2),amneut(4),xmuchar(2),gmstau(2),
     .          dchi(2),xmustau(2),xmneut(4)
      dimension alstor(2,2),akstor(2,2)
      dimension ale(2,2),alto(2,2),alsne(2,2),blsne(2,2),alsnt(2,2),
     .          blsnt(2,2),blto(2,2)

      COMMON/SD_param/sdgf,sdmz,sdmw,pi,g2
      COMMON/SD_fermion/amt,amb,amtau
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2
      COMMON/SD_indices/ni,nj
      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_scala/scalb,scalt
      COMMON/SD_yukawa/ytewsb,ybewsb,ytauewsb
      COMMON/SD_sfermionetau/ase1,ase2,astau1,astau2
      COMMON/SD_coup5/ale,alto,alsne,blsne,alsnt,blsnt
      COMMON/SD_runcoupscale/scalechoice,scaleofcoupling,inumloop

      gmst(1)=ast1
      gmst(2)=ast2

c --- the running couplings ---

      if(scalechoice.eq.1.D0) then
         scalb = ybewsb/dsqrt(g2)
         scalt = ytewsb/dsqrt(g2)
      elseif(scalechoice.eq.2.D0) then         
         call SD_runmass(gmst(ni),0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      elseif(scalechoice.eq.3.D0) then
         call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      endif

      call SD_charstopbot(alstor,akstor)

c ------------------------------

      gmstau(1)=astau1
      gmstau(2)=astau2

      xmuchar(1) = amchar(1)**2/gmst(ni)**2
      xmuchar(2) = amchar(2)**2/gmst(ni)**2
      xmustau(1) = gmstau(1)**2/gmst(ni)**2
      xmustau(2) = gmstau(2)**2/gmst(ni)**2
      xmub       = amb**2/gmst(ni)**2

      dchi(1)=1.D0-x1-xmuchar(1)+xmub
      dchi(2)=1.D0-x1-xmuchar(2)+xmub

      do i=1,2,1
         blto(1,i)=0.D0
         blto(2,i)=0.D0
      end do

      SD_stbnustau=0.D0

      do k=1,2,1
         do l=1,2,1
            SD_stbnustau=SD_stbnustau+1.D0/dchi(k)/dchi(l)*(
     .        (alstor(ni,k)*alstor(ni,l)*alto(nj,k)*alto(nj,l)
     .        +akstor(ni,k)*akstor(ni,l)*blto(nj,k)*blto(nj,l))*
     .         dsqrt(xmuchar(k)*xmuchar(l))*(x1+x2-1.D0+xmustau(nj)
     .         -xmub)
     .       +(alstor(ni,k)*alstor(ni,l)*blto(nj,k)*blto(nj,l)
     .        +akstor(ni,k)*akstor(ni,l)*alto(nj,k)*alto(nj,l))*
     .        ((1.D0-x1)*(1.D0-x2)-xmustau(nj)+xmub*(xmustau(nj)+x1-x2
     .         -xmub)) 
     .       +(alstor(ni,k)*akstor(ni,l)*blto(nj,k)*blto(nj,l)
     .        +akstor(ni,k)*alstor(ni,l)*alto(nj,k)*alto(nj,l))*
     .        dsqrt(xmuchar(l)*xmub)*(-1.D0-xmub+xmustau(nj)+x1)
     .       +(alstor(ni,k)*akstor(ni,l)*alto(nj,k)*alto(nj,l)
     .        +akstor(ni,k)*alstor(ni,l)*blto(nj,k)*blto(nj,l))*
     .        dsqrt(xmuchar(k)*xmub)*(-1.D0-xmub+xmustau(nj)+x1) )
         end do
      end do

      end

c ==================================================================== c
c ========================= b sneutrino_tau tau ====================== c
c ==================================================================== c

      double precision function SD_stbsnutau(x1,x2)

      implicit double precision (a-h,m,o-z)

      dimension gmst(2),amchar(2),amneut(4),xmuchar(2),dchi(2),
     .          xmusn(2),xmneut(4)
      dimension alstor(2,2),akstor(2,2)
      dimension ale(2,2),alto(2,2),alsne(2,2),blsne(2,2),alsnt(2,2),
     .          blsnt(2,2)

      COMMON/SD_param/sdgf,sdmz,sdmw,pi,g2
      COMMON/SD_fermion/amt,amb,amtau
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2
      COMMON/SD_indices/ni,nj
      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_sneutrino/asne1,asne2,asntau1,asntau2
      COMMON/SD_sfermionetau/ase1,ase2,astau1,astau2
      COMMON/SD_scala/scalb,scalt
      COMMON/SD_yukawa/ytewsb,ybewsb,ytauewsb
      COMMON/SD_coup5/ale,alto,alsne,blsne,alsnt,blsnt
      COMMON/SD_runcoupscale/scalechoice,scaleofcoupling,inumloop

      gmst(1)=ast1
      gmst(2)=ast2

c --- the running couplings ---

      if(scalechoice.eq.1.D0) then
         scalb = ybewsb/dsqrt(g2)
         scalt = ytewsb/dsqrt(g2)
      elseif(scalechoice.eq.2.D0) then         
         call SD_runmass(gmst(ni),0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      elseif(scalechoice.eq.3.D0) then
         call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      endif

      call SD_charstopbot(alstor,akstor)

c ------------------------------

      xmuchar(1)= amchar(1)**2/gmst(ni)**2
      xmuchar(2)= amchar(2)**2/gmst(ni)**2
      xmusn(1)  = asntau1**2/gmst(ni)**2
      xmusn(2)  = asntau2**2/gmst(ni)**2
      xmub      = amb**2/gmst(ni)**2
      xmutau    = amtau**2/gmst(ni)**2

      dchi(1)=1.D0-x1-xmuchar(1)+xmub
      dchi(2)=1.D0-x1-xmuchar(2)+xmub

      SD_stbsnutau=0.D0

      do k=1,2,1
         do l=1,2,1
            SD_stbsnutau=SD_stbsnutau+1.D0/dchi(k)/dchi(l)*(
     .        (alstor(ni,k)*alstor(ni,l)*blsnt(nj,k)*blsnt(nj,l)+
     .         akstor(ni,k)*akstor(ni,l)*alsnt(nj,k)*alsnt(nj,l))*
     .        dsqrt(xmuchar(k)*xmuchar(l))*(x1+x2-1.D0+xmusn(nj)
     .        -xmub-xmutau)
     .       +(alstor(ni,k)*alstor(ni,l)*alsnt(nj,k)*alsnt(nj,l)+
     .         akstor(ni,k)*akstor(ni,l)*blsnt(nj,k)*blsnt(nj,l))*
     .        ((1.D0-x1)*(1.D0-x2)-xmusn(nj)+xmub*(xmusn(nj)+x1-x2
     .        -xmub-xmutau)+xmutau)
     .       +(alstor(ni,k)*alstor(ni,l)*alsnt(nj,k)*blsnt(nj,l)+
     .         akstor(ni,k)*akstor(ni,l)*blsnt(nj,k)*alsnt(nj,l))*
     .        dsqrt(xmuchar(l)*xmutau)*(-2.D0*xmub+x1)
     .       +(alstor(ni,k)*akstor(ni,l)*alsnt(nj,k)*alsnt(nj,l)+
     .         akstor(ni,k)*alstor(ni,l)*blsnt(nj,k)*blsnt(nj,l))*
     .        dsqrt(xmuchar(l)*xmub)*(-1.D0-xmub-xmutau+xmusn(nj)+x1)
     .       +(alstor(ni,k)*alstor(ni,l)*blsnt(nj,k)*alsnt(nj,l)+
     .         akstor(ni,k)*akstor(ni,l)*alsnt(nj,k)*blsnt(nj,l))*
     .        dsqrt(xmuchar(k)*xmutau)*(-2.D0*xmub+x1)
     .       +(alstor(ni,k)*akstor(ni,l)*blsnt(nj,k)*blsnt(nj,l)+
     .         akstor(ni,k)*alstor(ni,l)*alsnt(nj,k)*alsnt(nj,l))*
     .        dsqrt(xmuchar(k)*xmub)*(-1.D0-xmub-xmutau+xmusn(nj)+x1)
     .       +(alstor(ni,k)*akstor(ni,l)*alsnt(nj,k)*blsnt(nj,l)+
     .         akstor(ni,k)*alstor(ni,l)*blsnt(nj,k)*alsnt(nj,l))*
     .        dsqrt(xmub*xmutau)*(-2.D0-2.D0*xmub+2.D0*x1)
     .       +(alstor(ni,k)*akstor(ni,l)*blsnt(nj,k)*alsnt(nj,l)+
     .         akstor(ni,k)*alstor(ni,l)*alsnt(nj,k)*blsnt(nj,l))*
     .        dsqrt(xmub*xmutau)*dsqrt(xmuchar(k)*xmuchar(l))*(-2.D0) )
         end do
      end do

      end

c ==================================================================== c
c ======================== b selectron neutrino_e ==================== c
c ==================================================================== c

      double precision function SD_stbnusel(x1,x2)

      implicit double precision (a-h,m,o-z)

      dimension gmst(2),amchar(2),amneut(4),xmuchar(2),gmsel(2),
     .          dchi(2),xmusel(2),xmneut(4)
      dimension alstor(2,2),akstor(2,2)
      dimension ale(2,2),altau(2,2),alsne(2,2),blsne(2,2),alsnt(2,2),
     .          blsnt(2,2),ble(2,2)

      COMMON/SD_param/sdgf,sdmz,sdmw,pi,g2
      COMMON/SD_fermion/amt,amb,amtau
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2
      COMMON/SD_indices/ni,nj
      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_coup5/ale,altau,alsne,blsne,alsnt,blsnt
      COMMON/SD_sfermionetau/ase1,ase2,astau1,astau2
      COMMON/SD_scala/scalb,scalt
      COMMON/SD_yukawa/ytewsb,ybewsb,ytauewsb
      COMMON/SD_runcoupscale/scalechoice,scaleofcoupling,inumloop

      gmst(1)=ast1
      gmst(2)=ast2

c --- the running couplings ---

      if(scalechoice.eq.1.D0) then
         scalb = ybewsb/dsqrt(g2)
         scalt = ytewsb/dsqrt(g2)
      elseif(scalechoice.eq.2.D0) then         
         call SD_runmass(gmst(ni),0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      elseif(scalechoice.eq.3.D0) then
         call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      endif

      call SD_charstopbot(alstor,akstor)

c ------------------------------

      gmsel(1)=ase1
      gmsel(2)=ase2

      xmuchar(1) = amchar(1)**2/gmst(ni)**2
      xmuchar(2) = amchar(2)**2/gmst(ni)**2
      xmusel(1)  = gmsel(1)**2/gmst(ni)**2
      xmusel(2)  = gmsel(2)**2/gmst(ni)**2
      xmub       = amb**2/gmst(ni)**2

      dchi(1)=1.D0-x1-xmuchar(1)+xmub
      dchi(2)=1.D0-x1-xmuchar(2)+xmub

      do i=1,2,1
         ble(1,i)=0.D0
         ble(2,i)=0.D0
      end do

      SD_stbnusel=0.D0

      do k=1,2,1
         do l=1,2,1
            SD_stbnusel=SD_stbnusel+1.D0/dchi(k)/dchi(l)*(
     .        (alstor(ni,k)*alstor(ni,l)*ale(nj,k)*ale(nj,l)
     .        +akstor(ni,k)*akstor(ni,l)*ble(nj,k)*ble(nj,l))*
     .         dsqrt(xmuchar(k)*xmuchar(l))*(x1+x2-1.D0+xmusel(nj)
     .         -xmub)
     .       +(alstor(ni,k)*alstor(ni,l)*ble(nj,k)*ble(nj,l)
     .        +akstor(ni,k)*akstor(ni,l)*ale(nj,k)*ale(nj,l))*
     .        ((1.D0-x1)*(1.D0-x2)-xmusel(nj)+xmub*(xmusel(nj)+x1-x2
     .         -xmub)) 
     .       +(alstor(ni,k)*akstor(ni,l)*ble(nj,k)*ble(nj,l)
     .        +akstor(ni,k)*alstor(ni,l)*ale(nj,k)*ale(nj,l))*
     .        dsqrt(xmuchar(l)*xmub)*(-1.D0-xmub+xmusel(nj)+x1)
     .       +(alstor(ni,k)*akstor(ni,l)*ale(nj,k)*ale(nj,l)
     .        +akstor(ni,k)*alstor(ni,l)*ble(nj,k)*ble(nj,l))*
     .        dsqrt(xmuchar(k)*xmub)*(-1.D0-xmub+xmusel(nj)+x1) )
         end do
      end do

      end

c ==================================================================== c
c ======================= b sneutrino_e electron ===================== c
c ==================================================================== c

      double precision function SD_stbsnuel(x1,x2)

      implicit double precision (a-h,m,o-z)

      dimension gmst(2),amchar(2),amneut(4),xmuchar(2),gmsn(4),
     .          dchi(2),xmusn(2),xmneut(4)
      dimension alstor(2,2),akstor(2,2)
      dimension ale(2,2),altau(2,2),alsne(2,2),blsne(2,2),alsnt(2,2),
     .          blsnt(2,2)

      COMMON/SD_param/sdgf,sdmz,sdmw,pi,g2
      COMMON/SD_fermion/amt,amb,amtau
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2
      COMMON/SD_indices/ni,nj
      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_coup5/ale,altau,alsne,blsne,alsnt,blsnt
      COMMON/SD_sneutrino/asne1,asne2,asntau1,asntau2
      COMMON/SD_scala/scalb,scalt
      COMMON/SD_yukawa/ytewsb,ybewsb,ytauewsb
      COMMON/SD_runcoupscale/scalechoice,scaleofcoupling,inumloop

      gmst(1)=ast1
      gmst(2)=ast2

c --- the running couplings ---

      if(scalechoice.eq.1.D0) then
         scalb = ybewsb/dsqrt(g2)
         scalt = ytewsb/dsqrt(g2)
      elseif(scalechoice.eq.2.D0) then         
         call SD_runmass(gmst(ni),0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      elseif(scalechoice.eq.3.D0) then
         call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      endif

      call SD_charstopbot(alstor,akstor)

c ------------------------------

      gmsn(1)=asne1
      gmsn(2)=asne2

      xmuchar(1)= amchar(1)**2/gmst(ni)**2
      xmuchar(2)= amchar(2)**2/gmst(ni)**2
      xmusn(1)  = gmsn(1)**2/gmst(ni)**2
      xmusn(2)  = gmsn(2)**2/gmst(ni)**2
      xmub      = amb**2/gmst(ni)**2

      dchi(1)=1.D0-x1-xmuchar(1)+xmub
      dchi(2)=1.D0-x1-xmuchar(2)+xmub

      SD_stbsnuel=0.D0

      do k=1,2,1
         do l=1,2,1
            SD_stbsnuel=SD_stbsnuel+1.D0/dchi(k)/dchi(l)*(
     .        (alstor(ni,k)*alstor(ni,l)*blsne(1,k)*blsne(1,l)+
     .         akstor(ni,k)*akstor(ni,l)*alsne(1,k)*alsne(1,l))*
     .        dsqrt(xmuchar(k)*xmuchar(l))*(x1+x2-1.D0+xmusn(1)
     .        -xmub)
     .       +(alstor(ni,k)*alstor(ni,l)*alsne(1,k)*alsne(1,l)+
     .         akstor(ni,k)*akstor(ni,l)*blsne(1,k)*blsne(1,l))*
     .        ((1.D0-x1)*(1.D0-x2)-xmusn(1)+xmub*(xmusn(1)+x1-x2
     .        -xmub))
     .       +(alstor(ni,k)*akstor(ni,l)*alsne(1,k)*alsne(1,l)+
     .         akstor(ni,k)*alstor(ni,l)*blsne(1,k)*blsne(1,l))*
     .        dsqrt(xmuchar(l)*xmub)*(-1.D0-xmub+xmusn(1)+x1)
     .       +(alstor(ni,k)*akstor(ni,l)*blsne(1,k)*blsne(1,l)+
     .         akstor(ni,k)*alstor(ni,l)*alsne(1,k)*alsne(1,l))*
     .        dsqrt(xmuchar(k)*xmub)*(-1.D0-xmub+xmusn(1)+x1) )
         end do
      end do

      end

c ==================================================================== c
c ========================== b sbottom_1/2* top ====================== c
c ==================================================================== c

      double precision function SD_stbsbstart(x1,x2)

      implicit double precision (a-h,m,o-z)
      double precision neutneut

      dimension gmst(2),amchar(2),amneut(4),xmuchar(2),gmsb(2),
     .          dchi(2),xmusb(2),xmneut(4),dneut(4),xmuneut(4)
      dimension alsbot(2,2),aksbot(2,2),alstor(2,2),akstor(2,2),
     .          abot(2,4),bbot(2,4),atopr(2,4),btopr(2,4)
      dimension gul(2),gur(2),gdl(2),gdr(2),gtl(2),gtr(2),gbl(2),gbr(2)

      COMMON/SD_param/sdgf,sdmz,sdmw,pi,g2
      COMMON/SD_fermion/amt,amb,amtau
      COMMON/SD_gluino/mgluino
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2
      COMMON/SD_indices/ni,nj
      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_scala/scalb,scalt
      COMMON/SD_yukawa/ytewsb,ybewsb,ytauewsb
      COMMON/SD_coupewsb/alsew,g2ew,g1ew
      COMMON/SD_runcoupscale/scalechoice,scaleofcoupling,inumloop
      COMMON/SD_coup21/gtr,gtl,gbr,gbl,gur,gul,gdr,gdl

      external SD_alphascall

      gmst(1)=ast1
      gmst(2)=ast2
      gmsb(1)=asb1
      gmsb(2)=asb2

c --- the running couplings ---

      if(scalechoice.eq.1.D0) then
         scalb = ybewsb/dsqrt(g2)
         scalt = ytewsb/dsqrt(g2)
         gs2   = alsew*4.D0*pi
      elseif(scalechoice.eq.2.D0) then         
         call SD_runmass(gmst(ni),0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
         gs2   = SD_alphascall(gmst(ni),inumloop)*4.D0*pi
      elseif(scalechoice.eq.3.D0) then
         call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
         gs2   = SD_alphascall(scaleofcoupling,inumloop)*4.D0*pi
      endif

      call SD_charstopbot(alstor,akstor)
      call SD_charsbottop(alsbot,aksbot)
      call SD_neutsbotbot(abot,bbot)
      call SD_neutstoptop(atopr,btopr)

c -----------------------------

      do k=1,4,1 
         xmuneut(k) = amneut(k)**2/gmst(ni)**2
      end do
      xmuchar(1) = amchar(1)**2/gmst(ni)**2
      xmuchar(2) = amchar(2)**2/gmst(ni)**2
      xmusb(1)   = gmsb(1)**2/gmst(ni)**2
      xmusb(2)   = gmsb(2)**2/gmst(ni)**2
      xmut       = amt**2/gmst(ni)**2
      xmub       = amb**2/gmst(ni)**2
      xmugl      = mgluino**2/gmst(ni)**2

      dchi(1)=1.D0-x1-xmuchar(1)+xmub
      dchi(2)=1.D0-x1-xmuchar(2)+xmub

      do k=1,4,1
         dneut(k)=1.D0-x2-xmuneut(k)+xmut
      end do

      dgl = 1.D0-x2-xmugl+xmut

c -------------------------------------------------------------------- c
c                           chargino exchange
c -------------------------------------------------------------------- c

      charchar=0.D0

      do k=1,2,1
         do l=1,2,1
            charchar=charchar+3.D0*g2**2/dchi(k)/dchi(l)*(
     .           dsqrt(xmuchar(k)*xmuchar(l))*
     .           (-1.D0+x1+x2-xmub-xmut+xmusb(nj))*
     .           (alstor(ni,k)*alstor(ni,l)*alsbot(nj,k)*alsbot(nj,l)+
     .            akstor(ni,k)*akstor(ni,l)*aksbot(nj,k)*aksbot(nj,l))
     .           +(xmub*(-x2+xmusb(nj)-xmub+x1-xmut)-x2+x1*x2-x1+1.D0
     .             -xmusb(nj)+xmut)*
     .           (alstor(ni,k)*alstor(ni,l)*aksbot(nj,k)*aksbot(nj,l)+
     .            akstor(ni,k)*akstor(ni,l)*alsbot(nj,k)*alsbot(nj,l))
     .           +dsqrt(xmuchar(k)*xmut)*(x1-2.D0*xmub)*
     .           (alstor(ni,k)*alstor(ni,l)*alsbot(nj,k)*aksbot(nj,l)+
     .            akstor(ni,k)*akstor(ni,l)*alsbot(nj,l)*aksbot(nj,k))
     .           +dsqrt(xmuchar(l)*xmut)*(x1-2.D0*xmub)*
     .           (alstor(ni,k)*alstor(ni,l)*alsbot(nj,l)*aksbot(nj,k)+
     .            akstor(ni,k)*akstor(ni,l)*alsbot(nj,k)*aksbot(nj,l))
     .           +dsqrt(xmub*xmut)*(-2.D0*xmub+2.D0*x1-2.D0)*
     .           (alstor(ni,k)*akstor(ni,l)*alsbot(nj,l)*aksbot(nj,k)+
     .            alstor(ni,l)*akstor(ni,k)*alsbot(nj,k)*aksbot(nj,l))
     .           +dsqrt(xmub*xmuchar(l))*(x1-xmub+xmusb(nj)-xmut-1.D0)*
     .           (alstor(ni,k)*akstor(ni,l)*aksbot(nj,k)*aksbot(nj,l)+
     .            alstor(ni,l)*akstor(ni,k)*alsbot(nj,l)*alsbot(nj,k))
     .           +dsqrt(xmub*xmuchar(k))*(x1-xmub+xmusb(nj)-xmut-1.D0)*
     .           (alstor(ni,k)*akstor(ni,l)*alsbot(nj,k)*alsbot(nj,l)+
     .            alstor(ni,l)*akstor(ni,k)*aksbot(nj,k)*aksbot(nj,l))
     .           +dsqrt(xmuchar(k)*xmuchar(l)*xmub*xmut)*(-2.D0)*
     .           (alstor(ni,k)*akstor(ni,l)*alsbot(nj,k)*aksbot(nj,l)+
     .            alstor(ni,l)*akstor(ni,k)*alsbot(nj,l)*aksbot(nj,k)) )
         end do
      end do

c -------------------------------------------------------------------- c
c                          neutralino exchange
c -------------------------------------------------------------------- c

      neutneut=0.D0

      do k=1,4,1
         do l=1,4,1
            neutneut=neutneut+3.D0*g2**2/dneut(k)/dneut(l)*(
     .           xmneut(k)*xmneut(l)/gmst(ni)**2*
     .           (-1.D0+x1+x2-xmub-xmut+xmusb(nj))*
     .           (atopr(ni,k)*atopr(ni,l)*abot(nj,k)*abot(nj,l)+
     .            btopr(ni,k)*btopr(ni,l)*bbot(nj,k)*bbot(nj,l))
     .           +(xmut*(x2+xmusb(nj)-xmub-x1-xmut)-x2+x1*x2-x1+1.D0
     .             -xmusb(nj)+xmub)*
     .           (atopr(ni,k)*atopr(ni,l)*bbot(nj,k)*bbot(nj,l)+
     .            btopr(ni,k)*btopr(ni,l)*abot(nj,k)*abot(nj,l))
     .           +xmneut(k)/gmst(ni)*dsqrt(xmub)*(x2-2.D0*xmut)*
     .           (atopr(ni,k)*atopr(ni,l)*abot(nj,k)*bbot(nj,l)+
     .            btopr(ni,k)*btopr(ni,l)*abot(nj,l)*bbot(nj,k))
     .           +xmneut(l)/gmst(ni)*dsqrt(xmub)*(x2-2.D0*xmut)*
     .           (atopr(ni,k)*atopr(ni,l)*abot(nj,l)*bbot(nj,k)+
     .            btopr(ni,k)*btopr(ni,l)*abot(nj,k)*bbot(nj,l))
     .           +dsqrt(xmub*xmut)*(-2.D0*xmut+2.D0*x2-2.D0)*
     .           (atopr(ni,k)*btopr(ni,l)*abot(nj,l)*bbot(nj,k)+
     .            atopr(ni,l)*btopr(ni,k)*abot(nj,k)*bbot(nj,l))
     .           +dsqrt(xmut)*xmneut(l)/gmst(ni)*
     .           (x2-xmub+xmusb(nj)-xmut-1.D0)*
     .           (atopr(ni,k)*btopr(ni,l)*bbot(nj,k)*bbot(nj,l)+
     .            atopr(ni,l)*btopr(ni,k)*abot(nj,l)*abot(nj,k))
     .           +dsqrt(xmut)*xmneut(k)/gmst(ni)*
     .           (x2-xmub+xmusb(nj)-xmut-1.D0)*
     .           (atopr(ni,k)*btopr(ni,l)*abot(nj,k)*abot(nj,l)+
     .            atopr(ni,l)*btopr(ni,k)*bbot(nj,k)*bbot(nj,l))
     .           +dsqrt(xmub*xmut)*xmneut(k)*xmneut(l)/gmst(ni)**2*
     .           (-2.D0)*
     .           (atopr(ni,k)*btopr(ni,l)*abot(nj,k)*bbot(nj,l)+
     .            atopr(ni,l)*btopr(ni,k)*abot(nj,l)*bbot(nj,k)) )
         end do
      end do

c -------------------------------------------------------------------- c
c                            gluino exchange
c -------------------------------------------------------------------- c

      gluiglui= 2.D0/3.D0*gs2**2*4.D0/dgl**2*(
     .          xmugl*dsqrt(xmub*xmut)*(-4.D0)*
     .          gtr(ni)*gtl(ni)*gbr(nj)*gbl(nj)
     .         +dsqrt(xmugl*xmub)*2.D0*(x2-2.D0*xmut)*
     .          gbr(nj)*gbl(nj)*(gtr(ni)**2+gtl(ni)**2)
     .         +dsqrt(xmub*xmut)*4.D0*(x2-xmut-1.D0)*
     .          gbr(nj)*gbl(nj)*gtr(ni)*gtl(ni)
     .         +dsqrt(xmut*xmugl)*(-2.D0)*(1.D0-x2+xmub+xmut-xmusb(nj))*
     .          gtr(ni)*gtl(ni)*(gbr(nj)**2+gbl(nj)**2)
     .         +xmugl*(x1+x2-xmut-xmub-1.D0+xmusb(nj))*
     .          (gbr(nj)**2*gtr(ni)**2+gbl(nj)**2*gtl(ni)**2)
     .         +(x2*xmut-xmut*xmub+x1*x2-xmut**2-x1*xmut+xmut*xmusb(nj)
     .           -x1-xmusb(nj)+1.D0+xmub-x2)*
     .          (gbr(nj)**2*gtl(ni)**2+gbl(nj)**2*gtr(ni)**2) )

c -------------------------------------------------------------------- c
c                    chargino neutralino interference
c -------------------------------------------------------------------- c

      charneut=0.D0

      do k=1,2,1
         do l=1,4,1
            charneut=charneut+2.D0*3.D0*g2**2/dchi(k)/dneut(l)*(
     .           amchar(k)*xmneut(l)/gmst(ni)**2*
     .           (-1.D0+x1+x2-xmub-xmut+xmusb(nj))*
     .           (atopr(ni,l)*abot(nj,l)*alstor(ni,k)*alsbot(nj,k)+
     .            btopr(ni,l)*bbot(nj,l)*akstor(ni,k)*aksbot(nj,k))
     .           +(x2-x1*x2+x1-1.D0-xmut-xmub-2.D0*xmub*xmut+x1*xmut
     .            +x2*xmub+xmusb(nj))*
     .           (atopr(ni,l)*bbot(nj,l)*alsbot(nj,k)*akstor(ni,k)+
     .            btopr(ni,l)*abot(nj,l)*alstor(ni,k)*aksbot(nj,k))
     .           +amchar(k)/gmst(ni)*dsqrt(xmub)*(x2-2.D0*xmut)*
     .           (atopr(ni,l)*bbot(nj,l)*alstor(ni,k)*alsbot(nj,k)+
     .            btopr(ni,l)*abot(nj,l)*akstor(ni,k)*aksbot(nj,k))
     .           +xmneut(l)/gmst(ni)*dsqrt(xmut)*(x1-2.D0*xmub)*
     .           (atopr(ni,l)*abot(nj,l)*alstor(ni,k)*aksbot(nj,k)+
     .            btopr(ni,l)*bbot(nj,l)*akstor(ni,k)*alsbot(nj,k))
     .           +dsqrt(xmub*xmut)*(1.D0-xmub-xmut+xmusb(nj))*
     .           (atopr(ni,l)*bbot(nj,l)*alstor(ni,k)*aksbot(nj,k)+
     .            btopr(ni,l)*abot(nj,l)*akstor(ni,k)*alsbot(nj,k))
     .           +dsqrt(xmut)*amchar(k)/gmst(ni)*
     .           (x2-xmub+xmusb(nj)-xmut-1.D0)*
     .           (atopr(ni,l)*bbot(nj,l)*akstor(ni,k)*aksbot(nj,k)+
     .            btopr(ni,l)*abot(nj,l)*alstor(ni,k)*alsbot(nj,k))
     .           +dsqrt(xmub)*xmneut(l)/gmst(ni)*
     .           (x1-xmub+xmusb(nj)-xmut-1.D0)*
     .           (atopr(ni,l)*abot(nj,l)*akstor(ni,k)*alsbot(nj,k)+
     .            btopr(ni,l)*bbot(nj,l)*alstor(ni,k)*aksbot(nj,k))
     .           +dsqrt(xmub*xmut)*amchar(k)*xmneut(l)/gmst(ni)**2*
     .           (-2.D0)*
     .           (atopr(ni,l)*abot(nj,l)*akstor(ni,k)*aksbot(nj,k)+
     .            btopr(ni,l)*bbot(nj,l)*alstor(ni,k)*alsbot(nj,k)) )
         end do
      end do

c -------------------------------------------------------------------- c

      SD_stbsbstart=charchar+neutneut+gluiglui+charneut

      end

c ==================================================================== c
c ======================== sbottom_1/2 bbar top ====================== c
c ==================================================================== c

      double precision function SD_stbbsbt(x1,x2)

      implicit double precision (a-h,m,o-z)

      dimension gmst(2),gmsb(2),xmusb(2),dw(2),dch(2),gctbr(2,2)
      dimension gtr(2),gtl(2),gbr(2),gbl(2),gur(2),gul(2),gdr(2),gdl(2)
      dimension amchar(2),dneut(4),xmuneut(4),amneut(4),xmneut(4)
      dimension atopr(2,4),btopr(2,4),abot(2,4),bbot(2,4)
      dimension gwtb(2,2),gwntau(2,2)

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_indices/ni,nj
      COMMON/SD_hmass/ama,aml,amh,amch,amar
      COMMON/SD_fermion/amt,amb,amtau
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2
      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_gluino/mgluino
      COMMON/SD_scala/scalb,scalt
      COMMON/SD_yukawa/ytewsb,ybewsb,ytauewsb
      COMMON/SD_coup20/gwtb,gwntau
      COMMON/SD_coup21/gtr,gtl,gbr,gbl,gur,gul,gdr,gdl
      COMMON/SD_coupewsb/alsew,g2ew,g1ew
      COMMON/SD_runcoupscale/scalechoice,scaleofcoupling,inumloop
      COMMON/SD_mwmzpole/amwp,amzp

      external SD_alphascall

      gmst(1)=ast1
      gmst(2)=ast2
      gmsb(1)=asb1
      gmsb(2)=asb2

c --- the running couplings ---

      if(scalechoice.eq.1.D0) then
         gs21 = alsew*4.D0*pi
         gs22 = gs21
      elseif(scalechoice.eq.2.D0) then         
         gs21 = SD_alphascall(gmst(ni),inumloop)*4.D0*pi
         gs22 = gs21
      elseif(scalechoice.eq.3.D0) then
         gs21 = SD_alphascall(scaleofcoupling,inumloop)*4.D0*pi
         gs22 = gs21
      endif

      if(scalechoice.eq.1.D0) then
         scalb = ybewsb/dsqrt(g2)
         scalt = ytewsb/dsqrt(g2)
      elseif(scalechoice.eq.2.D0) then         
         call SD_runmass(gmst(ni),0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      elseif(scalechoice.eq.3.D0) then
         call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      endif

      call SD_hcsbotstop(gctbr)
      call SD_higgschudb(chtbrunr,chtbrunl)
      call SD_neutstoptop(atopr,btopr)
      call SD_neutsbotbot(abot,bbot)      

c -------------------------------------------------------------------- c

      xmusb(1)   = gmsb(1)**2/gmst(ni)**2
      xmusb(2)   = gmsb(2)**2/gmst(ni)**2
      xmut       = amt**2/gmst(ni)**2
      xmub       = amb**2/gmst(ni)**2
      xmuw       = amwp**2/gmst(ni)**2
      xmuch      = amch**2/gmst(ni)**2
      xmugl      = mgluino**2/gmst(ni)**2
      do i=1,4,1
         xmuneut(i) = amneut(i)**2/gmst(ni)**2
      end do

      x3 = 2.D0-x1-x2

      dw(1)   = 1.D0-x3+xmusb(1)-xmuw
      dw(2)   = 1.D0-x3+xmusb(2)-xmuw
      dch(1)  = 1.D0-x3+xmusb(1)-xmuch
      dch(2)  = 1.D0-x3+xmusb(2)-xmuch
      dgl     = 1.D0-x2+xmut-xmugl
      do i=1,4,1
         dneut(i) = 1.D0-x2+xmut-xmuneut(i)
      end do

c -------------------------------------------------------------------- c
c                              W exchange
c -------------------------------------------------------------------- c

      stsbotww=3.D0*g2**2/4.D0/dw(nj)**2*gwtb(ni,nj)**2*( 
     .     4.D0*(1.D0+x1*x2-x1-x2-xmusb(nj)) 
     .   + xmut*(3.D0-3.D0*x1+x2+xmusb(nj)-xmut+2.D0*xmub) 
     .   + xmub*(3.D0-3.D0*x2+x1+xmusb(nj)-xmub) 
     .   + xmut/xmuw**2*(1.D0-xmusb(nj))**2*
     .     (-1.D0+x1+x2+xmusb(nj)-xmut+2.D0*xmub)
     .   + xmub/xmuw**2*(1.D0-xmusb(nj))**2*
     .     (-1.D0+x1+x2+xmusb(nj)-xmub) 
     .   + 2.D0*xmut/xmuw*(1.D0-xmusb(nj))*
     .     (-x1+x2-xmut-1.D0+xmusb(nj)+2.D0*xmub) 
     .   + 2.D0*xmub/xmuw*(1.D0-xmusb(nj))*
     .     (-x2+x1-xmub-1.D0+xmusb(nj)) ) 

c -------------------------------------------------------------------- c
c                             H+ exchange
c -------------------------------------------------------------------- c

      stsbothh=3.D0*g2**2*gctbr(ni,nj)**2*amw**2/gmst(ni)**2
     .     /dch(nj)**2*(
     .     (chtbrunr**2+chtbrunl**2)*(x1+x2+xmusb(nj)-1.D0-xmut-xmub)
     .     -4.D0*chtbrunr*chtbrunl*dsqrt(xmub*xmut) )

c -------------------------------------------------------------------- c
c                           gluino exchange
c -------------------------------------------------------------------- c

      stsbotgl=gs21*gs22*2.D0/3.D0/dgl**2*4.D0*(
     .     gtr(ni)*gtl(ni)*gbr(nj)*gbl(nj)*dsqrt(xmub*xmut)*(
     .     -4.D0*xmugl-4.D0*(1.D0+xmut-x2) ) +
     .     gtr(ni)*gtl(ni)*(gbr(nj)**2+gbl(nj)**2)*dsqrt(xmut*xmugl)*
     .     2.D0*(-xmut-xmub+xmusb(nj)+x2-1.D0) +
     .     gbr(nj)*gbl(nj)*(gtr(ni)**2+gtl(ni)**2)*dsqrt(xmub*xmugl)*
     .     2.D0*(x2-2.D0*xmut) +
     .     (gtr(ni)**2*gbl(nj)**2+gtl(ni)**2*gbr(nj)**2)*xmugl*
     .     (-1.D0-xmut-xmub+xmusb(nj)+x1+x2) +
     .     (gtr(ni)**2*gbr(nj)**2+gtl(ni)**2*gbl(nj)**2)*
     .     (1.D0+x1*x2-x1-x2-xmusb(nj)+xmub+xmut*(-xmub+xmusb(nj)+x2
     .      -x1-xmut)) )

c -------------------------------------------------------------------- c
c                        neutralino exchange
c -------------------------------------------------------------------- c

      stsbotneut = 0.D0

      do k=1,4,1
         do l=1,4,1
            stsbotneut=stsbotneut+3.D0*g2**2/dneut(k)/dneut(l)*(
     .          (abot(nj,k)*abot(nj,l)*atopr(ni,k)*atopr(ni,l)+
     .           bbot(nj,k)*bbot(nj,l)*btopr(ni,k)*btopr(ni,l))*
     .          ((1.D0-x1)*(1.D0-x2)-xmusb(nj)+xmut*(-x1+x2+xmusb(nj)
     .           -xmut-xmub)+xmub)
     .         +(abot(nj,k)*abot(nj,l)*btopr(ni,k)*btopr(ni,l)+
     .           bbot(nj,k)*bbot(nj,l)*atopr(ni,k)*atopr(ni,l))*
     .           xmneut(k)*xmneut(l)/gmst(ni)**2*(x1+x2-1.D0+xmusb(nj)
     .           -xmut-xmub)
     .         +(abot(nj,k)*bbot(nj,l)*atopr(ni,k)*btopr(ni,l)+
     .           bbot(nj,k)*abot(nj,l)*btopr(ni,k)*atopr(ni,l))*
     .           2.D0*dsqrt(xmub*xmut)*(-1.D0+x2-xmut)
     .         +dsqrt(xmub)*(x2-2.D0*xmut)*( xmneut(k)/gmst(ni)*
     .          (abot(nj,k)*bbot(nj,l)*btopr(ni,k)*btopr(ni,l)+
     .           bbot(nj,k)*abot(nj,l)*atopr(ni,k)*atopr(ni,l))
     .         +xmneut(l)/gmst(ni)*
     .          (abot(nj,k)*bbot(nj,l)*atopr(ni,k)*atopr(ni,l)+
     .           bbot(nj,k)*abot(nj,l)*btopr(ni,k)*btopr(ni,l)) )
     .         +dsqrt(xmut)*(-1.D0+x2+xmusb(nj)-xmub-xmut)* 
     .         (xmneut(k)/gmst(ni)*
     .          (abot(nj,k)*abot(nj,l)*btopr(ni,k)*atopr(ni,l)+
     .           bbot(nj,k)*bbot(nj,l)*atopr(ni,k)*btopr(ni,l))
     .         +xmneut(l)/gmst(ni)*
     .          (abot(nj,k)*abot(nj,l)*atopr(ni,k)*btopr(ni,l)+
     .           bbot(nj,k)*bbot(nj,l)*btopr(ni,k)*atopr(ni,l)) )
     .         +(abot(nj,l)*bbot(nj,k)*atopr(ni,k)*btopr(ni,l)+
     .           bbot(nj,l)*abot(nj,k)*btopr(ni,k)*atopr(ni,l))*
     .           (-2.D0)*dsqrt(xmub*xmut)*
     .             xmneut(k)*xmneut(l)/gmst(ni)**2 )
         end do
      end do

c -------------------------------------------------------------------- c
c                           H+ W interference
c -------------------------------------------------------------------- c

      stsbothw=-3.D0*g2**2*gctbr(ni,nj)*gwtb(ni,nj)*amw/gmst(ni)
     .     /dw(nj)/dch(nj)*
     .     (dsqrt(xmut)*chtbrunl*(xmusb(nj)+xmub-xmut+x2-x1-1.D0)
     .     +dsqrt(xmub)*chtbrunr*(-xmusb(nj)+xmub-xmut+x2-x1+1.D0)
     .     +dsqrt(xmut)/xmuw*chtbrunl*(xmusb(nj)-1.D0)*(xmut-xmub-x1-x2
     .      +1.D0-xmusb(nj))
     .     +dsqrt(xmub)/xmuw*chtbrunr*(xmusb(nj)-1.D0)*(xmut-xmub+x1+x2
     .      -1.D0+xmusb(nj)) )

c -------------------------------------------------------------------- c
c                       neutralino W interference
c -------------------------------------------------------------------- c

      stsbotwneut = 0.D0

      do l=1,4,1
         stsbotwneut=stsbotwneut
     .     +3.D0*g2**2/dw(nj)/dneut(l)*gwtb(ni,nj)*(
     .      bbot(nj,l)*btopr(ni,l)*dsqrt(xmut*xmub)*(1.D0/xmuw*
     .      (xmusb(nj)*(xmusb(nj)+xmut-xmub-2.D0)-xmut+xmub+1.D0) +
     .      2.D0*x2-xmusb(nj)-xmut+xmub-3.D0) +
     .      abot(nj,l)*atopr(ni,l)*(1.D0/xmuw*(1.D0-xmusb(nj))*(xmut*
     .      (xmusb(nj)+x2-xmut+xmub-1.D0)-x2*xmub) + xmut*(1.D0+x2+
     .      xmusb(nj)+xmub-2.D0*x1-xmut)-2.D0*xmusb(nj)+2.D0*x1*x2+2.D0
     .      -2.D0*x1-2.D0*x2+xmub*(2.D0-x2)) +
     .      bbot(nj,l)*atopr(ni,l)*dsqrt(xmub)*xmneut(l)/gmst(ni)*
     .      (1.D0/xmuw*
     .      (xmusb(nj)-1.D0)*(xmusb(nj)+x1+x2-1.D0-xmub+xmut)+x2-x1
     .      -xmusb(nj)-xmut+xmub+1.D0) +
     .      abot(nj,l)*btopr(ni,l)*dsqrt(xmut)*xmneut(l)/gmst(ni)*
     .      (1.D0/xmuw*
     .      (1.D0-xmusb(nj))*(xmusb(nj)+x1+x2-1.D0+xmub-xmut)+x2-x1
     .      +xmusb(nj)-xmut+xmub-1.D0) )
      end do

c -------------------------------------------------------------------- c
c                    neutralino Higgs interference
c -------------------------------------------------------------------- c

      stsbothcneut = 0.D0

      do l=1,4,1
         stsbothcneut=stsbothcneut
     .     +3.D0*g2**2*2.D0/dch(nj)/dneut(l)*
     .      (-gctbr(ni,nj))*amw/gmst(ni)*(
     .      (chtbrunr*btopr(ni,l)*abot(nj,l)+chtbrunl*atopr(ni,l)*
     .       bbot(nj,l))*dsqrt(xmut*xmub)*xmneut(l)/gmst(ni)*(-2.D0) +
     .      (chtbrunr*btopr(ni,l)*bbot(nj,l)+chtbrunl*atopr(ni,l)*
     .       abot(nj,l))*dsqrt(xmut)*(-1.D0-xmut-xmub+xmusb(nj)+x2) +
     .      (chtbrunr*atopr(ni,l)*bbot(nj,l)+chtbrunl*btopr(ni,l)*
     .       abot(nj,l))*xmneut(l)/gmst(ni)*(-1.D0-xmut-xmub+xmusb(nj)
     .       +x1+x2) +
     .      (chtbrunr*atopr(ni,l)*abot(nj,l)+chtbrunl*btopr(ni,l)*
     .       bbot(nj,l))*dsqrt(xmub)*(-2.D0*xmut+x2) )
      end do

c -------------------------------------------------------------------- c

      SD_stbbsbt = stsbotww+stsbothh+stsbothw+stsbotgl+stsbotneut+
     .             stsbotwneut+stsbothcneut

      end

c ==================================================================== c
c ====================== sbottom_1/2 tau+ nu_tau ===================== c
c ==================================================================== c

      double precision function SD_sttausbnu(x1,x2)

      implicit double precision (a-h,m,o-z)

      dimension gmst(2),gmsb(2),xmusb(2),dw(2),dch(2),gctbr(2,2)
      dimension gwtb(2,2),gwntau(2,2)
      dimension gul(2),gur(2),gdl(2),gdr(2),gtl(2),gtr(2),gbl(2),gbr(2)

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_indices/ni,nj
      COMMON/SD_hmass/ama,aml,amh,amch,amar
      COMMON/SD_fermion/amt,amb,amtau
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2
      COMMON/SD_scala/scalb,scalt
      COMMON/SD_yukawa/ytewsb,ybewsb,ytauewsb
      COMMON/SD_coup14/chctbl,chctbr,chctaunur,chctaunul
      COMMON/SD_coup20/gwtb,gwntau
      COMMON/SD_coup21/gtr,gtl,gbr,gbl,gur,gul,gdr,gdl
      COMMON/SD_runcoupscale/scalechoice,scaleofcoupling,inumloop
      COMMON/SD_mwmzpole/amwp,amzp

      gmst(1)=ast1
      gmst(2)=ast2
      gmsb(1)=asb1
      gmsb(2)=asb2

c --- the running couplings ---

      if(scalechoice.eq.1.D0) then
         scalb = ybewsb/dsqrt(g2)
         scalt = ytewsb/dsqrt(g2)
      elseif(scalechoice.eq.2.D0) then         
         call SD_runmass(gmst(ni),0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      elseif(scalechoice.eq.3.D0) then
         call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      endif

      call SD_hcsbotstop(gctbr)

c -----------------------------

      xmusb(1) = gmsb(1)**2/gmst(ni)**2
      xmusb(2) = gmsb(2)**2/gmst(ni)**2
      xmutau   = amtau**2/gmst(ni)**2
      xmuw     = amwp**2/gmst(ni)**2
      xmuch    = amch**2/gmst(ni)**2

      x3 = 2.D0-x1-x2

      dw(1)  = 1.D0-x3+xmusb(1)-xmuw
      dw(2)  = 1.D0-x3+xmusb(2)-xmuw
      dch(1) = 1.D0-x3+xmusb(1)-xmuch
      dch(2) = 1.D0-x3+xmusb(2)-xmuch

c -------------------------------------------------------------------- c
c                             W exchange
c -------------------------------------------------------------------- c

      ststauww=1.D0/4.D0/dw(nj)**2*gwtb(ni,nj)**2*( 
     .     4.D0*(1.D0+x1*x2-x1-x2-xmusb(nj)) + 
     .     xmutau*(3.D0-3.D0*x1+x2+xmusb(nj)-xmutau) 
     .     +xmutau/xmuw**2*(1.D0-xmusb(nj))**2*(-1.D0+xmusb(nj)+x1+x2
     .      -xmutau)
     .     +2.D0*xmutau/xmuw*(1.D0-xmusb(nj))*(-x1+x2-xmutau-1.D0+
     .      xmusb(nj)) )

c -------------------------------------------------------------------- c
c                             H+ exchange
c -------------------------------------------------------------------- c

      ststauhh=gctbr(ni,nj)**2*amw**2/gmst(ni)**2/dch(nj)**2*
     .     chctaunur**2*(x1+x2+xmusb(nj)-1.D0-xmutau)

c -------------------------------------------------------------------- c
c                          H+ W interference
c -------------------------------------------------------------------- c

      ststauhw=-gctbr(ni,nj)*gwtb(ni,nj)*amw/gmst(ni)/dw(nj)/dch(nj)*
     .      dsqrt(xmutau)*chctaunur*(
     .      1.D0+x1-x2+xmutau-xmusb(nj)+
     .      1.D0/xmuw*(xmusb(nj)-1.D0)*(-xmutau+x1+x2-1.D0+xmusb(nj))) 

c -------------------------------------------------------------------- c

      SD_sttausbnu = ststauww+ststauhh+ststauhw

      end

c ==================================================================== c
c ======================== sbottom_1/2 e+ nu_e ======================= c
c ==================================================================== c

      double precision function SD_stelsbnu(x1,x2)

      implicit double precision (a-h,m,o-z)

      dimension gmst(2),gmsb(2),xmusb(2),dw(2)
      dimension gwtb(2,2),gwntau(2,2)

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_indices/ni,nj
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2
      COMMON/SD_coup20/gwtb,gwntau
      COMMON/SD_mwmzpole/amwp,amzp

      gmst(1)=ast1
      gmst(2)=ast2
      gmsb(1)=asb1
      gmsb(2)=asb2

      xmusb(1) = gmsb(1)**2/gmst(ni)**2
      xmusb(2) = gmsb(2)**2/gmst(ni)**2
      xmuw     = amwp**2/gmst(ni)**2

      x3 = 2.D0-x1-x2

      dw(1) = 1.D0-x3+xmusb(1)-xmuw
      dw(2) = 1.D0-x3+xmusb(2)-xmuw

c -------------------------------------------------------------------- c
c                             W exchange
c -------------------------------------------------------------------- c

      stselww=1.D0/4.D0/dw(nj)**2*gwtb(ni,nj)**2*
     .        4.D0*(1.D0+x1*x2-x1-x2-xmusb(nj))

c -------------------------------------------------------------------- c

      SD_stelsbnu = stselww

      end

c ==================================================================== c
c =========================== stop1* top top ========================= c
c ==================================================================== c

      double precision function SD_st2st1startt(x1,x2)

      implicit double precision (a-h,m,o-z)
      dimension atopr(2,4),btopr(2,4)
      dimension amchar(2),dneut(4),xmuneut(4),amneut(4),xmneut(4)
      dimension gul(2),gur(2),gdl(2),gdr(2),gtl(2),gtr(2),gbl(2),gbr(2)

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_scala/scalb,scalt
      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2
      COMMON/SD_fermion/amt,amb,amtau
      COMMON/SD_weinberg/sw,cw
      COMMON/SD_runcoupscale/scalechoice,scaleofcoupling,inumloop
      COMMON/SD_coupewsb/alsew,g2ew,g1ew
      COMMON/SD_yukawa/ytewsb,ybewsb,ytauewsb
      COMMON/SD_gluino/mgluino
      COMMON/SD_coup21/gtr,gtl,gbr,gbl,gur,gul,gdr,gdl

      external SD_alphascall

c -- the Yukawa coupling --

      if(scalechoice.eq.1.D0) then
         scalb = ybewsb/dsqrt(g2)
         scalt = ytewsb/dsqrt(g2)
         gs2 = alsew*4.D0*pi
      elseif(scalechoice.eq.2.D0) then         
         call SD_runmass(ast2,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
         gs2 = SD_alphascall(ast2,inumloop)*4.D0*pi
      elseif(scalechoice.eq.3.D0) then
         call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
         gs2 = SD_alphascall(scaleofcoupling,inumloop)*4.D0*pi
      endif

      call SD_neutstoptop(atopr,btopr)

c --- several definitions ---

      xmut   = amt**2/ast2**2
      do i=1,4,1
         xmuneut(i) = amneut(i)**2/ast2**2
      end do
      xmugl  = mgluino**2/ast2**2
      xmust1 = ast1*2/ast2**2

      do i=1,4,1
         dneut(i) = 1.D0-x1+xmut-xmuneut(i)
      end do
      dgl = 1.D0-x1+xmut-xmugl

c -------------------------------------------------------------------- c
c                          neutralino exchange
c -------------------------------------------------------------------- c

      st2st1neut=0.D0

      do k=1,4,1
         do l=1,4,1
            st2st1neut=st2st1neut+1.D0/dneut(k)/dneut(l)*(
     .          (btopr(1,k)*btopr(1,l)*atopr(2,k)*atopr(2,l)+
     .           atopr(1,k)*atopr(1,l)*btopr(2,k)*btopr(2,l))*
     .          ((1.D0-x1)*(1.D0-x2)-xmust1+xmut*(x1-x2+xmust1
     .           -2.D0*xmut)+xmut)
     .         +(btopr(1,k)*btopr(1,l)*btopr(2,k)*btopr(2,l)+
     .           atopr(1,k)*atopr(1,l)*atopr(2,k)*atopr(2,l))*
     .           xmneut(k)*xmneut(l)/ast2**2*(x1+x2-1.D0+xmust1
     .           -2.D0*xmut)
     .         +(btopr(1,k)*atopr(1,l)*atopr(2,k)*btopr(2,l)+
     .           atopr(1,k)*btopr(1,l)*btopr(2,k)*atopr(2,l))*
     .           2.D0*xmut*(-1.D0+x1-xmut)
     .         +dsqrt(xmut)*(x1-2.D0*xmut)*(xmneut(k)/ast2*
     .          (btopr(1,k)*atopr(1,l)*btopr(2,k)*btopr(2,l)+
     .           atopr(1,k)*btopr(1,l)*atopr(2,k)*atopr(2,l))
     .         +xmneut(l)/ast2*
     .          (btopr(1,k)*atopr(1,l)*atopr(2,k)*atopr(2,l)+
     .           atopr(1,k)*btopr(1,l)*btopr(2,k)*btopr(2,l)) )
     .         +dsqrt(xmut)*(-1.D0+x1+xmust1-2.D0*xmut)* 
     .         (xmneut(k)/ast2*
     .          (btopr(1,k)*btopr(1,l)*btopr(2,k)*atopr(2,l)+
     .           atopr(1,k)*atopr(1,l)*atopr(2,k)*btopr(2,l))
     .         +xmneut(l)/ast2*
     .          (btopr(1,k)*btopr(1,l)*atopr(2,k)*btopr(2,l)+
     .           atopr(1,k)*atopr(1,l)*btopr(2,k)*atopr(2,l)) )
     .         +(btopr(1,l)*atopr(1,k)*atopr(2,k)*btopr(2,l)+
     .           atopr(1,l)*btopr(1,k)*btopr(2,k)*atopr(2,l))*
     .           (-2.D0)*xmut*xmneut(k)*xmneut(l)/ast2**2 )
         end do
      end do

c -------------------------------------------------------------------- c
c                             gluino exchange
c -------------------------------------------------------------------- c

      st2st1gg=1.D0/dgl**2*4.D0*( -4.D0*dsqrt(xmut*xmugl)*xmut*
     .     (gtr(2)*gtr(1)+gtl(1)*gtl(2))*(gtl(1)*gtr(2)+gtr(1)*gtl(2))
     .    +2.D0*dsqrt(xmut*xmugl)*(
     .     (gtl(1)*gtr(1)*(gtr(2)**2+gtl(2)**2)+gtr(2)*gtl(2)*
     .     (gtl(1)**2+gtr(1)**2))*x1 +
     .     gtr(2)*gtl(2)*(gtl(1)**2+gtr(1)**2)*(xmust1-1.D0))
     .    +(-2.D0)*xmut*xmugl*(gtl(1)*gtl(2)+gtr(2)*gtr(1))**2
     .    +xmut*((gtl(1)**2*gtr(2)**2+gtr(1)**2*gtl(2)**2)*(1.D0+x1
     .     -x2+xmust1)+4.D0*gtl(1)*gtr(2)*gtr(1)*gtl(2)*(x1-1.D0))
     .    +xmut**2*(-2.D0)*(gtl(1)*gtr(2)+gtr(1)*gtl(2))**2
     .    +xmugl*(gtl(1)**2*gtl(2)**2+gtr(2)**2*gtr(1)**2)*(x1+x2+
     .     xmust1-1.D0)
     .    +(gtl(1)**2*gtr(2)**2+gtr(1)**2*gtl(2)**2)*(x1*x2-x1-x2
     .     -xmust1+1.D0) )

c -------------------------------------------------------------------- c

      SD_st2st1startt=3.D0*g2**2*st2st1neut+
     .                2.D0/3.D0*gs2**2*st2st1gg

      end

c ==================================================================== c
c ========================== stop1 top topbar ======================== c
c ==================================================================== c

      double precision function SD_st2st1tt(x1,x2)

      implicit double precision (a-h,m,o-z)
      dimension atopr(2,4),btopr(2,4)
      dimension glttr(2,2),ghttr(2,2)
      dimension amchar(2),dneut(4),xmuneut(4),amneut(4),xmneut(4)
      dimension gztt(2,2),gzbb(2,2),gztautau(2,2)
      dimension gul(2),gur(2),gdl(2),gdr(2),gtl(2),gtr(2),gbl(2),gbr(2)

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_scala/scalb,scalt
      COMMON/SD_yukawa/ytewsb,ybewsb,ytauewsb
      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2
      COMMON/SD_hmass/ama,aml,amh,amch,amar
      COMMON/SD_fermion/amt,amb,amtau
      COMMON/SD_weinberg/sw,cw
      COMMON/SD_coup17/azztoptop,vzztoptop,azztautau,vzztautau,
     .                 azzneutneut,vzzneutneut,azzbotbot,vzzbotbot
      COMMON/SD_coup19/gztt,gzbb,gztautau
      COMMON/SD_runcoupscale/scalechoice,scaleofcoupling,inumloop
      COMMON/SD_coupewsb/alsew,g2ew,g1ew
      COMMON/SD_gluino/mgluino
      COMMON/SD_coup21/gtr,gtl,gbr,gbl,gur,gul,gdr,gdl
      COMMON/SD_mwmzpole/amwp,amzp

      external SD_alphascall

      aztt11=gztt(1,1)
      aztt12=gztt(1,2)
      aztt21=gztt(2,1)
      aztt22=gztt(2,2)

c -- the Yukawa coupling --

      if(scalechoice.eq.1.D0) then
         scalb = ybewsb/dsqrt(g2)
         scalt = ytewsb/dsqrt(g2)
         gs2 = alsew*4.D0*pi
      elseif(scalechoice.eq.2.D0) then         
         call SD_runmass(ast2,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
         gs2 = SD_alphascall(ast2,inumloop)*4.D0*pi
      elseif(scalechoice.eq.3.D0) then
         call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
         gs2 = SD_alphascall(scaleofcoupling,inumloop)*4.D0*pi
      endif

      call SD_higgsst1st2(glttr,ghttr,gattr)
      call SD_neutstoptop(atopr,btopr)
      call SD_phitoptop(hlttr,hhttr,hattr)

c --- several definitions ---

      xmut   = amt**2/ast2**2
      do i=1,4,1
         xmuneut(i) = amneut(i)**2/ast2**2
      end do
      xmugl  = mgluino**2/ast2**2
      xmuz   = amzp**2/ast2**2
      xmust1 = ast1*2/ast2**2
      xmuhl  = aml**2/ast2**2
      xmuhh  = amh**2/ast2**2
      xmuha  = ama**2/ast2**2

      x3  = 2.D0-x1-x2

      do i=1,4,1
         dneut(i) = 1.D0-x1+xmut-xmuneut(i)
      end do
      dgl = 1.D0-x1+xmut-xmugl
      dz  = 1.D0-x3+xmust1-xmuz
      dhl = 1.D0-x3+xmust1-xmuhl
      dhh = 1.D0-x3+xmust1-xmuhh
      dha = 1.D0-x3+xmust1-xmuha

      vzz = vzztoptop
      azz = azztoptop

c -------------------------------------------------------------------- c
c                              Z exchange
c -------------------------------------------------------------------- c

      st2st1zz = 1.D0/4.D0/cw**2/dz**2*aztt12**2*(
     .      8.D0*xmut*azz**2*(-x1-x2+xmust1+3.D0)
     .     -8.D0*(azz**2+vzz**2)*(x1+x2-1.D0+xmust1-x1*x2)
     .     -16.D0*azz**2*(1.D0-xmust1)**2*xmut/xmuz
     .     +8.D0*azz**2*xmut/xmuz**2*(1.D0-xmust1)**2*
     .     (x1+x2+xmust1-1.D0))

c -------------------------------------------------------------------- c
c                              Higgs exchange
c -------------------------------------------------------------------- c

      st2st1hk = (2.D0/ast2**2/dhl**2*(hlttr/dsqrt(2.D0))**2*
     .    amz**4/amw**2*glttr(1,2)**2
     .   +2.D0/ast2**2/dhh**2*(hhttr/dsqrt(2.D0))**2*
     .    amz**4/amw**2*ghttr(1,2)**2
     .   +4.D0/ast2**2/dhh/dhl*(hlttr/dsqrt(2.D0))*(hhttr/dsqrt(2.D0))*
     .    amz**4/amw**2*glttr(1,2)*ghttr(1,2))*
     .    (-1.D0+x1+x2+xmust1-4.D0*xmut)

      st2st1aa = 2.D0/ast2**2/dha**2*(hattr/dsqrt(2.D0))**2*
     .     amz**4/amw**2*gattr**2*(-1.D0+x1+x2+xmust1)

      st2st1higgs = st2st1hk+st2st1aa

c -------------------------------------------------------------------- c
c                          neutralino exchange
c -------------------------------------------------------------------- c

      st2st1neut=0.D0

      do k=1,4,1
         do l=1,4,1
            st2st1neut=st2st1neut+1.D0/dneut(k)/dneut(l)*(
     .          (atopr(1,k)*atopr(1,l)*atopr(2,k)*atopr(2,l)+
     .           btopr(1,k)*btopr(1,l)*btopr(2,k)*btopr(2,l))*
     .          ((1.D0-x1)*(1.D0-x2)-xmust1+xmut*(x1-x2+xmust1
     .           -2.D0*xmut)+xmut)
     .         +(atopr(1,k)*atopr(1,l)*btopr(2,k)*btopr(2,l)+
     .           btopr(1,k)*btopr(1,l)*atopr(2,k)*atopr(2,l))*
     .           xmneut(k)*xmneut(l)/ast2**2*(x1+x2-1.D0+xmust1
     .           -2.D0*xmut)
     .         +(atopr(1,k)*btopr(1,l)*atopr(2,k)*btopr(2,l)+
     .           btopr(1,k)*atopr(1,l)*btopr(2,k)*atopr(2,l))*
     .           2.D0*xmut*(-1.D0+x1-xmut)
     .         +dsqrt(xmut)*(x1-2.D0*xmut)*(xmneut(k)/ast2*
     .          (atopr(1,k)*btopr(1,l)*btopr(2,k)*btopr(2,l)+
     .           btopr(1,k)*atopr(1,l)*atopr(2,k)*atopr(2,l))
     .         +xmneut(l)/ast2*
     .          (atopr(1,k)*btopr(1,l)*atopr(2,k)*atopr(2,l)+
     .           btopr(1,k)*atopr(1,l)*btopr(2,k)*btopr(2,l)) )
     .         +dsqrt(xmut)*(-1.D0+x1+xmust1-2.D0*xmut)* 
     .         (xmneut(k)/ast2*
     .          (atopr(1,k)*atopr(1,l)*btopr(2,k)*atopr(2,l)+
     .           btopr(1,k)*btopr(1,l)*atopr(2,k)*btopr(2,l))
     .         +xmneut(l)/ast2*
     .          (atopr(1,k)*atopr(1,l)*atopr(2,k)*btopr(2,l)+
     .           btopr(1,k)*btopr(1,l)*btopr(2,k)*atopr(2,l)) )
     .         +(atopr(1,l)*btopr(1,k)*atopr(2,k)*btopr(2,l)+
     .           btopr(1,l)*atopr(1,k)*btopr(2,k)*atopr(2,l))*
     .           (-2.D0)*xmut*xmneut(k)*xmneut(l)/ast2**2 )
         end do
      end do

c -------------------------------------------------------------------- c
c                             gluino exchange
c -------------------------------------------------------------------- c

      st2st1gg=1.D0/dgl**2*4.D0*( -4.D0*dsqrt(xmut*xmugl)*xmut*
     .     (gtr(2)*gtl(1)+gtr(1)*gtl(2))*(gtr(1)*gtr(2)+gtl(1)*gtl(2))
     .    +2.D0*dsqrt(xmut*xmugl)*(
     .     (gtr(1)*gtl(1)*(gtr(2)**2+gtl(2)**2)+gtr(2)*gtl(2)*
     .     (gtr(1)**2+gtl(1)**2))*x1 +
     .     gtr(2)*gtl(2)*(gtr(1)**2+gtl(1)**2)*(xmust1-1.D0))
     .    +(-2.D0)*xmut*xmugl*(gtr(1)*gtl(2)+gtr(2)*gtl(1))**2
     .    +xmut*((gtr(1)**2*gtr(2)**2+gtl(1)**2*gtl(2)**2)*(1.D0+x1
     .     -x2+xmust1)+4.D0*gtr(1)*gtr(2)*gtl(1)*gtl(2)*(x1-1.D0))
     .    +xmut**2*(-2.D0)*(gtr(1)*gtr(2)+gtl(1)*gtl(2))**2
     .    +xmugl*(gtr(1)**2*gtl(2)**2+gtr(2)**2*gtl(1)**2)*(x1+x2+
     .     xmust1-1.D0)
     .    +(gtr(1)**2*gtr(2)**2+gtl(1)**2*gtl(2)**2)*(x1*x2-x1-x2
     .     -xmust1+1.D0) )

c -------------------------------------------------------------------- c
c                         neutralino Z interference
c -------------------------------------------------------------------- c

      st2st1neutz=0.D0

      do l=1,4,1
         st2st1neutz=st2st1neutz+aztt12/cw/dz/dneut(l)*(
     .      xmut*(atopr(1,l)*atopr(2,l)*(vzz-azz)+
     .            btopr(1,l)*btopr(2,l)*(vzz+azz))*(
     .      1.D0/xmuz*(xmust1*(xmust1-2.D0)+1.D0)+
     .      2.D0*x1-xmust1-3.D0)
     .     +(atopr(1,l)*atopr(2,l)*(vzz+azz)+
     .       btopr(1,l)*btopr(2,l)*(vzz-azz))*(
     .      1.D0/xmuz*(1.D0-xmust1)*(xmut*(xmust1+x1-1.D0)-x1*xmut)
     .      +xmut*(1.D0+x1+xmust1-2.D0*x2)-2.D0*xmust1+2.D0*x1*x2+2.D0
     .      -2.D0*(x1+x2)+xmut*(-x1+2.D0) )
     .     +dsqrt(xmut)*xmneut(l)/ast2*
     .      (atopr(1,l)*btopr(2,l)*(vzz-azz)+
     .       btopr(1,l)*atopr(2,l)*(vzz+azz))*(
     .      1.D0/xmuz*(xmust1-1.D0)*(xmust1+x1+x2-1.D0)+x1-x2-xmust1
     .      +1.D0 )
     .     +dsqrt(xmut)*xmneut(l)/ast2*
     .      (atopr(1,l)*btopr(2,l)*(vzz+azz)+
     .       btopr(1,l)*atopr(2,l)*(vzz-azz))*(
     .      1.D0/xmuz*(1.D0-xmust1)*(xmust1+x1+x2-1.D0)+x1-x2+xmust1
     .      -1.D0 ) )
      end do

c -------------------------------------------------------------------- c
c                       neutralino Higgs interference
c -------------------------------------------------------------------- c

      st2st1hneut=0.D0

      do l=1,4,1
         st2st1hneut=st2st1hneut-2.D0*(hlttr/dsqrt(2.D0)/dneut(l)
     .        /dhl/ast2*amz**2/amw*glttr(1,2)+hhttr/dsqrt(2.D0)/dneut(l)
     .        /dhh/ast2*amz**2/amw*ghttr(1,2))*(
     .        (atopr(1,l)*btopr(2,l)+atopr(2,l)*btopr(1,l))*
     .        xmneut(l)/ast2*(x1+x2+xmust1-1.D0-4.D0*xmut) 
     .        +(atopr(1,l)*atopr(2,l)+btopr(2,l)*btopr(1,l))*
     .        dsqrt(xmut)*(2.D0*x1-1.D0+xmust1-4.D0*xmut) )
     .        +2.D0*hattr/dsqrt(2.D0)/dneut(l)/dha/ast2*amz**2/amw*
     .        (-gattr)*(
     .        (atopr(1,l)*atopr(2,l)-btopr(2,l)*btopr(1,l))*
     .        dsqrt(xmut)*(1.D0-xmust1) +
     .        (atopr(1,l)*btopr(2,l)-atopr(2,l)*btopr(1,l))*
     .        xmneut(l)/ast2*(1.D0-x1-x2-xmust1) )
      end do

c -------------------------------------------------------------------- c
c                          Higgs Z interference
c -------------------------------------------------------------------- c

      st2st1hz=-2.D0/2.D0/cw*
     .   (aztt12*hlttr/dsqrt(2.D0)*amz**2/amw*glttr(1,2)
     .   /ast2/dz/dhl+aztt12*hhttr/dsqrt(2.D0)*amz**2/amw*ghttr(1,2)
     .   /ast2/dz/dhh)*2.D0*dsqrt(xmut)*vzz*2.D0*(x1-x2)
     .   +2.D0/2.D0/cw*
     .    aztt12*hattr/dsqrt(2.D0)*amz**2/amw*(-gattr)/ast2/dz/dha*
     .   (2.D0*dsqrt(xmut)*azz*(2.D0/xmuz*(1.D0+(xmust1-1.D0)*(x1
     .   +x2)+xmust1**2-2.D0*xmust1)+2.D0-2.D0*xmust1) )

c -------------------------------------------------------------------- c

      SD_st2st1tt=3.D0*g2**2*(st2st1zz+st2st1higgs+st2st1neut+
     .            st2st1neutz+st2st1hneut+st2st1hz) +
     .            gs2**2*2.D0/3.D0*st2st1gg

      end

c ==================================================================== c
c ======================= stop1 bottom bottombar ===================== c
c ==================================================================== c

      double precision function SD_st2st1bb(x1,x2)

      implicit double precision (a-h,m,o-z)

      dimension amchar(2),dchi(2),xmuchar(2),amneut(4),xmneut(4)
      dimension alstor(2,2),akstor(2,2),alstor1(2,2),blstor1(2,2),
     .          alstor2(2,2),blstor2(2,2)
      dimension glttr(2,2),ghttr(2,2)
      dimension gztt(2,2),gzbb(2,2),gztautau(2,2)

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_scala/scalb,scalt
      COMMON/SD_yukawa/ytewsb,ybewsb,ytauewsb
      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2
      COMMON/SD_hmass/ama,aml,amh,amch,amar
      COMMON/SD_fermion/amt,amb,amtau
      COMMON/SD_weinberg/sw,cw
      COMMON/SD_coup17/azztoptop,vzztoptop,azztautau,vzztautau,
     .                 azzneutneut,vzzneutneut,azzbotbot,vzzbotbot
      COMMON/SD_coup19/gztt,gzbb,gztautau
      COMMON/SD_runcoupscale/scalechoice,scaleofcoupling,inumloop
      COMMON/SD_mwmzpole/amwp,amzp

      aztt11=gztt(1,1)
      aztt12=gztt(1,2)
      aztt21=gztt(2,1)
      aztt22=gztt(2,2)

c --- the running couplings ---

      if(scalechoice.eq.1.D0) then
         scalb = ybewsb/dsqrt(g2)
         scalt = ytewsb/dsqrt(g2)
      elseif(scalechoice.eq.2.D0) then         
         call SD_runmass(ast2,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      elseif(scalechoice.eq.3.D0) then
         call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      endif

      call SD_higgsst1st2(glttr,ghttr,gattr)
      call SD_charstopbot(alstor,akstor)
      do i=1,2,1
         do j=1,2,1
            alstor1(i,j) = alstor(i,j)
            blstor1(i,j) = akstor(i,j)
            alstor2(i,j) = alstor(i,j)
            blstor2(i,j) = akstor(i,j)
         end do
      end do
     
      call SD_phibotbot(hlbbr,hhbbr,habbr)

c --- several definitions ---

      xmub       = amb**2/ast2**2
      xmuchar(1) = amchar(1)**2/ast2**2
      xmuchar(2) = amchar(2)**2/ast2**2
      xmuz       = amzp**2/ast2**2
      xmust1     = ast1**2/ast2**2
      xmuhl      = aml**2/ast2**2
      xmuhh      = amh**2/ast2**2
      xmuha      = ama**2/ast2**2

      x3  = 2.D0-x1-x2

      dchi(1) = 1.D0-x1+xmub-xmuchar(1)
      dchi(2) = 1.D0-x1+xmub-xmuchar(2)
      dz      = 1.D0-x3+xmust1-xmuz
      dhl     = 1.D0-x3+xmust1-xmuhl
      dhh     = 1.D0-x3+xmust1-xmuhh
      dha     = 1.D0-x3+xmust1-xmuha

      vzz = vzzbotbot
      azz = azzbotbot

c -------------------------------------------------------------------- c
c                               Z exchange
c -------------------------------------------------------------------- c

      st2st1zz = 1.D0/4.D0/cw**2/dz**2*aztt12**2*(
     .      8.D0*xmub*azz**2*(-x1-x2+xmust1+3.D0)
     .     -8.D0*(azz**2+vzz**2)*(x1+x2-1.D0+xmust1-x1*x2)
     .     -16.D0*azz**2*(1.D0-xmust1)**2*xmub/xmuz
     .     +8.D0*azz**2*xmub/xmuz**2*(1.D0-xmust1)**2*
     .     (x1+x2+xmust1-1.D0))

c -------------------------------------------------------------------- c
c                              Higgs exchange
c -------------------------------------------------------------------- c

      st2st1hk = (2.D0/ast2**2/dhl**2*(hlbbr/dsqrt(2.D0))**2*
     .    amz**4/amw**2*glttr(1,2)**2
     .   +2.D0/ast2**2/dhh**2*(hhbbr/dsqrt(2.D0))**2*
     .    amz**4/amw**2*ghttr(1,2)**2
     .   +4.D0/ast2**2/dhh/dhl*(hlbbr/dsqrt(2.D0))*(hhbbr/dsqrt(2.D0))*
     .    amz**4/amw**2*glttr(1,2)*ghttr(1,2))*
     .    (-1.D0+x1+x2+xmust1-4.D0*xmub)

      st2st1aa = 2.D0/ast2**2/dha**2*(habbr/dsqrt(2.D0))**2*
     .     amz**4/amw**2*gattr**2*(-1.D0+x1+x2+xmust1)

      st2st1higgs = st2st1hk+st2st1aa

c -------------------------------------------------------------------- c
c                          chargino exchange
c -------------------------------------------------------------------- c

      st2st1chi=0.D0

      do k=1,2,1
         do l=1,2,1
            st2st1chi=st2st1chi+1.D0/dchi(k)/dchi(l)*(
     .          (alstor2(1,k)*alstor2(1,l)*alstor1(2,k)*alstor1(2,l)+
     .           blstor2(1,k)*blstor2(1,l)*blstor1(2,k)*blstor1(2,l))*
     .          ((1.D0-x1)*(1.D0-x2)-xmust1+xmub*(x1-x2+xmust1
     .           -2.D0*xmub)+xmub)
     .         +(alstor2(1,k)*alstor2(1,l)*blstor1(2,k)*blstor1(2,l)+
     .           blstor2(1,k)*blstor2(1,l)*alstor1(2,k)*alstor1(2,l))*
     .           dsqrt(xmuchar(k)*xmuchar(l))*(x1+x2-1.D0+xmust1
     .           -2.D0*xmub)
     .         +(alstor2(1,k)*blstor2(1,l)*alstor1(2,k)*blstor1(2,l)+
     .           blstor2(1,k)*alstor2(1,l)*blstor1(2,k)*alstor1(2,l))*
     .           2.D0*xmub*(-1.D0+x1-xmub)
     .         +dsqrt(xmub)*(x1-2.D0*xmub)*(dsqrt(xmuchar(k))*
     .          (alstor2(1,k)*blstor2(1,l)*blstor1(2,k)*blstor1(2,l)+
     .           blstor2(1,k)*alstor2(1,l)*alstor1(2,k)*alstor1(2,l))
     .         +dsqrt(xmuchar(l))*
     .          (alstor2(1,k)*blstor2(1,l)*alstor1(2,k)*alstor1(2,l)+
     .           blstor2(1,k)*alstor2(1,l)*blstor1(2,k)*blstor1(2,l)) )
     .         +dsqrt(xmub)*(-1.D0+x1+xmust1-2.D0*xmub)* 
     .         (dsqrt(xmuchar(k))*
     .          (alstor2(1,k)*alstor2(1,l)*blstor1(2,k)*alstor1(2,l)+
     .           blstor2(1,k)*blstor2(1,l)*alstor1(2,k)*blstor1(2,l))
     .         +dsqrt(xmuchar(l))*
     .          (alstor2(1,k)*alstor2(1,l)*alstor1(2,k)*blstor1(2,l)+
     .           blstor2(1,k)*blstor2(1,l)*blstor1(2,k)*alstor1(2,l)) )
     .         +(alstor2(1,l)*blstor2(1,k)*alstor1(2,k)*blstor1(2,l)+
     .           blstor2(1,l)*alstor2(1,k)*blstor1(2,k)*alstor1(2,l))*
     .           (-2.D0)*xmub*dsqrt(xmuchar(k))*dsqrt(xmuchar(l)) )
         end do
      end do

c -------------------------------------------------------------------- c
c                         chargino Z interference
c -------------------------------------------------------------------- c

      st2st1chiz=0.D0

      do l=1,2,1
         st2st1chiz=st2st1chiz+aztt12/cw/dz/dchi(l)*(
     .      xmub*(alstor2(1,l)*alstor1(2,l)*(vzz-azz)+
     .            blstor2(1,l)*blstor1(2,l)*(vzz+azz))*(
     .      1.D0/xmuz*(xmust1*(xmust1-2.D0)+1.D0)+
     .      2.D0*x1-xmust1-3.D0)
     .     +(alstor2(1,l)*alstor1(2,l)*(vzz+azz)+
     .       blstor2(1,l)*blstor1(2,l)*(vzz-azz))*(
     .      1.D0/xmuz*(1.D0-xmust1)*(xmub*(xmust1+x1-1.D0)-x1*xmub)
     .      +xmub*(1.D0+x1+xmust1-2.D0*x2)-2.D0*xmust1+2.D0*x1*x2+2.D0
     .      -2.D0*(x1+x2)+xmub*(-x1+2.D0) )
     .     +dsqrt(xmub)*dsqrt(xmuchar(l))*
     .      (alstor2(1,l)*blstor1(2,l)*(vzz-azz)+
     .       blstor2(1,l)*alstor1(2,l)*(vzz+azz))*(
     .      1.D0/xmuz*(xmust1-1.D0)*(xmust1+x1+x2-1.D0)+x1-x2-xmust1
     .      +1.D0 )
     .     +dsqrt(xmub)*dsqrt(xmuchar(l))*
     .      (alstor2(1,l)*blstor1(2,l)*(vzz+azz)+
     .       blstor2(1,l)*alstor1(2,l)*(vzz-azz))*(
     .      1.D0/xmuz*(1.D0-xmust1)*(xmust1+x1+x2-1.D0)+x1-x2+xmust1
     .      -1.D0 ) )
      end do

c -------------------------------------------------------------------- c
c                       chargino Higgs interference
c -------------------------------------------------------------------- c

      st2st1hchi=0.D0

      do l=1,2,1
         st2st1hchi=st2st1hchi-2.D0*(hlbbr/dsqrt(2.D0)/dchi(l)
     .        /dhl/ast2*amz**2/amw*glttr(1,2)+hhbbr/dsqrt(2.D0)/dchi(l)
     .        /dhh/ast2*amz**2/amw*ghttr(1,2))*(
     .        (alstor2(1,l)*blstor1(2,l)+alstor1(2,l)*blstor2(1,l))*
     .        dsqrt(xmuchar(l))*(x1+x2+xmust1-1.D0-4.D0*xmub) 
     .        +(alstor2(1,l)*alstor1(2,l)+blstor1(2,l)*blstor2(1,l))*
     .        dsqrt(xmub)*(2.D0*x1-1.D0+xmust1-4.D0*xmub) )
     .        +2.D0*habbr/dsqrt(2.D0)/dchi(l)/dha/ast2*amz**2/amw*
     .        (-gattr)*(
     .        (alstor2(1,l)*alstor1(2,l)-blstor1(2,l)*blstor2(1,l))*
     .        dsqrt(xmub)*(1.D0-xmust1) +
     .        (alstor2(1,l)*blstor1(2,l)-alstor1(2,l)*blstor2(1,l))*
     .        dsqrt(xmuchar(l))*(1.D0-x1-x2-xmust1) )
      end do

c -------------------------------------------------------------------- c
c                         Z Higgs interference
c -------------------------------------------------------------------- c

      st2st1hz=-2.D0/2.D0/cw*
     .   (aztt12*hlbbr/dsqrt(2.D0)*amz**2/amw*glttr(1,2)
     .   /ast2/dz/dhl+aztt12*hhbbr/dsqrt(2.D0)*amz**2/amw*ghttr(1,2)
     .   /ast2/dz/dhh)*2.D0*dsqrt(xmub)*vzz*2.D0*(x1-x2)
     .   +2.D0/2.D0/cw*
     .    aztt12*habbr/dsqrt(2.D0)*amz**2/amw*(-gattr)/ast2/dz/dha*
     .   (2.D0*dsqrt(xmub)*azz*(2.D0/xmuz*(1.D0+(xmust1-1.D0)*(x1
     .   +x2)+xmust1**2-2.D0*xmust1)+2.D0-2.D0*xmust1) )

c -------------------------------------------------------------------- c

      SD_st2st1bb=st2st1zz+st2st1higgs+st2st1chi+st2st1chiz+st2st1hchi+
     .            st2st1hz

      end

c ==================================================================== c
c =========================== stop1 up upbar ========================= c
c ==================================================================== c

      double precision function SD_st2st1uu(x1,x2)

      implicit double precision (a-h,m,o-z)
      dimension gztt(2,2),gzbb(2,2),gztautau(2,2)

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2
      COMMON/SD_weinberg/sw,cw
      COMMON/SD_coup17/azztoptop,vzztoptop,azztautau,vzztautau,
     .                 azzneutneut,vzzneutneut,azzbotbot,vzzbotbot
      COMMON/SD_coup19/gztt,gzbb,gztautau
      COMMON/SD_mwmzpole/amwp,amzp

      aztt11=gztt(1,1)
      aztt12=gztt(1,2)
      aztt21=gztt(2,1)
      aztt22=gztt(2,2)

      xmuz   = amzp**2/ast2**2
      xmust1 = ast1*2/ast2**2

      x3  = 2.D0-x1-x2
      dz  = 1.D0-x3+xmust1-xmuz

      vzz = vzztoptop 
      azz = azztoptop

c -------------------------------------------------------------------- c
c                              Z exchange
c -------------------------------------------------------------------- c

      st2st1zz = 1.D0/4.D0/cw**2/dz**2*aztt12**2*
     .           2.D0*(vzz**2+azz**2)*4.D0*(1.D0+x1*x2-x1-x2-xmust1) 

c ----------------------------------------------------------------- c

      SD_st2st1uu=st2st1zz

      end

c ==================================================================== c
c ========================= stop1 down downbar ======================= c
c ==================================================================== c

      double precision function SD_st2st1dd(x1,x2)

      implicit double precision (a-h,m,o-z)
      dimension gztt(2,2),gzbb(2,2),gztautau(2,2)

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2
      COMMON/SD_weinberg/sw,cw
      COMMON/SD_coup17/azztoptop,vzztoptop,azztautau,vzztautau,
     .                 azzneutneut,vzzneutneut,azzbotbot,vzzbotbot
      COMMON/SD_coup19/gztt,gzbb,gztautau
      COMMON/SD_mwmzpole/amwp,amzp

      aztt11=gztt(1,1)
      aztt12=gztt(1,2)
      aztt21=gztt(2,1)
      aztt22=gztt(2,2)

      xmuz   = amzp**2/ast2**2
      xmust1 = ast1*2/ast2**2

      x3  = 2.D0-x1-x2
      dz  = 1.D0-x3+xmust1-xmuz

      vzz = vzzbotbot
      azz = azzbotbot

c -------------------------------------------------------------------- c
c                              Z exchange
c -------------------------------------------------------------------- c

      st2st1zz = 1.D0/4.D0/cw**2/dz**2*aztt12**2*
     .     2.D0*(vzz**2+azz**2)*4.D0*(1.D0+x1*x2-x1-x2-xmust1)

c -------------------------------------------------------------------- c

      SD_st2st1dd=st2st1zz

      end

c ==================================================================== c
c ============================= stop1 e+ e- ========================== c
c ==================================================================== c

      double precision function SD_st2st1ee(x1,x2)

      implicit double precision (a-h,m,o-z)
      dimension gztt(2,2),gzbb(2,2),gztautau(2,2)

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2
      COMMON/SD_weinberg/sw,cw
      COMMON/SD_coup17/azztoptop,vzztoptop,azztautau,vzztautau,
     .                 azzneutneut,vzzneutneut,azzbotbot,vzzbotbot
      COMMON/SD_coup19/gztt,gzbb,gztautau
      COMMON/SD_mwmzpole/amwp,amzp

      aztt11=gztt(1,1)
      aztt12=gztt(1,2)
      aztt21=gztt(2,1)
      aztt22=gztt(2,2)

      xmuz   = amzp**2/ast2**2
      xmust1 = ast1*2/ast2**2

      x3  = 2.D0-x1-x2
      dz  = 1.D0-x3+xmust1-xmuz

      vzz = vzztautau
      azz = azztautau

c -------------------------------------------------------------------- c
c                              Z exchange
c -------------------------------------------------------------------- c

      st2st1zz = 1.D0/4.D0/cw**2/dz**2*aztt12**2*
     .     2.D0*(vzz**2+azz**2)*4.D0*(1.D0+x1*x2-x1-x2-xmust1)

c -------------------------------------------------------------------- c

      SD_st2st1ee=st2st1zz

      end

c ==================================================================== c
c =========================== stop1 nu nubar ========================= c
c ==================================================================== c

      double precision function SD_st2st1nunu(x1,x2)

      implicit double precision (a-h,m,o-z)
      dimension gztt(2,2),gzbb(2,2),gztautau(2,2)

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2
      COMMON/SD_weinberg/sw,cw
      COMMON/SD_coup17/azztoptop,vzztoptop,azztautau,vzztautau,
     .                 azzneutneut,vzzneutneut,azzbotbot,vzzbotbot
      COMMON/SD_coup19/gztt,gzbb,gztautau
      COMMON/SD_mwmzpole/amwp,amzp

      aztt11=gztt(1,1)
      aztt12=gztt(1,2)
      aztt21=gztt(2,1)
      aztt22=gztt(2,2)

      xmuz   = amzp**2/ast2**2
      xmust1 = ast1*2/ast2**2

      x3  = 2.D0-x1-x2
      dz  = 1.D0-x3+xmust1-xmuz

      vzz = vzzneutneut
      azz = azzneutneut

c -------------------------------------------------------------------- c
c                              Z exchange
c -------------------------------------------------------------------- c

      st2st1zz = 1.D0/4.D0/cw**2/dz**2*aztt12**2*
     .     2.D0*(vzz**2+azz**2)*4.D0*(1.D0+x1*x2-x1-x2-xmust1) 

c -------------------------------------------------------------------- c

      SD_st2st1nunu=st2st1zz

      end

c ==================================================================== c
c =========================== stop1 tau+ tau- ======================== c
c ==================================================================== c

      double precision function SD_st2st1tautau(x1,x2)

      implicit double precision (a-h,m,o-z)

      dimension glttr(2,2),ghttr(2,2),gztt(2,2),gzbb(2,2),gztautau(2,2)

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_hmass/ama,aml,amh,amch,amar
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2
      COMMON/SD_fermion/amt,amb,amtau
      COMMON/SD_weinberg/sw,cw
      COMMON/SD_mixang/a,tanbeta
      COMMON/SD_yukawa/yt,yb,ytau
      COMMON/SD_scala/scalb,scalt
      COMMON/SD_coup17/azztoptop,vzztoptop,azztautau,vzztautau,
     .                 azzneutneut,vzzneutneut,azzbotbot,vzzbotbot
      COMMON/SD_coup19/gztt,gzbb,gztautau
      COMMON/SD_runcoupscale/scalechoice,scaleofcoupling,inumloop
      COMMON/SD_mwmzpole/amwp,amzp

      aztt11=gztt(1,1)
      aztt12=gztt(1,2)
      aztt21=gztt(2,1)
      aztt22=gztt(2,2)

      bet=datan(tanbeta)
      b  =bet

c --- the running couplings ---

      if(scalechoice.eq.1.D0) then
         scalb = yb/dsqrt(g2)
         scalt = yt/dsqrt(g2)
      elseif(scalechoice.eq.2.D0) then         
         call SD_runmass(ast2,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      elseif(scalechoice.eq.3.D0) then
         call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      endif

      call SD_higgsst1st2(glttr,ghttr,gattr)

c --- several definitions ---

      xmuz   = amzp**2/ast2**2
      xmutau = amtau**2/ast2**2
      xmust1 = ast1*2/ast2**2
      xmuhl  = aml**2/ast2**2
      xmuhh  = amh**2/ast2**2
      xmuha  = ama**2/ast2**2

      x3  = 2.D0-x1-x2
      dz  = 1.D0-x3+xmust1-xmuz
      dhl = 1.D0-x3+xmust1-xmuhl
      dhh = 1.D0-x3+xmust1-xmuhh
      dha = 1.D0-x3+xmust1-xmuha

      vzz = vzztautau
      azz = azztautau

      scaltau = ytau/dsqrt(g2)

c -------------------------------------------------------------------- c
c                              Z exchange
c -------------------------------------------------------------------- c

      st2st1zz = 1.D0/4.D0/cw**2/dz**2*aztt12**2*(
     .   1.D0/xmuz**2*(4.D0*(vzz**2-azz**2)*xmutau*(1.D0-(x1+x2)*(1.D0  
     .   -xmust1)**2+xmust1*(-xmust1**2+3.D0*xmust1-3.D0))+
     .   2.D0*(vzz**2+azz**2)*(1.D0-xmust1)**2*(2.D0*xmutau*(xmust1
     .   +x1+x2-1.D0)) )
     .   +1.D0/xmuz*(8.D0*(vzz**2-azz**2)*xmutau*(1.D0-xmust1)**2+
     .   4.D0*(vzz**2+azz**2)*(1.D0-xmust1)*2.D0*xmutau*(xmust1-1.D0))
     .   +4.D0*(vzz**2-azz**2)*xmutau*(x1+x2-xmust1-3.D0)
     .   +2.D0*(vzz**2+azz**2)*(4.D0*(1.D0+x1*x2-x1-x2-xmust1)+
     .   xmutau*(-2.D0*x1-2.D0*x2+2.D0*xmust1+6.D0)) )

c -------------------------------------------------------------------- c
c                             Higgs exchange
c -------------------------------------------------------------------- c

      st2st1hk = (2.D0/ast2**2/dhl**2*(-scaltau/dsqrt(2.D0)*dsin(a))**2*
     .    amz**4/amw**2*glttr(1,2)**2
     .   +2.D0/ast2**2/dhh**2*(scaltau/dsqrt(2.D0)*dcos(a))**2*
     .    amz**4/amw**2*ghttr(1,2)**2
     .   +4.D0/ast2**2/dhh/dhl*(-scaltau/dsqrt(2.D0)*dsin(a))*
     .    (scaltau/dsqrt(2.D0)*dcos(a))*
     .    amz**4/amw**2*glttr(1,2)*ghttr(1,2))*
     .    (-1.D0+x1+x2+xmust1-4.D0*xmutau)

      st2st1aa = 2.D0/ast2**2/dha**2*(scaltau/dsqrt(2.D0)*dsin(b))**2*
     .     amz**4/amw**2*gattr**2*(-1.D0+x1+x2+xmust1)

      st2st1higgs = st2st1hk+st2st1aa

c -------------------------------------------------------------------- c
c                           Higgs Z interference
c -------------------------------------------------------------------- c

      st2st1hz= -1.D0/cw*
     .   (aztt12*(-scaltau/dsqrt(2.D0)*dsin(a))*amz**2/amw*glttr(1,2)
     .   /ast2/dz/dhl
     .   +aztt12*scaltau/dsqrt(2.D0)*dcos(a)*amz**2/amw*ghttr(1,2)
     .   /ast2/dz/dhh)*2.D0*dsqrt(xmutau)*vzz*2.D0*(x1-x2)
     .   + 1.D0/cw*
     .    aztt12*(-scaltau/dsqrt(2.D0)*dsin(b))*amz**2/amw*
     .   (-gattr)/ast2/dz/dha*
     .   (2.D0*dsqrt(xmutau)*azz*(2.D0/xmuz*(1.D0+(xmust1-1.D0)*(x1
     .   +x2)+xmust1**2-2.D0*xmust1)+2.D0-2.D0*xmust1) )

c -------------------------------------------------------------------- c

      SD_st2st1tautau=st2st1zz+st2st1higgs+st2st1hz

      end

c ==================================================================== c
c                       sbottom1/2 2-body decays                       c
c ==================================================================== c

      subroutine SD_sb2bod(sb1neutt,sb2neutt,sb1chart,sb2chart,sb1glui,
     .                  sb2glui,sb1hcst,sb2hl,sb2hh,sb2ha,sb2hcst,
     .                  sb1wst,sb2wst,sb2zbot,qcdsb1neut,qcdsb2neut,
     .                  qcdsb1chart,qcdsb2chart,qcdsb1glui,qcdsb2glui,
     .                  qcdsb1hcst,qcdsb2hcst,qcdsb2hl,qcdsb2hh,
     .                  qcdsb2ha,qcdsb2zbot,qcdsb1wst,qcdsb2wst)

      implicit double precision (a-h,m,o-z)
      double precision SD_lamb,lamv,nf
      integer nj

      dimension sb1neutt(4),sb2neutt(4),sb1chart(2),sb2chart(2),
     .          sb1hcst(2),sb2hcst(2),sb1wst(2),sb2wst(2)
      dimension amneut(4),xmneut(4),amchar(2),gmst(2)
      dimension abot(2,4),bbot(2,4),alsbot(2,2),aksbot(2,2)
      dimension gztt(2,2),gzbb(2,2),gztautau(2,2)
      dimension gwtb(2,2),gwntau(2,2),gctbr(2,2),glbbr(2,2),ghbbr(2,2)
      dimension qcdsb1hcst(2),qcdsb2hcst(2)
      dimension qcdsb1neut(4),qcdsb2neut(4)
      dimension qcdsb1chart(2),qcdsb2chart(2)
      dimension qcdsb1wst(2),qcdsb2wst(2)

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_hmass/ama,aml,amh,amch,amar
      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_gluino/mgluino
      COMMON/SD_fermion/amt,amb,amtau
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2
      COMMON/SD_squarkud/asup1,asup2,asdown1,asdown2
      COMMON/SD_sfmixang/thet,theb,thel,cum,sum,cdm,sdm,cem,sem
      COMMON/SD_scala/scalb,scalt
      COMMON/SD_yukawa/ytewsb,ybewsb,ytauewsb
      COMMON/SD_runmcalc/rmtc,rmbc,rmtauc
      COMMON/SD_coup19/gztt,gzbb,gztautau
      COMMON/SD_coup20/gwtb,gwntau
      COMMON/SD_mixang/alp_mssm,tanbeta
      COMMON/SD_coupewsb/alsew,g2ew,g1ew
      COMMON/SD_runcoupscale/scalechoice,scaleofcoupling,inumloop
      COMMON/SD_refscale/amuref
      COMMON/SD_mwmzpole/amwp,amzp
      COMMON/SD_weinberg/sw,cw

      external SD_lamb
      external SD_alphascall,SD_runmass,SD_yuk
      external SD_glbneut,SD_grbneut,SD_corrreali,SD_glbchar,SD_grbchar
      external SD_gamtop1,SD_gamtop2,SD_gamglui1,SD_gamglui2,
     .         SD_gamglui3,SD_gam11,SD_gam12,SD_gamvirt,SD_gamcfdec,
     .         SD_gamreal
      external SD_gvirtgl,SD_gvirtmix,SD_sbotstop1719,SD_dcounterhc,
     .         SD_realcorr
      external SD_gvirtmixdiv,SD_botneut1719,SD_dcounterneut

c -- the scales necessary for the QCD corrections --

      lamv = 1.D-15
      amuv = 1000.D20

c -- the stop masses --

      gmst(1) = ast1
      gmst(2) = ast2

c --- the running couplings ---

      if(scalechoice.eq.1.D0) then
         gs21 = alsew*4.D0*pi
         gs22 = gs21
      elseif(scalechoice.eq.2.D0) then         
         gs21 = SD_alphascall(asb1,inumloop)*4.D0*pi
         gs22 = SD_alphascall(asb2,inumloop)*4.D0*pi
      elseif(scalechoice.eq.3.D0) then
         gs21 = SD_alphascall(scaleofcoupling,inumloop)*4.D0*pi
         gs22 = gs21
      endif

      if(scalechoice.eq.1.D0) then
         scalb = ybewsb/dsqrt(g2)
         scalt = ytewsb/dsqrt(g2)
         amurefer = amuref
      elseif(scalechoice.eq.3.D0) then
         call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
         amurefer = scaleofcoupling
      endif

c -------------------------------------------------------------------- c
c  sbottom1 --> chi0_1/chi0_2/chi0_3/chi0_4 + bottom

      if(scalechoice.eq.2.D0) then         
         call SD_runmass(asb1,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
         amurefer = asb1
      endif

      call SD_neutsbotbot(abot,bbot)

      do i=1,4,1
         if(asb1.gt.(amneut(i)+amb)) then
            sb1neutt(i)=g2*((abot(1,i)**2+bbot(1,i)**2)*(asb1**2-
     .           amb**2-amneut(i)**2)-4.D0*abot(1,i)*bbot(1,i)*
     .           amb*xmneut(i))*SD_lamb(amb/asb1,amneut(i)/asb1)
     .           /(16*pi*asb1)
         else
            sb1neutt(i)=0.D0
         endif
      end do

c --- the QCD corrections ---

      amuvdiv = amuv/amurefer

      do j=1,4,1
         if(asb1.gt.(amneut(j)+amb)) then
            if(xmneut(j).le.0.D0) then
               jsign = 1
            else
               jsign = 0
            endif
            qcdsb1neut(j) = -g2/24.D0/pi**2/asb1*gs21/(4.D0*pi)*
     .           ((bbot(1,j)*SD_glbneut(1,j,amuv,amuvdiv,lamv)
     .            +abot(1,j)*SD_grbneut(1,j,amuv,amuvdiv,lamv))*
     .           (asb1**2-amb**2-amneut(j)**2)
     .           -2.D0*(bbot(1,j)*SD_grbneut(1,j,amuv,amuvdiv,lamv)
     .                 +abot(1,j)*SD_glbneut(1,j,amuv,amuvdiv,lamv))*
     .           amb*xmneut(j))*SD_lamb(amb/asb1,amneut(j)/asb1) 
     .           +g2/(6.D0*pi**2*asb1)*gs21/(4.D0*pi)*
     .           SD_corrreali(amb,amneut(j),asb1,lamv,1,jsign,1,j,2)
         else
            qcdsb1neut(j) = 0.D0
         endif
      end do
      
c -------------------------------------------------------------------- c
c  sbottom2 --> chi0_1/chi0_2/chi0_3/chi0_4 + bottom

      if(scalechoice.eq.2.D0) then         
         call SD_runmass(asb2,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
         amurefer = asb2
      endif

      call SD_neutsbotbot(abot,bbot)

      do i=1,4,1
         if(asb2.gt.(amneut(i)+amb)) then
            sb2neutt(i)=g2*((abot(2,i)**2+bbot(2,i)**2)*(asb2**2-
     .           amb**2-amneut(i)**2)-4.D0*abot(2,i)*bbot(2,i)*
     .           amb*xmneut(i))*SD_lamb(amb/asb2,amneut(i)/asb2)
     .           /(16*pi*asb2)
         else
            sb2neutt(i)=0.D0
         endif
      end do

c --- the QCD corrections ---

      amuvdiv = amuv/amurefer

      do j=1,4,1
         if(asb2.gt.(amneut(j)+amb)) then
            if(xmneut(j).le.0.D0) then
               jsign = 1
            else
               jsign = 0
            endif

            qcdsb2neut(j) = -g2/24.D0/pi**2/asb2*gs22/(4.D0*pi)*
     .           ((bbot(2,j)*SD_glbneut(2,j,amuv,amuvdiv,lamv)
     .            +abot(2,j)*SD_grbneut(2,j,amuv,amuvdiv,lamv))*
     .           (asb2**2-amb**2-amneut(j)**2)
     .           -2.D0*(bbot(2,j)*SD_grbneut(2,j,amuv,amuvdiv,lamv)
     .                 +abot(2,j)*SD_glbneut(2,j,amuv,amuvdiv,lamv))*
     .           amb*xmneut(j))*SD_lamb(amb/asb2,amneut(j)/asb2) 
     .           +g2/(6.D0*pi**2*asb2)*gs22/(4.D0*pi)*
     .           SD_corrreali(amb,amneut(j),asb2,lamv,1,jsign,2,j,2)
         else
            qcdsb2neut(j) = 0.D0
         endif
      end do
      
c -------------------------------------------------------------------- c
c  sbottom1 --> chi-_1/chi-_2 + top

      if(scalechoice.eq.2.D0) then         
         call SD_runmass(asb1,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
         amurefer = asb1
      endif

      call SD_charsbottop(alsbot,aksbot)

      do i=1,2,1
         if(asb1.gt.(amchar(i)+amt)) then
            sb1chart(i)=g2*((alsbot(1,i)**2+aksbot(1,i)**2)*
     .           (asb1**2-amt**2-amchar(i)**2)
     .           -4.D0*alsbot(1,i)*aksbot(1,i)*
     .           amt*amchar(i))*SD_lamb(amt/asb1,amchar(i)/asb1)
     .           /(16*pi*asb1)
         else
            sb1chart(i)=0.D0
         endif
      end do

c --- the QCD corrections ---

      amuvdiv = amuv/amurefer

      do j=1,2,1
         if(asb1.gt.(amchar(j)+amt)) then
            jsign = 0

            qcdsb1chart(j) = -g2/24.D0/pi**2/asb1*gs21/(4.D0*pi)*
     .           ((aksbot(1,j)*SD_glbchar(1,j,amuv,amuvdiv,lamv)
     .            +alsbot(1,j)*SD_grbchar(1,j,amuv,amuvdiv,lamv))*
     .           (asb1**2-amt**2-amchar(j)**2)
     .           -2.D0*(aksbot(1,j)*SD_grbchar(1,j,amuv,amuvdiv,lamv)
     .                 +alsbot(1,j)*SD_glbchar(1,j,amuv,amuvdiv,lamv))*
     .           amt*amchar(j))*SD_lamb(amt/asb1,amchar(j)/asb1) 
     .           +g2/(6.D0*pi**2*asb1)*gs21/(4.D0*pi)*
     .           SD_corrreali(amt,amchar(j),asb1,lamv,2,jsign,1,j,2)
         else
            qcdsb1chart(j) = 0.D0
         endif
      end do

c -------------------------------------------------------------------- c
c  sbottom2 --> chi-_1/chi-_2 + top

      if(scalechoice.eq.2.D0) then         
         call SD_runmass(asb2,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
         amurefer = asb2
      endif

      call SD_charsbottop(alsbot,aksbot)

      do i=1,2,1
         if(asb2.gt.(amchar(i)+amt)) then
            sb2chart(i)=g2*((alsbot(2,i)**2+aksbot(2,i)**2)*
     .           (asb2**2-amt**2-amchar(i)**2)
     .           -4.D0*alsbot(2,i)*aksbot(2,i)*
     .           amt*amchar(i))*SD_lamb(amt/asb2,amchar(i)/asb2)
     .           /(16*pi*asb2)
         else
            sb2chart(i)=0.D0
         endif
      end do

c --- the QCD corrections ---

      amuvdiv = amuv/amurefer

      do j=1,2,1
         if(asb2.gt.(amchar(j)+amt)) then
            jsign = 0

            qcdsb2chart(j) = -g2/24.D0/pi**2/asb2*gs22/(4.D0*pi)*
     .           ((aksbot(2,j)*SD_glbchar(2,j,amuv,amuvdiv,lamv)
     .            +alsbot(2,j)*SD_grbchar(2,j,amuv,amuvdiv,lamv))*
     .           (asb2**2-amt**2-amchar(j)**2)
     .           -2.D0*(aksbot(2,j)*SD_grbchar(2,j,amuv,amuvdiv,lamv)
     .                 +alsbot(2,j)*SD_glbchar(2,j,amuv,amuvdiv,lamv))*
     .           amt*amchar(j))*SD_lamb(amt/asb2,amchar(j)/asb2) 
     .           +g2/(6.D0*pi**2*asb2)*gs22/(4.D0*pi)*
     .           SD_corrreali(amt,amchar(j),asb2,lamv,2,jsign,2,j,2)
         else
            qcdsb2chart(j) = 0.D0
         endif
      end do

c -------------------------------------------------------------------- c
c  sbottom1 --> gluino + bottom

      if(asb1.gt.(mgluino+amb)) then
         sb1glui = 8.D0*gs21*((asb1**2-amb**2-mgluino**2)+4.D0*amb*
     .        mgluino*dsin(theb)*dcos(theb))*
     .        SD_lamb(amb/asb1,mgluino/asb1)/(16.D0*pi*asb1)/3.D0  
      else
         sb1glui = 0.D0
      endif

c --- the QCD corrections ---

      if(scalechoice.eq.2.D0) then         
         amurefer = asb1
      endif

      if(asb1.gt.(mgluino+amb)) then
         amsq    = 2.D0*(asup1+asup2+asdown1+asdown2)/8.D0
         scalmur = amurefer
         alp     = gs21/(4.D0*pi)
         nf      = 6.D0
         qcdsb1glui = 8.D0*pi*alp/3.D0/amb**2*sb1glui*
     .        SD_gamtop1(asb1,asb2,amb,mgluino,theb,1,amuv,lamv) +
     .        16.D0*pi*alp**2*SD_lamb(amb/asb1,mgluino/asb1)/
     .        (9.D0*amb**2*asb1)*
     .        SD_gamtop2(asb1,asb2,amb,mgluino,theb,1,amuv) +
     .        4.D0*pi*alp/mgluino**2*sb1glui*(nf-2.D0)*
     .        SD_gamglui1(ast1,ast2,amsq,amt,mgluino,amuv) +
     .        2.D0*pi*alp/mgluino**2*sb1glui*
     .        SD_gamglui2(ast1,ast2,amt,thet,asb1,asb2,amb,theb,
     .                    mgluino,1,amuv) +
     .        4.D0*pi*alp*3.D0/mgluino**2*sb1glui*
     .        SD_gamglui3(mgluino,amuv,lamv) +
     .        8.D0*4.D0/3.D0*pi*alp*sb1glui*
     .        SD_gam11(asb1,asb2,amb,mgluino,theb,1,amuv,lamv) +
     .        8.D0*16.D0/9.D0*pi*alp**2/asb1*
     .        SD_lamb(amb/asb1,mgluino/asb1)*
     .        SD_gam12(asb1,asb2,amb,mgluino,theb,1,amuv,lamv,scalmur) +
     .        alp**2*SD_lamb(amb/asb1,mgluino/asb1)/asb1*
     .        SD_gamvirt(asb1,asb2,amb,mgluino,theb,1,amuv,lamv) +
     .        alp**2*SD_gamreal(asb1,amb,mgluino,theb,1,lamv) +
     .        alp/(4.D0*pi)*sb1glui*
     .        SD_gamcfdec(ast1,ast2,amt,asb1,asb2,amb,mgluino,amsq,amuv,
     .        scalmur)
      else
         qcdsb1glui = 0.D0
      endif

c -------------------------------------------------------------------- c
c  sbottom2 --> gluino + bottom

      if(asb2.gt.(mgluino+amb)) then
         sb2glui = 8.D0*gs22*((asb2**2-amb**2-mgluino**2)-4.D0*amb*
     .        mgluino*dsin(theb)*dcos(theb))*
     .        SD_lamb(amb/asb2,mgluino/asb2)/(16.D0*pi*asb2)/3.D0
      else
         sb2glui = 0.D0
      endif

c --- the QCD corrections ---

      if(scalechoice.eq.2.D0) then         
         amurefer = asb2
      endif

      if(asb2.gt.(mgluino+amb)) then
         amsq    = 2.D0*(asup1+asup2+asdown1+asdown2)/8.D0
         scalmur = amurefer
         alp     = gs22/(4.D0*pi)
         nf      = 6.D0
         qcdsb2glui = 8.D0*pi*alp/3.D0/amb**2*sb2glui*
     .        SD_gamtop1(asb2,asb1,amb,mgluino,theb,2,amuv,lamv) +
     .        16.D0*pi*alp**2*SD_lamb(amb/asb2,mgluino/asb2)/
     .        (9.D0*amb**2*asb2)*
     .        SD_gamtop2(asb2,asb1,amb,mgluino,theb,2,amuv) +
     .        4.D0*pi*alp/mgluino**2*sb2glui*(nf-2.D0)*
     .        SD_gamglui1(ast2,ast1,amsq,amt,mgluino,amuv) +
     .        2.D0*pi*alp/mgluino**2*sb2glui*
     .        SD_gamglui2(ast2,ast1,amt,thet,asb2,asb1,amb,theb,
     .                    mgluino,2,amuv) +
     .        4.D0*pi*alp*3.D0/mgluino**2*sb2glui*
     .        SD_gamglui3(mgluino,amuv,lamv) +
     .        8.D0*4.D0/3.D0*pi*alp*sb2glui*
     .        SD_gam11(asb2,asb1,amb,mgluino,theb,2,amuv,lamv) +
     .        8.D0*16.D0/9.D0*pi*alp**2/asb2*
     .        SD_lamb(amb/asb2,mgluino/asb2)*
     .        SD_gam12(asb2,asb1,amb,mgluino,theb,2,amuv,lamv,scalmur) +
     .        alp**2*SD_lamb(amb/asb2,mgluino/asb2)/asb2*
     .        SD_gamvirt(asb2,asb1,amb,mgluino,theb,2,amuv,lamv) +
     .        alp**2*SD_gamreal(asb2,amb,mgluino,theb,2,lamv) +
     .        alp/(4.D0*pi)*sb2glui*
     .        SD_gamcfdec(ast2,ast1,amt,asb2,asb1,amb,mgluino,amsq,amuv,
     .        scalmur)
      else
         qcdsb2glui = 0.D0
      endif

c -------------------------------------------------------------------- c
c  sbottom1 --> H- + stop1/2

      if(scalechoice.eq.1.D0) then
         scalb = ybewsb/dsqrt(g2)
         scalt = ytewsb/dsqrt(g2)
         runmt = rmtc
         runmb = rmbc
         amurefer = amuref
      elseif(scalechoice.eq.2.D0) then         
         call SD_runmass(asb1,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
         amurefer = asb1
      elseif(scalechoice.eq.3.D0) then
         call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
         amurefer = scaleofcoupling
      endif

      call SD_hcsbotstop(gctbr)

      do i=1,2,1
         if(asb1.gt.(gmst(i)+amch)) then
            sb1hcst(i)=g2*amw**2*gctbr(i,1)**2*
     .           SD_lamb(gmst(i)/asb1,amch/asb1)/(16.D0*pi*asb1)
         else
            sb1hcst(i)=0.D0
         endif
      end do

c --- the QCD corrections ---

      amuvdiv = amuv/amurefer

      do nj=1,2,1
      if(asb1.gt.(gmst(nj)+amch)) then
         alp = gs21/(4.D0*pi)
         delta11c = -dsqrt(2.D0)*amw**2*gctbr(nj,1)*
     .        SD_gvirtgl(gmst(nj),amch,asb1,lamv,amuv)
         delta12c =  -dsqrt(2.D0)*amw**2*gctbr(3-nj,1)*
     .        1.D0/(gmst(3-nj)**2-gmst(nj)**2)*
     .        SD_gvirtmix(ast1,ast2,gmst(nj),mgluino,runmt,thet,amuv)
     .        -dsqrt(2.D0)*amw**2*gctbr(nj,2)*
     .        1.D0/(asb2**2-asb1**2)*
     .        SD_gvirtmix(asb1,asb2,asb1,mgluino,runmb,theb,amuv)
         delta13c = SD_sbotstop1719(amuv,1,nj)
         delta14c = SD_dcounterhc(asb1,runmb,theb,1,gmst(nj),runmt,
     .                         thet,nj,mgluino,amuv,amuvdiv,lamv,nj,1)
         delta15c = SD_realcorr(amch,asb1,gmst(nj),lamv,4,0,nj,1,asb1)

         qcdsb1hcst(nj) = -g2*amw**2/(24.D0*dsqrt(2.D0)*pi*amw**2*
     .        asb1)*alp/pi*SD_lamb(gmst(nj)/asb1,amch/asb1)*
     .        gctbr(nj,1)*(delta11c+delta12c+delta13c+delta14c+delta15c)

      else
         qcdsb1hcst(nj) = 0.D0
      endif
      end do

c -------------------------------------------------------------------- c
c sbottom2 --> Higgs + sbottom1

      if(scalechoice.eq.1.D0) then
         scalb = ybewsb/dsqrt(g2)
         scalt = ytewsb/dsqrt(g2)
         runmt = rmtc
         runmb = rmbc
         amurefer = amuref
      elseif(scalechoice.eq.2.D0) then         
         call SD_runmass(asb2,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
         amurefer = asb2
      elseif(scalechoice.eq.3.D0) then
         call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
         amurefer = scaleofcoupling
      endif

c -------------------------------------------------------------------- c
c sbottom2 --> h + sbottom1

      call SD_higgssb1sb2(glbbr,ghbbr,gabbr)

      if(asb2.gt.(asb1+aml)) then
         sb2hl=g2*amz**4/amw**2*glbbr(2,1)**2*
     .         SD_lamb(asb1/asb2,aml/asb2)/(16.D0*pi*asb2)
      else
         sb2hl=0.D0
      endif

c --- the QCD corrections ---

      amuvdiv = amuv/amurefer

      if(asb2.gt.(asb1+aml)) then
         alp = gs22/(4.D0*pi)
         delta1l = -dsqrt(2.D0)*amz**2*glbbr(2,1)*
     .        SD_gvirtgl(asb2,aml,asb1,lamv,amuv)
         delta2l =  -dsqrt(2.D0)*amz**2*glbbr(2,2)*
     .        1.D0/(asb2**2-asb1**2)*
     .        SD_gvirtmixdiv(asb1,asb2,asb1,mgluino,runmb,theb,amuv)
     .        -dsqrt(2.D0)*amz**2*glbbr(1,1)*
     .        1.D0/(asb1**2-asb2**2)*
     .        SD_gvirtmixdiv(asb1,asb2,asb2,mgluino,runmb,theb,amuv)
         delta3l = SD_botneut1719(1,amuv)
         delta4l = SD_dcounterneut(asb1,asb2,runmb,theb,mgluino,amuv,
     .                          amuvdiv,lamv,2,1)
         delta5l = SD_realcorr(aml,asb2,asb1,lamv,1,2,2,1,asb2)

         qcdsb2hl = -g2*amz**2/(24.D0*dsqrt(2.D0)*pi*amw**2*asb2)*
     .        alp/pi*SD_lamb(asb1/asb2,aml/asb2)*glbbr(2,1)*
     .        (delta1l+delta2l+delta3l+delta4l+delta5l)
      else
         qcdsb2hl = 0.D0
      endif

c -------------------------------------------------------------------- c
c  sbottom2 --> H + sbottom1

      if(asb2.gt.(asb1+amh)) then
         sb2hh=g2*amz**4/amw**2*ghbbr(2,1)**2*
     .         SD_lamb(asb1/asb2,amh/asb2)/(16.D0*pi*asb2)
      else
         sb2hh=0.D0
      endif

c --- the QCD corrections ---

      amuvdiv = amuv/amurefer

      if(asb2.gt.(asb1+amh)) then
         alp = gs22/(4.D0*pi)
         delta1h = -dsqrt(2.D0)*amz**2*ghbbr(2,1)*
     .        SD_gvirtgl(asb2,amh,asb1,lamv,amuv)
         delta2h =  -dsqrt(2.D0)*amz**2*ghbbr(2,2)*
     .        1.D0/(asb2**2-asb1**2)*
     .        SD_gvirtmixdiv(asb1,asb2,asb1,mgluino,runmb,theb,amuv)
     .        -dsqrt(2.D0)*amz**2*ghbbr(1,1)*
     .        1.D0/(asb1**2-asb2**2)*
     .        SD_gvirtmixdiv(asb1,asb2,asb2,mgluino,runmb,theb,amuv)
         delta3h = SD_botneut1719(2,amuv)
         delta4h = SD_dcounterneut(asb1,asb2,runmb,theb,mgluino,amuv,
     .                          amuvdiv,lamv,2,2)
         delta5h = SD_realcorr(amh,asb2,asb1,lamv,2,2,2,1,asb2)

         qcdsb2hh = -g2*amz**2/(24.D0*dsqrt(2.D0)*pi*amw**2*asb2)*
     .        alp/pi*SD_lamb(asb1/asb2,amh/asb2)*ghbbr(2,1)*
     .        (delta1h+delta2h+delta3h+delta4h+delta5h)
      else
         qcdsb2hh = 0.D0
      endif

c -------------------------------------------------------------------- c
c  sbottom2 --> A + sbottom1

      if(asb2.gt.(asb1+ama)) then
         sb2ha=g2*amz**4/amw**2*gabbr**2*
     .         SD_lamb(asb1/asb2,ama/asb2)/(16.D0*pi*asb2)
      else
         sb2ha=0.D0
      endif

c --- the QCD corrections ---

      amuvdiv = amuv/amurefer

      if(asb2.gt.(asb1+ama)) then
         alp = gs22/(4.D0*pi)
         delta1a = dsqrt(2.D0)*amz**2*gabbr*
     .        SD_gvirtgl(asb2,ama,asb1,lamv,amuv)
         delta2a = 0.D0 
         delta3a = SD_botneut1719(3,amuv)
         delta4a = SD_dcounterneut(asb1,asb2,runmb,theb,mgluino,amuv,
     .                          amuvdiv,lamv,2,3)
         delta5a = SD_realcorr(ama,asb2,asb1,lamv,3,2,2,1,asb2)

         qcdsb2ha = g2*amz**2/(24.D0*dsqrt(2.D0)*pi*amw**2*asb2)*
     .        alp/pi*SD_lamb(asb1/asb2,ama/asb2)*gabbr*
     .        (delta1a+delta2a+delta3a+delta4a+delta5a)
      else
         qcdsb2ha = 0.D0
      endif

c -------------------------------------------------------------------- c
c  sbottom2 --> H- + stop1/2

      if(scalechoice.eq.1.D0) then
         scalb = ybewsb/dsqrt(g2)
         scalt = ytewsb/dsqrt(g2)
         runmt = rmtc
         runmb = rmbc
         amurefer = amuref
      elseif(scalechoice.eq.2.D0) then         
         call SD_runmass(asb2,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
         amurefer = asb2
      elseif(scalechoice.eq.3.D0) then
         call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
         amurefer = scaleofcoupling
      endif

      call SD_hcsbotstop(gctbr)

      do i=1,2,1
         if(asb2.gt.(gmst(i)+amch)) then
            sb2hcst(i)=g2*amw**2*gctbr(i,2)**2*
     .           SD_lamb(gmst(i)/asb2,amch/asb2)/(16.D0*pi*asb2)
         else
            sb2hcst(i)=0.D0
         endif
      end do

c --- the QCD corrections ---

      amuvdiv = amuv/amurefer

      do nj=1,2,1
      if(asb2.gt.(gmst(nj)+amch)) then
         alp = gs22/(4.D0*pi)
         delta21c = -dsqrt(2.D0)*amw**2*gctbr(nj,2)*
     .        SD_gvirtgl(gmst(nj),amch,asb2,lamv,amuv)
         delta22c =  -dsqrt(2.D0)*amw**2*gctbr(3-nj,2)*
     .        1.D0/(gmst(3-nj)**2-gmst(nj)**2)*
     .        SD_gvirtmix(ast1,ast2,gmst(nj),mgluino,runmt,thet,amuv)
     .        -dsqrt(2.D0)*amw**2*gctbr(nj,1)*
     .        1.D0/(asb1**2-asb2**2)*
     .        SD_gvirtmix(asb1,asb2,asb2,mgluino,runmb,theb,amuv)
         delta23c = SD_sbotstop1719(amuv,2,nj)
         delta24c = SD_dcounterhc(asb2,runmb,theb,2,gmst(nj),runmt,
     .                         thet,nj,mgluino,amuv,amuvdiv,lamv,nj,2)
         delta25c = SD_realcorr(amch,asb2,gmst(nj),lamv,4,0,nj,2,asb2)

         qcdsb2hcst(nj) = -g2*amw**2/(24.D0*dsqrt(2.D0)*pi*amw**2*
     .        asb2)*alp/pi*SD_lamb(gmst(nj)/asb2,amch/asb2)*
     .        gctbr(nj,2)*(delta21c+delta22c+delta23c+delta24c+delta25c)

      else
         qcdsb2hcst(nj) = 0.D0
      endif
      end do

c -------------------------------------------------------------------- c
c  sbottom2 --> Z + sbottom1

      if(asb2.gt.(asb1+amzp)) then
         sb2zbot=g2/64.D0/pi/cw**2/amzp**2*asb2**3*gzbb(2,1)**2*
     .           SD_lamb(asb1/asb2,amzp/asb2)**3
      else
         sb2zbot=0.D0
      endif

c -- the QCD corrections --

      if(asb2.gt.(asb1+amzp)) then
         alp = gs22/(4.D0*pi)
         del1 = -alp/3.D0/pi*gzbb(2,1)/2.D0/cw*
     .        SD_gluonvertex(asb2,asb1,amzp,lamv,amuv)
         del2 = -alp/3.D0/pi/cw*SD_gluinoZvertex(asb2,asb1,amzp,lamv,
     .        amuv,mgluino,amb,-1.D0/2.D0,-1.D0/3.D0,sw,theb)
         del3 = alp/pi*SD_wavefuncvertex(asb2,asb1,amb,amb,
     .     theb,theb,1.D0,2.D0,2,1,mgluino,lamv,amuv)
         del4 = alp/pi*SD_quarkmixZ(asb2,theb,-1.D0/2.D0,-1.D0/3.D0,
     .     asb1,asb2,amb,mgluino,amuv)
         del5 = SD_realgluonem(asb2,asb1,amzp,lamv)
         qcdsb2zbot =  g2/16.D0/pi/amzp**2*asb2**3*(gzbb(2,1)/2.D0/cw)*
     .        SD_lamb(asb1/asb2,amzp/asb2)**3*(2.D0*del1+2.D0*del2
     .        +2.D0*del3+2.D0*del4) + 
     .        g2/3.D0/pi**2/asb2*alp*(gzbb(2,1)/(2.D0*cw))**2*del5
      else
         qcdsb2zbot = 0.D0
      endif

c -------------------------------------------------------------------- c
c  sbottom1 --> W- + stop1/2

      do i=1,2,1
         if(asb1.gt.(gmst(i)+amwp)) then
            sb1wst(i)=g2/32.D0/pi/amwp**2*asb1**3*gwtb(i,1)**2*
     .                SD_lamb(gmst(i)/asb1,amwp/asb1)**3
         else
            sb1wst(i)=0.D0
         endif
      end do

c -- the QCD corrections --

      do i=1,2,1
         if(asb1.gt.(gmst(i)+amwp)) then
            alp = gs21/(4.D0*pi)
            del1 = -alp/3.D0/pi*gwtb(i,1)/dsqrt(2.D0)*
     .           SD_gluonvertex(asb1,gmst(i),amwp,lamv,amuv)
            del2 = -dsqrt(2.D0)/3.D0*alp/pi*
     .           SD_gluinoWvertex(asb1,gmst(i),amwp,lamv,amuv,mgluino,
     .           amb,amt,theb,thet,1,i)
            del3 = alp/pi*SD_wavefuncvertex(asb1,gmst(i),amb,amt,
     .           theb,thet,2.D0,2.D0,1,i,mgluino,lamv,amuv)
            del4 = alp/pi*SD_quarkmixW(asb1,theb,-1.D0/2.D0,-1.D0/3.D0,
     .             asb1,asb2,amb,gmst(i),thet,1.D0/2.D0,2.D0/3.D0,
     .             ast1,ast2,amt,1,i,mgluino,amuv)
            del5 = SD_realgluonem(asb1,gmst(i),amwp,lamv)
            qcdsb1wst(i) = g2/16.D0/pi/amwp**2*asb1**3*
     .           (gwtb(i,1)/dsqrt(2.D0))*
     .           SD_lamb(gmst(i)/asb1,amwp/asb1)**3*(2.D0*del1+2.D0*del2
     .           +2.D0*del3+2.D0*del4) + 
     .           g2/3.D0/pi**2/asb1*alp*(gwtb(i,1)/dsqrt(2.D0))**2*del5
         else
            qcdsb1wst(i) = 0.D0
         endif
      end do

c -------------------------------------------------------------------- c
c  sbottom2 --> W- + stop1/2

      do i=1,2,1
         if(asb2.gt.(gmst(i)+amwp)) then
            sb2wst(i)=g2/32.D0/pi/amwp**2*asb2**3*gwtb(i,2)**2*
     .                SD_lamb(gmst(i)/asb2,amwp/asb2)**3
         else
            sb2wst(i)=0.D0
         endif
      end do

c -- the QCD corrections --

      amuv = 1.D20
      lamv = 1.D-30

      do i=1,2,1
         if(asb2.gt.(gmst(i)+amwp)) then
            alp = gs22/(4.D0*pi)
            del1 = -alp/3.D0/pi*gwtb(i,2)/dsqrt(2.D0)*
     .           SD_gluonvertex(asb2,gmst(i),amwp,lamv,amuv)
            del2 = -dsqrt(2.D0)/3.D0*alp/pi*
     .           SD_gluinoWvertex(asb2,gmst(i),amwp,lamv,amuv,mgluino,
     .           amb,amt,theb,thet,2,i)
            del3 = alp/pi*SD_wavefuncvertex(asb2,gmst(i),amb,amt,
     .           theb,thet,2.D0,2.D0,2,i,mgluino,lamv,amuv)
            del4 = alp/pi*SD_quarkmixW(asb2,theb,-1.D0/2.D0,-1.D0/3.D0,
     .             asb1,asb2,amb,gmst(i),thet,1.D0/2.D0,2.D0/3.D0,
     .             ast1,ast2,amt,2,i,mgluino,amuv)
            del5 = SD_realgluonem(asb2,gmst(i),amwp,lamv)
            qcdsb2wst(i) = g2/16.D0/pi/amwp**2*asb2**3*
     .           (gwtb(i,2)/dsqrt(2.D0))*
     .           SD_lamb(gmst(i)/asb2,amwp/asb2)**3*(2.D0*del1+2.D0*del2
     .           +2.D0*del3+2.D0*del4) + 
     .           g2/3.D0/pi**2/asb2*alp*(gwtb(i,2)/dsqrt(2.D0))**2*del5
         else
            qcdsb2wst(i) = 0.D0
         endif
      end do

      end

c ==================================================================== c
c                       The sbottom 3-body decays                      c
c ==================================================================== c

      subroutine SD_xintegsbottom(xintegsb2sb1bb,xintegsb2sb1tt,
     .     xintegsb2sb1uu,xintegsb2sb1dd,xintegsb2sb1ee,
     .     xintegsb2sb1nunu,xintegsb2sb1tautau,xintegsb2sb1starbb,
     .     xintegsbtstsb,xintegsbtbstb,xintegsbtaustnu,xintegsbelstnu,
     .     xintegsbupstdow,xintegsbstau,xintegsbsntau,xintegsbsel,
     .     xintegsbsnel)

      implicit double precision (a-h,m,o-z)  
      integer nx1t,ny1t

      dimension xintegsbtstsb(2,2),xintegsbtbstb(2,2),
     .          xintegsbtaustnu(2,2),xintegsbelstnu(2,2),
     .          xintegsbupstdow(2,2),xintegsbstau(2,2),
     .          xintegsbsntau(2,2),xintegsbsel(2,2),xintegsbsnel(2)
      dimension amneut(4),xmneut(4),amchar(2)
      dimension gmsb(2),gmst(2),gmstau(2),gmsel(2),gmsne(2),gmsnt(2)

      external SD_ay,SD_by,SD_ax,SD_bx
      external SD_sb2sb1bb,SD_sb2sb1tt,SD_sb2sb1uu,SD_sb2sb1dd,
     .         SD_sb2sb1ee,SD_sb2sb1nunu,SD_sb2sb1tautau,
     .         SD_sb2sb1starbb,SD_sbtststarb,SD_sbtbstb,SD_sbtaustnu,
     .         SD_sbelstnu,SD_sbtnustau,SD_sbtsnutau,SD_sbtnusel,
     .         SD_sbtsnuel

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_hmass/ama,aml,amh,amch,amar
      COMMON/SD_fermion/amt,amb,amtau
      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2
      COMMON/SD_sfermionetau/ase1,ase2,astau1,astau2
      COMMON/SD_sneutrino/asne1,asne2,asntau1,asntau2
      COMMON/SD_nx1/nx1t,ny1t
      COMMON/SD_indices/ni,nj

      gmst(1) = ast1
      gmst(2) = ast2
      gmsb(1) = asb1
      gmsb(2) = asb2

      gmstau(1) = astau1
      gmstau(2) = astau2
      gmsel(1)  = ase1
      gmsel(2)  = ase2
      gmsne(1)  = asne1
      gmsne(2)  = asne2
      gmsnt(1)  = asntau1
      gmsnt(2)  = asntau2

c ----------------------- sbottom1, sbottom2 decays ------------------ c

c -------------------------------------------------------------------- c
c ------------------------- t stau neutrino_tau ---------------------- c
c -------------------------------------------------------------------- c

      do ni=1,2,1
         do nj=1,2,1
            xmu1=amt**2/gmsb(ni)**2
            xmu2=0.D0
            xmu3=gmstau(nj)**2/gmsb(ni)**2

            if(gmsb(ni).gt.(amt+gmstau(nj))) then
               call SD_integ2(SD_sbtnustau,SD_ax,SD_bx,SD_ay,SD_by,
     .              xmu1,xmu2,xmu3,nx1t,ny1t,sum)
               xintegsbstau(ni,nj)=g2**2/32.D0/(2.D0*pi)**3*gmsb(ni)*
     .              sum
            else
               xintegsbstau(ni,nj)=0.D0
            endif
         end do
      end do

c -------------------------------------------------------------------- c
c ------------------------- t sneutrino_tau tau ---------------------- c
c -------------------------------------------------------------------- c

      do ni=1,2,1
         do nj=1,2,1
            xmu1=amt**2/gmsb(ni)**2
            xmu2=amtau**2/gmsb(ni)**2
            xmu3=gmsnt(nj)**2/gmsb(ni)**2

            if(gmsb(ni).gt.(gmsnt(nj)+amt+amtau)) then
               call SD_integ2(SD_sbtsnutau,SD_ax,SD_bx,SD_ay,SD_by,
     .              xmu1,xmu2,xmu3,nx1t,ny1t,sum)
               xintegsbsntau(ni,nj)=g2**2/32.D0/(2.D0*pi)**3*
     .              gmsb(ni)*sum
            else
               xintegsbsntau(ni,nj)=0.D0
            endif
         end do
      end do

c -------------------------------------------------------------------- c
c ----------------------- t selectron neutrino_e --------------------- c
c -------------------------------------------------------------------- c

      do ni=1,2,1
         do nj=1,2,1
            xmu1=amt**2/gmsb(ni)**2
            xmu2=0.D0
            xmu3=gmsel(nj)**2/gmsb(ni)**2

            if(gmsb(ni).gt.(gmsel(nj)+amt)) then
               call SD_integ2(SD_sbtnusel,SD_ax,SD_bx,SD_ay,SD_by,xmu1,
     .              xmu2,xmu3,nx1t,ny1t,sum)
               xintegsbsel(ni,nj)=g2**2/32.D0/(2.D0*pi)**3*gmsb(ni)*
     .              sum
            else
               xintegsbsel(ni,nj)=0.D0
            endif
         end do
      end do

c -------------------------------------------------------------------- c
c ----------------------- t sneutrino_e electron --------------------- c
c -------------------------------------------------------------------- c

      do ni=1,2,1
         xmu1=amt**2/gmsb(ni)**2
         xmu2=0.D0
         xmu3=gmsne(1)**2/gmsb(ni)**2

         if(gmsb(ni).gt.(gmsne(1)+amt)) then
            call SD_integ2(SD_sbtsnuel,SD_ax,SD_bx,SD_ay,SD_by,xmu1,
     .           xmu2,xmu3,nx1t,ny1t,sum)
            xintegsbsnel(ni)=g2**2/32.D0/(2.D0*pi)**3*gmsb(ni)*sum
         else
            xintegsbsnel(ni)=0.D0
         endif
      end do

c -------------------------------------------------------------------- c
c ------------------------- stop_1/2* bottom top --------------------- c
c -------------------------------------------------------------------- c

      do ni=1,2,1
         do nj=1,2,1
            xmu1=amt**2/gmsb(ni)**2
            xmu2=amb**2/gmsb(ni)**2
            xmu3=gmst(nj)**2/gmsb(ni)**2

            if(gmsb(ni).gt.(amt+amb+gmst(nj))) then
               call SD_integ2(SD_sbtststarb,SD_ax,SD_bx,SD_ay,SD_by,
     .              xmu1,xmu2,xmu3,nx1t,ny1t,sum)
               xintegsbtstsb(ni,nj)=1.D0/32.D0/(2.D0*pi)**3*gmsb(ni)*sum
            else
               xintegsbtstsb(ni,nj)=0.D0
            endif
         end do
      end do

c -------------------------------------------------------------------- c
c ----------------------- stop_1/2 bottom topbar --------------------- c
c -------------------------------------------------------------------- c

      do ni=1,2,1
         do nj=1,2,1
            xmu1=amt**2/gmsb(ni)**2
            xmu2=amb**2/gmsb(ni)**2
            xmu3=gmst(nj)**2/gmsb(ni)**2

            if(gmsb(ni).gt.(amt+amb+gmst(nj))) then
               call SD_integ2(SD_sbtbstb,SD_ax,SD_bx,SD_ay,SD_by,xmu1,
     .              xmu2,xmu3,nx1t,ny1t,sum)
               xintegsbtbstb(ni,nj)=1.D0/32.D0/(2.D0*pi)**3*gmsb(ni)*
     .              sum
            else
               xintegsbtbstb(ni,nj)=0.D0
            endif
         end do
      end do

c -------------------------------------------------------------------- c
c ---------------------- stop_1/2 tau- nu_taubar --------------------- c
c -------------------------------------------------------------------- c

      do ni=1,2,1
         do nj=1,2,1
            xmu1=amtau**2/gmsb(ni)**2
            xmu2=0.D0
            xmu3=gmst(nj)**2/gmsb(ni)**2

            if(gmsb(ni).gt.(amtau+gmst(nj))) then
               call SD_integ2(SD_sbtaustnu,SD_ax,SD_bx,SD_ay,SD_by,
     .              xmu1,xmu2,xmu3,nx1t,ny1t,sum)
               xintegsbtaustnu(ni,nj)=g2**2/32.D0/(2.D0*pi)**3*
     .              gmsb(ni)*sum
            else
               xintegsbtaustnu(ni,nj)=0.D0
            endif
         end do
      end do

c -------------------------------------------------------------------- c
c --------------------- stop_1/2 electron- nu_ebar ------------------- c
c -------------------------------------------------------------------- c

      do ni=1,2,1
         do nj=1,2,1
            xmu1=0.D0
            xmu2=0.D0
            xmu3=gmst(nj)**2/gmsb(ni)**2
            
            if(gmsb(ni).gt.gmst(nj)) then
               call SD_integ2(SD_sbelstnu,SD_ax,SD_bx,SD_ay,SD_by,xmu1,
     .              xmu2,xmu3,nx1t,ny1t,sum)
               xintegsbelstnu(ni,nj)=g2**2/32.D0/(2.D0*pi)**3*
     .              gmsb(ni)*sum
            else
               xintegsbelstnu(ni,nj)=0.D0
            endif
         end do
      end do

c -------------------------------------------------------------------- c
c ------------------------- stop_1/2 upbar down ---------------------- c
c -------------------------------------------------------------------- c

      do ni=1,2,1
         do nj=1,2,1
            if(gmsb(ni).gt.gmst(nj)) then
               xintegsbupstdow(ni,nj)=3.D0*xintegsbelstnu(ni,nj)
            else
               xintegsbupstdow(ni,nj)=0.D0
            endif
         end do
      end do

c ----------------------------- sbottom2 decays ---------------------- c

c -------------------------------------------------------------------- c
c --------------------------- sbottom1* b b -------------------------- c
c -------------------------------------------------------------------- c

      xmu1=amb**2/gmsb(2)**2
      xmu2=amb**2/gmsb(2)**2
      xmu3=gmsb(1)**2/gmsb(2)**2

      if(gmsb(2).gt.(gmsb(1)+2.D0*amb)) then
         call SD_integ2(SD_sb2sb1starbb,SD_ax,SD_bx,SD_ay,SD_by,xmu1,
     .        xmu2,xmu3,nx1t,ny1t,sum)
         xintegsb2sb1starbb=1.D0/32.D0/(2.D0*pi)**3*gmsb(2)*sum
      else 
         xintegsb2sb1starbb=0.D0
      endif

c -------------------------------------------------------------------- c
c --------------------------- sbottom1 b bbar ------------------------ c
c -------------------------------------------------------------------- c

      xmu1=amb**2/gmsb(2)**2
      xmu2=amb**2/gmsb(2)**2
      xmu3=gmsb(1)**2/gmsb(2)**2

      if(gmsb(2).gt.(gmsb(1)+2.D0*amb)) then
         call SD_integ2(SD_sb2sb1bb,SD_ax,SD_bx,SD_ay,SD_by,xmu1,xmu2,
     .        xmu3,nx1t,ny1t,sum)
         xintegsb2sb1bb=1.D0/32.D0/(2.D0*pi)**3*gmsb(2)*sum
      else 
         xintegsb2sb1bb=0.D0
      endif

c -------------------------------------------------------------------- c
c --------------------------- sbottom1 t tbar ------------------------ c
c -------------------------------------------------------------------- c

      xmu1=amt**2/gmsb(2)**2
      xmu2=amt**2/gmsb(2)**2
      xmu3=gmsb(1)**2/gmsb(2)**2

      if((gmsb(1)+2.D0*amt).lt.gmsb(2)) then
         call SD_integ2(SD_sb2sb1tt,SD_ax,SD_bx,SD_ay,SD_by,xmu1,xmu2,
     .        xmu3,nx1t,ny1t,sum)
         xintegsb2sb1tt=g2**2/32.D0/(2.D0*pi)**3*gmsb(2)*sum*3.D0
      else 
         xintegsb2sb1tt=0.D0
      endif

c -------------------------------------------------------------------- c
c --------------------------- sbottom1 up upbar ---------------------- c
c -------------------------------------------------------------------- c

      xmu1=0.D0
      xmu2=0.D0
      xmu3=gmsb(1)**2/gmsb(2)**2

      if(gmsb(2).gt.gmsb(1)) then
         call SD_integ2(SD_sb2sb1uu,SD_ax,SD_bx,SD_ay,SD_by,xmu1,xmu2,
     .        xmu3,nx1t,ny1t,sum)
         xintegsb2sb1uu=g2**2/32.D0/(2.D0*pi)**3*gmsb(2)*sum*3.D0
      else 
         xintegsb2sb1uu=0.D0
      endif

c -------------------------------------------------------------------- c
c ------------------------- sbottom1 down downbar -------------------- c
c -------------------------------------------------------------------- c

      xmu1=0.D0
      xmu2=0.D0
      xmu3=gmsb(1)**2/gmsb(2)**2

      if(gmsb(2).gt.gmsb(1)) then
         call SD_integ2(SD_sb2sb1dd,SD_ax,SD_bx,SD_ay,SD_by,xmu1,xmu2,
     .        xmu3,nx1t,ny1t,sum)
         xintegsb2sb1dd=g2**2/32.D0/(2.D0*pi)**3*gmsb(2)*sum*3.D0
      else 
         xintegsb2sb1dd=0.D0
      endif

c -------------------------------------------------------------------- c
c ----------------------------- sbottom1 e+ e- ----------------------- c
c -------------------------------------------------------------------- c

      xmu1=0.D0
      xmu2=0.D0
      xmu3=gmsb(1)**2/gmsb(2)**2

      if(gmsb(2).gt.gmsb(1)) then
         call SD_integ2(SD_sb2sb1ee,SD_ax,SD_bx,SD_ay,SD_by,xmu1,xmu2,
     .        xmu3,nx1t,ny1t,sum)
         xintegsb2sb1ee=g2**2/32.D0/(2.D0*pi)**3*gmsb(2)*sum*1.D0
      else 
         xintegsb2sb1ee=0.D0
      endif

c -------------------------------------------------------------------- c
c -------------------------- sbottom1 nu nubar ----------------------- c
c -------------------------------------------------------------------- c

      xmu1=0.D0
      xmu2=0.D0
      xmu3=gmsb(1)**2/gmsb(2)**2

      if(gmsb(2).gt.gmsb(1)) then
         call SD_integ2(SD_sb2sb1nunu,SD_ax,SD_bx,SD_ay,SD_by,xmu1,
     .        xmu2,xmu3,nx1t,ny1t,sum)
         xintegsb2sb1nunu=g2**2/32.D0/(2.D0*pi)**3*gmsb(2)*sum*1.D0
      else 
         xintegsb2sb1nunu=0.D0
      endif

c -------------------------------------------------------------------- c
c ------------------------ sbottom1 tau+ tau- ------------------------ c
c -------------------------------------------------------------------- c

      xmu1=amtau**2/gmsb(2)**2
      xmu2=amtau**2/gmsb(2)**2
      xmu3=gmsb(1)**2/gmsb(2)**2

      if(gmsb(2).gt.(gmsb(1)+2.D0*amtau)) then
         call SD_integ2(SD_sb2sb1tautau,SD_ax,SD_bx,SD_ay,SD_by,xmu1,
     .        xmu2,xmu3,nx1t,ny1t,sum)
         xintegsb2sb1tautau=g2**2/32.D0/(2.D0*pi)**3*gmsb(2)*sum*1.D0
      else 
         xintegsb2sb1tautau=0.D0
      endif

      end

c ==================================================================== c
c ========================= t stau neutrino_tau ====================== c
c ==================================================================== c

      double precision function SD_sbtnustau(x1,x2)

      implicit double precision (a-h,m,o-z)

      dimension gmsb(2),amchar(2),amneut(4),xmuchar(2),gmstau(2),
     .          dchi(2),xmustau(2),xmneut(4)
      dimension alsbot(2,2),aksbot(2,2)
      dimension ale(2,2),alto(2,2),alsne(2,2),blsne(2,2),alsnt(2,2),
     .          blsnt(2,2),blto(2,2)

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_fermion/amt,amb,amtau
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2
      COMMON/SD_indices/ni,nj
      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_scala/scalb,scalt
      COMMON/SD_yukawa/ytewsb,ybewsb,ytauewsb
      COMMON/SD_sfermionetau/ase1,ase2,astau1,astau2
      COMMON/SD_coup5/ale,alto,alsne,blsne,alsnt,blsnt
      COMMON/SD_runcoupscale/scalechoice,scaleofcoupling,inumloop

      gmsb(1)=asb1
      gmsb(2)=asb2

c --- the running couplings ---

      if(scalechoice.eq.1.D0) then
         scalb = ybewsb/dsqrt(g2)
         scalt = ytewsb/dsqrt(g2)
      elseif(scalechoice.eq.2.D0) then         
         call SD_runmass(gmsb(ni),0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      elseif(scalechoice.eq.3.D0) then
         call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      endif

      call SD_charsbottop(alsbot,aksbot)

c ------------------------------

      gmstau(1)=astau1
      gmstau(2)=astau2

      xmuchar(1) = amchar(1)**2/gmsb(ni)**2
      xmuchar(2) = amchar(2)**2/gmsb(ni)**2
      xmustau(1) = gmstau(1)**2/gmsb(ni)**2
      xmustau(2) = gmstau(2)**2/gmsb(ni)**2
      xmut       = amt**2/gmsb(ni)**2

      dchi(1)=1.D0-x1-xmuchar(1)+xmut
      dchi(2)=1.D0-x1-xmuchar(2)+xmut

      do i=1,2,1
         blto(1,i)=0.D0
         blto(2,i)=0.D0
      end do

      SD_sbtnustau=0.D0

      do k=1,2,1
         do l=1,2,1
            SD_sbtnustau=SD_sbtnustau+1.D0/dchi(k)/dchi(l)*(
     .        (alsbot(ni,k)*alsbot(ni,l)*blto(nj,k)*blto(nj,l)
     .        +aksbot(ni,k)*aksbot(ni,l)*alto(nj,k)*alto(nj,l))*
     .         dsqrt(xmuchar(k)*xmuchar(l))*(x1+x2-1.D0+xmustau(nj)
     .         -xmut)
     .       +(alsbot(ni,k)*alsbot(ni,l)*alto(nj,k)*alto(nj,l)
     .        +aksbot(ni,k)*aksbot(ni,l)*blto(nj,k)*blto(nj,l))*
     .        ((1.D0-x1)*(1.D0-x2)-xmustau(nj)+xmut*(xmustau(nj)+x1-x2
     .         -xmut)) 
     .       +(alsbot(ni,k)*aksbot(ni,l)*alto(nj,k)*alto(nj,l)
     .        +aksbot(ni,k)*alsbot(ni,l)*blto(nj,k)*blto(nj,l))*
     .        dsqrt(xmuchar(l)*xmut)*(-1.D0-xmut+xmustau(nj)+x1)
     .       +(alsbot(ni,k)*aksbot(ni,l)*blto(nj,k)*blto(nj,l)
     .        +aksbot(ni,k)*alsbot(ni,l)*alto(nj,k)*alto(nj,l))*
     .        dsqrt(xmuchar(k)*xmut)*(-1.D0-xmut+xmustau(nj)+x1) )
         end do
      end do

      end

c ==================================================================== c
c ========================= t sneutrino_tau tau ====================== c
c ==================================================================== c

      double precision function SD_sbtsnutau(x1,x2)

      implicit double precision (a-h,m,o-z)

      dimension gmsb(2),amchar(2),amneut(4),xmuchar(2),dchi(2),
     .          xmusn(2),xmneut(4)
      dimension alsbot(2,2),aksbot(2,2)
      dimension ale(2,2),alto(2,2),alsne(2,2),blsne(2,2),alsnt(2,2),
     .          blsnt(2,2)

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_fermion/amt,amb,amtau
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2
      COMMON/SD_indices/ni,nj
      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_sneutrino/asne1,asne2,asntau1,asntau2
      COMMON/SD_sfermionetau/ase1,ase2,astau1,astau2
      COMMON/SD_scala/scalb,scalt
      COMMON/SD_yukawa/ytewsb,ybewsb,ytauewsb
      COMMON/SD_coup5/ale,alto,alsne,blsne,alsnt,blsnt
      COMMON/SD_runcoupscale/scalechoice,scaleofcoupling,inumloop

      gmsb(1)=asb1
      gmsb(2)=asb2

c --- the running couplings ---

      if(scalechoice.eq.1.D0) then
         scalb = ybewsb/dsqrt(g2)
         scalt = ytewsb/dsqrt(g2)
      elseif(scalechoice.eq.2.D0) then         
         call SD_runmass(gmsb(ni),0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      elseif(scalechoice.eq.3.D0) then
         call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      endif

      call SD_charsbottop(alsbot,aksbot)

c ------------------------------

      xmuchar(1)= amchar(1)**2/gmsb(ni)**2
      xmuchar(2)= amchar(2)**2/gmsb(ni)**2
      xmusn(1)  = asntau1**2/gmsb(ni)**2
      xmusn(2)  = asntau2**2/gmsb(ni)**2
      xmut      = amt**2/gmsb(ni)**2
      xmutau    = amtau**2/gmsb(ni)**2

      dchi(1)=1.D0-x1-xmuchar(1)+xmut
      dchi(2)=1.D0-x1-xmuchar(2)+xmut

      SD_sbtsnutau=0.D0

      do k=1,2,1
         do l=1,2,1
            SD_sbtsnutau=SD_sbtsnutau+1.D0/dchi(k)/dchi(l)*(
     .        (alsbot(ni,k)*alsbot(ni,l)*alsnt(nj,k)*alsnt(nj,l)+
     .         aksbot(ni,k)*aksbot(ni,l)*blsnt(nj,k)*blsnt(nj,l))*
     .        dsqrt(xmuchar(k)*xmuchar(l))*(x1+x2-1.D0+xmusn(nj)
     .        -xmut-xmutau)
     .       +(alsbot(ni,k)*alsbot(ni,l)*blsnt(nj,k)*blsnt(nj,l)+
     .         aksbot(ni,k)*aksbot(ni,l)*alsnt(nj,k)*alsnt(nj,l))*
     .        ((1.D0-x1)*(1.D0-x2)-xmusn(nj)+xmut*(xmusn(nj)+x1-x2
     .        -xmut-xmutau)+xmutau)
     .       +(alsbot(ni,k)*alsbot(ni,l)*alsnt(nj,l)*blsnt(nj,k)+
     .         aksbot(ni,k)*aksbot(ni,l)*blsnt(nj,l)*alsnt(nj,k))*
     .        dsqrt(xmuchar(l)*xmutau)*(-2.D0*xmut+x1)
     .       +(alsbot(ni,k)*aksbot(ni,l)*blsnt(nj,k)*blsnt(nj,l)+
     .         aksbot(ni,k)*alsbot(ni,l)*alsnt(nj,k)*alsnt(nj,l))*
     .        dsqrt(xmuchar(l)*xmut)*(-1.D0-xmut-xmutau+xmusn(nj)+x1)
     .       +(alsbot(ni,k)*alsbot(ni,l)*alsnt(nj,k)*blsnt(nj,l)+
     .         aksbot(ni,k)*aksbot(ni,l)*blsnt(nj,k)*alsnt(nj,l))*
     .        dsqrt(xmuchar(k)*xmutau)*(-2.D0*xmut+x1)
     .       +(alsbot(ni,k)*aksbot(ni,l)*alsnt(nj,k)*alsnt(nj,l)+
     .         aksbot(ni,k)*alsbot(ni,l)*blsnt(nj,k)*blsnt(nj,l))*
     .        dsqrt(xmuchar(k)*xmut)*(-1.D0-xmut-xmutau+xmusn(nj)+x1)
     .       +(alsbot(ni,k)*aksbot(ni,l)*blsnt(nj,k)*alsnt(nj,l)+
     .         aksbot(ni,k)*alsbot(ni,l)*alsnt(nj,k)*blsnt(nj,l))*
     .        dsqrt(xmut*xmutau)*(-2.D0-2.D0*xmut+2.D0*x1)
     .       +(alsbot(ni,k)*aksbot(ni,l)*alsnt(nj,k)*blsnt(nj,l)+
     .         aksbot(ni,k)*alsbot(ni,l)*blsnt(nj,k)*alsnt(nj,l))*
     .        dsqrt(xmut*xmutau)*dsqrt(xmuchar(k)*xmuchar(l))*(-2.D0) )
         end do
      end do

      end

c ==================================================================== c
c ======================== t selectron neutrino_e ==================== c
c ==================================================================== c

      double precision function SD_sbtnusel(x1,x2)

      implicit double precision (a-h,m,o-z)

      dimension gmsb(2),amchar(2),amneut(4),xmuchar(2),gmsel(2),
     .          dchi(2),xmusel(2),xmneut(4)
      dimension alsbot(2,2),aksbot(2,2)
      dimension ale(2,2),altau(2,2),alsne(2,2),blsne(2,2),alsnt(2,2),
     .          blsnt(2,2),ble(2,2)

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_fermion/amt,amb,amtau
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2
      COMMON/SD_indices/ni,nj
      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_coup5/ale,altau,alsne,blsne,alsnt,blsnt
      COMMON/SD_sfermionetau/ase1,ase2,astau1,astau2
      COMMON/SD_scala/scalb,scalt
      COMMON/SD_yukawa/ytewsb,ybewsb,ytauewsb
      COMMON/SD_runcoupscale/scalechoice,scaleofcoupling,inumloop

      gmsb(1)=asb1
      gmsb(2)=asb2

c --- the running couplings ---

      if(scalechoice.eq.1.D0) then
         scalb = ybewsb/dsqrt(g2)
         scalt = ytewsb/dsqrt(g2)
      elseif(scalechoice.eq.2.D0) then         
         call SD_runmass(gmsb(ni),0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      elseif(scalechoice.eq.3.D0) then
         call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      endif

      call SD_charsbottop(alsbot,aksbot)

c ------------------------------

      gmsel(1)=ase1
      gmsel(2)=ase2

      xmuchar(1) = amchar(1)**2/gmsb(ni)**2
      xmuchar(2) = amchar(2)**2/gmsb(ni)**2
      xmusel(1)  = gmsel(1)**2/gmsb(ni)**2
      xmusel(2)  = gmsel(2)**2/gmsb(ni)**2
      xmut       = amt**2/gmsb(ni)**2

      dchi(1)=1.D0-x1-xmuchar(1)+xmut
      dchi(2)=1.D0-x1-xmuchar(2)+xmut

      do i=1,2,1
         ble(1,i)=0.D0
         ble(2,i)=0.D0
      end do

      SD_sbtnusel=0.D0

      do k=1,2,1
         do l=1,2,1
            SD_sbtnusel=SD_sbtnusel+1.D0/dchi(k)/dchi(l)*(
     .        (alsbot(ni,k)*alsbot(ni,l)*ble(nj,k)*ble(nj,l)
     .        +aksbot(ni,k)*aksbot(ni,l)*ale(nj,k)*ale(nj,l))*
     .         dsqrt(xmuchar(k)*xmuchar(l))*(x1+x2-1.D0+xmusel(nj)
     .         -xmut)
     .       +(alsbot(ni,k)*alsbot(ni,l)*ale(nj,k)*ale(nj,l)
     .        +aksbot(ni,k)*aksbot(ni,l)*ble(nj,k)*ble(nj,l))*
     .        ((1.D0-x1)*(1.D0-x2)-xmusel(nj)+xmut*(xmusel(nj)+x1-x2
     .         -xmut)) 
     .       +(alsbot(ni,k)*aksbot(ni,l)*ale(nj,k)*ale(nj,l)
     .        +aksbot(ni,k)*alsbot(ni,l)*ble(nj,k)*ble(nj,l))*
     .        dsqrt(xmuchar(l)*xmut)*(-1.D0-xmut+xmusel(nj)+x1)
     .       +(alsbot(ni,k)*aksbot(ni,l)*ble(nj,k)*ble(nj,l)
     .        +aksbot(ni,k)*alsbot(ni,l)*ale(nj,k)*ale(nj,l))*
     .        dsqrt(xmuchar(k)*xmut)*(-1.D0-xmut+xmusel(nj)+x1) )
         end do
      end do

      end

c ==================================================================== c
c ======================= t sneutrino_e electron ===================== c
c ==================================================================== c

      double precision function SD_sbtsnuel(x1,x2)

      implicit double precision (a-h,m,o-z)

      dimension gmsb(2),amchar(2),amneut(4),xmuchar(2),gmsn(4),
     .          dchi(2),xmusn(2),xmneut(4)
      dimension alsbot(2,2),aksbot(2,2)
      dimension ale(2,2),altau(2,2),alsne(2,2),blsne(2,2),alsnt(2,2),
     .          blsnt(2,2)

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_fermion/amt,amb,amtau
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2
      COMMON/SD_indices/ni,nj
      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_coup5/ale,altau,alsne,blsne,alsnt,blsnt
      COMMON/SD_sneutrino/asne1,asne2,asntau1,asntau2
      COMMON/SD_scala/scalb,scalt
      COMMON/SD_yukawa/ytewsb,ybewsb,ytauewsb
      COMMON/SD_runcoupscale/scalechoice,scaleofcoupling,inumloop

      gmsb(1)=asb1
      gmsb(2)=asb2

c --- the running couplings ---

      if(scalechoice.eq.1.D0) then
         scalb = ybewsb/dsqrt(g2)
         scalt = ytewsb/dsqrt(g2)
      elseif(scalechoice.eq.2.D0) then         
         call SD_runmass(gmsb(ni),0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      elseif(scalechoice.eq.3.D0) then
         call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      endif

      call SD_charsbottop(alsbot,aksbot)

c ------------------------------

      gmsn(1)=asne1
      gmsn(2)=asne2

      xmuchar(1)= amchar(1)**2/gmsb(ni)**2
      xmuchar(2)= amchar(2)**2/gmsb(ni)**2
      xmusn(1)  = gmsn(1)**2/gmsb(ni)**2
      xmusn(2)  = gmsn(2)**2/gmsb(ni)**2
      xmut      = amt**2/gmsb(ni)**2

      dchi(1)=1.D0-x1-xmuchar(1)+xmut
      dchi(2)=1.D0-x1-xmuchar(2)+xmut

      SD_sbtsnuel=0.D0

      do k=1,2,1
         do l=1,2,1
            SD_sbtsnuel=SD_sbtsnuel+1.D0/dchi(k)/dchi(l)*(
     .        (alsbot(ni,k)*alsbot(ni,l)*alsne(1,k)*alsne(1,l)+
     .         aksbot(ni,k)*aksbot(ni,l)*blsne(1,k)*blsne(1,l))*
     .        dsqrt(xmuchar(k)*xmuchar(l))*(x1+x2-1.D0+xmusn(1)
     .        -xmut)
     .       +(alsbot(ni,k)*alsbot(ni,l)*blsne(1,k)*blsne(1,l)+
     .         aksbot(ni,k)*aksbot(ni,l)*alsne(1,k)*alsne(1,l))*
     .        ((1.D0-x1)*(1.D0-x2)-xmusn(1)+xmut*(xmusn(1)+x1-x2
     .        -xmut))
     .       +(alsbot(ni,k)*aksbot(ni,l)*blsne(1,k)*blsne(1,l)+
     .         aksbot(ni,k)*alsbot(ni,l)*alsne(1,k)*alsne(1,l))*
     .        dsqrt(xmuchar(l)*xmut)*(-1.D0-xmut+xmusn(1)+x1)
     .       +(alsbot(ni,k)*aksbot(ni,l)*alsne(1,k)*alsne(1,l)+
     .         aksbot(ni,k)*alsbot(ni,l)*blsne(1,k)*blsne(1,l))*
     .        dsqrt(xmuchar(k)*xmut)*(-1.D0-xmut+xmusn(1)+x1) )
         end do
      end do

      end

c ==================================================================== c
c ========================= bottom stop_1/2* top ===================== c
c ==================================================================== c

      double precision function SD_sbtststarb(x1,x2)

      implicit double precision (a-h,m,o-z)
      double precision neutneut

      dimension gmst(2),amchar(2),amneut(4),xmuchar(2),gmsb(2),
     .          dchi(2),xmust(2),xmneut(4),dneut(4),xmuneut(4)
      dimension alsbot(2,2),aksbot(2,2),alstor(2,2),akstor(2,2),
     .          abot(2,4),bbot(2,4),atopr(2,4),btopr(2,4)
      dimension gul(2),gur(2),gdl(2),gdr(2),gtl(2),gtr(2),gbl(2),gbr(2)

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_fermion/amt,amb,amtau
      COMMON/SD_gluino/mgluino
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2
      COMMON/SD_indices/ni,nj
      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_scala/scalb,scalt
      COMMON/SD_yukawa/ytewsb,ybewsb,ytauewsb
      COMMON/SD_coupewsb/alsew,g2ew,g1ew
      COMMON/SD_runcoupscale/scalechoice,scaleofcoupling,inumloop
      COMMON/SD_coup21/gtr,gtl,gbr,gbl,gur,gul,gdr,gdl

      external SD_alphascall

      gmst(1)=ast1
      gmst(2)=ast2
      gmsb(1)=asb1
      gmsb(2)=asb2

c --- the running couplings ---

      if(scalechoice.eq.1.D0) then
         scalb = ybewsb/dsqrt(g2)
         scalt = ytewsb/dsqrt(g2)
         gs2   = alsew*4.D0*pi
      elseif(scalechoice.eq.2.D0) then         
         call SD_runmass(gmsb(ni),0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
         gs2   = SD_alphascall(gmsb(ni),inumloop)*4.D0*pi
      elseif(scalechoice.eq.3.D0) then
         call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
         gs2   = SD_alphascall(scaleofcoupling,inumloop)*4.D0*pi
      endif

      call SD_charstopbot(alstor,akstor)
      call SD_charsbottop(alsbot,aksbot)
      call SD_neutsbotbot(abot,bbot)
      call SD_neutstoptop(atopr,btopr)

c -----------------------------

      do k=1,4,1 
         xmuneut(k) = amneut(k)**2/gmsb(ni)**2
      end do
      xmuchar(1) = amchar(1)**2/gmsb(ni)**2
      xmuchar(2) = amchar(2)**2/gmsb(ni)**2
      xmust(1)   = gmst(1)**2/gmsb(ni)**2
      xmust(2)   = gmst(2)**2/gmsb(ni)**2
      xmut       = amt**2/gmsb(ni)**2
      xmub       = amb**2/gmsb(ni)**2
      xmugl      = mgluino**2/gmsb(ni)**2

      dchi(1)=1.D0-x1-xmuchar(1)+xmut
      dchi(2)=1.D0-x1-xmuchar(2)+xmut

      do k=1,4,1
         dneut(k)=1.D0-x2-xmuneut(k)+xmub
      end do

      dgl = 1.D0-x2-xmugl+xmub

c -------------------------------------------------------------------- c
c                           chargino exchange
c -------------------------------------------------------------------- c

      charchar=0.D0

      do k=1,2,1
         do l=1,2,1
            charchar=charchar+3.D0*g2**2/dchi(k)/dchi(l)*(
     .           dsqrt(xmuchar(k)*xmuchar(l))*
     .           (-1.D0+x1+x2-xmut-xmub+xmust(nj))*
     .           (alsbot(ni,k)*alsbot(ni,l)*alstor(nj,k)*alstor(nj,l)+
     .            aksbot(ni,k)*aksbot(ni,l)*akstor(nj,k)*akstor(nj,l))
     .           +(xmut*(-x2+xmust(nj)-xmut+x1-xmub)-x2+x1*x2-x1+1.D0
     .             -xmust(nj)+xmub)*
     .           (alsbot(ni,k)*alsbot(ni,l)*akstor(nj,k)*akstor(nj,l)+
     .            aksbot(ni,k)*aksbot(ni,l)*alstor(nj,k)*alstor(nj,l))
     .           +dsqrt(xmuchar(k)*xmub)*(x1-2.D0*xmut)*
     .           (alsbot(ni,k)*alsbot(ni,l)*alstor(nj,k)*akstor(nj,l)+
     .            aksbot(ni,k)*aksbot(ni,l)*alstor(nj,l)*akstor(nj,k))
     .           +dsqrt(xmuchar(l)*xmub)*(x1-2.D0*xmut)*
     .           (alsbot(ni,k)*alsbot(ni,l)*alstor(nj,l)*akstor(nj,k)+
     .            aksbot(ni,k)*aksbot(ni,l)*alstor(nj,k)*akstor(nj,l))
     .           +dsqrt(xmut*xmub)*(-2.D0*xmut+2.D0*x1-2.D0)*
     .           (alsbot(ni,k)*aksbot(ni,l)*alstor(nj,l)*akstor(nj,k)+
     .            alsbot(ni,l)*aksbot(ni,k)*alstor(nj,k)*akstor(nj,l))
     .           +dsqrt(xmut*xmuchar(l))*(x1-xmut+xmust(nj)-xmub-1.D0)*
     .           (alsbot(ni,k)*aksbot(ni,l)*akstor(nj,k)*akstor(nj,l)+
     .            alsbot(ni,l)*aksbot(ni,k)*alstor(nj,l)*alstor(nj,k))
     .           +dsqrt(xmut*xmuchar(k))*(x1-xmut+xmust(nj)-xmub-1.D0)*
     .           (alsbot(ni,k)*aksbot(ni,l)*alstor(nj,k)*alstor(nj,l)+
     .            alsbot(ni,l)*aksbot(ni,k)*akstor(nj,k)*akstor(nj,l))
     .           +dsqrt(xmuchar(k)*xmuchar(l)*xmut*xmub)*(-2.D0)*
     .           (alsbot(ni,k)*aksbot(ni,l)*alstor(nj,k)*akstor(nj,l)+
     .            alsbot(ni,l)*aksbot(ni,k)*alstor(nj,l)*akstor(nj,k)) )
         end do
      end do

c -------------------------------------------------------------------- c
c                          neutralino exchange
c -------------------------------------------------------------------- c

      neutneut=0.D0

      do k=1,4,1
         do l=1,4,1
            neutneut=neutneut+3.D0*g2**2/dneut(k)/dneut(l)*(
     .           xmneut(k)*xmneut(l)/gmsb(ni)**2*
     .           (-1.D0+x1+x2-xmut-xmub+xmust(nj))*
     .           (abot(ni,k)*abot(ni,l)*atopr(nj,k)*atopr(nj,l)+
     .            bbot(ni,k)*bbot(ni,l)*btopr(nj,k)*btopr(nj,l))
     .           +(xmub*(x2+xmust(nj)-xmut-x1-xmub)-x2+x1*x2-x1+1.D0
     .             -xmust(nj)+xmut)*
     .           (abot(ni,k)*abot(ni,l)*btopr(nj,k)*btopr(nj,l)+
     .            bbot(ni,k)*bbot(ni,l)*atopr(nj,k)*atopr(nj,l))
     .           +xmneut(k)/gmsb(ni)*dsqrt(xmut)*(x2-2.D0*xmub)*
     .           (abot(ni,k)*abot(ni,l)*atopr(nj,k)*btopr(nj,l)+
     .            bbot(ni,k)*bbot(ni,l)*atopr(nj,l)*btopr(nj,k))
     .           +xmneut(l)/gmsb(ni)*dsqrt(xmut)*(x2-2.D0*xmub)*
     .           (abot(ni,k)*abot(ni,l)*atopr(nj,l)*btopr(nj,k)+
     .            bbot(ni,k)*bbot(ni,l)*atopr(nj,k)*btopr(nj,l))
     .           +dsqrt(xmut*xmub)*(-2.D0*xmub+2.D0*x2-2.D0)*
     .           (abot(ni,k)*bbot(ni,l)*atopr(nj,l)*btopr(nj,k)+
     .            abot(ni,l)*bbot(ni,k)*atopr(nj,k)*btopr(nj,l))
     .           +dsqrt(xmub)*xmneut(l)/gmsb(ni)*
     .           (x2-xmut+xmust(nj)-xmub-1.D0)*
     .           (abot(ni,k)*bbot(ni,l)*btopr(nj,k)*btopr(nj,l)+
     .            abot(ni,l)*bbot(ni,k)*atopr(nj,l)*atopr(nj,k))
     .           +dsqrt(xmub)*xmneut(k)/gmsb(ni)*
     .           (x2-xmut+xmust(nj)-xmub-1.D0)*
     .           (abot(ni,k)*bbot(ni,l)*atopr(nj,k)*atopr(nj,l)+
     .            abot(ni,l)*bbot(ni,k)*btopr(nj,k)*btopr(nj,l))
     .           +dsqrt(xmut*xmub)*xmneut(k)*xmneut(l)/gmsb(ni)**2*
     .           (-2.D0)*
     .           (abot(ni,k)*bbot(ni,l)*atopr(nj,k)*btopr(nj,l)+
     .            abot(ni,l)*bbot(ni,k)*atopr(nj,l)*btopr(nj,k)) )
         end do
      end do

c -------------------------------------------------------------------- c
c                            gluino exchange
c -------------------------------------------------------------------- c

      gluiglui= 2.D0/3.D0*gs2**2*4.D0/dgl**2*(
     .          xmugl*dsqrt(xmut*xmub)*(-4.D0)*
     .          gbr(ni)*gbl(ni)*gtr(nj)*gtl(nj)
     .         +dsqrt(xmugl*xmut)*2.D0*(x2-2.D0*xmub)*
     .          gtr(nj)*gtl(nj)*(gbr(ni)**2+gbl(ni)**2)
     .         +dsqrt(xmut*xmub)*4.D0*(x2-xmub-1.D0)*
     .          gtr(nj)*gtl(nj)*gbr(ni)*gbl(ni)
     .         +dsqrt(xmub*xmugl)*(-2.D0)*(1.D0-x2+xmut+xmub-xmust(nj))*
     .          gbr(ni)*gbl(ni)*(gtr(nj)**2+gtl(nj)**2)
     .         +xmugl*(x1+x2-xmub-xmut-1.D0+xmust(nj))*
     .          (gtr(nj)**2*gbr(ni)**2+gtl(nj)**2*gbl(ni)**2)
     .         +(x2*xmub-xmub*xmut+x1*x2-xmub**2-x1*xmub+xmub*xmust(nj)
     .           -x1-xmust(nj)+1.D0+xmut-x2)*
     .          (gtr(nj)**2*gbl(ni)**2+gtl(nj)**2*gbr(ni)**2) )

c -------------------------------------------------------------------- c
c                    chargino neutralino interference
c -------------------------------------------------------------------- c

      charneut=0.D0

      do k=1,2,1
         do l=1,4,1
            charneut=charneut+2.D0*3.D0*g2**2/dchi(k)/dneut(l)*(
     .           amchar(k)*xmneut(l)/gmsb(ni)**2*
     .           (-1.D0+x1+x2-xmut-xmub+xmust(nj))*
     .           (abot(ni,l)*atopr(nj,l)*alsbot(ni,k)*alstor(nj,k)+
     .            bbot(ni,l)*btopr(nj,l)*aksbot(ni,k)*akstor(nj,k))
     .           +(x2-x1*x2+x1-1.D0-xmub-xmut-2.D0*xmut*xmub+x1*xmub
     .            +x2*xmut+xmust(nj))*
     .           (abot(ni,l)*btopr(nj,l)*alstor(nj,k)*aksbot(ni,k)+
     .            bbot(ni,l)*atopr(nj,l)*alsbot(ni,k)*akstor(nj,k))
     .           +amchar(k)/gmsb(ni)*dsqrt(xmut)*(x2-2.D0*xmub)*
     .           (abot(ni,l)*btopr(nj,l)*alsbot(ni,k)*alstor(nj,k)+
     .            bbot(ni,l)*atopr(nj,l)*aksbot(ni,k)*akstor(nj,k))
     .           +xmneut(l)/gmsb(ni)*dsqrt(xmub)*(x1-2.D0*xmut)*
     .           (abot(ni,l)*atopr(nj,l)*alsbot(ni,k)*akstor(nj,k)+
     .            bbot(ni,l)*btopr(nj,l)*aksbot(ni,k)*alstor(nj,k))
     .           +dsqrt(xmut*xmub)*(1.D0-xmut-xmub+xmust(nj))*
     .           (abot(ni,l)*btopr(nj,l)*alsbot(ni,k)*akstor(nj,k)+
     .            bbot(ni,l)*atopr(nj,l)*aksbot(ni,k)*alstor(nj,k))
     .           +dsqrt(xmub)*amchar(k)/gmsb(ni)*
     .           (x2-xmut+xmust(nj)-xmub-1.D0)*
     .           (abot(ni,l)*btopr(nj,l)*aksbot(ni,k)*akstor(nj,k)+
     .            bbot(ni,l)*atopr(nj,l)*alsbot(ni,k)*alstor(nj,k))
     .           +dsqrt(xmut)*xmneut(l)/gmsb(ni)*
     .           (x1-xmut+xmust(nj)-xmub-1.D0)*
     .           (abot(ni,l)*atopr(nj,l)*aksbot(ni,k)*alstor(nj,k)+
     .            bbot(ni,l)*btopr(nj,l)*alsbot(ni,k)*akstor(nj,k))
     .           +dsqrt(xmut*xmub)*amchar(k)*xmneut(l)/gmsb(ni)**2*
     .           (-2.D0)*
     .           (abot(ni,l)*atopr(nj,l)*aksbot(ni,k)*akstor(nj,k)+
     .            bbot(ni,l)*btopr(nj,l)*alsbot(ni,k)*alstor(nj,k)) )
         end do
      end do

c -------------------------------------------------------------------- c

      SD_sbtststarb=charchar+neutneut+gluiglui+charneut

      end

c ==================================================================== c
c ======================== stop_1/2 tbar bottom ====================== c
c ==================================================================== c

      double precision function SD_sbtbstb(x1,x2)

      implicit double precision (a-h,m,o-z)

      dimension gmst(2),gmsb(2),xmust(2),dw(2),dch(2),gctbr(2,2)
      dimension gtr(2),gtl(2),gbr(2),gbl(2),gur(2),gul(2),gdr(2),gdl(2)
      dimension amchar(2),dneut(4),xmuneut(4),amneut(4),xmneut(4)
      dimension atopr(2,4),btopr(2,4),abot(2,4),bbot(2,4)
      dimension gwtb(2,2),gwntau(2,2)

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_indices/ni,nj
      COMMON/SD_hmass/ama,aml,amh,amch,amar
      COMMON/SD_fermion/amt,amb,amtau
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2
      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_gluino/mgluino
      COMMON/SD_scala/scalb,scalt
      COMMON/SD_yukawa/ytewsb,ybewsb,ytauewsb
      COMMON/SD_coup20/gwtb,gwntau
      COMMON/SD_coup21/gtr,gtl,gbr,gbl,gur,gul,gdr,gdl
      COMMON/SD_coupewsb/alsew,g2ew,g1ew
      COMMON/SD_runcoupscale/scalechoice,scaleofcoupling,inumloop
      COMMON/SD_mwmzpole/amwp,amzp

      external SD_alphascall

      gmst(1)=ast1
      gmst(2)=ast2
      gmsb(1)=asb1
      gmsb(2)=asb2

c --- the running couplings ---

      if(scalechoice.eq.1.D0) then
         gs21 = alsew*4.D0*pi
         gs22 = gs21
      elseif(scalechoice.eq.2.D0) then         
         gs21 = SD_alphascall(gmsb(ni),inumloop)*4.D0*pi
         gs22 = gs21
      elseif(scalechoice.eq.3.D0) then
         gs21 = SD_alphascall(scaleofcoupling,inumloop)*4.D0*pi
         gs22 = gs21
      endif

      if(scalechoice.eq.1.D0) then
         scalb = ybewsb/dsqrt(g2)
         scalt = ytewsb/dsqrt(g2)
      elseif(scalechoice.eq.2.D0) then         
         call SD_runmass(gmsb(ni),0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      elseif(scalechoice.eq.3.D0) then
         call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      endif

      call SD_hcsbotstop(gctbr)
      call SD_higgschudb(chtbrunr,chtbrunl)
      call SD_neutstoptop(atopr,btopr)
      call SD_neutsbotbot(abot,bbot)      

c -------------------------------------------------------------------- c

      xmust(1)   = gmst(1)**2/gmsb(ni)**2
      xmust(2)   = gmst(2)**2/gmsb(ni)**2
      xmut       = amt**2/gmsb(ni)**2
      xmub       = amb**2/gmsb(ni)**2
      xmuw       = amwp**2/gmsb(ni)**2
      xmuch      = amch**2/gmsb(ni)**2
      xmugl      = mgluino**2/gmsb(ni)**2
      do i=1,4,1
         xmuneut(i) = amneut(i)**2/gmsb(ni)**2
      end do

      x3 = 2.D0-x1-x2

      dw(1)   = 1.D0-x3+xmust(1)-xmuw
      dw(2)   = 1.D0-x3+xmust(2)-xmuw
      dch(1)  = 1.D0-x3+xmust(1)-xmuch
      dch(2)  = 1.D0-x3+xmust(2)-xmuch
      dgl     = 1.D0-x2+xmub-xmugl
      do i=1,4,1
         dneut(i) = 1.D0-x2+xmub-xmuneut(i)
      end do

c -------------------------------------------------------------------- c
c                              W exchange
c -------------------------------------------------------------------- c

      stsbotww=3.D0*g2**2/4.D0/dw(nj)**2*gwtb(nj,ni)**2*( 
     .     4.D0*(1.D0+x1*x2-x1-x2-xmust(nj)) 
     .   + xmub*(3.D0-3.D0*x1+x2+xmust(nj)-xmub+2.D0*xmut) 
     .   + xmut*(3.D0-3.D0*x2+x1+xmust(nj)-xmut) 
     .   + xmub/xmuw**2*(1.D0-xmust(nj))**2*
     .     (-1.D0+x1+x2+xmust(nj)-xmub+2.D0*xmut)
     .   + xmut/xmuw**2*(1.D0-xmust(nj))**2*
     .     (-1.D0+x1+x2+xmust(nj)-xmut) 
     .   + 2.D0*xmub/xmuw*(1.D0-xmust(nj))*
     .     (-x1+x2-xmub-1.D0+xmust(nj)+2.D0*xmut) 
     .   + 2.D0*xmut/xmuw*(1.D0-xmust(nj))*
     .     (-x2+x1-xmut-1.D0+xmust(nj)) ) 

c -------------------------------------------------------------------- c
c                             H+ exchange
c -------------------------------------------------------------------- c

      stsbothh=3.D0*g2**2*gctbr(nj,ni)**2*amw**2/gmsb(ni)**2
     .     /dch(nj)**2*(
     .     (chtbrunr**2+chtbrunl**2)*(x1+x2+xmust(nj)-1.D0-xmub-xmut)
     .     -4.D0*chtbrunr*chtbrunl*dsqrt(xmut*xmub) )

c -------------------------------------------------------------------- c
c                           gluino exchange
c -------------------------------------------------------------------- c

      stsbotgl=gs21*gs22*2.D0/3.D0/dgl**2*4.D0*(
     .     gbr(ni)*gbl(ni)*gtr(nj)*gtl(nj)*dsqrt(xmut*xmub)*(
     .     -4.D0*xmugl-4.D0*(1.D0+xmub-x2) ) +
     .     gbr(ni)*gbl(ni)*(gtr(nj)**2+gtl(nj)**2)*dsqrt(xmub*xmugl)*
     .     2.D0*(-xmub-xmut+xmust(nj)+x2-1.D0) +
     .     gtr(nj)*gtl(nj)*(gbr(ni)**2+gbl(ni)**2)*dsqrt(xmut*xmugl)*
     .     2.D0*(x2-2.D0*xmub) +
     .     (gbr(ni)**2*gtl(nj)**2+gbl(ni)**2*gtr(nj)**2)*xmugl*
     .     (-1.D0-xmub-xmut+xmust(nj)+x1+x2) +
     .     (gbr(ni)**2*gtr(nj)**2+gbl(ni)**2*gtl(nj)**2)*
     .     (1.D0+x1*x2-x1-x2-xmust(nj)+xmut+xmub*(-xmut+xmust(nj)+x2
     .      -x1-xmub)) )

c -------------------------------------------------------------------- c
c                        neutralino exchange
c -------------------------------------------------------------------- c

      stsbotneut = 0.D0

      do k=1,4,1
         do l=1,4,1
            stsbotneut=stsbotneut+3.D0*g2**2/dneut(k)/dneut(l)*(
     .          (atopr(nj,k)*atopr(nj,l)*abot(ni,k)*abot(ni,l)+
     .           btopr(nj,k)*btopr(nj,l)*bbot(ni,k)*bbot(ni,l))*
     .          ((1.D0-x1)*(1.D0-x2)-xmust(nj)+xmub*(-x1+x2+xmust(nj)
     .           -xmub-xmut)+xmut)
     .         +(atopr(nj,k)*atopr(nj,l)*bbot(ni,k)*bbot(ni,l)+
     .           btopr(nj,k)*btopr(nj,l)*abot(ni,k)*abot(ni,l))*
     .           xmneut(k)*xmneut(l)/gmsb(ni)**2*(x1+x2-1.D0+xmust(nj)
     .           -xmub-xmut)
     .         +(atopr(nj,k)*btopr(nj,l)*abot(ni,k)*bbot(ni,l)+
     .           btopr(nj,k)*atopr(nj,l)*bbot(ni,k)*abot(ni,l))*
     .           2.D0*dsqrt(xmut*xmub)*(-1.D0+x2-xmub)
     .         +dsqrt(xmut)*(x2-2.D0*xmub)*( xmneut(k)/gmsb(ni)*
     .          (atopr(nj,k)*btopr(nj,l)*bbot(ni,k)*bbot(ni,l)+
     .           btopr(nj,k)*atopr(nj,l)*abot(ni,k)*abot(ni,l))
     .         +xmneut(l)/gmsb(ni)*
     .          (atopr(nj,k)*btopr(nj,l)*abot(ni,k)*abot(ni,l)+
     .           btopr(nj,k)*atopr(nj,l)*bbot(ni,k)*bbot(ni,l)) )
     .         +dsqrt(xmub)*(-1.D0+x2+xmust(nj)-xmut-xmub)* 
     .         (xmneut(k)/gmsb(ni)*
     .          (atopr(nj,k)*atopr(nj,l)*bbot(ni,k)*abot(ni,l)+
     .           btopr(nj,k)*btopr(nj,l)*abot(ni,k)*bbot(ni,l))
     .         +xmneut(l)/gmsb(ni)*
     .          (atopr(nj,k)*atopr(nj,l)*abot(ni,k)*bbot(ni,l)+
     .           btopr(nj,k)*btopr(nj,l)*bbot(ni,k)*abot(ni,l)) )
     .         +(atopr(nj,l)*btopr(nj,k)*abot(ni,k)*bbot(ni,l)+
     .           btopr(nj,l)*atopr(nj,k)*bbot(ni,k)*abot(ni,l))*
     .           (-2.D0)*dsqrt(xmut*xmub)*
     .             xmneut(k)*xmneut(l)/gmsb(ni)**2 )
         end do
      end do

c -------------------------------------------------------------------- c
c                           H+ W interference
c -------------------------------------------------------------------- c

      stsbothw=-3.D0*g2**2*gctbr(nj,ni)*(-gwtb(nj,ni))*amw/gmsb(ni)
     .     /dw(nj)/dch(nj)*
     .     (dsqrt(xmub)*chtbrunr*(xmust(nj)+xmut-xmub+x2-x1-1.D0)
     .     +dsqrt(xmut)*chtbrunl*(-xmust(nj)+xmut-xmub+x2-x1+1.D0)
     .     +dsqrt(xmub)/xmuw*chtbrunr*(xmust(nj)-1.D0)*(xmub-xmut-x1-x2
     .      +1.D0-xmust(nj))
     .     +dsqrt(xmut)/xmuw*chtbrunl*(xmust(nj)-1.D0)*(xmub-xmut+x1+x2
     .      -1.D0+xmust(nj)) )

c -------------------------------------------------------------------- c
c                       neutralino W interference
c -------------------------------------------------------------------- c

      stsbotwneut = 0.D0

      do l=1,4,1
         stsbotwneut=stsbotwneut
     .     +3.D0*g2**2/dw(nj)/dneut(l)*(-gwtb(nj,ni))*(
     .      btopr(nj,l)*bbot(ni,l)*dsqrt(xmub*xmut)*(1.D0/xmuw*
     .      (xmust(nj)*(xmust(nj)+xmub-xmut-2.D0)-xmub+xmut+1.D0) +
     .      2.D0*x2-xmust(nj)-xmub+xmut-3.D0) +
     .      atopr(nj,l)*abot(ni,l)*(1.D0/xmuw*(1.D0-xmust(nj))*(xmub*
     .      (xmust(nj)+x2-xmub+xmut-1.D0)-x2*xmut) + xmub*(1.D0+x2+
     .      xmust(nj)+xmut-2.D0*x1-xmub)-2.D0*xmust(nj)+2.D0*x1*x2+2.D0
     .      -2.D0*x1-2.D0*x2+xmut*(2.D0-x2)) +
     .      btopr(nj,l)*abot(ni,l)*dsqrt(xmut)*xmneut(l)/gmsb(ni)*
     .      (1.D0/xmuw*
     .      (xmust(nj)-1.D0)*(xmust(nj)+x1+x2-1.D0-xmut+xmub)+x2-x1
     .      -xmust(nj)-xmub+xmut+1.D0) +
     .      atopr(nj,l)*bbot(ni,l)*dsqrt(xmub)*xmneut(l)/gmsb(ni)*
     .      (1.D0/xmuw*
     .      (1.D0-xmust(nj))*(xmust(nj)+x1+x2-1.D0+xmut-xmub)+x2-x1
     .      +xmust(nj)-xmub+xmut-1.D0) )
      end do

c -------------------------------------------------------------------- c
c                    neutralino Higgs interference
c -------------------------------------------------------------------- c

      stsbothcneut = 0.D0

      do l=1,4,1
         stsbothcneut=stsbothcneut
     .     +3.D0*g2**2*2.D0/dch(nj)/dneut(l)*
     .      (-gctbr(nj,ni))*amw/gmsb(ni)*(
     .      (chtbrunl*bbot(ni,l)*atopr(nj,l)+chtbrunr*abot(ni,l)*
     .       btopr(nj,l))*dsqrt(xmub*xmut)*xmneut(l)/gmsb(ni)*(-2.D0) +
     .      (chtbrunl*bbot(ni,l)*btopr(nj,l)+chtbrunr*abot(ni,l)*
     .       atopr(nj,l))*dsqrt(xmub)*(-1.D0-xmub-xmut+xmust(nj)+x2) +
     .      (chtbrunl*abot(ni,l)*btopr(nj,l)+chtbrunr*bbot(ni,l)*
     .       atopr(nj,l))*xmneut(l)/gmsb(ni)*(-1.D0-xmub-xmut+xmust(nj)
     .       +x1+x2) +
     .      (chtbrunl*abot(ni,l)*atopr(nj,l)+chtbrunr*bbot(ni,l)*
     .       btopr(nj,l))*dsqrt(xmut)*(-2.D0*xmub+x2) )
      end do

c -------------------------------------------------------------------- c

      SD_sbtbstb = stsbotww+stsbothh+stsbothw+stsbotgl+stsbotneut+
     .          stsbotwneut+stsbothcneut

      end

c ==================================================================== c
c ====================== stop_1/2 tau- nu_taubar ===================== c
c ==================================================================== c

      double precision function SD_sbtaustnu(x1,x2)

      implicit double precision (a-h,m,o-z)

      dimension gmst(2),gmsb(2),xmust(2),dw(2),dch(2),gctbr(2,2)
      dimension gwtb(2,2),gwntau(2,2)
      dimension gul(2),gur(2),gdl(2),gdr(2),gtl(2),gtr(2),gbl(2),gbr(2)

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_indices/ni,nj
      COMMON/SD_hmass/ama,aml,amh,amch,amar
      COMMON/SD_fermion/amt,amb,amtau
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2
      COMMON/SD_scala/scalb,scalt
      COMMON/SD_yukawa/ytewsb,ybewsb,ytauewsb
      COMMON/SD_coup14/chctbl,chctbr,chctaunur,chctaunul
      COMMON/SD_coup20/gwtb,gwntau
      COMMON/SD_coup21/gtr,gtl,gbr,gbl,gur,gul,gdr,gdl
      COMMON/SD_runcoupscale/scalechoice,scaleofcoupling,inumloop
      COMMON/SD_mwmzpole/amwp,amzp

      gmst(1)=ast1
      gmst(2)=ast2
      gmsb(1)=asb1
      gmsb(2)=asb2

c --- the running couplings ---

      if(scalechoice.eq.1.D0) then
         scalb = ybewsb/dsqrt(g2)
         scalt = ytewsb/dsqrt(g2)
      elseif(scalechoice.eq.2.D0) then         
         call SD_runmass(gmsb(ni),0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      elseif(scalechoice.eq.3.D0) then
         call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      endif

      call SD_hcsbotstop(gctbr)

c -----------------------------

      xmust(1) = gmst(1)**2/gmsb(ni)**2
      xmust(2) = gmst(2)**2/gmsb(ni)**2
      xmutau   = amtau**2/gmsb(ni)**2
      xmuw     = amwp**2/gmsb(ni)**2
      xmuch    = amch**2/gmsb(ni)**2

      x3 = 2.D0-x1-x2

      dw(1)  = 1.D0-x3+xmust(1)-xmuw
      dw(2)  = 1.D0-x3+xmust(2)-xmuw
      dch(1) = 1.D0-x3+xmust(1)-xmuch
      dch(2) = 1.D0-x3+xmust(2)-xmuch

c -------------------------------------------------------------------- c
c                             W exchange
c -------------------------------------------------------------------- c

      ststauww=1.D0/4.D0/dw(nj)**2*(-gwtb(nj,ni))**2*( 
     .     4.D0*(1.D0+x1*x2-x1-x2-xmust(nj)) + 
     .     xmutau*(3.D0-3.D0*x1+x2+xmust(nj)-xmutau) 
     .     +xmutau/xmuw**2*(1.D0-xmust(nj))**2*(-1.D0+xmust(nj)+x1+x2
     .      -xmutau)
     .     +2.D0*xmutau/xmuw*(1.D0-xmust(nj))*(-x1+x2-xmutau-1.D0+
     .      xmust(nj)) )

c -------------------------------------------------------------------- c
c                             H+ exchange
c -------------------------------------------------------------------- c

      ststauhh=gctbr(nj,ni)**2*amw**2/gmsb(ni)**2/dch(nj)**2*
     .     chctaunur**2*(x1+x2+xmust(nj)-1.D0-xmutau)

c -------------------------------------------------------------------- c
c                          H+ W interference
c -------------------------------------------------------------------- c

      ststauhw=-gctbr(nj,ni)*(-gwtb(nj,ni))*amw/gmsb(ni)/dw(nj)/dch(nj)*
     .      dsqrt(xmutau)*chctaunur*(
     .      -1.D0-x1+x2-xmutau+xmust(nj)+
     .      1.D0/xmuw*(xmust(nj)-1.D0)*(xmutau-x1-x2+1.D0-xmust(nj))) 

c -------------------------------------------------------------------- c

      SD_sbtaustnu = ststauww+ststauhh+ststauhw

      end

c ==================================================================== c
c ======================== stop_1/2 e- nu_ebar ======================= c
c ==================================================================== c

      double precision function SD_sbelstnu(x1,x2)

      implicit double precision (a-h,m,o-z)

      dimension gmst(2),gmsb(2),xmust(2),dw(2)
      dimension gwtb(2,2),gwntau(2,2)

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_indices/ni,nj
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2
      COMMON/SD_coup20/gwtb,gwntau
      COMMON/SD_mwmzpole/amwp,amzp

      gmst(1)=ast1
      gmst(2)=ast2
      gmsb(1)=asb1
      gmsb(2)=asb2

      xmust(1) = gmst(1)**2/gmsb(ni)**2
      xmust(2) = gmst(2)**2/gmsb(ni)**2
      xmuw     = amwp**2/gmsb(ni)**2

      x3 = 2.D0-x1-x2

      dw(1) = 1.D0-x3+xmust(1)-xmuw
      dw(2) = 1.D0-x3+xmust(2)-xmuw

c -------------------------------------------------------------------- c
c                             W exchange
c -------------------------------------------------------------------- c

      stselww=1.D0/4.D0/dw(nj)**2*(-gwtb(nj,ni))**2*
     .        4.D0*(1.D0+x1*x2-x1-x2-xmust(nj))

c -------------------------------------------------------------------- c

      SD_sbelstnu = stselww

      end

c ==================================================================== c
c ======================= sbottom1* bottom bottom ==================== c
c ==================================================================== c

      double precision function SD_sb2sb1starbb(x1,x2)

      implicit double precision (a-h,m,o-z)
      dimension abot(2,4),bbot(2,4)
      dimension amchar(2),dneut(4),xmuneut(4),amneut(4),xmneut(4)
      dimension gul(2),gur(2),gdl(2),gdr(2),gtl(2),gtr(2),gbl(2),gbr(2)

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_scala/scalb,scalt
      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2
      COMMON/SD_fermion/amt,amb,amtau
      COMMON/SD_weinberg/sw,cw
      COMMON/SD_runcoupscale/scalechoice,scaleofcoupling,inumloop
      COMMON/SD_coupewsb/alsew,g2ew,g1ew
      COMMON/SD_yukawa/ytewsb,ybewsb,ytauewsb
      COMMON/SD_gluino/mgluino
      COMMON/SD_coup21/gtr,gtl,gbr,gbl,gur,gul,gdr,gdl

      external SD_alphascall

c -- the Yukawa coupling --

      if(scalechoice.eq.1.D0) then
         scalb = ybewsb/dsqrt(g2)
         scalt = ytewsb/dsqrt(g2)
         gs2 = alsew*4.D0*pi
      elseif(scalechoice.eq.2.D0) then         
         call SD_runmass(asb2,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
         gs2 = SD_alphascall(asb2,inumloop)*4.D0*pi
      elseif(scalechoice.eq.3.D0) then
         call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
         gs2 = SD_alphascall(scaleofcoupling,inumloop)*4.D0*pi
      endif

      call SD_neutsbotbot(abot,bbot)

c --- several definitions ---

      xmub   = amb**2/asb2**2
      do i=1,4,1
         xmuneut(i) = amneut(i)**2/asb2**2
      end do
      xmugl  = mgluino**2/asb2**2
      xmusb1 = asb1*2/asb2**2

      do i=1,4,1
         dneut(i) = 1.D0-x1+xmub-xmuneut(i)
      end do
      dgl = 1.D0-x1+xmub-xmugl

c -------------------------------------------------------------------- c
c                          neutralino exchange
c -------------------------------------------------------------------- c

      sb2sb1neut=0.D0

      do k=1,4,1
         do l=1,4,1
            sb2sb1neut=sb2sb1neut+1.D0/dneut(k)/dneut(l)*(
     .          (bbot(1,k)*bbot(1,l)*abot(2,k)*abot(2,l)+
     .           abot(1,k)*abot(1,l)*bbot(2,k)*bbot(2,l))*
     .          ((1.D0-x1)*(1.D0-x2)-xmusb1+xmub*(x1-x2+xmusb1
     .           -2.D0*xmub)+xmub)
     .         +(bbot(1,k)*bbot(1,l)*bbot(2,k)*bbot(2,l)+
     .           abot(1,k)*abot(1,l)*abot(2,k)*abot(2,l))*
     .           xmneut(k)*xmneut(l)/asb2**2*(x1+x2-1.D0+xmusb1
     .           -2.D0*xmub)
     .         +(bbot(1,k)*abot(1,l)*abot(2,k)*bbot(2,l)+
     .           abot(1,k)*bbot(1,l)*bbot(2,k)*abot(2,l))*
     .           2.D0*xmub*(-1.D0+x1-xmub)
     .         +dsqrt(xmub)*(x1-2.D0*xmub)*(xmneut(k)/asb2*
     .          (bbot(1,k)*abot(1,l)*bbot(2,k)*bbot(2,l)+
     .           abot(1,k)*bbot(1,l)*abot(2,k)*abot(2,l))
     .         +xmneut(l)/asb2*
     .          (bbot(1,k)*abot(1,l)*abot(2,k)*abot(2,l)+
     .           abot(1,k)*bbot(1,l)*bbot(2,k)*bbot(2,l)) )
     .         +dsqrt(xmub)*(-1.D0+x1+xmusb1-2.D0*xmub)* 
     .         (xmneut(k)/asb2*
     .          (bbot(1,k)*bbot(1,l)*bbot(2,k)*abot(2,l)+
     .           abot(1,k)*abot(1,l)*abot(2,k)*bbot(2,l))
     .         +xmneut(l)/asb2*
     .          (bbot(1,k)*bbot(1,l)*abot(2,k)*bbot(2,l)+
     .           abot(1,k)*abot(1,l)*bbot(2,k)*abot(2,l)) )
     .         +(bbot(1,l)*abot(1,k)*abot(2,k)*bbot(2,l)+
     .           abot(1,l)*bbot(1,k)*bbot(2,k)*abot(2,l))*
     .           (-2.D0)*xmub*xmneut(k)*xmneut(l)/asb2**2 )
         end do
      end do

c -------------------------------------------------------------------- c
c                             gluino exchange
c -------------------------------------------------------------------- c

      sb2sb1gg=1.D0/dgl**2*4.D0*( -4.D0*dsqrt(xmub*xmugl)*xmub*
     .     (gbr(2)*gbr(1)+gbl(1)*gbl(2))*(gbl(1)*gbr(2)+gbr(1)*gbl(2))
     .    +2.D0*dsqrt(xmub*xmugl)*(
     .     (gbl(1)*gbr(1)*(gbr(2)**2+gbl(2)**2)+gbr(2)*gbl(2)*
     .     (gbl(1)**2+gbr(1)**2))*x1 +
     .     gbr(2)*gbl(2)*(gbl(1)**2+gbr(1)**2)*(xmusb1-1.D0))
     .    +(-2.D0)*xmub*xmugl*(gbl(1)*gbl(2)+gbr(2)*gbr(1))**2
     .    +xmub*((gbl(1)**2*gbr(2)**2+gbr(1)**2*gbl(2)**2)*(1.D0+x1
     .     -x2+xmusb1)+4.D0*gbl(1)*gbr(2)*gbr(1)*gbl(2)*(x1-1.D0))
     .    +xmub**2*(-2.D0)*(gbl(1)*gbr(2)+gbr(1)*gbl(2))**2
     .    +xmugl*(gbl(1)**2*gbl(2)**2+gbr(2)**2*gbr(1)**2)*(x1+x2+
     .     xmusb1-1.D0)
     .    +(gbl(1)**2*gbr(2)**2+gbr(1)**2*gbl(2)**2)*(x1*x2-x1-x2
     .     -xmusb1+1.D0) )

c -------------------------------------------------------------------- c

      SD_sb2sb1starbb=3.D0*g2**2*sb2sb1neut+
     .             2.D0/3.D0*gs2**2*sb2sb1gg

      end

c ==================================================================== c
c ===================== sbottom1 bottom bottombar ==================== c
c ==================================================================== c

      double precision function SD_sb2sb1bb(x1,x2)

      implicit double precision (a-h,m,o-z)
      dimension abot(2,4),bbot(2,4)
      dimension glbbr(2,2),ghbbr(2,2)
      dimension amchar(2),dneut(4),xmuneut(4),amneut(4),xmneut(4)
      dimension gztautau(2,2),gztt(2,2),gzbb(2,2)
      dimension gul(2),gur(2),gdl(2),gdr(2),gtl(2),gtr(2),gbl(2),gbr(2)

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_scala/scalb,scalt
      COMMON/SD_yukawa/ytewsb,ybewsb,ytauewsb
      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2
      COMMON/SD_hmass/ama,aml,amh,amch,amar
      COMMON/SD_fermion/amt,amb,amtau
      COMMON/SD_weinberg/sw,cw
      COMMON/SD_coup17/azztoptop,vzztoptop,azztautau,vzztautau,
     .                 azzneutneut,vzzneutneut,azzbotbot,vzzbotbot
      COMMON/SD_coup19/gztt,gzbb,gztautau
      COMMON/SD_runcoupscale/scalechoice,scaleofcoupling,inumloop
      COMMON/SD_coupewsb/alsew,g2ew,g1ew
      COMMON/SD_gluino/mgluino
      COMMON/SD_coup21/gtr,gtl,gbr,gbl,gur,gul,gdr,gdl
      COMMON/SD_mwmzpole/amwp,amzp

      external SD_alphascall

      azbb11=gzbb(1,1)
      azbb12=gzbb(1,2)
      azbb21=gzbb(2,1)
      azbb22=gzbb(2,2)

c -- the Yukawa coupling --

      if(scalechoice.eq.1.D0) then
         scalb = ybewsb/dsqrt(g2)
         scalt = ytewsb/dsqrt(g2)
         gs2 = alsew*4.D0*pi
      elseif(scalechoice.eq.2.D0) then         
         call SD_runmass(asb2,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
         gs2 = SD_alphascall(asb2,inumloop)*4.D0*pi
      elseif(scalechoice.eq.3.D0) then
         call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
         gs2 = SD_alphascall(scaleofcoupling,inumloop)*4.D0*pi
      endif

      call SD_higgssb1sb2(glbbr,ghbbr,gabbr)
      call SD_neutsbotbot(abot,bbot)
      call SD_phibotbot(hlbbr,hhbbr,habbr)

c --- several definitions ---

      xmub   = amb**2/asb2**2
      do i=1,4,1
         xmuneut(i) = amneut(i)**2/asb2**2
      end do
      xmugl  = mgluino**2/asb2**2
      xmuz   = amzp**2/asb2**2
      xmusb1 = asb1*2/asb2**2
      xmuhl  = aml**2/asb2**2
      xmuhh  = amh**2/asb2**2
      xmuha  = ama**2/asb2**2

      x3  = 2.D0-x1-x2

      do i=1,4,1
         dneut(i) = 1.D0-x1+xmub-xmuneut(i)
      end do
      dgl = 1.D0-x1+xmub-xmugl
      dz  = 1.D0-x3+xmusb1-xmuz
      dhl = 1.D0-x3+xmusb1-xmuhl
      dhh = 1.D0-x3+xmusb1-xmuhh
      dha = 1.D0-x3+xmusb1-xmuha

      vzz = vzzbotbot
      azz = azzbotbot

c -------------------------------------------------------------------- c
c                              Z exchange
c -------------------------------------------------------------------- c

      sb2sb1zz = 1.D0/4.D0/cw**2/dz**2*azbb12**2*(
     .      8.D0*xmub*azz**2*(-x1-x2+xmusb1+3.D0)
     .     -8.D0*(azz**2+vzz**2)*(x1+x2-1.D0+xmusb1-x1*x2)
     .     -16.D0*azz**2*(1.D0-xmusb1)**2*xmub/xmuz
     .     +8.D0*azz**2*xmub/xmuz**2*(1.D0-xmusb1)**2*
     .     (x1+x2+xmusb1-1.D0))

c -------------------------------------------------------------------- c
c                              Higgs exchange
c -------------------------------------------------------------------- c

      sb2sb1hk = (2.D0/asb2**2/dhl**2*(hlbbr/dsqrt(2.D0))**2*
     .    amz**4/amw**2*glbbr(1,2)**2
     .   +2.D0/asb2**2/dhh**2*(hhbbr/dsqrt(2.D0))**2*
     .    amz**4/amw**2*ghbbr(1,2)**2
     .   +4.D0/asb2**2/dhh/dhl*(hlbbr/dsqrt(2.D0))*(hhbbr/dsqrt(2.D0))*
     .    amz**4/amw**2*glbbr(1,2)*ghbbr(1,2))*
     .    (-1.D0+x1+x2+xmusb1-4.D0*xmub)

      sb2sb1aa = 2.D0/asb2**2/dha**2*(habbr/dsqrt(2.D0))**2*
     .     amz**4/amw**2*gabbr**2*(-1.D0+x1+x2+xmusb1)

      sb2sb1higgs = sb2sb1hk+sb2sb1aa

c -------------------------------------------------------------------- c
c                          neutralino exchange
c -------------------------------------------------------------------- c

      sb2sb1neut=0.D0

      do k=1,4,1
         do l=1,4,1
            sb2sb1neut=sb2sb1neut+1.D0/dneut(k)/dneut(l)*(
     .          (abot(1,k)*abot(1,l)*abot(2,k)*abot(2,l)+
     .           bbot(1,k)*bbot(1,l)*bbot(2,k)*bbot(2,l))*
     .          ((1.D0-x1)*(1.D0-x2)-xmusb1+xmub*(x1-x2+xmusb1
     .           -2.D0*xmub)+xmub)
     .         +(abot(1,k)*abot(1,l)*bbot(2,k)*bbot(2,l)+
     .           bbot(1,k)*bbot(1,l)*abot(2,k)*abot(2,l))*
     .           xmneut(k)*xmneut(l)/asb2**2*(x1+x2-1.D0+xmusb1
     .           -2.D0*xmub)
     .         +(abot(1,k)*bbot(1,l)*abot(2,k)*bbot(2,l)+
     .           bbot(1,k)*abot(1,l)*bbot(2,k)*abot(2,l))*
     .           2.D0*xmub*(-1.D0+x1-xmub)
     .         +dsqrt(xmub)*(x1-2.D0*xmub)*(xmneut(k)/asb2*
     .          (abot(1,k)*bbot(1,l)*bbot(2,k)*bbot(2,l)+
     .           bbot(1,k)*abot(1,l)*abot(2,k)*abot(2,l))
     .         +xmneut(l)/asb2*
     .          (abot(1,k)*bbot(1,l)*abot(2,k)*abot(2,l)+
     .           bbot(1,k)*abot(1,l)*bbot(2,k)*bbot(2,l)) )
     .         +dsqrt(xmub)*(-1.D0+x1+xmusb1-2.D0*xmub)* 
     .         (xmneut(k)/asb2*
     .          (abot(1,k)*abot(1,l)*bbot(2,k)*abot(2,l)+
     .           bbot(1,k)*bbot(1,l)*abot(2,k)*bbot(2,l))
     .         +xmneut(l)/asb2*
     .          (abot(1,k)*abot(1,l)*abot(2,k)*bbot(2,l)+
     .           bbot(1,k)*bbot(1,l)*bbot(2,k)*abot(2,l)) )
     .         +(abot(1,l)*bbot(1,k)*abot(2,k)*bbot(2,l)+
     .           bbot(1,l)*abot(1,k)*bbot(2,k)*abot(2,l))*
     .           (-2.D0)*xmub*xmneut(k)*xmneut(l)/asb2**2 )
         end do
      end do

c -------------------------------------------------------------------- c
c                             gluino exchange
c -------------------------------------------------------------------- c

      sb2sb1gg=1.D0/dgl**2*4.D0*( -4.D0*dsqrt(xmub*xmugl)*xmub*
     .     (gbr(2)*gbl(1)+gbr(1)*gbl(2))*(gbr(1)*gbr(2)+gbl(1)*gbl(2))
     .    +2.D0*dsqrt(xmub*xmugl)*(
     .     (gbr(1)*gbl(1)*(gbr(2)**2+gbl(2)**2)+gbr(2)*gbl(2)*
     .     (gbr(1)**2+gbl(1)**2))*x1 +
     .     gbr(2)*gbl(2)*(gbr(1)**2+gbl(1)**2)*(xmusb1-1.D0))
     .    +(-2.D0)*xmub*xmugl*(gbr(1)*gbl(2)+gbr(2)*gbl(1))**2
     .    +xmub*((gbr(1)**2*gbr(2)**2+gbl(1)**2*gbl(2)**2)*(1.D0+x1
     .     -x2+xmusb1)+4.D0*gbr(1)*gbr(2)*gbl(1)*gbl(2)*(x1-1.D0))
     .    +xmub**2*(-2.D0)*(gbr(1)*gbr(2)+gbl(1)*gbl(2))**2
     .    +xmugl*(gbr(1)**2*gbl(2)**2+gbr(2)**2*gbl(1)**2)*(x1+x2+
     .     xmusb1-1.D0)
     .    +(gbr(1)**2*gbr(2)**2+gbl(1)**2*gbl(2)**2)*(x1*x2-x1-x2
     .     -xmusb1+1.D0) )

c -------------------------------------------------------------------- c
c                         neutralino Z interference
c -------------------------------------------------------------------- c

      sb2sb1neutz=0.D0

      do l=1,4,1
         sb2sb1neutz=sb2sb1neutz+azbb12/cw/dz/dneut(l)*(
     .      xmub*(abot(1,l)*abot(2,l)*(vzz-azz)+
     .            bbot(1,l)*bbot(2,l)*(vzz+azz))*(
     .      1.D0/xmuz*(xmusb1*(xmusb1-2.D0)+1.D0)+
     .      2.D0*x1-xmusb1-3.D0)
     .     +(abot(1,l)*abot(2,l)*(vzz+azz)+
     .       bbot(1,l)*bbot(2,l)*(vzz-azz))*(
     .      1.D0/xmuz*(1.D0-xmusb1)*(xmub*(xmusb1+x1-1.D0)-x1*xmub)
     .      +xmub*(1.D0+x1+xmusb1-2.D0*x2)-2.D0*xmusb1+2.D0*x1*x2+2.D0
     .      -2.D0*(x1+x2)+xmub*(-x1+2.D0) )
     .     +dsqrt(xmub)*xmneut(l)/asb2*
     .      (abot(1,l)*bbot(2,l)*(vzz-azz)+
     .       bbot(1,l)*abot(2,l)*(vzz+azz))*(
     .      1.D0/xmuz*(xmusb1-1.D0)*(xmusb1+x1+x2-1.D0)+x1-x2-xmusb1
     .      +1.D0 )
     .     +dsqrt(xmub)*xmneut(l)/asb2*
     .      (abot(1,l)*bbot(2,l)*(vzz+azz)+
     .       bbot(1,l)*abot(2,l)*(vzz-azz))*(
     .      1.D0/xmuz*(1.D0-xmusb1)*(xmusb1+x1+x2-1.D0)+x1-x2+xmusb1
     .      -1.D0 ) )
      end do

c -------------------------------------------------------------------- c
c                       neutralino Higgs interference
c -------------------------------------------------------------------- c

      sb2sb1hneut=0.D0

      do l=1,4,1
         sb2sb1hneut=sb2sb1hneut-2.D0*(hlbbr/dsqrt(2.D0)/dneut(l)
     .        /dhl/asb2*amz**2/amw*glbbr(1,2)+hhbbr/dsqrt(2.D0)/dneut(l)
     .        /dhh/asb2*amz**2/amw*ghbbr(1,2))*(
     .        (abot(1,l)*bbot(2,l)+abot(2,l)*bbot(1,l))*
     .        xmneut(l)/asb2*(x1+x2+xmusb1-1.D0-4.D0*xmub) 
     .        +(abot(1,l)*abot(2,l)+bbot(2,l)*bbot(1,l))*
     .        dsqrt(xmub)*(2.D0*x1-1.D0+xmusb1-4.D0*xmub) )
     .        +2.D0*habbr/dsqrt(2.D0)/dneut(l)/dha/asb2*amz**2/amw*
     .        (-gabbr)*(
     .        (abot(1,l)*abot(2,l)-bbot(2,l)*bbot(1,l))*
     .        dsqrt(xmub)*(1.D0-xmusb1) +
     .        (abot(1,l)*bbot(2,l)-abot(2,l)*bbot(1,l))*
     .        xmneut(l)/asb2*(1.D0-x1-x2-xmusb1) )
      end do

c -------------------------------------------------------------------- c
c                          Higgs Z interference
c -------------------------------------------------------------------- c

      sb2sb1hz=-2.D0/2.D0/cw*
     .   (azbb12*hlbbr/dsqrt(2.D0)*amz**2/amw*glbbr(1,2)
     .   /asb2/dz/dhl+azbb12*hhbbr/dsqrt(2.D0)*amz**2/amw*ghbbr(1,2)
     .   /asb2/dz/dhh)*2.D0*dsqrt(xmub)*vzz*2.D0*(x1-x2)
     .   +2.D0/2.D0/cw*
     .    azbb12*habbr/dsqrt(2.D0)*amz**2/amw*(-gabbr)/asb2/dz/dha*
     .   (2.D0*dsqrt(xmub)*azz*(2.D0/xmuz*(1.D0+(xmusb1-1.D0)*(x1
     .   +x2)+xmusb1**2-2.D0*xmusb1)+2.D0-2.D0*xmusb1) )

c -------------------------------------------------------------------- c

      SD_sb2sb1bb=3.D0*g2**2*(sb2sb1zz+sb2sb1higgs+sb2sb1neut+
     .         sb2sb1neutz+sb2sb1hneut+sb2sb1hz) +
     .         gs2**2*2.D0/3.D0*sb2sb1gg

      end

c ==================================================================== c
c ========================= sbottom1 top topbar ====================== c
c ==================================================================== c

      double precision function SD_sb2sb1tt(x1,x2)

      implicit double precision (a-h,m,o-z)

      dimension amchar(2),dchi(2),xmuchar(2),amneut(4),xmneut(4)
      dimension alsbot(2,2),aksbot(2,2),alsbot1(2,2),blsbot1(2,2),
     .          alsbot2(2,2),blsbot2(2,2)
      dimension glbbr(2,2),ghbbr(2,2)
      dimension gztt(2,2),gzbb(2,2),gztautau(2,2)

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_scala/scalb,scalt
      COMMON/SD_yukawa/ytewsb,ybewsb,ytauewsb
      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2
      COMMON/SD_hmass/ama,aml,amh,amch,amar
      COMMON/SD_fermion/amt,amb,amtau
      COMMON/SD_weinberg/sw,cw
      COMMON/SD_coup17/azztoptop,vzztoptop,azztautau,vzztautau,
     .                 azzneutneut,vzzneutneut,azzbotbot,vzzbotbot
      COMMON/SD_coup19/gztt,gzbb,gztautau
      COMMON/SD_runcoupscale/scalechoice,scaleofcoupling,inumloop
      COMMON/SD_mwmzpole/amwp,amzp

      azbb11=gzbb(1,1)
      azbb12=gzbb(1,2)
      azbb21=gzbb(2,1)
      azbb22=gzbb(2,2)

c --- the running couplings ---

      if(scalechoice.eq.1.D0) then
         scalb = ybewsb/dsqrt(g2)
         scalt = ytewsb/dsqrt(g2)
      elseif(scalechoice.eq.2.D0) then         
         call SD_runmass(asb2,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      elseif(scalechoice.eq.3.D0) then
         call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      endif

      call SD_higgssb1sb2(glbbr,ghbbr,gabbr)
      call SD_charsbottop(alsbot,aksbot)
      do i=1,2,1
         do j=1,2,1
            alsbot1(i,j) = alsbot(i,j)
            blsbot1(i,j) = aksbot(i,j)
            alsbot2(i,j) = alsbot(i,j)
            blsbot2(i,j) = aksbot(i,j)
         end do
      end do
     
      call SD_phitoptop(hlttr,hhttr,hattr)

c --- several definitions ---

      xmut       = amt**2/asb2**2
      xmuchar(1) = amchar(1)**2/asb2**2
      xmuchar(2) = amchar(2)**2/asb2**2
      xmuz       = amzp**2/asb2**2
      xmusb1     = asb1**2/asb2**2
      xmuhl      = aml**2/asb2**2
      xmuhh      = amh**2/asb2**2
      xmuha      = ama**2/asb2**2

      x3  = 2.D0-x1-x2

      dchi(1) = 1.D0-x1+xmut-xmuchar(1)
      dchi(2) = 1.D0-x1+xmut-xmuchar(2)
      dz      = 1.D0-x3+xmusb1-xmuz
      dhl     = 1.D0-x3+xmusb1-xmuhl
      dhh     = 1.D0-x3+xmusb1-xmuhh
      dha     = 1.D0-x3+xmusb1-xmuha

      vzz = vzztoptop
      azz = azztoptop

c -------------------------------------------------------------------- c
c                               Z exchange
c -------------------------------------------------------------------- c

      sb2sb1zz = 1.D0/4.D0/cw**2/dz**2*azbb12**2*(
     .      8.D0*xmut*azz**2*(-x1-x2+xmusb1+3.D0)
     .     -8.D0*(azz**2+vzz**2)*(x1+x2-1.D0+xmusb1-x1*x2)
     .     -16.D0*azz**2*(1.D0-xmusb1)**2*xmut/xmuz
     .     +8.D0*azz**2*xmut/xmuz**2*(1.D0-xmusb1)**2*
     .     (x1+x2+xmusb1-1.D0))

c -------------------------------------------------------------------- c
c                              Higgs exchange
c -------------------------------------------------------------------- c

      sb2sb1hk = (2.D0/asb2**2/dhl**2*(hlttr/dsqrt(2.D0))**2*
     .    amz**4/amw**2*glbbr(1,2)**2
     .   +2.D0/asb2**2/dhh**2*(hhttr/dsqrt(2.D0))**2*
     .    amz**4/amw**2*ghbbr(1,2)**2
     .   +4.D0/asb2**2/dhh/dhl*(hlttr/dsqrt(2.D0))*(hhttr/dsqrt(2.D0))*
     .    amz**4/amw**2*glbbr(1,2)*ghbbr(1,2))*
     .    (-1.D0+x1+x2+xmusb1-4.D0*xmut)

      sb2sb1aa = 2.D0/asb2**2/dha**2*(hattr/dsqrt(2.D0))**2*
     .     amz**4/amw**2*gabbr**2*(-1.D0+x1+x2+xmusb1)

      sb2sb1higgs = sb2sb1hk+sb2sb1aa

c -------------------------------------------------------------------- c
c                          chargino exchange
c -------------------------------------------------------------------- c

      sb2sb1chi=0.D0

      do k=1,2,1
         do l=1,2,1
            sb2sb1chi=sb2sb1chi+1.D0/dchi(k)/dchi(l)*(
     .          (alsbot2(1,k)*alsbot2(1,l)*alsbot1(2,k)*alsbot1(2,l)+
     .           blsbot2(1,k)*blsbot2(1,l)*blsbot1(2,k)*blsbot1(2,l))*
     .          ((1.D0-x1)*(1.D0-x2)-xmusb1+xmut*(x1-x2+xmusb1
     .           -2.D0*xmut)+xmut)
     .         +(alsbot2(1,k)*alsbot2(1,l)*blsbot1(2,k)*blsbot1(2,l)+
     .           blsbot2(1,k)*blsbot2(1,l)*alsbot1(2,k)*alsbot1(2,l))*
     .           dsqrt(xmuchar(k)*xmuchar(l))*(x1+x2-1.D0+xmusb1
     .           -2.D0*xmut)
     .         +(alsbot2(1,k)*blsbot2(1,l)*alsbot1(2,k)*blsbot1(2,l)+
     .           blsbot2(1,k)*alsbot2(1,l)*blsbot1(2,k)*alsbot1(2,l))*
     .           2.D0*xmut*(-1.D0+x1-xmut)
     .         +dsqrt(xmut)*(x1-2.D0*xmut)*(dsqrt(xmuchar(k))*
     .          (alsbot2(1,k)*blsbot2(1,l)*blsbot1(2,k)*blsbot1(2,l)+
     .           blsbot2(1,k)*alsbot2(1,l)*alsbot1(2,k)*alsbot1(2,l))
     .         +dsqrt(xmuchar(l))*
     .          (alsbot2(1,k)*blsbot2(1,l)*alsbot1(2,k)*alsbot1(2,l)+
     .           blsbot2(1,k)*alsbot2(1,l)*blsbot1(2,k)*blsbot1(2,l)) )
     .         +dsqrt(xmut)*(-1.D0+x1+xmusb1-2.D0*xmut)* 
     .         (dsqrt(xmuchar(k))*
     .          (alsbot2(1,k)*alsbot2(1,l)*blsbot1(2,k)*alsbot1(2,l)+
     .           blsbot2(1,k)*blsbot2(1,l)*alsbot1(2,k)*blsbot1(2,l))
     .         +dsqrt(xmuchar(l))*
     .          (alsbot2(1,k)*alsbot2(1,l)*alsbot1(2,k)*blsbot1(2,l)+
     .           blsbot2(1,k)*blsbot2(1,l)*blsbot1(2,k)*alsbot1(2,l)) )
     .         +(alsbot2(1,l)*blsbot2(1,k)*alsbot1(2,k)*blsbot1(2,l)+
     .           blsbot2(1,l)*alsbot2(1,k)*blsbot1(2,k)*alsbot1(2,l))*
     .           (-2.D0)*xmut*dsqrt(xmuchar(k))*dsqrt(xmuchar(l)) )
         end do
      end do

c -------------------------------------------------------------------- c
c                         chargino Z interference
c -------------------------------------------------------------------- c

      sb2sb1chiz=0.D0

      do l=1,2,1
         sb2sb1chiz=sb2sb1chiz+azbb12/cw/dz/dchi(l)*(
     .      xmut*(alsbot2(1,l)*alsbot1(2,l)*(vzz-azz)+
     .            blsbot2(1,l)*blsbot1(2,l)*(vzz+azz))*(
     .      1.D0/xmuz*(xmusb1*(xmusb1-2.D0)+1.D0)+
     .      2.D0*x1-xmusb1-3.D0)
     .     +(alsbot2(1,l)*alsbot1(2,l)*(vzz+azz)+
     .       blsbot2(1,l)*blsbot1(2,l)*(vzz-azz))*(
     .      1.D0/xmuz*(1.D0-xmusb1)*(xmut*(xmusb1+x1-1.D0)-x1*xmut)
     .      +xmut*(1.D0+x1+xmusb1-2.D0*x2)-2.D0*xmusb1+2.D0*x1*x2+2.D0
     .      -2.D0*(x1+x2)+xmut*(-x1+2.D0) )
     .     +dsqrt(xmut)*dsqrt(xmuchar(l))*
     .      (alsbot2(1,l)*blsbot1(2,l)*(vzz-azz)+
     .       blsbot2(1,l)*alsbot1(2,l)*(vzz+azz))*(
     .      1.D0/xmuz*(xmusb1-1.D0)*(xmusb1+x1+x2-1.D0)+x1-x2-xmusb1
     .      +1.D0 )
     .     +dsqrt(xmut)*dsqrt(xmuchar(l))*
     .      (alsbot2(1,l)*blsbot1(2,l)*(vzz+azz)+
     .       blsbot2(1,l)*alsbot1(2,l)*(vzz-azz))*(
     .      1.D0/xmuz*(1.D0-xmusb1)*(xmusb1+x1+x2-1.D0)+x1-x2+xmusb1
     .      -1.D0 ) )
      end do

c -------------------------------------------------------------------- c
c                       chargino Higgs interference
c -------------------------------------------------------------------- c

      sb2sb1hchi=0.D0

      do l=1,2,1
         sb2sb1hchi=sb2sb1hchi-2.D0*(hlttr/dsqrt(2.D0)/dchi(l)
     .        /dhl/asb2*amz**2/amw*glbbr(1,2)+hhttr/dsqrt(2.D0)/dchi(l)
     .        /dhh/asb2*amz**2/amw*ghbbr(1,2))*(
     .        (alsbot2(1,l)*blsbot1(2,l)+alsbot1(2,l)*blsbot2(1,l))*
     .        dsqrt(xmuchar(l))*(x1+x2+xmusb1-1.D0-4.D0*xmut) 
     .        +(alsbot2(1,l)*alsbot1(2,l)+blsbot1(2,l)*blsbot2(1,l))*
     .        dsqrt(xmut)*(2.D0*x1-1.D0+xmusb1-4.D0*xmut) )
     .        +2.D0*hattr/dsqrt(2.D0)/dchi(l)/dha/asb2*amz**2/amw*
     .        (-gabbr)*(
     .        (alsbot2(1,l)*alsbot1(2,l)-blsbot1(2,l)*blsbot2(1,l))*
     .        dsqrt(xmut)*(1.D0-xmusb1) +
     .        (alsbot2(1,l)*blsbot1(2,l)-alsbot1(2,l)*blsbot2(1,l))*
     .        dsqrt(xmuchar(l))*(1.D0-x1-x2-xmusb1) )
      end do

c -------------------------------------------------------------------- c
c                         Z Higgs interference
c -------------------------------------------------------------------- c

      sb2sb1hz=-2.D0/2.D0/cw*
     .   (azbb12*hlttr/dsqrt(2.D0)*amz**2/amw*glbbr(1,2)
     .   /asb2/dz/dhl+azbb12*hhttr/dsqrt(2.D0)*amz**2/amw*ghbbr(1,2)
     .   /asb2/dz/dhh)*2.D0*dsqrt(xmut)*vzz*2.D0*(x1-x2)
     .   +2.D0/2.D0/cw*
     .    azbb12*hattr/dsqrt(2.D0)*amz**2/amw*(-gabbr)/asb2/dz/dha*
     .   (2.D0*dsqrt(xmut)*azz*(2.D0/xmuz*(1.D0+(xmusb1-1.D0)*(x1
     .   +x2)+xmusb1**2-2.D0*xmusb1)+2.D0-2.D0*xmusb1) )

c -------------------------------------------------------------------- c

      SD_sb2sb1tt=sb2sb1zz+sb2sb1higgs+sb2sb1chi+sb2sb1chiz+sb2sb1hchi+
     .         sb2sb1hz

      end

c ==================================================================== c
c ========================= sbottom1 up upbar ======================== c
c ==================================================================== c

      double precision function SD_sb2sb1uu(x1,x2)

      implicit double precision (a-h,m,o-z)
      dimension gztt(2,2),gzbb(2,2),gztautau(2,2)

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2
      COMMON/SD_weinberg/sw,cw
      COMMON/SD_coup17/azztoptop,vzztoptop,azztautau,vzztautau,
     .                 azzneutneut,vzzneutneut,azzbotbot,vzzbotbot
      COMMON/SD_coup19/gztt,gzbb,gztautau
      COMMON/SD_mwmzpole/amwp,amzp

      azbb11=gzbb(1,1)
      azbb12=gzbb(1,2)
      azbb21=gzbb(2,1)
      azbb22=gzbb(2,2)

      xmuz   = amzp**2/asb2**2
      xmusb1 = asb1*2/asb2**2

      x3  = 2.D0-x1-x2
      dz  = 1.D0-x3+xmusb1-xmuz

      vzz = vzztoptop
      azz = azztoptop

c -------------------------------------------------------------------- c
c                              Z exchange
c -------------------------------------------------------------------- c

      sb2sb1zz = 1.D0/4.D0/cw**2/dz**2*azbb12**2*
     .     2.D0*(vzz**2+azz**2)*4.D0*(1.D0+x1*x2-x1-x2-xmusb1) 

c ----------------------------------------------------------------- c

      SD_sb2sb1uu=sb2sb1zz

      end

c ==================================================================== c
c ======================= sbottom1 down downbar ====================== c
c ==================================================================== c

      double precision function SD_sb2sb1dd(x1,x2)

      implicit double precision (a-h,m,o-z)
      dimension gztt(2,2),gzbb(2,2),gztautau(2,2)

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2
      COMMON/SD_weinberg/sw,cw
      COMMON/SD_coup17/azztoptop,vzztoptop,azztautau,vzztautau,
     .                 azzneutneut,vzzneutneut,azzbotbot,vzzbotbot
      COMMON/SD_coup19/gztt,gzbb,gztautau
      COMMON/SD_mwmzpole/amwp,amzp

      azbb11=gzbb(1,1)
      azbb12=gzbb(1,2)
      azbb21=gzbb(2,1)
      azbb22=gzbb(2,2)

      xmuz   = amzp**2/asb2**2
      xmusb1 = asb1*2/asb2**2

      x3  = 2.D0-x1-x2
      dz  = 1.D0-x3+xmusb1-xmuz

      vzz = vzzbotbot
      azz = azzbotbot

c -------------------------------------------------------------------- c
c                              Z exchange
c -------------------------------------------------------------------- c

      sb2sb1zz = 1.D0/4.D0/cw**2/dz**2*azbb12**2*
     .     2.D0*(vzz**2+azz**2)*4.D0*(1.D0+x1*x2-x1-x2-xmusb1)

c -------------------------------------------------------------------- c

      SD_sb2sb1dd=sb2sb1zz

      end

c ==================================================================== c
c =========================== sbottom1 e+ e- ========================= c
c ==================================================================== c

      double precision function SD_sb2sb1ee(x1,x2)

      implicit double precision (a-h,m,o-z)
      dimension gztt(2,2),gzbb(2,2),gztautau(2,2)

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2
      COMMON/SD_weinberg/sw,cw
      COMMON/SD_coup17/azztoptop,vzztoptop,azztautau,vzztautau,
     .                 azzneutneut,vzzneutneut,azzbotbot,vzzbotbot
      COMMON/SD_coup19/gztt,gzbb,gztautau
      COMMON/SD_mwmzpole/amwp,amzp

      azbb11=gzbb(1,1)
      azbb12=gzbb(1,2)
      azbb21=gzbb(2,1)
      azbb22=gzbb(2,2)

      xmuz   = amzp**2/asb2**2
      xmusb1 = asb1*2/asb2**2

      x3  = 2.D0-x1-x2
      dz  = 1.D0-x3+xmusb1-xmuz

      vzz = vzztautau
      azz = azztautau

c -------------------------------------------------------------------- c
c                              Z exchange
c -------------------------------------------------------------------- c

      sb2sb1zz = 1.D0/4.D0/cw**2/dz**2*azbb12**2*
     .     2.D0*(vzz**2+azz**2)*4.D0*(1.D0+x1*x2-x1-x2-xmusb1)

c -------------------------------------------------------------------- c

      SD_sb2sb1ee=sb2sb1zz

      end

c ==================================================================== c
c ========================= sbottom1 nu nubar ======================== c
c ==================================================================== c

      double precision function SD_sb2sb1nunu(x1,x2)

      implicit double precision (a-h,m,o-z)
      dimension gztt(2,2),gzbb(2,2),gztautau(2,2)

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2
      COMMON/SD_weinberg/sw,cw
      COMMON/SD_coup17/azztoptop,vzztoptop,azztautau,vzztautau,
     .                 azzneutneut,vzzneutneut,azzbotbot,vzzbotbot
      COMMON/SD_coup19/gztt,gzbb,gztautau
      COMMON/SD_mwmzpole/amwp,amzp

      azbb11=gzbb(1,1)
      azbb12=gzbb(1,2)
      azbb21=gzbb(2,1)
      azbb22=gzbb(2,2)

      xmuz   = amzp**2/asb2**2
      xmusb1 = asb1*2/asb2**2

      x3  = 2.D0-x1-x2
      dz  = 1.D0-x3+xmusb1-xmuz

      vzz = vzzneutneut
      azz = azzneutneut

c -------------------------------------------------------------------- c
c                              Z exchange
c -------------------------------------------------------------------- c

      sb2sb1zz = 1.D0/4.D0/cw**2/dz**2*azbb12**2*
     .     2.D0*(vzz**2+azz**2)*4.D0*(1.D0+x1*x2-x1-x2-xmusb1) 

c -------------------------------------------------------------------- c

      SD_sb2sb1nunu=sb2sb1zz

      end

c ==================================================================== c
c ========================= sbottom1 tau+ tau- ======================= c
c ==================================================================== c

      double precision function SD_sb2sb1tautau(x1,x2)

      implicit double precision (a-h,m,o-z)

      dimension glbbr(2,2),ghbbr(2,2),gztt(2,2),gzbb(2,2),gztautau(2,2)

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_hmass/ama,aml,amh,amch,amar
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2
      COMMON/SD_fermion/amt,amb,amtau
      COMMON/SD_weinberg/sw,cw
      COMMON/SD_mixang/a,tanbeta
      COMMON/SD_yukawa/yt,yb,ytau
      COMMON/SD_scala/scalb,scalt
      COMMON/SD_coup17/azztoptop,vzztoptop,azztautau,vzztautau,
     .                 azzneutneut,vzzneutneut,azzbotbot,vzzbotbot
      COMMON/SD_coup19/gztt,gzbb,gztautau
      COMMON/SD_runcoupscale/scalechoice,scaleofcoupling,inumloop
      COMMON/SD_mwmzpole/amwp,amzp

      azbb11=gzbb(1,1)
      azbb12=gzbb(1,2)
      azbb21=gzbb(2,1)
      azbb22=gzbb(2,2)

      bet=datan(tanbeta)
      b  =bet

c --- the running couplings ---

      if(scalechoice.eq.1.D0) then
         scalb = yb/dsqrt(g2)
         scalt = yt/dsqrt(g2)
      elseif(scalechoice.eq.2.D0) then         
         call SD_runmass(asb2,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      elseif(scalechoice.eq.3.D0) then
         call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      endif

      call SD_higgssb1sb2(glbbr,ghbbr,gabbr)

c --- several definitions ---

      xmuz   = amzp**2/asb2**2
      xmutau = amtau**2/asb2**2
      xmusb1 = asb1*2/asb2**2
      xmuhl  = aml**2/asb2**2
      xmuhh  = amh**2/asb2**2
      xmuha  = ama**2/asb2**2

      x3  = 2.D0-x1-x2
      dz  = 1.D0-x3+xmusb1-xmuz
      dhl = 1.D0-x3+xmusb1-xmuhl
      dhh = 1.D0-x3+xmusb1-xmuhh
      dha = 1.D0-x3+xmusb1-xmuha

      vzz = vzztautau
      azz = azztautau

      scaltau = ytau/dsqrt(g2)

c -------------------------------------------------------------------- c
c                              Z exchange
c -------------------------------------------------------------------- c

      sb2sb1zz = 1.D0/4.D0/cw**2/dz**2*azbb12**2*(
     .   1.D0/xmuz**2*(4.D0*(vzz**2-azz**2)*xmutau*(1.D0-(x1+x2)*(1.D0  
     .   -xmusb1)**2+xmusb1*(-xmusb1**2+3.D0*xmusb1-3.D0))+
     .   2.D0*(vzz**2+azz**2)*(1.D0-xmusb1)**2*(2.D0*xmutau*(xmusb1
     .   +x1+x2-1.D0)) )
     .   +1.D0/xmuz*(8.D0*(vzz**2-azz**2)*xmutau*(1.D0-xmusb1)**2+
     .   4.D0*(vzz**2+azz**2)*(1.D0-xmusb1)*2.D0*xmutau*(xmusb1-1.D0))
     .   +4.D0*(vzz**2-azz**2)*xmutau*(x1+x2-xmusb1-3.D0)
     .   +2.D0*(vzz**2+azz**2)*(4.D0*(1.D0+x1*x2-x1-x2-xmusb1)+
     .   xmutau*(-2.D0*x1-2.D0*x2+2.D0*xmusb1+6.D0)) )

c -------------------------------------------------------------------- c
c                             Higgs exchange
c -------------------------------------------------------------------- c

      sb2sb1hk = (2.D0/asb2**2/dhl**2*(-scaltau/dsqrt(2.D0)*dsin(a))**2*
     .    amz**4/amw**2*glbbr(1,2)**2
     .   +2.D0/asb2**2/dhh**2*(scaltau/dsqrt(2.D0)*dcos(a))**2*
     .    amz**4/amw**2*ghbbr(1,2)**2
     .   +4.D0/asb2**2/dhh/dhl*(-scaltau/dsqrt(2.D0)*dsin(a))*
     .    (scaltau/dsqrt(2.D0)*dcos(a))*
     .    amz**4/amw**2*glbbr(1,2)*ghbbr(1,2))*
     .    (-1.D0+x1+x2+xmusb1-4.D0*xmutau)

      sb2sb1aa = 2.D0/asb2**2/dha**2*(scaltau/dsqrt(2.D0)*dsin(b))**2*
     .     amz**4/amw**2*gabbr**2*(-1.D0+x1+x2+xmusb1)

      sb2sb1higgs = sb2sb1hk+sb2sb1aa

c -------------------------------------------------------------------- c
c                           Higgs Z interference
c -------------------------------------------------------------------- c

      sb2sb1hz= -1.D0/cw*
     .   (azbb12*(-scaltau/dsqrt(2.D0)*dsin(a))*amz**2/amw*glbbr(1,2)
     .   /asb2/dz/dhl
     .   +azbb12*scaltau/dsqrt(2.D0)*dcos(a)*amz**2/amw*ghbbr(1,2)
     .   /asb2/dz/dhh)*2.D0*dsqrt(xmutau)*vzz*2.D0*(x1-x2)
     .   + 1.D0/cw*
     .    azbb12*(-scaltau/dsqrt(2.D0)*dsin(b))*amz**2/amw*
     .   (-gabbr)/asb2/dz/dha*
     .   (2.D0*dsqrt(xmutau)*azz*(2.D0/xmuz*(1.D0+(xmusb1-1.D0)*(x1
     .   +x2)+xmusb1**2-2.D0*xmusb1)+2.D0-2.D0*xmusb1) )

c -------------------------------------------------------------------- c

      SD_sb2sb1tautau=sb2sb1zz+sb2sb1higgs+sb2sb1hz

      end

c ==================================================================== c
c                        selectron 2-body decays                       c
c ==================================================================== c

      subroutine SD_sel2bod(sellneute,sellcharnue,selrneute,selrcharnue)

      implicit double precision (a-h,m,o-z)
      double precision SD_lamb

      dimension sellneute(4),selrneute(4),sellcharnue(2),selrcharnue(2)
      dimension amneut(4),xmneut(4),amchar(2)
      dimension ae(2,4),be(2,4),atau(2,4),btau(2,4),anu(2,4),bnu(2,4),
     .          antau(2,4),bntau(2,4)
      dimension ale(2,2),altau(2,2),alsne(2,2),blsne(2,2),alsnt(2,2),
     .          blsnt(2,2)

      external SD_lamb

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_sfermionetau/ase1,ase2,astau1,astau2
      COMMON/SD_coup5/ale,altau,alsne,blsne,alsnt,blsnt
      COMMON/SD_coup8/ae,be,atau,btau,anu,bnu,antau,bntau    

c -------------------------------------------------------------------- c
c  selectron_L --> chi0_1/chi0_2/chi0_3/chi0_4 + e-

      do i=1,4,1
         if(ase1.gt.amneut(i)) then
            sellneute(i)=g2*(ae(1,i)**2+be(1,i)**2)*
     .           (ase1**2-amneut(i)**2)*
     .           SD_lamb(0.D0,amneut(i)/ase1)/(16*pi*ase1)
         else
            sellneute(i)=0.D0
         endif
      end do

c -------------------------------------------------------------------- c
c  selectron_L --> chi-_1/chi-_2 + neutrino_e

      do i=1,2,1
         if(ase1.gt.amchar(i)) then
            sellcharnue(i)=g2*ale(1,i)**2*(ase1**2-amchar(i)**2)*
     .                     SD_lamb(0.D0,amchar(i)/ase1)/(16*pi*ase1)
         else
            sellcharnue(i)=0.D0
         endif
      end do

c -------------------------------------------------------------------- c
c  selectron_R --> chi0_1/chi0_2/chi0_3/chi0_4 + e-

      do i=1,4,1
         if(ase2.gt.amneut(i)) then
            selrneute(i)=g2*(ae(2,i)**2+be(2,i)**2)*
     .           (ase2**2-amneut(i)**2)*
     .           SD_lamb(0.D0,amneut(i)/ase2)/(16*pi*ase2)
         else
            selrneute(i)=0.D0
         endif
      end do

c -------------------------------------------------------------------- c
c  selectron_R --> chi-_1/chi-_2 + neutrino_e

      do i=1,2,1
         if(ase2.gt.amchar(i)) then
            selrcharnue(i)=g2*ale(2,i)**2*(ase2**2-amchar(i)**2)*
     .                     SD_lamb(0.D0,amchar(i)/ase2)/(16*pi*ase2)
         else
            selrcharnue(i)=0.D0
         endif
      end do

      end

c ==================================================================== c
c                       sneutrino_el 2-body decays                     c
c ==================================================================== c

      subroutine SD_snel2bod(snellneut,snellchar)

      implicit double precision (a-h,m,o-z)
      double precision SD_lamb

      dimension snellneut(4),snellchar(2)
      dimension amneut(4),xmneut(4),amchar(2)
      dimension ae(2,4),be(2,4),atau(2,4),btau(2,4),anu(2,4),bnu(2,4),
     .          antau(2,4),bntau(2,4)
      dimension ale(2,2),altau(2,2),alsne(2,2),blsne(2,2),alsnt(2,2),
     .          blsnt(2,2)

      external SD_lamb

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_sneutrino/asne1,asne2,asntau1,asntau2
      COMMON/SD_coup5/ale,altau,alsne,blsne,alsnt,blsnt
      COMMON/SD_coup8/ae,be,atau,btau,anu,bnu,antau,bntau    

c -------------------------------------------------------------------- c
c  sneutrion_eL --> chi0_1/chi0_2/chi0_3/chi0_4 + neutrino_e

      do i=1,4,1
         if(asne1.gt.amneut(i)) then
            snellneut(i)=g2*(anu(1,i)**2+bnu(2,i)**2)*
     .        (asne1**2-amneut(i)**2)*SD_lamb(0.D0,amneut(i)/asne1)
     .        /(16*pi*asne1)
         else
            snellneut(i)=0.D0
         endif
      end do

c -------------------------------------------------------------------- c
c  sneutrino_eL --> chi+_1/chi+_2 + e-

      do i=1,2,1
         if(asne1.gt.amchar(i)) then
           snellchar(i)=g2*alsne(1,i)**2*(asne1**2-amchar(i)**2)*
     .           SD_lamb(0.D0,amchar(i)/asne1)/(16*pi*asne1)
         else
            snellchar(i)=0.D0
         endif
      end do

      end

c ==================================================================== c
c                       stau1/2 2-body decays                          c
c ==================================================================== c

      subroutine SD_stau2bod(stau1neut,stau1char,stau2neut,stau2char,
     .                      stau1hcsn,stau2hcsn,stau2hl,stau2hh,stau2ha,
     .                      stau2ztau,stau1wsn,stau2wsn)

      implicit double precision (a-h,m,o-z)
      double precision SD_lamb

      dimension stau1neut(4),stau2neut(4),stau1char(2),stau2char(2)
      dimension amneut(4),xmneut(4),amchar(2)
      dimension ale(2,2),alto(2,2),alsne(2,2),blsne(2,2),alsnt(2,2),
     .          blsnt(2,2)
      dimension ae(2,4),be(2,4),ato(2,4),bto(2,4),anu(2,4),bnu(2,4),
     .          antau(2,4),bntau(2,4)
      dimension gmsntau(2),stau1hcsn(2),stau2hcsn(2),stau1wsn(2),
     .          stau2wsn(2)
      dimension gltautaur(2,2),ghtautaur(2,2),gcsntaur(2,2)
      dimension gztt(2,2),gzbb(2,2),gztautau(2,2)
      dimension gwtb(2,2),gwntau(2,2)

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_fermion/amt,amb,amtau
      COMMON/SD_hmass/ama,aml,amh,amch,amar
      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_sfermionetau/ase1,ase2,astau1,astau2
      COMMON/SD_sneutrino/asne1,asne2,asntau1,asntau2
      COMMON/SD_coup5/ale,alto,alsne,blsne,alsnt,blsnt
      COMMON/SD_coup8/ae,be,ato,bto,anu,bnu,antau,bntau
      COMMON/SD_coup19/gztt,gzbb,gztautau
      COMMON/SD_coup20/gwtb,gwntau
      COMMON/SD_yukawa/ytewsb,ybewsb,ytauewsb
      COMMON/SD_scalatau/scaltau
      COMMON/SD_mwmzpole/amwp,amzp
      COMMON/SD_weinberg/sw,cw

      external SD_lamb
      
      gmsntau(1) = asntau1
      gmsntau(2) = asntau2

c -------------------------------------------------------------------- c
c  stau1 --> chi0_1/chi0_2/chi0_3/chi0_4 + tau

      do i=1,4,1
         if(astau1.gt.(amneut(i)+amtau)) then
            stau1neut(i)=g2*((ato(1,i)**2+bto(1,i)**2)*
     .        (astau1**2-amneut(i)**2-amtau**2)
     .        -4*ato(1,i)*bto(1,i)*amtau*xmneut(i)
     .        )*SD_lamb(amtau/astau1,amneut(i)/astau1)
     .        /(16.D0*pi*astau1)
         else
            stau1neut(i)=0.D0
         endif
      end do

c -------------------------------------------------------------------- c
c  stau2 --> chi0_1/chi0_2/chi0_3/chi0_4 + tau
      
      do i=1,4,1
         if(astau2.gt.(amneut(i)+amtau)) then
            stau2neut(i)=g2*((ato(2,i)**2+bto(2,i)**2)*
     .        (astau2**2-amneut(i)**2-amtau**2)
     .        -4*ato(2,i)*bto(2,i)*amtau*xmneut(i)
     .        )*SD_lamb(amtau/astau2,amneut(i)/astau2)
     .        /(16.D0*pi*astau2)
         else
            stau2neut(i)=0.D0
         endif
      end do

c ----------------------------------------------------------------- c
c  stau1 --> chi+_1/chi+_2 + nu_tau

      do i=1,2,1
         if(astau1.gt.amchar(i)) then
            stau1char(i)=g2*alto(1,i)**2*(astau1**2-amchar(i)**2)*
     .        SD_lamb(0.D0,amchar(i)/astau1)/(16*pi*astau1)
         else
            stau1char(i)=0.D0
         endif
      end do

c -------------------------------------------------------------------- c
c  stau2 --> chi-_1/chi-_2 + nu_tau

      do i=1,2,1
         if(astau2.gt.amchar(i)) then
            stau2char(i)=g2*alto(2,i)**2*(astau2**2-amchar(i)**2)*
     .        SD_lamb(0.D0,amchar(i)/astau2)/(16*pi*astau2)
         else
            stau2char(i)=0.D0
         endif
      end do

c -------------------------------------------------------------------- c
c  stau1 --> H- + sneutrino_tau1/2

      scaltau = ytauewsb/dsqrt(g2)

      call SD_hcstausntau(gcsntaur)

      do i=1,2,1
         if(astau1.gt.(gmsntau(i)+amch)) then
            stau1hcsn(i)=g2*amw**2*gcsntaur(i,1)**2*
     .           SD_lamb(gmsntau(i)/astau1,amch/astau1)
     .           /(16.D0*pi*astau1)
         else
            stau1hcsn(i)=0.D0
         endif
      end do

c -------------------------------------------------------------------- c
c  stau2 --> H- + sneutrino_tau1/2

      scaltau = ytauewsb/dsqrt(g2)

      call SD_hcstausntau(gcsntaur)

      do i=1,2,1
         if(astau2.gt.(gmsntau(i)+amch)) then
            stau2hcsn(i)=g2*amw**2*gcsntaur(i,2)**2*
     .           SD_lamb(gmsntau(i)/astau2,amch/astau2)
     .           /(16.D0*pi*astau2)
         else
            stau2hcsn(i)=0.D0
         endif
      end do

c -------------------------------------------------------------------- c
c  stau2 --> h + stau1

      scaltau = ytauewsb/dsqrt(g2)

      call SD_higgsstau1stau2(gltautaur,ghtautaur,gatautaur)

      if(astau2.gt.(astau1+aml)) then
         stau2hl=g2*amz**4/amw**2*gltautaur(2,1)**2*
     .         SD_lamb(astau1/astau2,aml/astau2)/(16.D0*pi*astau2)
      else
         stau2hl=0.D0
      endif

c -------------------------------------------------------------------- c
c  stau2 --> H + stau1

      if(astau2.gt.(astau1+amh)) then
         stau2hh=g2*amz**4/amw**2*ghtautaur(2,1)**2*
     .         SD_lamb(astau1/astau2,amh/astau2)/(16.D0*pi*astau2)
      else
         stau2hh=0.D0
      endif

c -------------------------------------------------------------------- c
c  stau2 --> A + stau1

      if(astau2.gt.(astau1+ama)) then
         stau2ha=g2*amz**4/amw**2*gatautaur**2*
     .         SD_lamb(astau1/astau2,ama/astau2)/(16.D0*pi*astau2)
      else
         stau2ha=0.D0
      endif

c -------------------------------------------------------------------- c
c  stau2 --> Z + stau1

      if(astau2.gt.(astau1+amzp)) then
         stau2ztau=g2/64.D0/pi/cw**2/amzp**2*astau2**3*gztautau(2,1)**2*
     .           SD_lamb(astau1/astau2,amzp/astau2)**3
      else
         stau2ztau=0.D0
      endif

c -------------------------------------------------------------------- c
c  stau1 --> W- + sntau1/2

      do i=1,2,1
         if(astau1.gt.(gmsntau(i)+amwp)) then
            stau1wsn(i)=g2/32.D0/pi/amwp**2*astau1**3*gwntau(i,1)**2*
     .                SD_lamb(gmsntau(i)/astau1,amwp/astau1)**3
         else
            stau1wsn(i)=0.D0
         endif
      end do

c -------------------------------------------------------------------- c
c  stau2 --> W- + sntau1/2

      do i=1,2,1
         if(astau2.gt.(gmsntau(i)+amwp)) then
            stau2wsn(i)=g2/32.D0/pi/amwp**2*astau2**3*gwntau(i,2)**2*
     .                SD_lamb(gmsntau(i)/astau2,amwp/astau2)**3
         else
            stau2wsn(i)=0.D0
         endif
      end do

      end

c ==================================================================== c
c                       sneutrino_tau 2-body decays                    c
c ==================================================================== c

      subroutine SD_sntau2bod(sntauneut,sntauchar,sntau1hcstau,
     .                        sntau1wstau)

      implicit double precision (a-h,m,o-z)
      double precision SD_lamb

      dimension sntauneut(4),sntauchar(2),sntau1hcstau(2),sntau1wstau(2)
      dimension amneut(4),xmneut(4),amchar(2)
      dimension ale(2,2),alto(2,2),alsne(2,2),blsne(2,2),alsnt(2,2),
     .          blsnt(2,2)
      dimension ae(2,4),be(2,4),ato(2,4),bto(2,4),anu(2,4),bnu(2,4),
     .          antau(2,4),bntau(2,4)
      dimension gcsntaur(2,2),gmstau(2)
      dimension gwtb(2,2),gwntau(2,2)

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_hmass/ama,aml,amh,amch,amar
      COMMON/SD_fermion/amt,amb,amtau
      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_sneutrino/asne1,asne2,asntau1,asntau2
      COMMON/SD_sfermionetau/ase1,ase2,astau1,astau2
      COMMON/SD_coup5/ale,alto,alsne,blsne,alsnt,blsnt
      COMMON/SD_coup8/ae,be,ato,bto,anu,bnu,antau,bntau  
      COMMON/SD_coup20/gwtb,gwntau
      COMMON/SD_scalatau/scaltau
      COMMON/SD_yukawa/ytewsb,ybewsb,ytauewsb
      COMMON/SD_mwmzpole/amwp,amzp

      external SD_lamb

      gmstau(1) = astau1
      gmstau(2) = astau2

c -------------------------------------------------------------------- c
c  sneutrino_tau1 --> chi0_1/chi0_2/chi0_3/chi0_4 + neutrino_tau

      do i=1,4,1
         if(asntau1.gt.amneut(i)) then
            sntauneut(i)=g2*(antau(1,i)**2+bntau(1,i)**2)*
     .        (asntau1**2-amneut(i)**2)*
     .           SD_lamb(0.D0,amneut(i)/asntau1)
     .        /(16*pi*asntau1)
         else
            sntauneut(i)=0.D0
         endif
      end do

c -------------------------------------------------------------------- c
c  sneutrino_tau1 --> chi+_1/chi+_2 + tau-

      do i=1,2,1
         if(asntau1.gt.(amchar(i)+amtau)) then
            sntauchar(i)=g2*((alsnt(1,i)**2+blsnt(1,i)**2)*
     .           (asntau1**2-amchar(i)**2-amtau**2)
     .           -4.D0*alsnt(1,i)*blsnt(1,i)*amchar(i)*amtau)*
     .           SD_lamb(amtau/asntau1,amchar(i)/asntau1)
     .           /(16*pi*asntau1)
         else
            sntauchar(i)=0.D0
         endif
      end do

c -------------------------------------------------------------------- c
c  sneutrino_tau1 --> H- + stau1/2

      scaltau = ytauewsb/dsqrt(g2)

      call SD_hcstausntau(gcsntaur)

      do i=1,2,1
         if(asntau1.gt.(gmstau(i)+amch)) then
            sntau1hcstau(i)=g2*amw**2*gcsntaur(1,i)**2*
     .        SD_lamb(gmstau(i)/asntau1,amch/asntau1)/(16.D0*pi*asntau1)
         else
            sntau1hcstau(i)=0.D0
         endif
      end do

c -------------------------------------------------------------------- c
c  sneutrino_tau1 --> W- + stau1/2

      do i=1,2,1
         if(asntau1.gt.(gmstau(i)+amwp)) then
            sntau1wstau(i)=g2/32.D0/pi/amwp**2*asntau1**3*
     .                gwntau(1,i)**2*
     .                SD_lamb(gmstau(i)/asntau1,amwp/asntau1)**3
         else
            sntau1wstau(i)=0.D0
         endif
      end do

      end

c ==================================================================== c
c    In the following part, there are several help functions and       c
c    subroutines.                                                      c
c ==================================================================== c

c -------------------------------------------------------------------- c
c ---------------------- the function lambda ------------------------- c
c -------------------------------------------------------------------- c

      double precision function SD_lamb(x,y)      

      implicit double precision (a-h,k-z)

      SD_lamb=dsqrt((1.D0-x**2-y**2)**2-4.D0*x**2*y**2) 

      return
      end

c -------------------------------------------------------------------- c
c ---------------------- the integration limits ---------------------- c
c -------------------------------------------------------------------- c

      double precision function SD_ax(xmu1,xmu2,xmu3)
      implicit real*8(a-h,o-z)
      SD_ax=2.d0*dsqrt(xmu1)
      end

c -------------------------------------------------------------------- c

      double precision function SD_bx(xmu1,xmu2,xmu3)
      implicit real*8(a-h,o-z)
      SD_bx=1.D0+xmu1-(dsqrt(xmu2)+dsqrt(xmu3))**2
      end

c -------------------------------------------------------------------- c

      double precision function SD_ay(xmu1,xmu2,xmu3,x1)
      implicit real*8(a-h,o-z)

      a = 1.D0-x1+xmu1
      b = (x1-2.D0)*(x1-1.D0-xmu2+xmu3-xmu1)

      delta = (4.D0*xmu1-x1**2)*
     .        (4.D0*xmu2*xmu3-(x1-1.D0+xmu2+xmu3-xmu1)**2)

      if (delta.lt.0.D0) then
         SD_ay=0.D0
      else
         r1=(b-dsqrt(delta))/(2.D0*a)
         r2=(b+dsqrt(delta))/(2.D0*a)
         SD_ay=r1
      endif

      end

c -------------------------------------------------------------------- c

      double precision function SD_by(xmu1,xmu2,xmu3,x1)
      implicit real*8(a-h,o-z)

      a = 1.D0-x1+xmu1
      b = (x1-2.D0)*(x1-1.D0-xmu2+xmu3-xmu1)

      delta = (4.D0*xmu1-x1**2)*
     .        (4.D0*xmu2*xmu3-(x1-1.D0+xmu2+xmu3-xmu1)**2)
      
      if (delta.lt.0.d0) then
         SD_by=0.D0
      else
         r1=(b-dsqrt(delta))/(2.D0*a)
         r2=(b+dsqrt(delta))/(2.D0*a)
         SD_by=r2
      endif

      end

c -------------------------------------------------------------------- c
c ----------------------- the integration routine -------------------- c
c -------------------------------------------------------------------- c

      SUBROUTINE SD_INTEG2(F,SD_AX,SD_BX,SD_AY,SD_BY,xmu1,xmu2,xmu3,
     .                     NX,NY,SUM)
      IMPLICIT double precision (A-H,O-Z)
      DIMENSION RX(1000),WX(1000),RY(1000),WY(1000)
      EXTERNAL F,SD_AY,SD_BY,SD_AX,SD_BX
      INTEGER NX,NY
	
      AXX=SD_AX(xmu1,xmu2,xmu3)
      BXX=SD_BX(xmu1,xmu2,xmu3)

      CALL SD_GAUS(NX,AXX,BXX,RX,WX)
    
      SX=0.D0
      DO  1 K=1,NX
         X=RX(K)
         AYX=SD_AY(xmu1,xmu2,xmu3,X)
         BYX=SD_BY(xmu1,xmu2,xmu3,X)
         CALL SD_GAUS(NY,AYX,BYX,RY,WY)
         SY=0.D0
         DO 2 J=1,NY
            SY=SY+WY(J)*F(X,RY(J))
 2       CONTINUE
         SX=SX+WX(K)*SY
 1    CONTINUE		
      SUM=SX
      END

c -------------------------------------------------------------------- c

      SUBROUTINE SD_GAUS(N,A,B,X,W)
C     GAUSS-LEGENDRE INTEGRATION FROM A TO B (WEIGHT = 1.)
C     CALCULATES GAUSSIAN POINTS X AND WEIGHTS W
C                      FOR N=4,6,8,12,16,24,32 ;
C     IF N IS DIFFERENT FROM THESE VALUES THE PROGRAM DECOMPOSES
C     THE INTERVAL [A,B] AND N INTO CORRESPONDING PEACES
C     N MUST BE EVEN AND >= 4,IF IT IS NOT,IT IS CHANGED !
C
      IMPLICIT REAL*8 (A-H,O-Z)
      DIMENSION XG(16,7),DG(16,7),YG(16),EG(16),X(1),W(1),NI(7),NG(7)
      DATA NBEG,NA,NI,NG /9*0,4,6,8,12,16,24,32/
      DATA XG/ .43056815579702629D 0, .16999052179242813D 0, 14*0.D0,
     X         .46623475710157601D 0, .33060469323313226D 0,
     Y         .11930959304159845D 0,                        13*0.D0,
     Z         .48014492824876812D 0, .39833323870681337D 0,
     1         .26276620495816449D 0, .9171732124782490 D-1, 12*0.D0,
     2         .49078031712335963D 0, .45205862818523743D 0,
     3         .38495133709715234D 0, .29365897714330872D 0,
     4         .18391574949909010D 0, .62616704255734458D-1, 10*0.D0,
     5         .49470046749582497D 0, .47228751153661629D 0,
     6         .43281560119391587D 0, .37770220417750152D 0,
     7         .30893812220132187D 0, .22900838882861369D 0,
     8         .14080177538962946D 0, .47506254918818720D-1,  8*0.D0,
     9         .49759360999851068D 0, .48736427798565475D 0,
     A         .46913727600136638D 0, .44320776350220052D 0,
     B         .41000099298695146D 0, .37006209578927718D 0,
     C         .32404682596848778D 0, .27271073569441977D 0,
     D         .21689675381302257D 0, .15752133984808169D 0,
     E         .95559433736808150D-1, .32028446431302813D-1, 20*0.D0/
      DATA YG/ .49863193092474078D 0, .49280575577263417D 0,
     G         .48238112779375322D 0, .46745303796886984D 0,
     H         .44816057788302606D 0, .42468380686628499D 0,
     I         .39724189798397120D 0, .36609105937014484D 0,
     J         .33152213346510760D 0, .29385787862038116D 0,
     K         .25344995446611470D 0, .21067563806531767D 0,
     L         .16593430114106382D 0, .11964368112606854D 0,
     M         .72235980791398250D-1, .24153832843869158D-1/
      DATA DG/ .17392742256872693D 0, .32607257743127307D 0, 14*0.D0,
     X         .85662246189585173D-1, .18038078652406930D 0,
     Y         .23395696728634552D 0,                        13*0.D0,
     Z         .50614268145188130D-1, .11119051722668724D 0,
     1         .15685332293894364D 0, .18134189168918099D 0, 12*0.D0,
     2         .23587668193255914D-1, .53469662997659215D-1,
     3         .8003916427167311 D-1, .10158371336153296D 0,
     4         .11674626826917740D 0, .12457352290670139D 0, 10*0.D0,
     5         .13576229705877047D-1, .31126761969323946D-1,
     6         .47579255841246392D-1, .62314485627766936D-1,
     7         .74797994408288370D-1, .84578259697501270D-1,
     8         .91301707522461790D-1, .94725305227534250D-1,  8*0.D0,
     9         .61706148999935998D-2, .14265694314466832D-1,
     A         .22138719408709903D-1, .29649292457718390D-1,
     B         .36673240705540153D-1, .43095080765976638D-1,
     C         .48809326052056944D-1, .53722135057982817D-1,
     D         .57752834026862801D-1, .60835236463901696D-1,
     E         .62918728173414148D-1, .63969097673376078D-1, 20*0.D0/
      DATA EG/ .35093050047350483D-2, .8137197365452835 D-2,
     G         .12696032654631030D-1, .17136931456510717D-1,
     H         .21417949011113340D-1, .25499029631188088D-1,
     I         .29342046739267774D-1, .32911111388180923D-1,
     J         .36172897054424253D-1, .39096947893535153D-1,
     K         .41655962113473378D-1, .43826046502201906D-1,
     L         .45586939347881942D-1, .46922199540402283D-1,
     M         .47819360039637430D-1, .48270044257363900D-1/
C
    9 IF(NBEG.EQ.0) THEN
      NBEG=1
      DO 10 I=1,16
      XG(I,7)=YG(I)
   10 DG(I,7)=EG(I)
      END IF
C
C     N MUST BE EVEN AND >= 4
C
      NN=(N/2)*2
      IF(NN.LT.4) NN=4
      IF(NN.NE.N) THEN
      WRITE (*,*) N,' GAUSS-POINTS WERE NOT POSSIBLE'
      N=NN
      WRITE (*,*) ' INSTEAD NOW ',N,' POINTS ARE USED'
      END IF
      IF(NA.NE.N) THEN
      NA=N
      NR=NA
      DO 11 L=7,1,-1
      NI(L)=NR/NG(L)
      NR=NR-NG(L)*NI(L)
      IF(NR.EQ.2) THEN
      NI(L)=NI(L)-1
      NR=NR+NG(L)
      END IF
 11	 CONTINUE
      IF(NR.NE.0) WRITE (*,*) 'ERROR IN GAUSS: NR=',NR
      END IF
C
      DELP=(B-A)/N
      IF(DELP.EQ.0.D0) GO TO 15
      A1=A
      I0=0
      DO 14 L1=7,1,-1
      NIN=NI(L1)
      IF(NIN.EQ.0) GO TO 14
      DEL=DELP*NG(L1)
      M   = NG(L1)/2
      DO 13 K=1,NIN
      ABM =A1+DEL*0.5D0
      DO 12 J=1,M
      I   = M+J
      L   = M+1-J
      J1=J+I0
      I1=I+I0
      X(J1)=ABM-DEL*XG(J,L1)
      X(I1)=ABM+DEL*XG(L,L1)
      W(J1)=    DEL*DG(J,L1)
   12 W(I1)=    DEL*DG(L,L1)
      I0=I0+NG(L1)
   13 A1=A1+DEL
   14 CONTINUE
C
C     TEST
C
      IF(I0.NE.N) WRITE (*,*) 'ERROR IN GAUSS :',I0,'.NE.',N,
     +                        ' A1=',A1,' B=',B
      RETURN
   15 DO 16 L=1,N
      X(L)=A
   16 W(L)=0.D0
      RETURN
      END

c -------------------------------------------------------------------- c
c ---------------- Help functions for radiative decays --------------- c
c -------------------------------------------------------------------- c

c -------- Integrals needed in the radiative gluino decays:  --------- c
c -------- gluino -> neutralino_i gluon.                     --------- c
c -------- Taken from: Haber/Wyler Nucl.Phys.B323 (1989) 267 --------- c

      complex*16 function SD_iint(mj,mi,m,mc)

      implicit double precision (a-h,k-z)
      complex*16 SD_ccspen,lami,lamj,ctmp1,ctmp2,ctmp3,ctmp4,tmpa,tmpb,
     .           m2s,mc2s

      external SD_ccspen

      eps = 1.D-10

      m2s  = m**2*(1.D0-dcmplx(0.D0,1.D0)*eps)
      mc2s = mc**2*(1.D0-dcmplx(0.D0,1.D0)*eps)

      tmpa = dcmplx((m2s+mc2s-mi**2)**2-4.D0*m2s*mc2s)
      tmpb = dcmplx((m2s+mc2s-mj**2)**2-4.D0*m2s*mc2s)

      lami = cdsqrt(tmpa)
      lamj = cdsqrt(tmpb)

      ctmp1 = SD_ccspen( (mj**2+m2s-mc2s+lamj)/(2.D0*m2s) )
      ctmp2 = SD_ccspen( (mj**2+m2s-mc2s-lamj)/(2.D0*m2s) )
      ctmp3 = SD_ccspen( (mi**2+m2s-mc2s+lami)/(2.D0*m2s) )
      ctmp4 = SD_ccspen( (mi**2+m2s-mc2s-lami)/(2.D0*m2s) )

      if(mc.gt.1.D4.or.m.gt.1.D4) then
         SD_iint = 1.D0/(mc2s-m2s)*(1.D0-
     .                        mc2s/(mc2s-m2s)*cdlog(mc2s/m2s))
      else
         SD_iint = -1.D0/(mj**2-mi**2)*(ctmp1+ctmp2-ctmp3-ctmp4)
      endif

      return

      end

c -------------------------------------------------------------------- c

      complex*16 function SD_jint(mj,mi,m,mc)

      implicit double precision (a-h,k-z)
      complex*16 lami,lamj,tmpa,tmpb,ctmp1,ctmp2,ctmp3,ctmp4,m2s,mc2s,
     .           SD_iint

      external SD_iint

      eps = 1.D-10

      m2s  = m**2*(1.D0-dcmplx(0.D0,1.D0)*eps)
      mc2s = mc**2*(1.D0-dcmplx(0.D0,1.D0)*eps)

      tmpa = dcmplx((m2s+mc2s-mi**2)**2-4.D0*m2s*mc2s)
      tmpb = dcmplx((m2s+mc2s-mj**2)**2-4.D0*m2s*mc2s)

      lami = cdsqrt(tmpa)
      lamj = cdsqrt(tmpb)

      ctmp1 = dcmplx(m2s+mc2s-mj**2+lamj)
      ctmp2 = dcmplx(m2s+mc2s-mi**2+lami)

      ctmp3 = (cdlog(ctmp1/dcmplx(2.D0*m*mc)))**2
      ctmp4 = (cdlog(ctmp2/dcmplx(2.D0*m*mc)))**2

      if(mc.gt.1.D4.or.m.gt.1.D4) then
         SD_jint = 1.D0/(mc2s-m2s)*cdlog(m2s/mc2s) 
     .        - SD_iint(mj,mi,m,mc) 
      else
         SD_jint = 1.D0/(mj**2-mi**2)*( ctmp3 - ctmp4 )  
     .        - SD_iint(mj,mi,m,mc) 
      endif

      return

      end

c -------------------------------------------------------------------- c

      complex*16 function SD_i2int(mj,mi,m,mc)

      implicit double precision (a-h,k-z)
      complex*16 lami,lamj,tmpa,tmpb,m2s,mc2s,ctmp3,ctmp4,ctmp5,ctmp6

      eps = 1.D-10

      m2s  = m**2*(1.D0-dcmplx(0.D0,1.D0)*eps)
      mc2s = mc**2*(1.D0-dcmplx(0.D0,1.D0)*eps)

      tmpa = dcmplx((m2s+mc2s-mi**2)**2-4.D0*m2s*mc2s)
      tmpb = dcmplx((m2s+mc2s-mj**2)**2-4.D0*m2s*mc2s)

      lami = cdsqrt(tmpa)
      lamj = cdsqrt(tmpb)

      ctmp3 = m2s+mc2s-dcmplx(mj**2)-lamj
      ctmp4 = m2s+mc2s-dcmplx(mj**2)+lamj
      ctmp5 = m2s+mc2s-dcmplx(mi**2)-lami
      ctmp6 = m2s+mc2s-dcmplx(mi**2)+lami

      if(mc.gt.1.D4.or.m.gt.1.D4) then
         SD_i2int = -1.D0/(mc2s-m2s)**2*((m2s+mc2s)/2.D0-
     .        m2s*mc2s/(mc2s-m2s)*cdlog(mc2s/m2s))
      else
         SD_i2int = (mc2s-m2s)/(2.D0*mi**2*mj**2)*cdlog(m2s/mc2s) +
     .        1.D0/(mj**2-mi**2)*(
     .        lamj/(2.D0*mj**2)*cdlog(ctmp3/ctmp4) -
     .        lami/(2.D0*mi**2)*cdlog(ctmp5/ctmp6) )
      endif

      return

      end

c -------------------------------------------------------------------- c

      complex*16 function SD_kint(mj,mi,m,mc)

      implicit double precision (a-h,k-z)
      double precision m,mc,mj,mi
      complex*16 SD_iint,SD_jint,SD_i2int,m2s,mc2s

      external SD_iint,SD_jint,SD_i2int

      eps = 1.D-10

      m2s  = m**2*(1.D0-dcmplx(0.D0,1.D0)*eps)
      mc2s = mc**2*(1.D0-dcmplx(0.D0,1.D0)*eps)

      if(mc.gt.1.D4.or.m.gt.1.D4) then
         SD_kint = 1.D0/2.D0*SD_i2int(mj,mi,m,mc)
      else
         SD_kint = -1.D0/(mj**2-mi**2)*(1.D0+m2s*SD_iint(mj,mi,m,mc)+
     .        mc2s*SD_jint(mj,mi,m,mc)-mj**2*SD_i2int(mj,mi,m,mc))
      endif

      return

      end

c -------------------------------------------------------------------- c

      complex*16 function SD_iinthelp(mj,mi,m,mc)

      implicit double precision (a-h,k-z)
      complex*16 SD_ccspen,lami,lamj,ctmp1,ctmp2,ctmp3,ctmp4,tmpa,tmpb,
     .           m2s,mc2s

      external SD_ccspen

      eps = 1.D-10

      m2s  = m**2*(1.D0-dcmplx(0.D0,1.D0)*eps)
      mc2s = mc**2*(1.D0-dcmplx(0.D0,1.D0)*eps)

      tmpa = dcmplx((m2s+mc2s-mi**2)**2-4.D0*m2s*mc2s)
      tmpb = dcmplx((m2s+mc2s-mj**2)**2-4.D0*m2s*mc2s)

      lami = cdsqrt(tmpa)
      lamj = cdsqrt(tmpb)

      ctmp1 = SD_ccspen( (mj**2+m2s-mc2s+lamj)/(2.D0*m2s) )
      ctmp2 = SD_ccspen( (mj**2+m2s-mc2s-lamj)/(2.D0*m2s) )
      ctmp3 = SD_ccspen( (mi**2+m2s-mc2s+lami)/(2.D0*m2s) )
      ctmp4 = SD_ccspen( (mi**2+m2s-mc2s-lami)/(2.D0*m2s) )

      SD_iinthelp = -1.D0/(mj**2-mi**2)*(ctmp1+ctmp2-ctmp3-ctmp4)
      
      return

      end

c -------------------------------------------------------------------- c

      complex*16 function SD_jint0(mj,mi,mc)

      implicit double precision (a-h,k-z)
      complex*16 SD_iinthelp

      external SD_iinthelp

      SD_jint0 = SD_iinthelp(mj,mi,mc,0.D0) 

      return

      end

c -------------------------------------------------------------------- c

      complex*16 function SD_i2int0(mj,mi,mc)

      implicit double precision (a-h,k-z)
      complex*16 mc2s

      eps = 1.D-10

      mc2s = mc**2*(1.D0-dcmplx(0.D0,1.D0)*eps)

      if(mc.gt.1.D4) then
         SD_i2int0 = -1.D0/2.D0/mc2s
      else 
         SD_i2int0 = -mc2s/mi**2/mj**2*cdlog(mc2s) + 1.D0/(mj**2-mi**2)*
     .        ((mc2s-mi**2)/mi**2*cdlog(mc2s-mi**2) -
     .        (mc2s-mj**2)/mj**2*cdlog(mc2s-mj**2) )
      endif

      return

      end

c -------------------------------------------------------------------- c

      complex*16 function SD_kint0(mj,mi,mc)

      implicit double precision (a-h,k-z)
      complex*16 SD_jint0,SD_i2int0,mc2s

      external SD_jint0,SD_i2int0

      eps = 1.D-10

      mc2s = mc**2*(1.D0-dcmplx(0.D0,1.D0)*eps)

      if(mc.gt.1.D4) then
         SD_kint0 = 1.D0/2.D0*SD_i2int0(mj,mi,mc)
      else
         SD_kint0 = -1.D0/(mj**2-mi**2)*(1.D0+mc2s*SD_jint0(mj,mi,mc)
     .        -mj**2*SD_i2int0(mj,mi,mc))
      endif

      return

      end

c -------------------------------------------------------------------- c
c -------------- Help functions for the QCD corrections -------------- c
c -------------------------------------------------------------------- c

c -------------------------------------------------------------------- c
c ------------------ A.Bartl et al., hep-ph/9710286 ------------------ c
c -------------------------------------------------------------------- c
c -- The vertex corrections -- c

      double precision function SD_gluonvertex(ami,amj,amv,lamv,amuv)

      implicit double precision (a-h,k-z)
      complex*16 SD_C0_lam
      
      C1Den = - dreal(SD_C0_lam(ami,amj,amv,lamv)) - 
     .    SD_C1_lam(ami,amj,amv,ami,lamv,amj,amuv,lamv)
      C2Den = SD_C2_lam(ami,amj,amv,ami,lamv,amj,amuv,lamv)

      SD_gluonvertex = SD_B02(ami**2,lamv,ami,amuv**2) +
     .     SD_B02(amj**2,lamv,amj,amuv**2) - 2.D0*
     .     (ami**2+amj**2-amv**2)*
     .     (dreal(SD_C0_lam(ami,amj,amv,lamv)) + C1Den + C2Den)

      return

      end

c -------------------------------------------------------------------- c

      double precision function SD_gluinoZvertex(ami,amj,amv,lamv,amuv,
     .     mgluino,amq,iq3L,eq,sw,thetasq)

      implicit double precision (a-h,k-z)
      double precision iq3L
      complex*16 SD_C03

      C1Den = - dreal(SD_C03(ami**2,amv**2,amj**2,mgluino,amq,amq)) - 
     .    SD_C1(ami,amv,amj,mgluino,amq,amq,amuv)
      C2Den = SD_C2(ami,amv,amj,mgluino,amq,amq,amuv)

      SD_gluinoZvertex = iq3L*(2.D0*mgluino**2*
     .     dreal(SD_C03(ami**2,amv**2,amj**2,mgluino,amq,amq))
     .     + ami**2*C1Den + amj**2*C2Den
     .     +(mgluino**2-amq**2)*(C1Den+C2Den) +
     .     SD_B02(amv**2,amq,amq,amuv**2))*dsin(2.D0*thetasq) +
     .     2.D0*mgluino*amq*(iq3L-2.D0*eq*sw**2)*
     .     ( dreal(SD_C03(ami**2,amv**2,amj**2,mgluino,amq,amq)) 
     .     + C1Den + C2Den )*dcos(2.D0*thetasq)

      return

      end

c -------------------------------------------------------------------- c

      double precision function SD_gluinoWvertex(ami,amj,amv,lamv,amuv,
     .     mgluino,amq,amqp,thsq,thsqp,i,j)

      implicit double precision (a-h,k-z)
      double precision iq3L
      complex*16 SD_C03
      dimension r(2,2),rp(2,2)
      
      r(1,1) = dcos(thsq)
      r(1,2) = dsin(thsq)
      r(2,1) = -dsin(thsq)
      r(2,2) = dcos(thsq)

      rp(1,1) = dcos(thsqp)
      rp(1,2) = dsin(thsqp)
      rp(2,1) = -dsin(thsqp)
      rp(2,2) = dcos(thsqp)

      C1Den = - dreal(SD_C03(ami**2,amv**2,amj**2,mgluino,amq,amqp)) - 
     .    SD_C1(ami,amv,amj,mgluino,amq,amqp,amuv)
      C2Den = SD_C2(ami,amv,amj,mgluino,amq,amqp,amuv)

      SD_gluinoWvertex = mgluino*(
     .     dreal(SD_C03(ami**2,amv**2,amj**2,mgluino,amq,amqp)) +
     .     C1Den + C2Den )*
     .     ( amq*r(i,2)*rp(j,1) + amqp*r(i,1)*rp(j,2) )
     .     -(ami**2*C1Den + amj**2*C2Den + mgluino**2*(2.D0*
     .       dreal(SD_C03(ami**2,amv**2,amj**2,mgluino,amq,amqp)) 
     .      + C1Den + C2Den ) 
     .      + SD_B02(amv**2,amq,amqp,amuv**2) )*r(i,1)*rp(j,1)
     .     -amq*amqp*( C1Den + C2Den )*r(i,2)*rp(j,2)

      return

      end

c -------------------------------------------------------------------- c

      double precision function SD_wavefuncvertex(amsqi,amsqpj,amq,amqp,
     .     thetasq,thetasqp,vecindex,quarkindex,ii,jj,mgluino,lamv,amuv)

      implicit double precision (a-h,k-z)

      dimension gvqqp(2,2)
      dimension gztt(2,2),gzbb(2,2),gztautau(2,2)
      dimension gwtb(2,2),gwntau(2,2)
      dimension gmst(2),gmsb(2)

      COMMON/SD_coup19/gztt,gzbb,gztautau
      COMMON/SD_coup20/gwtb,gwntau
      COMMON/SD_weinberg/sw,cw
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2

      external SD_deltaZnngluon,SD_deltaZnngluino,SD_deltaZnnpgluino,
     .         SD_deltaZnnpsquark

      gmst(1) = ast1
      gmst(2) = ast2
      gmsb(1) = asb1
      gmsb(2) = asb2

      if(ii.eq.1) then
         ik = 2
      elseif(ii.eq.2) then
         ik = 1
      endif

      if(jj.eq.1) then
         il = 2
      elseif(jj.eq.2) then
         il = 1
      endif

      if(quarkindex.eq.1.D0) then
         if(vecindex.eq.1.D0) then
            do i=1,2,1
               do j=1,2,1
                  gvqqp(i,j) = 1.D0/2.D0/cw*gztt(i,j)
                  amsqk  = gmst(ik) 
                  amsqpl = gmst(il)
                  amsq1  = gmst(1)
                  amsq2  = gmst(2)
                  amsqp1 = gmst(1)
                  amsqp2 = gmst(2)
               end do
            end do
         elseif(vecindex.eq.2.D0) then
            do i=1,2,1
               do j=1,2,1
                  gvqqp(i,j) = 1.D0/dsqrt(2.D0)*gwtb(i,j)
                  amsqk  = gmst(ik) 
                  amsqpl = gmsb(il)
                  amsq1  = gmst(1)
                  amsq2  = gmst(2)
                  amsqp1 = gmsb(1)
                  amsqp2 = gmsb(2)
               end do
            end do
         endif
      elseif(quarkindex.eq.2.D0) then
         if(vecindex.eq.1.D0) then
            do i=1,2,1
               do j=1,2,1
                  gvqqp(i,j) = 1.D0/2.D0/cw*gzbb(i,j)
                  amsqk  = gmsb(ik) 
                  amsqpl = gmsb(il)
                  amsq1  = gmsb(1)
                  amsq2  = gmsb(2)
                  amsqp1 = gmsb(1)
                  amsqp2 = gmsb(2)
               end do
            end do
         elseif(vecindex.eq.2.D0) then
            do i=1,2,1
               do j=1,2,1
                  gvqqp(i,j) = 1.D0/dsqrt(2.D0)*gwtb(j,i)
                  amsqk  = gmsb(ik) 
                  amsqpl = gmst(il)
                  amsq1  = gmsb(1)
                  amsq2  = gmsb(2)
                  amsqp1 = gmst(1)
                  amsqp2 = gmst(2)
               end do
            end do
         endif
      endif

      SD_wavefuncvertex =1.D0/2.D0*(SD_deltaZnngluon(amsqi,lamv,amuv)+
     .                SD_deltaZnngluon(amsqpj,lamv,amuv))*gvqqp(ii,jj)
     .  +  1.D0/2.D0*(SD_deltaZnngluino(amsqi,mgluino,amq,amuv,dble(ii),
     .                thetasq) +
     .                SD_deltaZnngluino(amsqpj,mgluino,amqp,amuv,
     .                dble(jj),thetasqp) )*gvqqp(ii,jj)
     .    +SD_deltaZnnpgluino(amsqi,amsqk,mgluino,amq,amuv,thetasq)*
     .     gvqqp(ik,jj)
     .    +SD_deltaZnnpgluino(amsqpj,amsqpl,mgluino,amqp,amuv,thetasqp)*
     .     gvqqp(ii,il)
     .    +SD_deltaZnnpsquark(amsq1,amsq2,amsqi,amsqk,amuv,thetasq)*
     .     gvqqp(ik,jj)
     .    +SD_deltaZnnpsquark(amsqp1,amsqp2,amsqpj,amsqpl,amuv,thetasqp)
     .     *gvqqp(ii,il)

      return

      end

c -------------------------------------------------------------------- c

      double precision function SD_quarkmixZ(amsq,thetasq,iq3L,eq,amsq1,
     .     amsq2,amq,mgluino,amuv)

      implicit double precision (a-h,k-z)
      double precision iq3L

      COMMON/SD_weinberg/sw,cw

      deltathetasqsq = 1.D0/6.D0*dsin(4.D0*thetasq)/(amsq1**2-amsq2**2)
     .     *( SD_A01(amsq2**2,amuv**2) - SD_A01(amsq1**2,amuv**2) )

      v11 = 4.D0*(iq3L*dcos(thetasq)**2-eq*sw**2)
      v22 = 4.D0*(iq3L*dsin(thetasq)**2-eq*sw**2)

      deltathetasqgl = 1.D0/3.D0*mgluino*amq/iq3L/(amsq1**2-amsq2**2)*
     .     ( SD_B02(amsq2**2,mgluino,amq,amuv**2)*v11 -
     .       SD_B02(amsq1**2,mgluino,amq,amuv**2)*v22 )

      SD_quarkmixZ = -1.D0/cw*iq3L*dcos(2.D0*thetasq)*(
     .     deltathetasqsq + deltathetasqgl )

      return

      end

c -------------------------------------------------------------------- c

      double precision function SD_quarkmixW(amsq,thetasq,iq3L,eq,amsq1,
     .     amsq2,amq,amsqp,thetasqp,iqp3L,eqp,amsqp1,amsqp2,amqp,ii,jj,
     .     mgluino,amuv)

      implicit double precision (a-h,k-z)
      double precision iq3L,iqp3L
      dimension cijwsq(2,2),cijwsqp(2,2)

      COMMON/SD_weinberg/sw,cw

      cijwsq(1,1) = -dsin(thetasq)*dcos(thetasqp)
      cijwsq(1,2) =  dsin(thetasq)*dsin(thetasqp)
      cijwsq(2,1) = -dcos(thetasq)*dcos(thetasqp)
      cijwsq(2,2) =  dcos(thetasq)*dsin(thetasqp)

      cijwsqp(1,1) = -dsin(thetasqp)*dcos(thetasq)
      cijwsqp(1,2) = -dcos(thetasq)*dcos(thetasqp)
      cijwsqp(2,1) =  dsin(thetasq)*dsin(thetasqp)
      cijwsqp(2,2) =  dcos(thetasqp)*dsin(thetasq)

c --------------------------------------

      deltathetasqsq = 1.D0/6.D0*dsin(4.D0*thetasq)/(amsq1**2-amsq2**2)
     .     *( SD_A01(amsq2**2,amuv**2) - SD_A01(amsq1**2,amuv**2) )

      deltathetasqpsq = 1.D0/6.D0*dsin(4.D0*thetasqp)
     .     /(amsqp1**2-amsqp2**2)*
     .     ( SD_A01(amsqp2**2,amuv**2) - SD_A01(amsqp1**2,amuv**2) )

c --------------------------------------

      v11sq = 4.D0*(iq3L*dcos(thetasq)**2-eq*sw**2)
      v22sq = 4.D0*(iq3L*dsin(thetasq)**2-eq*sw**2)

      deltathetasqgl = 1.D0/3.D0*mgluino*amq/iq3L/(amsq1**2-amsq2**2)*
     .     ( SD_B02(amsq2**2,mgluino,amq,amuv**2)*v11sq -
     .       SD_B02(amsq1**2,mgluino,amq,amuv**2)*v22sq )

c --------------------------------------

      v11sqp = 4.D0*(iqp3L*dcos(thetasqp)**2-eqp*sw**2)
      v22sqp = 4.D0*(iqp3L*dsin(thetasqp)**2-eqp*sw**2)

      deltathetasqpgl = 1.D0/3.D0*mgluino*amqp/iqp3L
     .     /(amsqp1**2-amsqp2**2)*
     .     ( SD_B02(amsqp2**2,mgluino,amqp,amuv**2)*v11sqp -
     .       SD_B02(amsqp1**2,mgluino,amqp,amuv**2)*v22sqp )

c --------------------------------------

      SD_quarkmixW = 1.D0/dsqrt(2.D0)*( 
     .     cijwsq(ii,jj)*(deltathetasqsq+deltathetasqgl) +
     .     cijwsqp(ii,jj)*(deltathetasqpsq+deltathetasqpgl) )

      return

      end

c -------------------------------------------------------------------- c

      double precision function SD_realgluonem(amsqi,amsqpj,amv,lamv)

      implicit double precision (a-h,k-z)

      complex*16 SD_ccspen,SD_kappa

      external SD_kappa,SD_ccspen

      kap = dreal(SD_kappa(amsqi**2,amsqpj**2,amv**2,0.D0))

      b0 = (amsqi**2-amsqpj**2-amv**2+kap)/2.D0/amsqpj/amv
      b1 = (amsqi**2-amsqpj**2+amv**2-kap)/2.D0/amsqi/amv
      b2 = (amsqi**2+amsqpj**2-amv**2-kap)/2.D0/amsqi/amsqpj

      lb0 = dreal(cdlog(dcmplx(b0)))
      lb1 = dreal(cdlog(dcmplx(b1)))
      lb2 = dreal(cdlog(dcmplx(b2)))
      lb12 = dreal(cdlog(dcmplx(b1/b2)))
      lb02 = dreal(cdlog(dcmplx(b0/b2)))

      hint = 1.D0/4.D0/amsqi**2*(kap/2.D0*(amsqi**2+amsqpj**2+amv**2)+
     .     2.D0*amsqi**2*amsqpj**2*lb2 + 
     .     2.D0*amsqi**2*amv**2*lb1 +
     .     2.D0*amsqpj**2*amv**2*lb0 )

      hint0 = 1.D0/4.D0/amsqi**2*(-2.D0*amsqpj**2*lb2-2.D0*amv**2*lb1-
     .     kap)

      hint1 = 1.D0/4.D0/amsqi**2*(-2.D0*amsqi**2*lb2-2.D0*amv**2*lb0-
     .     kap)

      hint00 = 1.D0/4.D0/amsqi**4*(
     .     kap*dlog(kap**2/(lamv*amsqi*amsqpj*amv)) - kap -
     .     (amsqpj**2-amv**2)*lb12 - amsqi**2*lb0 )

      hint11 = 1.D0/4.D0/amsqi**2/amsqpj**2*(
     .     kap*dlog(kap**2/(lamv*amsqi*amsqpj*amv)) - kap -
     .     (amsqi**2-amv**2)*lb02 - amsqpj**2*lb1 )

      hint01 = dreal(1.D0/4.D0/amsqi**2*(
     .     -2.D0*dlog((lamv*amsqi*amsqpj*amv)/kap**2)*lb2 +
     .     2.D0*lb2**2 - lb0**2 - lb1**2 + 
     .     2.D0*SD_ccspen(dcmplx(1.D0-b2**2)) - 
     .     SD_ccspen(dcmplx(1-b0**2))
     .     - SD_ccspen(dcmplx(1-b1**2)) ) )

      SD_realgluonem = 2.D0*hint - kap**2/amv**2*( hint0+hint1+
     .     amsqi**2*hint00+amsqpj**2*hint11+
     .     (amsqi**2+amsqpj**2-amv**2)*hint01 )

      return

      end

c -------------------------------------------------------------------- c

      double precision function SD_deltaZnngluon(amsq,lamv,amuv)

      implicit double precision (a-h,k-z)

      SD_deltaZnngluon = 2.D0/3.D0*(
     .     SD_B02(amsq**2,0.D0,amsq,amuv**2) + 
     .     2.D0*amsq**2*SD_BP02(amsq**2,lamv,amsq,amuv**2) )

      return

      end

c -------------------------------------------------------------------- c

      double precision function SD_deltaZnngluino(amsq,mgluino,amq,
     .     amuv,n,thetasq)

      implicit double precision (a-h,k-z)

      SD_deltaZnngluino = -2.D0/3.D0*(
     .     SD_B02(amsq**2,mgluino,amq,amuv**2) + 
     .     (amsq**2-amq**2-mgluino**2)*
     .     SD_BP02(amsq**2,mgluino,amq,amuv**2) -
     .     2.D0*amq*mgluino*(-1.D0)**n*dsin(2.D0*thetasq)*
     .     SD_BP02(amsq**2,mgluino,amq,amuv**2) )

      return

      end

c -------------------------------------------------------------------- c

      double precision function SD_deltaZnnpgluino(amsq,amsqp,mgluino,
     .     amq,amuv,thetasq)

      implicit double precision (a-h,k-z)

      SD_deltaZnnpgluino = - 1.D0/(amsq**2-amsqp**2)*4.D0/3.D0*
     .     mgluino*amq*dcos(2.D0*thetasq)*
     .     SD_B02(amsq**2,mgluino,amq,amuv**2)

      return

      end

c -------------------------------------------------------------------- c

      double precision function SD_deltaZnnpsquark(amsq1,amsq2,amsq,
     .     amsqp,amuv,thetasq)

      implicit double precision (a-h,k-z)

      SD_deltaZnnpsquark = - 1.D0/(amsq**2-amsqp**2)*1.D0/6.D0*
     .     dsin(4.D0*thetasq)*( SD_A01(amsq2**2,amuv**2) -
     .     SD_A01(amsq1**2,amuv**2) )

      return

      end

c -------------------------------------------------------------------- c
c ----- A.Arhrib, A.Djouadi, W.Hollik, C.Juenger, hep-ph/9702426 ----- c
c -------------------------------------------------------------------- c
c -- Virtual corrections for the decays squark_i -> Higgs squark_j' -- c

      double precision function SD_gvirtgl(ami,amhi,amj,lamv,amuv)

      implicit double precision (a-h,k-z)
      complex*16 SD_C0_lam
      
      amisq = ami**2
      amjsq = amj**2
      amhsq = amhi**2
      amusq = amuv**2

      SD_gvirtgl = SD_B02(amisq,lamv,ami,amusq) + 
     .             SD_B02(amjsq,lamv,amj,amusq) -
     .             SD_B02(amhsq,ami,amj,amusq)  +
     .             2.D0*(amisq+amjsq-amhsq)*
     .             dreal(SD_C0_lam(amj,ami,amhi,lamv))

      return

      end

c -------------------------------------------------------------------- c

      double precision function SD_gvirtmix(am1,am2,amij,amgl,amq,theq,
     .                                   amuv)

      implicit double precision (a-h,k-z)

      c2q = dcos(2.D0*theq)
      s2q = dsin(2.D0*theq)

      am1sq  = am1**2
      am2sq  = am2**2
      amijsq = amij**2
      amusq  = amuv**2

      SD_gvirtmix = c2q*s2q*(SD_A01(am2sq,amusq)-
     .           SD_A01(am1sq,amusq))+
     .           4.D0*c2q*amq*amgl*SD_B02(amijsq,amgl,amq,amusq)

      return 

      end

c -------------------------------------------------------------------- c

      double precision function SD_gvirtmixdiv(am1,am2,amij,amgl,amq,
     .                                         theq,amuv)

      implicit double precision (a-h,k-z)

      c2q = dcos(2.D0*theq)
      s2q = dsin(2.D0*theq)

      am1sq  = am1**2
      am2sq  = am2**2
      amijsq = amij**2
      amusq  = amuv**2

      SD_gvirtmixdiv = c2q*s2q*(am2sq*dlog(amusq)-am1sq*dlog(amusq) )
     .     +4.D0*c2q*amq*amgl*SD_B02_DIV(amijsq,amgl,amq,amusq)

      return 

      end

c -------------------------------------------------------------------- c

      double precision function SD_topneut1719(nh,amuv)

      implicit double precision (a-h,k-z)
      integer nh
      complex*16 SD_C03

      dimension sm(2,2,2),glttr(2,2),ghttr(2,2)

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2
      COMMON/SD_hmass/ama,aml,amh,amch,amar
      COMMON/SD_gluino/mgluino
      COMMON/SD_sfmixang/thet,theb,thel,cum,sum,cdm,sdm,cem,sem
      COMMON/SD_scala/scalb,scalt
      COMMON/SD_yukawa/ytewsb,ybewsb,ytauewsb
      COMMON/SD_runmcalc/rmtc,rmbc,rmtauc
      COMMON/SD_runcoupscale/scalechoice,scaleofcoupling,inumloop

c --- the running couplings ---

      if(scalechoice.eq.1.D0) then
         scalb = ybewsb/dsqrt(g2)
         scalt = ytewsb/dsqrt(g2)
         runmt = rmtc
         runmb = rmbc
      elseif(scalechoice.eq.2.D0) then         
         call SD_runmass(ast2,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      elseif(scalechoice.eq.3.D0) then
         call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      endif

      call SD_higgsst1st2(glttr,ghttr,gattr)
      call SD_phitoptop(hlttr,hhttr,hattr)

c ----------------------------- 

      call SD_smatrix(sm)
      amusq  = amuv**2

c -----------------------------

      if(nh.eq.1) then
         coupphi = sm(2,1,1)*glttr(1,1)*sm(1,1,1)*
     .        SD_B02(aml**2,ast1,ast1,amusq) +
     .        sm(2,1,1)*glttr(1,2)*sm(2,1,1)*
     .        SD_B02(aml**2,ast1,ast2,amusq) +
     .        sm(2,2,1)*glttr(2,1)*sm(1,1,1)*
     .        SD_B02(aml**2,ast2,ast1,amusq) +
     .        sm(2,2,1)*glttr(2,2)*sm(2,1,1)*
     .        SD_B02(aml**2,ast2,ast2,amusq) 
      elseif(nh.eq.2) then
         coupphi = sm(2,1,1)*ghttr(1,1)*sm(1,1,1)*
     .        SD_B02(amh**2,ast1,ast1,amusq) +
     .        sm(2,1,1)*ghttr(1,2)*sm(2,1,1)*
     .        SD_B02(amh**2,ast1,ast2,amusq) +
     .        sm(2,2,1)*ghttr(2,1)*sm(1,1,1)*
     .        SD_B02(amh**2,ast2,ast1,amusq) +
     .        sm(2,2,1)*ghttr(2,2)*sm(2,1,1)*
     .        SD_B02(amh**2,ast2,ast2,amusq) 
      elseif(nh.eq.3) then
         coupphi = sm(2,1,1)*gattr*sm(2,1,1)*
     .        SD_B02(ama**2,ast1,ast2,amusq) -
     .        sm(2,2,1)*gattr*sm(1,1,1)*
     .        SD_B02(ama**2,ast2,ast1,amusq) 
      endif
      
      coupphi = dsqrt(2.D0)*amz**2*coupphi
      
c the result Eq.(17) in the paper
      
      squarktopneut = coupphi

c --------------------------------------------

      amq    = runmt
      ast1sq = ast1**2
      ast2sq = ast2**2
      amlsq  = aml**2
      amhsq  = amh**2
      amasq  = ama**2

      v1 = 1.D0/2.D0*(dcos(thet)-dsin(thet))
      v2 = -1.D0/2.D0*(dcos(thet)+dsin(thet))
      a1 = -v2
      a2 = v1

c the result Eq.(19) in the paper

      if(nh.eq.1) then
         gluinoex = 4.D0*amw*hlttr*(
     .        (amq*(v2*v1+a2*a1)+mgluino*(v2*v1-a2*a1))*
     .        (SD_B02(ast2**2,mgluino,amq,amusq)+
     .         SD_B02(ast1**2,mgluino,amq,amusq)) +
     .        2.D0*amq*(v2*v1+a2*a1)*
     .        SD_B02(aml**2,amq,amq,amusq) +
     .        (-mgluino*(v2*v1-a2*a1)*(aml**2-4.D0*amq**2)
     .         -(v2*v1+a2*a1)*(ast1**2*amq+ast2**2*amq-(mgluino**2+
     .         amq**2)*2.D0*amq) )*
     .        dreal(SD_C03(ast2sq,amlsq,ast1sq,mgluino,amq,amq)) )
      elseif(nh.eq.2) then
         gluinoex = 4.D0*amw*hhttr*(
     .        (amq*(v2*v1+a2*a1)+mgluino*(v2*v1-a2*a1))*
     .        (SD_B02(ast2**2,mgluino,amq,amusq)+
     .         SD_B02(ast1**2,mgluino,amq,amusq)) +
     .        2.D0*amq*(v2*v1+a2*a1)*
     .        SD_B02(amh**2,amq,amq,amusq) +
     .        (-mgluino*(v2*v1-a2*a1)*(amh**2-4.D0*amq**2)
     .         -(v2*v1+a2*a1)*(ast1**2*amq+ast2**2*amq-(mgluino**2+
     .         amq**2)*2.D0*amq) )*
     .        dreal(SD_C03(ast2sq,amhsq,ast1sq,mgluino,amq,amq)) )
      elseif(nh.eq.3) then
         gluinoex = -4.D0*amw*hattr*(
     .        (-amq*(v2*a1+a2*v1)-mgluino*(v2*a1-a2*v1))*
     .         SD_B02(ast2**2,mgluino,amq,amusq)+
     .        (amq*(v2*a1+a2*v1)-mgluino*(v2*a1-a2*v1))*
     .         SD_B02(ast1**2,mgluino,amq,amusq) +
     .        (mgluino*(v2*a1-a2*v1)*ama**2
     .         +(v2*a1+a2*v1)*(ast1**2*amq-ast2**2*amq) )*
     .        dreal(SD_C03(ast2sq,amasq,ast1sq,mgluino,amq,amq)) )
      endif

      SD_topneut1719 = squarktopneut + gluinoex

      return
      
      end

c -------------------------------------------------------------------- c

      double precision function SD_botneut1719(nh,amuv)

      implicit double precision (a-h,k-z)
      integer nh
      complex*16 SD_C03

      dimension sm(2,2,2),glbbr(2,2),ghbbr(2,2)

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2
      COMMON/SD_hmass/ama,aml,amh,amch,amar
      COMMON/SD_gluino/mgluino
      COMMON/SD_sfmixang/thet,theb,thel,cum,sum,cdm,sdm,cem,sem
      COMMON/SD_scala/scalb,scalt
      COMMON/SD_yukawa/ytewsb,ybewsb,ytauewsb
      COMMON/SD_runmcalc/rmtc,rmbc,rmtauc
      COMMON/SD_runcoupscale/scalechoice,scaleofcoupling,inumloop

c --- the running couplings ---

      if(scalechoice.eq.1.D0) then
         scalb = ybewsb/dsqrt(g2)
         scalt = ytewsb/dsqrt(g2)
         runmt = rmtc
         runmb = rmbc
      elseif(scalechoice.eq.2.D0) then         
         call SD_runmass(asb2,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      elseif(scalechoice.eq.3.D0) then
         call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      endif

      call SD_higgssb1sb2(glbbr,ghbbr,gabbr)
      call SD_phibotbot(hlbbr,hhbbr,habbr)

c ----------------------------- 

      call SD_smatrix(sm)
      amusq  = amuv**2

c -----------------------------

      if(nh.eq.1) then
         coupphi = sm(2,1,2)*glbbr(1,1)*sm(1,1,2)*
     .             SD_B02(aml**2,asb1,asb1,amusq) +
     .             sm(2,1,2)*glbbr(1,2)*sm(2,1,2)*
     .             SD_B02(aml**2,asb1,asb2,amusq) +
     .             sm(2,2,2)*glbbr(2,1)*sm(1,1,2)*
     .             SD_B02(aml**2,asb2,asb1,amusq) +
     .             sm(2,2,2)*glbbr(2,2)*sm(2,1,2)*
     .             SD_B02(aml**2,asb2,asb2,amusq) 
      elseif(nh.eq.2) then
         coupphi = sm(2,1,2)*ghbbr(1,1)*sm(1,1,2)*
     .             SD_B02(amh**2,asb1,asb1,amusq) +
     .             sm(2,1,2)*ghbbr(1,2)*sm(2,1,2)*
     .             SD_B02(amh**2,asb1,asb2,amusq) +
     .             sm(2,2,2)*ghbbr(2,1)*sm(1,1,2)*
     .             SD_B02(amh**2,asb2,asb1,amusq) +
     .             sm(2,2,2)*ghbbr(2,2)*sm(2,1,2)*
     .             SD_B02(amh**2,asb2,asb2,amusq) 
      elseif(nh.eq.3) then
         coupphi = sm(2,1,2)*gabbr*sm(2,1,2)*
     .             SD_B02(ama**2,asb1,asb2,amusq) -
     .             sm(2,2,2)*gabbr*sm(1,1,2)*
     .             SD_B02(ama**2,asb2,asb1,amusq) 
      endif

      coupphi = dsqrt(2.D0)*amz**2*coupphi

c the result Eq.(17) in the paper

      squarkbotneut = coupphi

c --------------------------------------------

      amq    = runmb
      asb1sq = asb1**2
      asb2sq = asb2**2
      amlsq  = aml**2
      amhsq  = amh**2
      amasq  = ama**2

      v1 = 1.D0/2.D0*(dcos(theb)-dsin(theb))
      v2 = -1.D0/2.D0*(dcos(theb)+dsin(theb))
      a1 = -v2
      a2 = v1

c the result Eq.(19) in the paper

      if(nh.eq.1) then
         gluinoex = 4.D0*amw*hlbbr*(
     .        (amq*(v2*v1+a2*a1)+mgluino*(v2*v1-a2*a1))*
     .        (SD_B02(asb2**2,mgluino,amq,amusq)+
     .         SD_B02(asb1**2,mgluino,amq,amusq)) +
     .        2.D0*amq*(v2*v1+a2*a1)*
     .        SD_B02(aml**2,amq,amq,amusq) +
     .        (-mgluino*(v2*v1-a2*a1)*(aml**2-4.D0*amq**2)
     .         -(v2*v1+a2*a1)*(asb1**2*amq+asb2**2*amq-(mgluino**2+
     .         amq**2)*2.D0*amq) )*
     .        dreal(SD_C03(asb2sq,amlsq,asb1sq,mgluino,amq,amq)) )
      elseif(nh.eq.2) then
         gluinoex = 4.D0*amw*hhbbr*(
     .        (amq*(v2*v1+a2*a1)+mgluino*(v2*v1-a2*a1))*
     .        (SD_B02(asb2**2,mgluino,amq,amusq)+
     .         SD_B02(asb1**2,mgluino,amq,amusq)) +
     .        2.D0*amq*(v2*v1+a2*a1)*
     .        SD_B02(amh**2,amq,amq,amusq) +
     .        (-mgluino*(v2*v1-a2*a1)*(amh**2-4.D0*amq**2)
     .         -(v2*v1+a2*a1)*(asb1**2*amq+asb2**2*amq-(mgluino**2+
     .         amq**2)*2.D0*amq) )*
     .        dreal(SD_C03(asb2sq,amhsq,asb1sq,mgluino,amq,amq)) )
      elseif(nh.eq.3) then
         gluinoex = -4.D0*amw*habbr*(
     .        (-amq*(v2*a1+a2*v1)-mgluino*(v2*a1-a2*v1))*
     .         SD_B02(asb2**2,mgluino,amq,amusq)+
     .        (amq*(v2*a1+a2*v1)-mgluino*(v2*a1-a2*v1))*
     .         SD_B02(asb1**2,mgluino,amq,amusq) +
     .        (mgluino*(v2*a1-a2*v1)*ama**2
     .         +(v2*a1+a2*v1)*(asb1**2*amq-asb2**2*amq) )*
     .        dreal(SD_C03(asb2sq,amasq,asb1sq,mgluino,amq,amq)) )
      endif

      SD_botneut1719 = squarkbotneut + gluinoex

      return

      end

c -------------------------------------------------------------------- c

      double precision function SD_stopsbot1719(amuv,ni,nj)

      implicit double precision (a-h,k-z)
      complex*16 SD_C03

      dimension sm(2,2,2),gctbr(2,2),gmst(2),vq(2),aq(2),vqp(2),
     .          aqp(2),gmsb(2)
      integer ni,nj

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2
      COMMON/SD_hmass/ama,aml,amh,amch,amar
      COMMON/SD_gluino/mgluino
      COMMON/SD_sfmixang/thet,theb,thel,cum,sum,cdm,sdm,cem,sem
      COMMON/SD_scala/scalb,scalt
      COMMON/SD_yukawa/ytewsb,ybewsb,ytauewsb
      COMMON/SD_runmcalc/rmtc,rmbc,rmtauc
      COMMON/SD_runcoupscale/scalechoice,scaleofcoupling,inumloop

      external SD_runmass,SD_yuk

      gmst(1) = ast1
      gmst(2) = ast2

      gmsb(1) = asb1
      gmsb(2) = asb2

c --- the running couplings ---

      if(scalechoice.eq.1.D0) then
         scalb = ybewsb/dsqrt(g2)
         scalt = ytewsb/dsqrt(g2)
         runmt = rmtc
         runmb = rmbc
      elseif(scalechoice.eq.2.D0) then         
         call SD_runmass(gmst(ni),0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      elseif(scalechoice.eq.3.D0) then
         call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      endif

      call SD_hcsbotstop(gctbr)
      call SD_higgschudb(chtbrunr,chtbrunl)

c ----------------------------- 

      call SD_smatrix(sm)
      amusq = amuv**2

c -----------------------------

      coupphi = sm(ni,1,1)*gctbr(1,1)*sm(1,nj,2)*
     .     SD_B02(amch**2,ast1,asb1,amusq) +
     .     sm(ni,1,1)*gctbr(1,2)*sm(2,nj,2)*
     .     SD_B02(amch**2,ast1,asb2,amusq) +
     .     sm(ni,2,1)*gctbr(2,1)*sm(1,nj,2)*
     .     SD_B02(amch**2,ast2,asb1,amusq) +
     .     sm(ni,2,1)*gctbr(2,2)*sm(2,nj,2)*
     .     SD_B02(amch**2,ast2,asb2,amusq) 

      coupphi = dsqrt(2.D0)*amw**2*coupphi

c the result Eq.(17) in the paper

      squarkstopsbot = coupphi

c --------------------------------------------

      amq = runmt
      amqp = runmb

      amchsq = amch**2

      vq(1) = 1.D0/2.D0*(dcos(thet)-dsin(thet))
      vq(2) = -1.D0/2.D0*(dcos(thet)+dsin(thet))
      aq(1) = -vq(2)
      aq(2) = vq(1)

      vqp(1) = 1.D0/2.D0*(dcos(theb)-dsin(theb))
      vqp(2) = -1.D0/2.D0*(dcos(theb)+dsin(theb))
      aqp(1) = -vqp(2)
      aqp(2) = vqp(1)

      vs = 2.D0*dsqrt(2.D0)*amw*(chtbrunr+chtbrunl)
      as = 2.D0*dsqrt(2.D0)*amw*(chtbrunr-chtbrunl)

c the result Eq.(19) in the paper

      gluinoex = (vs*(amq*(vq(ni)*vqp(nj)+aq(ni)*aqp(nj))+
     .     mgluino*(vq(ni)*vqp(nj)-aq(ni)*aqp(nj))) 
     .     -as*(amq*(vq(ni)*aqp(nj)+aq(ni)*vqp(nj))+
     .     mgluino*(vq(ni)*aqp(nj)-aq(ni)*vqp(nj))))*
     .     SD_B02(gmst(ni)**2,mgluino,amq,amusq) +
     .     (vs*(amqp*(vq(ni)*vqp(nj)+aq(ni)*aqp(nj))+
     .     mgluino*(vq(ni)*vqp(nj)-aq(ni)*aqp(nj))) +
     .     as*(amqp*(vq(ni)*aqp(nj)+aq(ni)*vqp(nj)) -
     .     mgluino*(vq(ni)*aqp(nj)-aq(ni)*vqp(nj))))*
     .     SD_B02(gmsb(nj)**2,mgluino,amqp,amusq) +
     .     (vs*(amq*(vq(ni)*vqp(nj)+aq(ni)*aqp(nj))+
     .     amqp*(vq(ni)*vqp(nj)+aq(ni)*aqp(nj))) -
     .     as*(amq*(vq(ni)*aqp(nj)+aq(ni)*vqp(nj))-
     .     amqp*(vq(ni)*aqp(nj)+aq(ni)*vqp(nj))))*
     .     SD_B02(amchsq,amq,amqp,amusq) +
     .     (as*mgluino*(vq(ni)*aqp(nj)-aq(ni)*vqp(nj))*
     .      (amch**2-(amq-amqp)**2) -
     .      vs*mgluino*(vq(ni)*vqp(nj)-aq(ni)*aqp(nj))*
     .      (amch**2-(amq+amqp)**2) +
     .      as*(vq(ni)*aqp(nj)+aq(ni)*vqp(nj))*(gmsb(nj)**2*amq
     .      -gmst(ni)**2*amqp-(mgluino**2-amq*amqp)*(amq-amqp)) -
     .      vs*(vq(ni)*vqp(nj)+aq(ni)*aqp(nj))*(gmsb(nj)**2*amq
     .      +gmst(ni)**2*amqp-(mgluino**2+amq*amqp)*(amq+amqp)) )*
     . dreal(SD_C03(gmst(ni)**2,amchsq,gmsb(nj)**2,mgluino,amq,amqp))

      SD_stopsbot1719 = squarkstopsbot + gluinoex

      return

      end

c -------------------------------------------------------------------- c

      double precision function SD_sbotstop1719(amuv,ni,nj)

      implicit double precision (a-h,k-z)
      complex*16 SD_C03

      dimension sm(2,2,2),gctbr(2,2),gmsb(2),vq(2),aq(2),vqp(2),
     .          aqp(2),gmst(2)
      integer ni,nj

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2
      COMMON/SD_hmass/ama,aml,amh,amch,amar
      COMMON/SD_gluino/mgluino
      COMMON/SD_sfmixang/thet,theb,thel,cum,sum,cdm,sdm,cem,sem
      COMMON/SD_scala/scalb,scalt
      COMMON/SD_yukawa/ytewsb,ybewsb,ytauewsb
      COMMON/SD_runmcalc/rmtc,rmbc,rmtauc
      COMMON/SD_runcoupscale/scalechoice,scaleofcoupling,inumloop

      external SD_runmass,SD_yuk

      gmsb(1) = asb1
      gmsb(2) = asb2

      gmst(1) = ast1
      gmst(2) = ast2

c --- the running couplings ---

      if(scalechoice.eq.1.D0) then
         scalb = ybewsb/dsqrt(g2)
         scalt = ytewsb/dsqrt(g2)
         runmt = rmtc
         runmb = rmbc
      elseif(scalechoice.eq.2.D0) then         
         call SD_runmass(gmsb(ni),0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      elseif(scalechoice.eq.3.D0) then
         call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      endif

      call SD_hcsbotstop(gctbr)
      call SD_higgschudb(chtbrunr,chtbrunl)

c ----------------------------- 

      call SD_smatrix(sm)
      amusq = amuv**2

c -----------------------------

      coupphi = sm(nj,1,1)*gctbr(1,1)*sm(1,ni,2)*
     .     SD_B02(amch**2,ast1,asb1,amusq) +
     .     sm(nj,1,1)*gctbr(1,2)*sm(2,ni,2)*
     .     SD_B02(amch**2,ast1,asb2,amusq) +
     .     sm(nj,2,1)*gctbr(2,1)*sm(1,ni,2)*
     .     SD_B02(amch**2,ast2,asb1,amusq) +
     .     sm(nj,2,1)*gctbr(2,2)*sm(2,ni,2)*
     .     SD_B02(amch**2,ast2,asb2,amusq) 

      coupphi = dsqrt(2.D0)*amw**2*coupphi

c the result Eq.(17) in the paper

      squarksbotstop = coupphi

c --------------------------------------------

      amq = runmt
      amqp = runmb

      amchsq = amch**2

      vqp(1) = 1.D0/2.D0*(dcos(theb)-dsin(theb))
      vqp(2) = -1.D0/2.D0*(dcos(theb)+dsin(theb))
      aqp(1) = -vqp(2)
      aqp(2) = vqp(1)

      vq(1) = 1.D0/2.D0*(dcos(thet)-dsin(thet))
      vq(2) = -1.D0/2.D0*(dcos(thet)+dsin(thet))
      aq(1) = -vq(2)
      aq(2) = vq(1)

      vs = 2.D0*dsqrt(2.D0)*amw*(chtbrunr+chtbrunl)
      as = 2.D0*dsqrt(2.D0)*amw*(chtbrunr-chtbrunl)

c the result Eq.(19) in the paper

      gluinoex = (vs*(amq*(vq(nj)*vqp(ni)+aq(nj)*aqp(ni))+
     .     mgluino*(vq(nj)*vqp(ni)-aq(nj)*aqp(ni))) 
     .     -as*(amq*(vq(nj)*aqp(ni)+aq(nj)*vqp(ni))+
     .     mgluino*(vq(nj)*aqp(ni)-aq(nj)*vqp(ni))))*
     .     SD_B02(gmst(nj)**2,mgluino,amq,amusq) +
     .     (vs*(amqp*(vq(nj)*vqp(ni)+aq(nj)*aqp(ni))+
     .     mgluino*(vq(nj)*vqp(ni)-aq(nj)*aqp(ni))) +
     .     as*(amqp*(vq(nj)*aqp(ni)+aq(nj)*vqp(ni)) -
     .     mgluino*(vq(nj)*aqp(ni)-aq(nj)*vqp(ni))))*
     .     SD_B02(gmsb(ni)**2,mgluino,amqp,amusq) +
     .     (vs*(amq*(vq(nj)*vqp(ni)+aq(nj)*aqp(ni))+
     .     amqp*(vq(nj)*vqp(ni)+aq(nj)*aqp(ni))) -
     .     as*(amq*(vq(nj)*aqp(ni)+aq(nj)*vqp(ni))-
     .     amqp*(vq(nj)*aqp(ni)+aq(nj)*vqp(ni))))*
     .     SD_B02(amchsq,amq,amqp,amusq) +
     .     (as*mgluino*(vq(nj)*aqp(ni)-aq(nj)*vqp(ni))*
     .      (amch**2-(amq-amqp)**2) -
     .      vs*mgluino*(vq(nj)*vqp(ni)-aq(nj)*aqp(ni))*
     .      (amch**2-(amq+amqp)**2) +
     .      as*(vq(nj)*aqp(ni)+aq(nj)*vqp(ni))*(gmsb(ni)**2*amq
     .      -gmst(nj)**2*amqp-(mgluino**2-amq*amqp)*(amq-amqp)) -
     .      vs*(vq(nj)*vqp(ni)+aq(nj)*aqp(ni))*(gmsb(ni)**2*amq
     .      +gmst(nj)**2*amqp-(mgluino**2+amq*amqp)*(amq+amqp)) )*
     . dreal(SD_C03(gmst(nj)**2,amchsq,gmsb(ni)**2,mgluino,amq,amqp))

      SD_sbotstop1719 = squarksbotstop + gluinoex

      return

      end

c -------------------------------------------------------------------- c

      subroutine SD_smatrix(sm)

      implicit double precision (a-h,k-z)

      dimension sm(2,2,2)

      COMMON/SD_sfmixang/thet,theb,thel,cum,sum,cdm,sdm,cem,sem

      sm(1,1,1) = dcos(thet)**2-dsin(thet)**2
      sm(1,2,1) = -2.D0*dsin(thet)*dcos(thet)
      sm(2,1,1) = sm(1,2,1)
      sm(2,2,1) = -sm(1,1,1)

      sm(1,1,2) = dcos(theb)**2-dsin(theb)**2
      sm(1,2,2) = -2.D0*dsin(theb)*dcos(theb)
      sm(2,1,2) = sm(1,2,2)
      sm(2,2,2) = -sm(1,1,2)

      end

c -------------------------------------------------------------------- c
c --------------------------- The counterterms ----------------------- c

c -- the counterterm for squark_i -> H+ squark'_j --

      double precision function SD_dcounterhc(amsq,amq,theq,ni,amsqp,
     .                   amqp,theqp,nj,mgluino,amuv,amuvdiv,lamv,ic,jc)

      implicit double precision (a-h,k-z)
      dimension gctbr(2,2),gcdthtr(2,2),gcdthbr(2,2),gcdmtr(2,2),
     .          gcdmbr(2,2),gcdabr(2,2),gcdatr(2,2)

      integer ni,nj

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2
      COMMON/SD_sfmixang/thet,theb,thel,cum,sum,cdm,sdm,cem,sem
      COMMON/SD_scala/scalb,scalt
      COMMON/SD_yukawa/ytewsb,ybewsb,ytauewsb
      COMMON/SD_runmcalc/rmtc,rmbc,rmtauc
      COMMON/SD_runcoupscale/scalechoice,scaleofcoupling,inumloop

c ---- the running couplings ----

      if(scalechoice.eq.1.D0) then
         scalb = ybewsb/dsqrt(g2)
         scalt = ytewsb/dsqrt(g2)
         runmt = rmtc
         runmb = rmbc
      elseif(scalechoice.eq.2.D0) then         
         call SD_runmass(amsq,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      elseif(scalechoice.eq.3.D0) then
         call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      endif

      call SD_hcsbotstop(gctbr)
      call SD_hcsbotstopderiv(gcdmtr,gcdmbr,gcdabr,gcdatr,gcdthtr,
     .                        gcdthbr)

c --- the running mass ---
      
      amtt = runmt
      ambb = runmb

c -------------------------------

      SD_dcounterhc = 1.D0/2.D0*gctbr(ic,jc)*( 
     .     SD_deltaz(amsq,mgluino,amq,theq,amuv,lamv,ni) +
     .     SD_deltaz(amsqp,mgluino,amqp,theqp,amuv,lamv,nj) ) +
     .     gcdmtr(ic,jc)*amtt*
     .     SD_deltamqdiv(ast1,ast2,mgluino,amtt,thet,amuvdiv,lamv) +
     .     gcdmbr(ic,jc)*ambb*
     .     SD_deltamqdiv(asb1,asb2,mgluino,ambb,theb,amuvdiv,lamv) +
     .     gcdatr(ic,jc)*
     .     SD_deltaAq(amsq,ast1,ast2,mgluino,amtt,thet,amuvdiv,lamv,1) +
     .     gcdabr(ic,jc)*
     .     SD_deltaAq(amsq,asb1,asb2,mgluino,ambb,theb,amuvdiv,lamv,2) +
     .     gcdthtr(ic,jc)*SD_deltathdiv(ast1,ast2,mgluino,amtt,thet,
     .                               amuvdiv) +
     .     gcdthbr(ic,jc)*SD_deltathdiv(asb1,asb2,mgluino,ambb,theb,
     .                               amuvdiv)

      SD_dcounterhc = -dsqrt(2.D0)*amw**2*SD_dcounterhc

      return 

      end

c -------------------------------------------------------------------- c

c -- the counterterm for squark2 -> h/H/A squark1 --

      double precision function SD_dcounterneut(amsq1,amsq2,amq,theq,
     .                            mgluino,amuv,amuvdiv,lamv,nq,nh)

      implicit double precision (a-h,k-z)
      dimension glttr(2,2),ghttr(2,2),glbbr(2,2),ghbbr(2,2),
     .          dtlttr(2,2),dthttr(2,2),datlttr(2,2),dathttr(2,2),
     .          dthlttr(2,2),dthhttr(2,2),dblbbr(2,2),dbhbbr(2,2),
     .          dablbbr(2,2),dabhbbr(2,2),dthlbbr(2,2),dthhbbr(2,2),
     .          gqqr(2,2),dmqqr(2,2),daqr(2,2),dthr(2,2)

      integer nq,nh

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_scala/scalb,scalt
      COMMON/SD_yukawa/ytewsb,ybewsb,ytauewsb
      COMMON/SD_runmcalc/rmtc,rmbc,rmtauc
      COMMON/SD_runcoupscale/scalechoice,scaleofcoupling,inumloop

c --- the running couplings ---

      if(scalechoice.eq.1.D0) then
         scalb = ybewsb/dsqrt(g2)
         scalt = ytewsb/dsqrt(g2)
         runmt = rmtc
         runmb = rmbc
      elseif(scalechoice.eq.2.D0) then         
         call SD_runmass(amsq2,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      elseif(scalechoice.eq.3.D0) then
         call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      endif

      call SD_higgsst1st2(glttr,ghttr,gattr)
      call SD_higgssb1sb2(glbbr,ghbbr,gabbr)
      call SD_higgsst1st2deriv(dtlttr,dthttr,dtattr,datlttr,dathttr,
     .           datattr,dthlttr,dthhttr,dthattr)
      call SD_higgssb1sb2deriv(dblbbr,dbhbbr,dbabbr,dablbbr,dabhbbr,
     .           dababbr,dthlbbr,dthhbbr,dthabbr)

c --- the running mass ---
      
      if(nq.eq.1) then
         amqq = runmt
      elseif(nq.eq.2) then
         amqq = runmb
      endif

c --- some definitions ---

      if(nq.eq.1.and.nh.eq.1) then
         gqqr(2,1)  = glttr(2,1)
         dmqqr(2,1) = dtlttr(2,1)
         daqr(2,1)  = datlttr(2,1)
         dthr(2,1)  = dthlttr(2,1)
      elseif(nq.eq.1.and.nh.eq.2) then
         gqqr(2,1)  = ghttr(2,1)
         dmqqr(2,1) = dthttr(2,1)
         daqr(2,1)  = dathttr(2,1)
         dthr(2,1)  = dthhttr(2,1)
      elseif(nq.eq.1.and.nh.eq.3) then
         gqqr(2,1)  = -gattr
         dmqqr(2,1) = -dtattr
         daqr(2,1)  = -datattr
         dthr(2,1)  = -dthattr
      elseif(nq.eq.2.and.nh.eq.1) then
         gqqr(2,1)  = glbbr(2,1)
         dmqqr(2,1) = dblbbr(2,1)
         daqr(2,1)  = dablbbr(2,1)
         dthr(2,1)  = dthlbbr(2,1)
      elseif(nq.eq.2.and.nh.eq.2) then
         gqqr(2,1)  = ghbbr(2,1)
         dmqqr(2,1) = dbhbbr(2,1)
         daqr(2,1)  = dabhbbr(2,1)
         dthr(2,1)  = dthhbbr(2,1)
      elseif(nq.eq.2.and.nh.eq.3) then
         gqqr(2,1)  = -gabbr
         dmqqr(2,1) = -dbabbr
         daqr(2,1)  = -dababbr
         dthr(2,1)  = -dthabbr
      endif

c ------------------------

      SD_dcounterneut = gqqr(2,1)/2.D0*(
     .     SD_deltaz(amsq2,mgluino,amq,theq,amuv,lamv,2) 
     .     +SD_deltaz(amsq1,mgluino,amq,theq,amuv,lamv,1) )
     .     +dmqqr(2,1)*amqq*
     .     SD_deltamqdiv(amsq1,amsq2,mgluino,amq,theq,amuvdiv,lamv) +
     .     daqr(2,1)*
     .     SD_deltaAq(amsq2,amsq1,amsq2,mgluino,amq,theq,amuvdiv,lamv,
     .                nq) +
     .     dthr(2,1)*SD_deltathdiv(amsq1,amsq2,mgluino,amq,theq,amuvdiv)

      SD_dcounterneut = -dsqrt(2.D0)*amz**2*SD_dcounterneut

      return

      end

c -------------------------------------------------------------------- c

      double precision function SD_deltaz(amsq,mgluino,amq,theq,amuv,
     .                                 lamv,ni)

      implicit double precision (a-h,k-z)
      integer ni

      amusq = amuv**2

      SD_deltaz = 2.D0*( 
     .     (amq**2+mgluino**2-amsq**2)*
     .     SD_BP02(amsq**2,amq,mgluino,amusq) - 
     .     SD_B02(amsq**2,amq,mgluino,amusq) 
     .     + SD_B02(amsq**2,lamv,amsq,amusq) +
     .     2.D0*(-1.D0)**ni*dsin(2.D0*theq)*mgluino*amq*
     .     SD_BP02(amsq**2,amq,mgluino,amusq) 
     .     +2.D0*amsq**2*
     .     SD_BP02(amsq**2,lamv,amsq,amusq) )

      return 

      end 

c -------------------------------------------------------------------- c

      double precision function SD_deltaAq(amdec,amsq1,amsq2,mgluino,
     .                                  amq,theq,amuv,lamv,nq)

      implicit double precision (a-h,k-z)
      integer nq

c --- the running masses ---

      amqq = amq

c --------------------------

      SD_deltaAq = (amsq1**2-amsq2**2)/(2.D0*amqq)*(
     .     2.D0*dcos(2.D0*theq)*
     .     SD_deltathdiv(amsq1,amsq2,mgluino,amq,theq,amuv)
     .     -dsin(2.D0*theq)*
     .     SD_deltamqdiv(amsq1,amsq2,mgluino,amq,theq,amuv,lamv) )
     .     +dsin(2.D0*theq)*
     .     SD_deltamsqdiv(amsq1,mgluino,amq,theq,amuv,lamv,1,nq)/amqq
     .     -dsin(2.D0*theq)*
     .     SD_deltamsqdiv(amsq2,mgluino,amq,theq,amuv,lamv,2,nq)/amqq

      return

      end

c -------------------------------------------------------------------- c

      double precision function SD_deltath(amsq1,amsq2,mgluino,amq,theq,
     .                                  amuv)

      implicit double precision (a-h,k-z)

      amusq = amuv**2

      SD_deltath = 1.D0/(amsq1**2-amsq2**2)*(4.D0*mgluino*amq*
     .     dcos(2.D0*theq)/2.D0*(
     .     SD_B02(amsq1**2,amq,mgluino,amusq)+
     .     SD_B02(amsq2**2,amq,mgluino,amusq) ) +
     .     dcos(2.D0*theq)*dsin(2.D0*theq)*(SD_A01(amsq2**2,amusq)
     .     -SD_A01(amsq1**2,amusq)) )

      return

      end

c -------------------------------------------------------------------- c

      double precision function SD_deltathdiv(amsq1,amsq2,mgluino,amq,
     .                                        theq,amuv)

      implicit double precision (a-h,k-z)

      amusq = amuv**2

      SD_deltathdiv = 1.D0/(amsq1**2-amsq2**2)*(4.D0*mgluino*amq*
     .     dcos(2.D0*theq)/2.D0*(
     .     SD_B02_DIV(amsq1**2,amq,mgluino,amusq)+
     .     SD_B02_DIV(amsq2**2,amq,mgluino,amusq) ) +
     .     dcos(2.D0*theq)*dsin(2.D0*theq)*(amsq2**2*dlog(amusq)
     .     -amsq1**2*log(amusq) ) )

      return

      end

c -------------------------------------------------------------------- c

      double precision function SD_deltamq(amsq1,amsq2,mgluino,amq,theq,
     .                                  amuv,lamv)

      implicit double precision (a-h,k-z)

      amusq = amuv**2

      SD_deltamq = -(2.D0*SD_B1(amq**2,amq,lamv,amusq) +
     .     4.D0*SD_B02(amq**2,amq,lamv,amusq) +
     .     SD_B1(amq**2,mgluino,amsq1,amusq) +
     .     SD_B1(amq**2,mgluino,amsq2,amusq) ) +
     .     dsin(2.D0*theq)*mgluino/amq*( 
     .     SD_B02(amq**2,mgluino,amsq1,amusq) -
     .     SD_B02(amq**2,mgluino,amsq2,amusq) )

      return

      end

c -------------------------------------------------------------------- c

      double precision function SD_deltamqdiv(amsq1,amsq2,mgluino,amq,
     .                                        theq,amuv,lamv)

      implicit double precision (a-h,k-z)

      amusq = amuv**2

      SD_deltamqdiv = -(2.D0*SD_B1_DIV(amq**2,amq,lamv,amusq) +
     .     4.D0*SD_B02_DIV(amq**2,amq,lamv,amusq) +
     .     SD_B1_DIV(amq**2,mgluino,amsq1,amusq) +
     .     SD_B1_DIV(amq**2,mgluino,amsq2,amusq) ) +
     .     dsin(2.D0*theq)*mgluino/amq*( 
     .     SD_B02_DIV(amq**2,mgluino,amsq1,amusq) -
     .     SD_B02_DIV(amq**2,mgluino,amsq2,amusq) )

      return

      end

c -------------------------------------------------------------------- c

      double precision function SD_deltamsq(amsq,mgluino,amq,theq,amuv,
     .                                   lamv,i,nq)

      implicit double precision (a-h,k-z)
      integer nq
      dimension gmsq(2)

      COMMON/SD_squarktb/ast1,ast2,asb1,asb2

      amusq = amuv**2
      ip = 3 - i
      
      if(nq.eq.1) then
         gmsq(1) = ast1 
         gmsq(2) = ast2
      elseif(nq.eq.2) then
         gmsq(1) = asb1
         gmsq(2) = asb2
      endif

      SD_deltamsq = -(amq**2+mgluino**2-amsq**2)*
     .     SD_B02(amsq**2,amq,mgluino,amusq) - 2.D0*amsq**2*
     .     SD_B02(amsq**2,lamv,amsq,amusq) -
     .     SD_A01(mgluino**2,amusq) - SD_A01(amq**2,amusq) +
     .     1.D0/2.D0*((1.D0+dcos(2.D0*theq)**2)*SD_A01(amsq**2,amusq)
     .     + dsin(2.D0*theq)**2*SD_A01(gmsq(ip)**2,amusq) ) -
     .     2.D0*(-1.D0)**i*dsin(2.D0*theq)*mgluino*amq*
     .     SD_B02(amsq**2,amq,mgluino,amusq) 

      return
      
      end

c -------------------------------------------------------------------- c

      double precision function SD_deltamsqdiv(amsq,mgluino,amq,theq,
     .                                         amuv,lamv,i,nq)

      implicit double precision (a-h,k-z)
      integer nq
      dimension gmsq(2)

      COMMON/SD_squarktb/ast1,ast2,asb1,asb2

      amusq = amuv**2
      ip = 3 - i
      
      if(nq.eq.1) then
         gmsq(1) = ast1 
         gmsq(2) = ast2
      elseif(nq.eq.2) then
         gmsq(1) = asb1
         gmsq(2) = asb2
      endif

      SD_deltamsqdiv = -(amq**2+mgluino**2-amsq**2)*
     .     SD_B02_DIV(amsq**2,amq,mgluino,amusq) - 2.D0*amsq**2*
     .     SD_B02_DIV(amsq**2,lamv,amsq,amusq) -
     .     SD_A01_DIV(mgluino**2,amusq) - SD_A01_DIV(amq**2,amusq) +
     .     1.D0/2.D0*((1.D0+dcos(2.D0*theq)**2)*
     .     SD_A01_DIV(amsq**2,amusq)
     .     + dsin(2.D0*theq)**2*SD_A01_DIV(gmsq(ip)**2,amusq) ) -
     .     2.D0*(-1.D0)**i*dsin(2.D0*theq)*mgluino*amq*
     .     SD_B02_DIV(amsq**2,amq,mgluino,amusq) 

      return
      
      end

c -------------------------------------------------------------------- c
c ----------------------- The real corrections ----------------------- c

      double precision function SD_realcorr(mphi,msq,msqp,lamv,nh,nq,ni,
     .                                   nj,scala)

      implicit double precision (a-h,k-z)
      dimension gctbr(2,2),glttr(2,2),ghttr(2,2),glbbr(2,2),ghbbr(2,2)
      integer nh,nq,ni,nj
      complex*16 SD_ccspen,SD_kappa

      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_scala/scalb,scalt
      COMMON/SD_yukawa/ytewsb,ybewsb,ytauewsb
      COMMON/SD_runcoupscale/scalechoice,scaleofcoupling,inumloop

c --- the running couplings ---

      if(scalechoice.eq.1.D0) then
         scalb = ybewsb/dsqrt(g2)
         scalt = ytewsb/dsqrt(g2)
      elseif(scalechoice.eq.2.D0) then         
         call SD_runmass(scala,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      elseif(scalechoice.eq.3.D0) then
         call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      endif

      call SD_hcsbotstop(gctbr)
      call SD_higgsst1st2(glttr,ghttr,gattr)
      call SD_higgssb1sb2(glbbr,ghbbr,gabbr)

c --- some definitions ---

      if(nh.eq.4.and.nq.eq.0) then
         gphi = -dsqrt(2.D0)*amw**2*gctbr(ni,nj)
      endif

      if(nh.eq.1.and.nq.eq.1) then
         gphi = -dsqrt(2.D0)*amz**2*glttr(2,1)
      elseif(nh.eq.1.and.nq.eq.2) then
         gphi = -dsqrt(2.D0)*amz**2*glbbr(2,1)
      elseif(nh.eq.2.and.nq.eq.1) then
         gphi = -dsqrt(2.D0)*amz**2*ghttr(2,1)
      elseif(nh.eq.2.and.nq.eq.2) then
         gphi = -dsqrt(2.D0)*amz**2*ghbbr(2,1)
      elseif(nh.eq.3.and.nq.eq.1) then
         gphi = dsqrt(2.D0)*amz**2*gattr
      elseif(nh.eq.3.and.nq.eq.2) then
         gphi = dsqrt(2.D0)*amz**2*gabbr
      endif

      kap = dreal(SD_kappa(msq**2,mphi**2,msqp**2,0.D0))

      b0 = (msq**2-mphi**2-msqp**2+kap)/(2.D0*mphi*msqp)

      b1 = (msq**2-mphi**2+msqp**2-kap)/(2.D0*msq*msqp)

      b2 = (mphi**2+msq**2-msqp**2-kap)/(2.D0*mphi*msq)

c -----------------------

      lb0 = dreal(cdlog(dcmplx(b0)))
      lb1 = dreal(cdlog(dcmplx(b1)))
      lb2 = dreal(cdlog(dcmplx(b2)))

      SD_realcorr = 2.D0*gphi/kap*(
     .     (mphi**2-msq**2-msqp**2)*(
     .     -2.D0*dlog((lamv*mphi*msq*msqp)/kap**2)*lb1
     .     +2.D0*lb1**2-lb0**2-lb2**2
     .     +2.D0*dreal(SD_ccspen(dcmplx(1.D0-b1**2)))
     .     -dreal(SD_ccspen(dcmplx(1.D0-b0**2)))
     .     -dreal(SD_ccspen(dcmplx(1.D0-b2**2))) )
     .     +2.D0*kap*dlog((lamv*mphi*msq*msqp)/kap**2)
     .     +4.D0*kap+(2.D0*mphi**2+msq**2+msqp**2)*lb1
     .     +(mphi**2+2.D0*msqp**2)*lb2+(mphi**2+2.D0*msq**2)*lb0 )

      return

      end

c -------------------------------------------------------------------- c
c ---------- A.Djouadi, W.Hollik, C.Juenger, hep-ph/9609419 ---------- c
c -------------------------------------------------------------------- c

c --- QCD corrections to the light squark decays --- c

      double precision function SD_ftotqcd(kap,gam)

      implicit double precision (a-h,k-z)

      complex*16 SD_ccspen,funci

      pi = 4.D0*datan(1.D0)

      if(kap*gam.lt.1.D0) then
         funci = SD_ccspen(dcmplx((gam-1.D0)/(gam*kap-1.D0))) -
     .        SD_ccspen(dcmplx(kap*(gam-1.D0)/(gam*kap-1.D0))) -
     .        SD_ccspen(dcmplx((gam+kap-2.D0)/(gam*kap-1.D0))) +
     .        SD_ccspen(dcmplx(kap*(gam+kap-2.D0)/(gam*kap-1.D0)))
      elseif(kap*gam.ge.1.D0) then
         funci = -SD_ccspen(dcmplx((gam*kap-1.D0)/(gam-1.D0))) +
     .        SD_ccspen(dcmplx((gam*kap-1.D0)/(gam+kap-2.D0))) +
     .        SD_ccspen(dcmplx((gam*kap-1.D0)/(kap*(gam-1.D0)))) -
     .        SD_ccspen(dcmplx((gam*kap-1.D0)/(kap*(gam+kap-2.D0)))) -
     .        dlog(kap)*cdlog(dcmplx((gam+kap-2.D0)/(gam-1.D0)))
      endif

      SD_ftotqcd = -1.D0/8.D0*( (4.D0*gam**2-27.D0*gam+25.D0)/(gam-1.D0)
     .     + (3.D0*kap-5.D0)/(kap-1.D0) ) - pi**2/3.D0 
     .     - 2.D0*dreal(SD_ccspen(dcmplx(kap))) 
     .     - 1.D0/2.D0*(gam**2-1.D0)*
     .     dreal(cdlog(dcmplx((gam-1.D0)/gam)))
     .     + (3.D0*gam**2-4.D0*gam+2.D0)/
     .     (4.D0*(1.D0-gam)**2)*dlog(gam) -3.D0/2.D0*dlog(1.D0-kap) +
c maggie changed 14 July 2012
     .     1.D0/4.D0*(3.D0*kap**2-4.D0*kap)/(kap-1.D0)**2*dlog(kap)
c end maggie changed 14 July 2012
     .     -dlog(kap)*dlog(1.D0-kap) + dsqrt(kap*gam)*
     .     (1.D0/kap*dlog(1.D0-kap)+1.D0/(1.D0-kap)*(gam*dlog(gam)
     .     -(gam-1.D0)*dreal(cdlog(dcmplx(gam-1.D0))) )
     .     + (kap+gam-2.D0)/(1.D0-kap)**2*dreal(funci) )

      return
    
      end

c -------------------------------------------------------------------- c

c --- Heavy squark decays                       --- c
c --- Virtual corrections for the decays        --- c
c --- squark_i -> chargino_j/neutralino_j quark --- c

      double precision function SD_gltneut(ni,nj,amusc,amuscdiv,lamsc)

      implicit double precision (a-h,k-z)
      integer ni,nj,k

      dimension gmst(2),atopr(2,4),btopr(2,4),vt(2),at(2),del(2,2)
      dimension fnt1(2,4),fnt2(2,4),fct1(2,2),fct2(2,2),
     .     fnt1ik(2,4,2),fnt2ik(2,4,2),fnt3ik(2,4,2),fnt4ik(2,4,2),
     .     fnt5ik(2,4,2),fnt6ik(2,4,2),fnt7ik(2,4,2),
     .     fct1ik(2,2,2),fct2ik(2,2,2),fct3ik(2,2,2),fct4ik(2,2,2),
     .     fct5ik(2,2,2),fct6ik(2,2,2),fct7ik(2,2,2)
      dimension u(2,2),v(2,2),z(4,4),zp(4,4)

      COMMON/SD_qcdscales/amuv,lamv
      COMMON/SD_decindex/idec
      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_scala/scalb,scalt
      COMMON/SD_yukawa/ytewsb,ybewsb,ytauewsb
      COMMON/SD_mixmat/u,v,z,zp
      COMMON/SD_mixang/alp_mssm,tanbeta
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2
      COMMON/SD_sfmixang/thet,theb,thel,cum,sum,cdm,sdm,cem,sem
      COMMON/SD_fermion/amt,amb,amtau
      COMMON/SD_gluino/mgluino
      COMMON/SD_weinberg/sw,cw
      COMMON/SD_runmcalc/rmtc,rmbc,rmtauc
      COMMON/SD_runcoupscale/scalechoice,scaleofcoupling,inumloop

      external SD_runmass,SD_yuk

      bet=datan(tanbeta)

      gmst(1) = ast1
      gmst(2) = ast2

      idec = ni

      amuv    = amusc
      lamv    = lamsc
      amuvdiv = amuscdiv
      
      vt(1) = 1.D0/2.D0*(dcos(thet)-dsin(thet))
      vt(2) = -1.D0/2.D0*(dcos(thet)+dsin(thet))
      at(1) = -vt(2)
      at(2) = vt(1)

      del(1,1) = 1.D0
      del(1,2) = 0.D0
      del(2,1) = 0.D0
      del(2,2) = 1.D0

      call SD_ftfunctions(fnt1,fnt2,fnt1ik,fnt2ik,fnt3ik,fnt4ik,fnt5ik,
     .     fnt6ik,fnt7ik,fct1,fct2,fct1ik,fct2ik,fct3ik,fct4ik,fct5ik,
     .     fct6ik,fct7ik)

c --- the running couplings ---

      if(scalechoice.eq.1.D0) then
         scalb = ybewsb/dsqrt(g2)
         scalt = ytewsb/dsqrt(g2)
         runmt = rmtc
         runmb = rmbc
      elseif(scalechoice.eq.2.D0) then         
         call SD_runmass(gmst(ni),0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      elseif(scalechoice.eq.3.D0) then
         call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      endif

      call SD_neutstoptop(atopr,btopr)

      amqt = amt

c -------------

      SD_gltneut = 0.D0

      do k=1,2,1
         SD_gltneut = SD_gltneut - 2.D0*(
     .        atopr(k,nj)*( 
     .        (vt(k)*vt(ni)+at(k)*at(ni))*fnt4ik(ni,nj,k) -
     .        (at(k)*vt(ni)+vt(k)*at(ni))*fnt5ik(ni,nj,k) +
     .        (vt(k)*vt(ni)-at(k)*at(ni))*fnt6ik(ni,nj,k) -
     .        (at(k)*vt(ni)-vt(k)*at(ni))*fnt7ik(ni,nj,k) ) +
     .        btopr(k,nj)*(
     .        (vt(k)*vt(ni)+at(k)*at(ni))*fnt1ik(ni,nj,k) -
     .        (at(k)*vt(ni)+vt(k)*at(ni))*fnt1ik(ni,nj,k) +
     .        (vt(k)*vt(ni)-at(k)*at(ni))*fnt2ik(ni,nj,k) -
     .        (at(k)*vt(ni)-vt(k)*at(ni))*fnt3ik(ni,nj,k)) )
      end do

      SD_gltneut = SD_gltneut + btopr(ni,nj)*fnt1(ni,nj) + 
     .     atopr(ni,nj)*fnt2(ni,nj)

      SD_gltneut = SD_gltneut + (-1.D0)**ni*(del(1,ni)*btopr(2,nj)+
     .     del(2,ni)*btopr(1,nj))/(ast1**2-ast2**2)*(
     .     4.D0*amqt*mgluino*dcos(2.D0*thet)*
     .     SD_B02(gmst(ni)**2,amqt,mgluino,amuv**2) +
     .     dcos(2.D0*thet)*dsin(2.D0*thet)*
     .     (SD_A01(ast2**2,amuv**2)-SD_A01(ast1**2,amuv**2)))

      if(ni.eq.1) then
         SD_gltneut = SD_gltneut + 1.D0/2.D0*btopr(1,nj)*(
     .        SD_delztr(amqt,mgluino,ast1,ast2,thet,amuv,lamv) +
     .        SD_delzst(amqt,mgluino,ast1,thet,amuv,lamv,1) ) -
     .        1.D0/(dsqrt(2.D0)*amw*dsin(bet))*z(nj,4)*dcos(thet)*
     .        SD_delmtdiv(amqt,mgluino,ast1,ast2,thet,amuvdiv,lamv)*
     .        runmt +
     .        runmt/(dsqrt(2.D0)*amw*dsin(bet))*z(nj,4)*dsin(thet)*
     .        SD_delthdiv(amqt,mgluino,ast1,ast2,thet,amuvdiv) -
     .        (-dsqrt(2.D0))*sw*(2.D0/3.D0*zp(nj,1)-2.D0/3.D0*sw/cw*
     .        zp(nj,2))*dcos(thet)*
     .        SD_delthdiv(amqt,mgluino,ast1,ast2,thet,amuvdiv) 
      elseif(ni.eq.2) then
         SD_gltneut = SD_gltneut + 1.D0/2.D0*btopr(2,nj)*(
     .        SD_delztr(amqt,mgluino,ast1,ast2,thet,amuv,lamv) +
     .        SD_delzst(amqt,mgluino,ast2,thet,amuv,lamv,2) ) -
     .        1.D0/(dsqrt(2.D0)*amw*dsin(bet))*z(nj,4)*(-dsin(thet))*
     .        SD_delmtdiv(amqt,mgluino,ast1,ast2,thet,amuvdiv,lamv)*
     .        runmt +
     .        runmt/(dsqrt(2.D0)*amw*dsin(bet))*z(nj,4)*dcos(thet)*
     .        SD_delthdiv(amqt,mgluino,ast1,ast2,thet,amuvdiv) -
     .        (-dsqrt(2.D0))*sw*(2.D0/3.D0*zp(nj,1)-2.D0/3.D0*sw/cw*
     .        zp(nj,2))*(-dsin(thet))*
     .        SD_delthdiv(amqt,mgluino,ast1,ast2,thet,amuvdiv)
      endif

      SD_gltneut = (-1.D0)*SD_gltneut

      return 

      end

c -------------------------------------------------------------------- c

      double precision function SD_glbneut(ni,nj,amusc,amuscdiv,lamsc)

      implicit double precision (a-h,k-z)
      integer ni,nj,k

      dimension gmsb(2),abot(2,4),bbot(2,4),vb(2),ab(2),del(2,2)
      dimension fnb1(2,4),fnb2(2,4),fcb1(2,2),fcb2(2,2),
     .     fnb1ik(2,4,2),fnb2ik(2,4,2),fnb3ik(2,4,2),fnb4ik(2,4,2),
     .     fnb5ik(2,4,2),fnb6ik(2,4,2),fnb7ik(2,4,2),
     .     fcb1ik(2,2,2),fcb2ik(2,2,2),fcb3ik(2,2,2),fcb4ik(2,2,2),
     .     fcb5ik(2,2,2),fcb6ik(2,2,2),fcb7ik(2,2,2)
      dimension u(2,2),v(2,2),z(4,4),zp(4,4)

      COMMON/SD_qcdscales/amuv,lamv
      COMMON/SD_decindex/idec
      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_scala/scalb,scalt
      COMMON/SD_yukawa/ytewsb,ybewsb,ytauewsb
      COMMON/SD_mixmat/u,v,z,zp
      COMMON/SD_mixang/alp_mssm,tanbeta
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2
      COMMON/SD_sfmixang/thet,theb,thel,cum,sum,cdm,sdm,cem,sem
      COMMON/SD_fermion/amt,amb,amtau
      COMMON/SD_gluino/mgluino
      COMMON/SD_weinberg/sw,cw
      COMMON/SD_runmcalc/rmtc,rmbc,rmtauc
      COMMON/SD_runcoupscale/scalechoice,scaleofcoupling,inumloop

      external SD_runmass,SD_yuk

      bet=datan(tanbeta)

      gmsb(1) = asb1
      gmsb(2) = asb2

      idec = ni

      amuv    = amusc
      lamv    = lamsc
      amuvdiv = amuscdiv

      vb(1) = 1.D0/2.D0*(dcos(theb)-dsin(theb))
      vb(2) = -1.D0/2.D0*(dcos(theb)+dsin(theb))
      ab(1) = -vb(2)
      ab(2) = vb(1)

      del(1,1) = 1.D0
      del(1,2) = 0.D0
      del(2,1) = 0.D0
      del(2,2) = 1.D0

      call SD_fbfunctions(fnb1,fnb2,fnb1ik,fnb2ik,fnb3ik,fnb4ik,fnb5ik,
     .     fnb6ik,fnb7ik,fcb1,fcb2,fcb1ik,fcb2ik,fcb3ik,fcb4ik,fcb5ik,
     .     fcb6ik,fcb7ik)

c --- the running couplings ---

      if(scalechoice.eq.1.D0) then
         scalb = ybewsb/dsqrt(g2)
         scalt = ytewsb/dsqrt(g2)
         runmt = rmtc
         runmb = rmbc
      elseif(scalechoice.eq.2.D0) then         
         call SD_runmass(gmsb(ni),0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      elseif(scalechoice.eq.3.D0) then
         call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      endif

      call SD_neutsbotbot(abot,bbot)

      amqb = amb

c -------------

      SD_glbneut = 0.D0

      do k=1,2,1
         SD_glbneut = SD_glbneut - 2.D0*(
     .        abot(k,nj)*( 
     .        (vb(k)*vb(ni)+ab(k)*ab(ni))*fnb4ik(ni,nj,k) -
     .        (ab(k)*vb(ni)+vb(k)*ab(ni))*fnb5ik(ni,nj,k) +
     .        (vb(k)*vb(ni)-ab(k)*ab(ni))*fnb6ik(ni,nj,k) -
     .        (ab(k)*vb(ni)-vb(k)*ab(ni))*fnb7ik(ni,nj,k) ) +
     .        bbot(k,nj)*(
     .        (vb(k)*vb(ni)+ab(k)*ab(ni))*fnb1ik(ni,nj,k) -
     .        (ab(k)*vb(ni)+vb(k)*ab(ni))*fnb1ik(ni,nj,k) +
     .        (vb(k)*vb(ni)-ab(k)*ab(ni))*fnb2ik(ni,nj,k) -
     .        (ab(k)*vb(ni)-vb(k)*ab(ni))*fnb3ik(ni,nj,k)) )
      end do

      SD_glbneut = SD_glbneut + bbot(ni,nj)*fnb1(ni,nj) + 
     .     abot(ni,nj)*fnb2(ni,nj)

      SD_glbneut = SD_glbneut + (-1.D0)**ni*(del(1,ni)*bbot(2,nj)+
     .     del(2,ni)*bbot(1,nj))/(asb1**2-asb2**2)*(
     .     4.D0*amqb*mgluino*dcos(2.D0*theb)*
     .     SD_B02(gmsb(ni)**2,amqb,mgluino,amuv**2) +
     .     dcos(2.D0*theb)*dsin(2.D0*theb)*
     .     (SD_A01(asb2**2,amuv**2)-SD_A01(asb1**2,amuv**2)))

      if(ni.eq.1) then
         SD_glbneut = SD_glbneut + 1.D0/2.D0*bbot(1,nj)*(
     .        SD_delztr(amqb,mgluino,asb1,asb2,theb,amuv,lamv) +
     .        SD_delzst(amqb,mgluino,asb1,theb,amuv,lamv,1) ) -
     .        1.D0/(dsqrt(2.D0)*amw*dcos(bet))*z(nj,3)*dcos(theb)*
     .        SD_delmtdiv(amqb,mgluino,asb1,asb2,theb,amuvdiv,lamv)*
     .        runmb +
     .        runmb/(dsqrt(2.D0)*amw*dcos(bet))*z(nj,3)*dsin(theb)*
     .        SD_delthdiv(amqb,mgluino,asb1,asb2,theb,amuvdiv) -
     .        (-dsqrt(2.D0))*sw*(-1.D0/3.D0*zp(nj,1)+1.D0/3.D0*sw/cw*
     .        zp(nj,2))*dcos(theb)*
     .        SD_delthdiv(amqb,mgluino,asb1,asb2,theb,amuvdiv) 
      elseif(ni.eq.2) then
         SD_glbneut = SD_glbneut + 1.D0/2.D0*bbot(2,nj)*(
     .        SD_delztr(amqb,mgluino,asb1,asb2,theb,amuv,lamv) +
     .        SD_delzst(amqb,mgluino,asb2,theb,amuv,lamv,2) ) -
     .        1.D0/(dsqrt(2.D0)*amw*dcos(bet))*z(nj,3)*(-dsin(theb))*
     .        SD_delmtdiv(amqb,mgluino,asb1,asb2,theb,amuvdiv,lamv)*
     .        runmb +
     .        runmb/(dsqrt(2.D0)*amw*dcos(bet))*z(nj,3)*dcos(theb)*
     .        SD_delthdiv(amqb,mgluino,asb1,asb2,theb,amuvdiv) -
     .        (-dsqrt(2.D0))*sw*(-1.D0/3.D0*zp(nj,1)+1.D0/3.D0*sw/cw*
     .        zp(nj,2))*(-dsin(theb))*
     .        SD_delthdiv(amqb,mgluino,asb1,asb2,theb,amuvdiv)
      endif

      SD_glbneut = (-1.D0)*SD_glbneut

      return 

      end

c -------------------------------------------------------------------- c

      double precision function SD_grtneut(ni,nj,amusc,amuscdiv,lamsc)

      implicit double precision (a-h,k-z)
      integer ni,nj,k

      dimension gmst(2),atopr(2,4),btopr(2,4),vt(2),at(2),del(2,2)
      dimension fnt1(2,4),fnt2(2,4),fct1(2,2),fct2(2,2),
     .     fnt1ik(2,4,2),fnt2ik(2,4,2),fnt3ik(2,4,2),fnt4ik(2,4,2),
     .     fnt5ik(2,4,2),fnt6ik(2,4,2),fnt7ik(2,4,2),
     .     fct1ik(2,2,2),fct2ik(2,2,2),fct3ik(2,2,2),fct4ik(2,2,2),
     .     fct5ik(2,2,2),fct6ik(2,2,2),fct7ik(2,2,2)
      dimension u(2,2),v(2,2),z(4,4),zp(4,4)

      COMMON/SD_qcdscales/amuv,lamv
      COMMON/SD_decindex/idec
      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_scala/scalb,scalt
      COMMON/SD_yukawa/ytewsb,ybewsb,ytauewsb
      COMMON/SD_mixmat/u,v,z,zp
      COMMON/SD_mixang/alp_mssm,tanbeta
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2
      COMMON/SD_sfmixang/thet,theb,thel,cum,sum,cdm,sdm,cem,sem
      COMMON/SD_fermion/amt,amb,amtau
      COMMON/SD_gluino/mgluino
      COMMON/SD_weinberg/sw,cw
      COMMON/SD_runmcalc/rmtc,rmbc,rmtauc
      COMMON/SD_runcoupscale/scalechoice,scaleofcoupling,inumloop

      external SD_runmass,SD_yuk

      bet=datan(tanbeta)

      gmst(1) = ast1
      gmst(2) = ast2

      idec = ni

      amuv    = amusc
      lamv    = lamsc
      amuvdiv = amuscdiv

      vt(1) = 1.D0/2.D0*(dcos(thet)-dsin(thet))
      vt(2) = -1.D0/2.D0*(dcos(thet)+dsin(thet))
      at(1) = -vt(2)
      at(2) = vt(1)

      del(1,1) = 1.D0
      del(1,2) = 0.D0
      del(2,1) = 0.D0
      del(2,2) = 1.D0

      call SD_ftfunctions(fnt1,fnt2,fnt1ik,fnt2ik,fnt3ik,fnt4ik,fnt5ik,
     .     fnt6ik,fnt7ik,fct1,fct2,fct1ik,fct2ik,fct3ik,fct4ik,fct5ik,
     .     fct6ik,fct7ik)

c --- the running couplings ---

      if(scalechoice.eq.1.D0) then
         scalb = ybewsb/dsqrt(g2)
         scalt = ytewsb/dsqrt(g2)
         runmt = rmtc
         runmb = rmbc
      elseif(scalechoice.eq.2.D0) then         
         call SD_runmass(gmst(ni),0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      elseif(scalechoice.eq.3.D0) then
         call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      endif

      call SD_neutstoptop(atopr,btopr)

      amqt = amt

c -------------

      SD_grtneut = 0.D0

      do k=1,2,1
         SD_grtneut = SD_grtneut - 2.D0*(
     .        btopr(k,nj)*( 
     .        (vt(k)*vt(ni)+at(k)*at(ni))*fnt4ik(ni,nj,k) +
     .        (at(k)*vt(ni)+vt(k)*at(ni))*fnt5ik(ni,nj,k) +
     .        (vt(k)*vt(ni)-at(k)*at(ni))*fnt6ik(ni,nj,k) +
     .        (at(k)*vt(ni)-vt(k)*at(ni))*fnt7ik(ni,nj,k) ) +
     .        atopr(k,nj)*(
     .        (vt(k)*vt(ni)+at(k)*at(ni))*fnt1ik(ni,nj,k) +
     .        (at(k)*vt(ni)+vt(k)*at(ni))*fnt1ik(ni,nj,k) +
     .        (vt(k)*vt(ni)-at(k)*at(ni))*fnt2ik(ni,nj,k) +
     .        (at(k)*vt(ni)-vt(k)*at(ni))*fnt3ik(ni,nj,k)) )
      end do

      SD_grtneut = SD_grtneut + atopr(ni,nj)*fnt1(ni,nj) + 
     .         btopr(ni,nj)*fnt2(ni,nj)

      SD_grtneut = SD_grtneut + (-1.D0)**ni*(del(1,ni)*atopr(2,nj)+
     .     del(2,ni)*atopr(1,nj))/(ast1**2-ast2**2)*(
     .     4.D0*amqt*mgluino*dcos(2.D0*thet)*
     .     SD_B02(gmst(ni)**2,amqt,mgluino,amuv**2) +
     .     dcos(2.D0*thet)*dsin(2.D0*thet)*
     .     (SD_A01(ast2**2,amuv**2)-SD_A01(ast1**2,amuv**2)))

      if(ni.eq.1) then
         SD_grtneut = SD_grtneut + 1.D0/2.D0*atopr(1,nj)*(
     .        SD_delztl(amqt,mgluino,ast1,ast2,thet,amuv,lamv) +
     .        SD_delzst(amqt,mgluino,ast1,thet,amuv,lamv,1) ) -
     .        1.D0/(dsqrt(2.D0)*amw*dsin(bet))*z(nj,4)*dsin(thet)*
     .        SD_delmtdiv(amqt,mgluino,ast1,ast2,thet,amuvdiv,lamv)*
     .        runmt -
     .        runmt/(dsqrt(2.D0)*amw*dsin(bet))*z(nj,4)*dcos(thet)*
     .        SD_delthdiv(amqt,mgluino,ast1,ast2,thet,amuvdiv) +
     .        dsqrt(2.D0)*sw*(2.D0/3.D0*zp(nj,1)+(1.D0/2.D0-
     .         2.D0/3.D0*sw**2)*1.D0/sw/cw*zp(nj,2))*dsin(thet)*
     .        SD_delthdiv(amqt,mgluino,ast1,ast2,thet,amuvdiv) 
      elseif(ni.eq.2) then
         SD_grtneut = SD_grtneut + 1.D0/2.D0*atopr(2,nj)*(
     .        SD_delztl(amqt,mgluino,ast1,ast2,thet,amuv,lamv) +
     .        SD_delzst(amqt,mgluino,ast2,thet,amuv,lamv,2) ) -
     .        1.D0/(dsqrt(2.D0)*amw*dsin(bet))*z(nj,4)*dcos(thet)*
     .        SD_delmtdiv(amqt,mgluino,ast1,ast2,thet,amuvdiv,lamv)*
     .        runmt -
     .        runmt/(dsqrt(2.D0)*amw*dsin(bet))*z(nj,4)*(-dsin(thet))*
     .        SD_delthdiv(amqt,mgluino,ast1,ast2,thet,amuvdiv) +
     .        dsqrt(2.D0)*sw*(2.D0/3.D0*zp(nj,1)+(1.D0/2.D0-
     .         2.D0/3.D0*sw**2)*1.D0/sw/cw*zp(nj,2))*dcos(thet)*
     .        SD_delthdiv(amqt,mgluino,ast1,ast2,thet,amuvdiv) 
      endif

      SD_grtneut = (-1.D0)*SD_grtneut

      return 

      end

c -------------------------------------------------------------------- c

      double precision function SD_grbneut(ni,nj,amusc,amuscdiv,lamsc)

      implicit double precision (a-h,k-z)
      integer ni,nj,k

      dimension gmsb(2),abot(2,4),bbot(2,4),vb(2),ab(2),del(2,2)
      dimension fnb1(2,4),fnb2(2,4),fcb1(2,2),fcb2(2,2),
     .     fnb1ik(2,4,2),fnb2ik(2,4,2),fnb3ik(2,4,2),fnb4ik(2,4,2),
     .     fnb5ik(2,4,2),fnb6ik(2,4,2),fnb7ik(2,4,2),
     .     fcb1ik(2,2,2),fcb2ik(2,2,2),fcb3ik(2,2,2),fcb4ik(2,2,2),
     .     fcb5ik(2,2,2),fcb6ik(2,2,2),fcb7ik(2,2,2)
      dimension u(2,2),v(2,2),z(4,4),zp(4,4)

      COMMON/SD_qcdscales/amuv,lamv
      COMMON/SD_decindex/idec
      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_scala/scalb,scalt
      COMMON/SD_yukawa/ytewsb,ybewsb,ytauewsb
      COMMON/SD_mixmat/u,v,z,zp
      COMMON/SD_mixang/alp_mssm,tanbeta
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2
      COMMON/SD_sfmixang/thet,theb,thel,cum,sum,cdm,sdm,cem,sem
      COMMON/SD_fermion/amt,amb,amtau
      COMMON/SD_gluino/mgluino
      COMMON/SD_weinberg/sw,cw
      COMMON/SD_runmcalc/rmtc,rmbc,rmtauc
      COMMON/SD_runcoupscale/scalechoice,scaleofcoupling,inumloop

      external SD_runmass,SD_yuk

      bet=datan(tanbeta)

      gmsb(1) = asb1
      gmsb(2) = asb2

      idec = ni

      amuv = amusc
      lamv = lamsc
      amuvdiv = amuscdiv

      vb(1) = 1.D0/2.D0*(dcos(theb)-dsin(theb))
      vb(2) = -1.D0/2.D0*(dcos(theb)+dsin(theb))
      ab(1) = -vb(2)
      ab(2) = vb(1)

      del(1,1) = 1.D0
      del(1,2) = 0.D0
      del(2,1) = 0.D0
      del(2,2) = 1.D0

      call SD_fbfunctions(fnb1,fnb2,fnb1ik,fnb2ik,fnb3ik,fnb4ik,fnb5ik,
     .     fnb6ik,fnb7ik,fcb1,fcb2,fcb1ik,fcb2ik,fcb3ik,fcb4ik,fcb5ik,
     .     fcb6ik,fcb7ik)

c --- the running couplings ---

      if(scalechoice.eq.1.D0) then
         scalb = ybewsb/dsqrt(g2)
         scalt = ytewsb/dsqrt(g2)
         runmt = rmtc
         runmb = rmbc
      elseif(scalechoice.eq.2.D0) then         
         call SD_runmass(gmsb(ni),0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      elseif(scalechoice.eq.3.D0) then
         call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      endif

      call SD_neutsbotbot(abot,bbot)

      amqb = amb

c -------------

      SD_grbneut = 0.D0

      do k=1,2,1
         SD_grbneut = SD_grbneut - 2.D0*(
     .        bbot(k,nj)*( 
     .        (vb(k)*vb(ni)+ab(k)*ab(ni))*fnb4ik(ni,nj,k) +
     .        (ab(k)*vb(ni)+vb(k)*ab(ni))*fnb5ik(ni,nj,k) +
     .        (vb(k)*vb(ni)-ab(k)*ab(ni))*fnb6ik(ni,nj,k) +
     .        (ab(k)*vb(ni)-vb(k)*ab(ni))*fnb7ik(ni,nj,k) ) +
     .        abot(k,nj)*(
     .        (vb(k)*vb(ni)+ab(k)*ab(ni))*fnb1ik(ni,nj,k) +
     .        (ab(k)*vb(ni)+vb(k)*ab(ni))*fnb1ik(ni,nj,k) +
     .        (vb(k)*vb(ni)-ab(k)*ab(ni))*fnb2ik(ni,nj,k) +
     .        (ab(k)*vb(ni)-vb(k)*ab(ni))*fnb3ik(ni,nj,k)) )
      end do

      SD_grbneut = SD_grbneut + abot(ni,nj)*fnb1(ni,nj) + 
     .         bbot(ni,nj)*fnb2(ni,nj)

      SD_grbneut = SD_grbneut + (-1.D0)**ni*(del(1,ni)*abot(2,nj)+
     .     del(2,ni)*abot(1,nj))/(asb1**2-asb2**2)*(
     .     4.D0*amqb*mgluino*dcos(2.D0*theb)*
     .     SD_B02(gmsb(ni)**2,amqb,mgluino,amuv**2) +
     .     dcos(2.D0*theb)*dsin(2.D0*theb)*
     .     (SD_A01(asb2**2,amuv**2)-SD_A01(asb1**2,amuv**2)))

      if(ni.eq.1) then
         SD_grbneut = SD_grbneut + 1.D0/2.D0*abot(1,nj)*(
     .        SD_delztl(amqb,mgluino,asb1,asb2,theb,amuv,lamv) +
     .        SD_delzst(amqb,mgluino,asb1,theb,amuv,lamv,1) ) -
     .        1.D0/(dsqrt(2.D0)*amw*dcos(bet))*z(nj,3)*dsin(theb)*
     .        SD_delmtdiv(amqb,mgluino,asb1,asb2,theb,amuvdiv,lamv)*
     .        runmb -
     .        runmb/(dsqrt(2.D0)*amw*dcos(bet))*z(nj,3)*dcos(theb)*
     .        SD_delthdiv(amqb,mgluino,asb1,asb2,theb,amuvdiv) +
     .        dsqrt(2.D0)*sw*(-1.D0/3.D0*zp(nj,1)+(-1.D0/2.D0+
     .         1.D0/3.D0*sw**2)*1.D0/sw/cw*zp(nj,2))*dsin(theb)*
     .        SD_delthdiv(amqb,mgluino,asb1,asb2,theb,amuvdiv) 
      elseif(ni.eq.2) then
         SD_grbneut = SD_grbneut + 1.D0/2.D0*abot(2,nj)*(
     .        SD_delztl(amqb,mgluino,asb1,asb2,theb,amuv,lamv) +
     .        SD_delzst(amqb,mgluino,asb2,theb,amuv,lamv,2) ) -
     .        1.D0/(dsqrt(2.D0)*amw*dcos(bet))*z(nj,3)*dcos(theb)*
     .        SD_delmtdiv(amqb,mgluino,asb1,asb2,theb,amuvdiv,lamv)*
     .        runmb -
     .        runmb/(dsqrt(2.D0)*amw*dcos(bet))*z(nj,3)*(-dsin(theb))*
     .        SD_delthdiv(amqb,mgluino,asb1,asb2,theb,amuvdiv) +
     .        dsqrt(2.D0)*sw*(-1.D0/3.D0*zp(nj,1)+(-1.D0/2.D0+
     .         1.D0/3.D0*sw**2)*1.D0/sw/cw*zp(nj,2))*dcos(theb)*
     .        SD_delthdiv(amqb,mgluino,asb1,asb2,theb,amuvdiv) 
      endif

      SD_grbneut = (-1.D0)*SD_grbneut

      return 

      end

c -------------------------------------------------------------------- c

      double precision function SD_gltchar(ni,nj,amusc,amuscdiv,lamsc)

      implicit double precision (a-h,k-z)
      integer ni,nj,k

      dimension gmst(2),vt(2),at(2),vb(2),ab(2),del(2,2)
      dimension alsbot(2,2),aksbot(2,2),alstor(2,2),akstor(2,2)
      dimension fnt1(2,4),fnt2(2,4),fct1(2,2),fct2(2,2),
     .     fnt1ik(2,4,2),fnt2ik(2,4,2),fnt3ik(2,4,2),fnt4ik(2,4,2),
     .     fnt5ik(2,4,2),fnt6ik(2,4,2),fnt7ik(2,4,2),
     .     fct1ik(2,2,2),fct2ik(2,2,2),fct3ik(2,2,2),fct4ik(2,2,2),
     .     fct5ik(2,2,2),fct6ik(2,2,2),fct7ik(2,2,2)
      dimension u(2,2),v(2,2),z(4,4),zp(4,4)

      COMMON/SD_qcdscales/amuv,lamv
      COMMON/SD_decindex/idec
      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_scala/scalb,scalt
      COMMON/SD_yukawa/ytewsb,ybewsb,ytauewsb
      COMMON/SD_mixmat/u,v,z,zp
      COMMON/SD_mixang/alp_mssm,tanbeta
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2
      COMMON/SD_sfmixang/thet,theb,thel,cum,sum,cdm,sdm,cem,sem
      COMMON/SD_fermion/amt,amb,amtau
      COMMON/SD_gluino/mgluino
      COMMON/SD_weinberg/sw,cw
      COMMON/SD_runmcalc/rmtc,rmbc,rmtauc
      COMMON/SD_runcoupscale/scalechoice,scaleofcoupling,inumloop

      external SD_runmass,SD_yuk

      bet=datan(tanbeta)

      amuv    = amusc
      lamv    = lamsc
      amuvdiv = amuscdiv

      idec = ni

      gmst(1) = ast1
      gmst(2) = ast2

      vt(1) = 1.D0/2.D0*(dcos(thet)-dsin(thet))
      vt(2) = -1.D0/2.D0*(dcos(thet)+dsin(thet))
      at(1) = -vt(2)
      at(2) = vt(1)

      vb(1) = 1.D0/2.D0*(dcos(theb)-dsin(theb))
      vb(2) = -1.D0/2.D0*(dcos(theb)+dsin(theb))
      ab(1) = -vb(2)
      ab(2) = vb(1)

      del(1,1) = 1.D0
      del(1,2) = 0.D0
      del(2,1) = 0.D0
      del(2,2) = 1.D0

      call SD_ftfunctions(fnt1,fnt2,fnt1ik,fnt2ik,fnt3ik,fnt4ik,fnt5ik,
     .     fnt6ik,fnt7ik,fct1,fct2,fct1ik,fct2ik,fct3ik,fct4ik,fct5ik,
     .     fct6ik,fct7ik)

c --- the running couplings ---

      if(scalechoice.eq.1.D0) then
         scalb = ybewsb/dsqrt(g2)
         scalt = ytewsb/dsqrt(g2)
         runmt = rmtc
         runmb = rmbc
      elseif(scalechoice.eq.2.D0) then         
         call SD_runmass(gmst(ni),0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      elseif(scalechoice.eq.3.D0) then
         call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      endif

      call SD_charsbottop(alsbot,aksbot)
      call SD_charstopbot(alstor,akstor)

      amqt = amt
      amqb = amb

c -------------

      SD_gltchar = 0.D0

      do k=1,2,1
         SD_gltchar = SD_gltchar -2.D0*(
     .        alsbot(k,nj)*( 
     .        (vb(k)*vt(ni)+ab(k)*at(ni))*fct4ik(ni,nj,k) -
     .        (ab(k)*vt(ni)+vb(k)*at(ni))*fct5ik(ni,nj,k) +
     .        (vb(k)*vt(ni)-ab(k)*at(ni))*fct6ik(ni,nj,k) -
     .        (ab(k)*vt(ni)-vb(k)*at(ni))*fct7ik(ni,nj,k) ) +
     .        aksbot(k,nj)*(
     .        (vb(k)*vt(ni)+ab(k)*at(ni))*fct1ik(ni,nj,k) -
     .        (ab(k)*vt(ni)+vb(k)*at(ni))*fct1ik(ni,nj,k) +
     .        (vb(k)*vt(ni)-ab(k)*at(ni))*fct2ik(ni,nj,k) -
     .        (ab(k)*vt(ni)-vb(k)*at(ni))*fct3ik(ni,nj,k)) )
      end do

      SD_gltchar = SD_gltchar + 
     .         akstor(ni,nj)*fct1(ni,nj) + alstor(ni,nj)*fct2(ni,nj)

      SD_gltchar = SD_gltchar + (-1.D0)**ni*(del(1,ni)*akstor(2,nj)+
     .     del(2,ni)*akstor(1,nj))/(ast1**2-ast2**2)*(
     .     4.D0*amqt*mgluino*dcos(2.D0*thet)*
     .     SD_B02(gmst(ni)**2,amqt,mgluino,amuv**2) +
     .     dcos(2.D0*thet)*dsin(2.D0*thet)*
     .     (SD_A01(ast2**2,amuv**2)-SD_A01(ast1**2,amuv**2)))

      if(ni.eq.1) then
         SD_gltchar = SD_gltchar + 1.D0/2.D0*akstor(1,nj)*(
     .        SD_delztr(amqb,mgluino,asb1,asb2,theb,amuv,lamv) +
     .        SD_delzst(amqt,mgluino,ast1,thet,amuv,lamv,1)  +
     .      2.D0*SD_delmtdiv(amqb,mgluino,asb1,asb2,theb,amuvdiv,lamv) )
     .        - runmb*u(nj,2)/dsqrt(2.D0)/amw/dcos(bet)*dsin(thet)*
     .        SD_delthdiv(amqt,mgluino,ast1,ast2,thet,amuvdiv)
      elseif(ni.eq.2) then
         SD_gltchar = SD_gltchar + 1.D0/2.D0*akstor(2,nj)*(
     .        SD_delztr(amqb,mgluino,asb1,asb2,theb,amuv,lamv) +
     .        SD_delzst(amqt,mgluino,ast2,thet,amuv,lamv,2)  +
     .      2.D0*SD_delmtdiv(amqb,mgluino,asb1,asb2,theb,amuvdiv,lamv) )
     .        - runmb*u(nj,2)/dsqrt(2.D0)/amw/dcos(bet)*dcos(thet)*
     .        SD_delthdiv(amqt,mgluino,ast1,ast2,thet,amuvdiv)
      endif

      SD_gltchar = (-1.D0)*SD_gltchar

      return 

      end

c -------------------------------------------------------------------- c

      double precision function SD_glbchar(ni,nj,amusc,amuscdiv,lamsc)

      implicit double precision (a-h,k-z)
      integer ni,nj,k

      dimension gmsb(2),vt(2),at(2),vb(2),ab(2),del(2,2)
      dimension alstor(2,2),akstor(2,2),aksbot(2,2),alsbot(2,2)
      dimension fnb1(2,4),fnb2(2,4),fcb1(2,2),fcb2(2,2),
     .     fnb1ik(2,4,2),fnb2ik(2,4,2),fnb3ik(2,4,2),fnb4ik(2,4,2),
     .     fnb5ik(2,4,2),fnb6ik(2,4,2),fnb7ik(2,4,2),
     .     fcb1ik(2,2,2),fcb2ik(2,2,2),fcb3ik(2,2,2),fcb4ik(2,2,2),
     .     fcb5ik(2,2,2),fcb6ik(2,2,2),fcb7ik(2,2,2)
      dimension u(2,2),v(2,2),z(4,4),zp(4,4)

      COMMON/SD_qcdscales/amuv,lamv
      COMMON/SD_decindex/idec
      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_scala/scalb,scalt
      COMMON/SD_yukawa/ytewsb,ybewsb,ytauewsb
      COMMON/SD_mixmat/u,v,z,zp
      COMMON/SD_mixang/alp_mssm,tanbeta
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2
      COMMON/SD_sfmixang/thet,theb,thel,cum,sum,cdm,sdm,cem,sem
      COMMON/SD_fermion/amt,amb,amtau
      COMMON/SD_gluino/mgluino
      COMMON/SD_weinberg/sw,cw
      COMMON/SD_runmcalc/rmtc,rmbc,rmtauc
      COMMON/SD_runcoupscale/scalechoice,scaleofcoupling,inumloop

      external SD_runmass,SD_yuk

      bet=datan(tanbeta)

      amuv = amusc
      lamv = lamsc
      amuvdiv = amuscdiv

      idec = ni

      gmsb(1) = asb1
      gmsb(2) = asb2

      vt(1) = 1.D0/2.D0*(dcos(thet)-dsin(thet))
      vt(2) = -1.D0/2.D0*(dcos(thet)+dsin(thet))
      at(1) = -vt(2)
      at(2) = vt(1)

      vb(1) = 1.D0/2.D0*(dcos(theb)-dsin(theb))
      vb(2) = -1.D0/2.D0*(dcos(theb)+dsin(theb))
      ab(1) = -vb(2)
      ab(2) = vb(1)

      del(1,1) = 1.D0
      del(1,2) = 0.D0
      del(2,1) = 0.D0
      del(2,2) = 1.D0

      call SD_fbfunctions(fnb1,fnb2,fnb1ik,fnb2ik,fnb3ik,fnb4ik,fnb5ik,
     .     fnb6ik,fnb7ik,fcb1,fcb2,fcb1ik,fcb2ik,fcb3ik,fcb4ik,fcb5ik,
     .     fcb6ik,fcb7ik)

c --- the running couplings ---

      if(scalechoice.eq.1.D0) then
         scalb = ybewsb/dsqrt(g2)
         scalt = ytewsb/dsqrt(g2)
         runmt = rmtc
         runmb = rmbc
      elseif(scalechoice.eq.2.D0) then         
         call SD_runmass(gmsb(ni),0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      elseif(scalechoice.eq.3.D0) then
         call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      endif

      call SD_charsbottop(alsbot,aksbot)
      call SD_charstopbot(alstor,akstor)

      amqt = amt
      amqb = amb

c -------------

      SD_glbchar = 0.D0

      do k=1,2,1
         SD_glbchar = SD_glbchar - 2.D0*(
     .        alstor(k,nj)*( 
     .        (vt(k)*vb(ni)+at(k)*ab(ni))*fcb4ik(ni,nj,k) -
     .        (at(k)*vb(ni)+vt(k)*ab(ni))*fcb5ik(ni,nj,k) +
     .        (vt(k)*vb(ni)-at(k)*ab(ni))*fcb6ik(ni,nj,k) -
     .        (at(k)*vb(ni)-vt(k)*ab(ni))*fcb7ik(ni,nj,k) ) +
     .        akstor(k,nj)*(
     .        (vt(k)*vb(ni)+at(k)*ab(ni))*fcb1ik(ni,nj,k) -
     .        (at(k)*vb(ni)+vt(k)*ab(ni))*fcb1ik(ni,nj,k) +
     .        (vt(k)*vb(ni)-at(k)*ab(ni))*fcb2ik(ni,nj,k) -
     .        (at(k)*vb(ni)-vt(k)*ab(ni))*fcb3ik(ni,nj,k)) )
      end do

      SD_glbchar = SD_glbchar + 
     .         aksbot(ni,nj)*fcb1(ni,nj) + alsbot(ni,nj)*fcb2(ni,nj)

      SD_glbchar = SD_glbchar + (-1.D0)**ni*(del(1,ni)*aksbot(2,nj)+
     .     del(2,ni)*aksbot(1,nj))/(asb1**2-asb2**2)*(
     .     4.D0*amqb*mgluino*dcos(2.D0*theb)*
     .     SD_B02(gmsb(ni)**2,amqb,mgluino,amuv**2) +
     .     dcos(2.D0*theb)*dsin(2.D0*theb)*
     .     (SD_A01(asb2**2,amuv**2)-SD_A01(asb1**2,amuv**2)))

      if(ni.eq.1) then
         SD_glbchar = SD_glbchar + 1.D0/2.D0*aksbot(1,nj)*(
     .        SD_delztr(amqt,mgluino,ast1,ast2,thet,amuv,lamv) +
     .        SD_delzst(amqb,mgluino,asb1,theb,amuv,lamv,1)  +
     .      2.D0*SD_delmtdiv(amqt,mgluino,ast1,ast2,thet,amuvdiv,lamv) )
     .        - runmt*v(nj,2)/dsqrt(2.D0)/amw/dsin(bet)*dsin(theb)*
     .        SD_delthdiv(amqb,mgluino,asb1,asb2,theb,amuvdiv)
      elseif(ni.eq.2) then
         SD_glbchar = SD_glbchar + 1.D0/2.D0*aksbot(2,nj)*(
     .        SD_delztr(amqt,mgluino,ast1,ast2,thet,amuv,lamv) +
     .        SD_delzst(amqb,mgluino,asb2,theb,amuv,lamv,2)  +
     .      2.D0*SD_delmtdiv(amqt,mgluino,ast1,ast2,thet,amuvdiv,lamv) )
     .        - runmt*v(nj,2)/dsqrt(2.D0)/amw/dsin(bet)*dcos(theb)*
     .        SD_delthdiv(amqb,mgluino,asb1,asb2,theb,amuvdiv)
      endif

      SD_glbchar = (-1.D0)*SD_glbchar

      return 

      end

c -------------------------------------------------------------------- c

      double precision function SD_grtchar(ni,nj,amusc,amuscdiv,lamsc)

      implicit double precision (a-h,k-z)
      integer ni,nj,k

      dimension gmst(2),vt(2),at(2),vb(2),ab(2),del(2,2)
      dimension alsbot(2,2),aksbot(2,2),alstor(2,2),akstor(2,2)
      dimension fnt1(2,4),fnt2(2,4),fct1(2,2),fct2(2,2),
     .     fnt1ik(2,4,2),fnt2ik(2,4,2),fnt3ik(2,4,2),fnt4ik(2,4,2),
     .     fnt5ik(2,4,2),fnt6ik(2,4,2),fnt7ik(2,4,2),
     .     fct1ik(2,2,2),fct2ik(2,2,2),fct3ik(2,2,2),fct4ik(2,2,2),
     .     fct5ik(2,2,2),fct6ik(2,2,2),fct7ik(2,2,2)
      dimension u(2,2),v(2,2),z(4,4),zp(4,4)

      COMMON/SD_qcdscales/amuv,lamv
      COMMON/SD_decindex/idec
      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_scala/scalb,scalt
      COMMON/SD_yukawa/ytewsb,ybewsb,ytauewsb
      COMMON/SD_mixmat/u,v,z,zp
      COMMON/SD_mixang/alp_mssm,tanbeta
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2
      COMMON/SD_sfmixang/thet,theb,thel,cum,sum,cdm,sdm,cem,sem
      COMMON/SD_fermion/amt,amb,amtau
      COMMON/SD_gluino/mgluino
      COMMON/SD_weinberg/sw,cw
      COMMON/SD_runmcalc/rmtc,rmbc,rmtauc
      COMMON/SD_runcoupscale/scalechoice,scaleofcoupling,inumloop

      external SD_runmass,SD_yuk

      bet=datan(tanbeta)

      amuv = amusc
      lamv = lamsc
      amuvdiv = amuscdiv

      idec = ni

      gmst(1) = ast1
      gmst(2) = ast2

      vt(1) = 1.D0/2.D0*(dcos(thet)-dsin(thet))
      vt(2) = -1.D0/2.D0*(dcos(thet)+dsin(thet))
      at(1) = -vt(2)
      at(2) = vt(1)

      vb(1) = 1.D0/2.D0*(dcos(theb)-dsin(theb))
      vb(2) = -1.D0/2.D0*(dcos(theb)+dsin(theb))
      ab(1) = -vb(2)
      ab(2) = vb(1)

      del(1,1) = 1.D0
      del(1,2) = 0.D0
      del(2,1) = 0.D0
      del(2,2) = 1.D0

      call SD_ftfunctions(fnt1,fnt2,fnt1ik,fnt2ik,fnt3ik,fnt4ik,fnt5ik,
     .     fnt6ik,fnt7ik,fct1,fct2,fct1ik,fct2ik,fct3ik,fct4ik,fct5ik,
     .     fct6ik,fct7ik)

c --- the running couplings ---

      if(scalechoice.eq.1.D0) then
         scalb = ybewsb/dsqrt(g2)
         scalt = ytewsb/dsqrt(g2)
         runmt = rmtc
         runmb = rmbc
      elseif(scalechoice.eq.2.D0) then         
         call SD_runmass(gmst(ni),0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      elseif(scalechoice.eq.3.D0) then
         call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      endif

      call SD_charsbottop(alsbot,aksbot)
      call SD_charstopbot(alstor,akstor)

      amqt = amt
      amqb = amb

c -------------

      SD_grtchar = 0.D0

      do k=1,2,1
         SD_grtchar = SD_grtchar -2.D0*(
     .        aksbot(k,nj)*( 
     .        (vb(k)*vt(ni)+ab(k)*at(ni))*fct4ik(ni,nj,k) +
     .        (ab(k)*vt(ni)+vb(k)*at(ni))*fct5ik(ni,nj,k) +
     .        (vb(k)*vt(ni)-ab(k)*at(ni))*fct6ik(ni,nj,k) +
     .        (ab(k)*vt(ni)-vb(k)*at(ni))*fct7ik(ni,nj,k) ) +
     .        alsbot(k,nj)*(
     .        (vb(k)*vt(ni)+ab(k)*at(ni))*fct1ik(ni,nj,k) +
     .        (ab(k)*vt(ni)+vb(k)*at(ni))*fct1ik(ni,nj,k) +
     .        (vb(k)*vt(ni)-ab(k)*at(ni))*fct2ik(ni,nj,k) +
     .        (ab(k)*vt(ni)-vb(k)*at(ni))*fct3ik(ni,nj,k)) )
      end do

      SD_grtchar = SD_grtchar + 
     .         alstor(ni,nj)*fct1(ni,nj) + akstor(ni,nj)*fct2(ni,nj)

      SD_grtchar = SD_grtchar + (-1.D0)**ni*(del(1,ni)*alstor(2,nj)+
     .     del(2,ni)*alstor(1,nj))/(ast1**2-ast2**2)*(
     .     4.D0*amqt*mgluino*dcos(2.D0*thet)*
     .     SD_B02(gmst(ni)**2,amqt,mgluino,amuv**2) +
     .     dcos(2.D0*thet)*dsin(2.D0*thet)*
     .     (SD_A01(ast2**2,amuv**2)-SD_A01(ast1**2,amuv**2)))

      if(ni.eq.1) then
         SD_grtchar = SD_grtchar + 1.D0/2.D0*alstor(1,nj)*(
     .        SD_delztl(amqb,mgluino,asb1,asb2,theb,amuv,lamv) +
     .        SD_delzst(amqt,mgluino,ast1,thet,amuv,lamv,1) ) +
     .        1.D0/(dsqrt(2.D0)*amw*dsin(bet))*v(nj,2)*dsin(thet)*
     .        SD_delmtdiv(amqt,mgluino,ast1,ast2,thet,amuvdiv,lamv)*
     .        runmt +
     .        v(nj,1)*dsin(thet)*
     .        SD_delthdiv(amqt,mgluino,ast1,ast2,thet,amuvdiv) +
     .        runmt*v(nj,2)/dsqrt(2.D0)/amw/dsin(bet)*dcos(thet)*
     .        SD_delthdiv(amqt,mgluino,ast1,ast2,thet,amuvdiv) 
      elseif(ni.eq.2) then
         SD_grtchar = SD_grtchar + 1.D0/2.D0*alstor(2,nj)*(
     .        SD_delztl(amqb,mgluino,asb1,asb2,theb,amuv,lamv) +
     .        SD_delzst(amqt,mgluino,ast2,thet,amuv,lamv,2) ) +
     .        1.D0/(dsqrt(2.D0)*amw*dsin(bet))*v(nj,2)*dcos(thet)*
     .        SD_delmtdiv(amqt,mgluino,ast1,ast2,thet,amuvdiv,lamv)*
     .        runmt +
     .        v(nj,1)*dcos(thet)*
     .        SD_delthdiv(amqt,mgluino,ast1,ast2,thet,amuvdiv) +
     .        runmt*v(nj,2)/dsqrt(2.D0)/amw/dsin(bet)*(-dsin(thet))*
     .        SD_delthdiv(amqt,mgluino,ast1,ast2,thet,amuvdiv)
      endif

      SD_grtchar = (-1.D0)*SD_grtchar

      return 

      end

c -------------------------------------------------------------------- c

      double precision function SD_grbchar(ni,nj,amusc,amuscdiv,lamsc)

      implicit double precision (a-h,k-z)
      integer ni,nj,k

      dimension gmsb(2),vt(2),at(2),vb(2),ab(2),del(2,2)
      dimension alsbot(2,2),aksbot(2,2),alstor(2,2),akstor(2,2)
      dimension fnb1(2,4),fnb2(2,4),fcb1(2,2),fcb2(2,2),
     .     fnb1ik(2,4,2),fnb2ik(2,4,2),fnb3ik(2,4,2),fnb4ik(2,4,2),
     .     fnb5ik(2,4,2),fnb6ik(2,4,2),fnb7ik(2,4,2),
     .     fcb1ik(2,2,2),fcb2ik(2,2,2),fcb3ik(2,2,2),fcb4ik(2,2,2),
     .     fcb5ik(2,2,2),fcb6ik(2,2,2),fcb7ik(2,2,2)
      dimension u(2,2),v(2,2),z(4,4),zp(4,4)

      COMMON/SD_qcdscales/amuv,lamv
      COMMON/SD_decindex/idec
      COMMON/SD_param/gf,amz,amw,pi,g2
      COMMON/SD_scala/scalb,scalt
      COMMON/SD_yukawa/ytewsb,ybewsb,ytauewsb
      COMMON/SD_mixmat/u,v,z,zp
      COMMON/SD_mixang/alp_mssm,tanbeta
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2
      COMMON/SD_sfmixang/thet,theb,thel,cum,sum,cdm,sdm,cem,sem
      COMMON/SD_fermion/amt,amb,amtau
      COMMON/SD_gluino/mgluino
      COMMON/SD_weinberg/sw,cw
      COMMON/SD_runmcalc/rmtc,rmbc,rmtauc
      COMMON/SD_runcoupscale/scalechoice,scaleofcoupling,inumloop

      external SD_runmass,SD_yuk

      bet=datan(tanbeta)

      amuv    = amusc
      lamv    = lamsc
      amuvdiv = amuscdiv

      idec = ni

      gmsb(1) = asb1
      gmsb(2) = asb2

      vt(1) = 1.D0/2.D0*(dcos(thet)-dsin(thet))
      vt(2) = -1.D0/2.D0*(dcos(thet)+dsin(thet))
      at(1) = -vt(2)
      at(2) = vt(1)

      vb(1) = 1.D0/2.D0*(dcos(theb)-dsin(theb))
      vb(2) = -1.D0/2.D0*(dcos(theb)+dsin(theb))
      ab(1) = -vb(2)
      ab(2) = vb(1)

      del(1,1) = 1.D0
      del(1,2) = 0.D0
      del(2,1) = 0.D0
      del(2,2) = 1.D0

      call SD_fbfunctions(fnb1,fnb2,fnb1ik,fnb2ik,fnb3ik,fnb4ik,fnb5ik,
     .     fnb6ik,fnb7ik,fcb1,fcb2,fcb1ik,fcb2ik,fcb3ik,fcb4ik,fcb5ik,
     .     fcb6ik,fcb7ik)

c --- the running couplings ---

      if(scalechoice.eq.1.D0) then
         scalb = ybewsb/dsqrt(g2)
         scalt = ytewsb/dsqrt(g2)
         runmt = rmtc
         runmb = rmbc
      elseif(scalechoice.eq.2.D0) then         
         call SD_runmass(gmsb(ni),0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      elseif(scalechoice.eq.3.D0) then
         call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      endif

      call SD_charsbottop(alsbot,aksbot)
      call SD_charstopbot(alstor,akstor)

      amqt = amt
      amqb = amb

c -------------

      SD_grbchar = 0.D0

      do k=1,2,1
         SD_grbchar = SD_grbchar - 2.D0*(
     .        akstor(k,nj)*( 
     .        (vt(k)*vb(ni)+at(k)*ab(ni))*fcb4ik(ni,nj,k) +
     .        (at(k)*vb(ni)+vt(k)*ab(ni))*fcb5ik(ni,nj,k) +
     .        (vt(k)*vb(ni)-at(k)*ab(ni))*fcb6ik(ni,nj,k) +
     .        (at(k)*vb(ni)-vt(k)*ab(ni))*fcb7ik(ni,nj,k) ) +
     .        alstor(k,nj)*(
     .        (vt(k)*vb(ni)+at(k)*ab(ni))*fcb1ik(ni,nj,k) +
     .        (at(k)*vb(ni)+vt(k)*ab(ni))*fcb1ik(ni,nj,k) +
     .        (vt(k)*vb(ni)-at(k)*ab(ni))*fcb2ik(ni,nj,k) +
     .        (at(k)*vb(ni)-vt(k)*ab(ni))*fcb3ik(ni,nj,k)) )
      end do

      SD_grbchar = SD_grbchar + 
     .         alsbot(ni,nj)*fcb1(ni,nj) + aksbot(ni,nj)*fcb2(ni,nj)

      SD_grbchar = SD_grbchar + (-1.D0)**ni*(del(1,ni)*alsbot(2,nj)+
     .     del(2,ni)*alsbot(1,nj))/(asb1**2-asb2**2)*(
     .     4.D0*amqb*mgluino*dcos(2.D0*theb)*
     .     SD_B02(gmsb(ni)**2,amqb,mgluino,amuv**2) +
     .     dcos(2.D0*theb)*dsin(2.D0*theb)*
     .     (SD_A01(asb2**2,amuv**2)-SD_A01(asb1**2,amuv**2)))

      if(ni.eq.1) then
         SD_grbchar = SD_grbchar + 1.D0/2.D0*alsbot(1,nj)*(
     .        SD_delztl(amqt,mgluino,ast1,ast2,thet,amuv,lamv) +
     .        SD_delzst(amqb,mgluino,asb1,theb,amuv,lamv,1) ) +
     .        1.D0/(dsqrt(2.D0)*amw*dcos(bet))*u(nj,2)*dsin(theb)*
     .        SD_delmtdiv(amqb,mgluino,asb1,asb2,theb,amuvdiv,lamv)*
     .        runmb +
     .        u(nj,1)*dsin(theb)*
     .        SD_delthdiv(amqb,mgluino,asb1,asb2,theb,amuvdiv) +
     .        runmb*u(nj,2)/dsqrt(2.D0)/amw/dcos(bet)*dcos(theb)*
     .        SD_delthdiv(amqb,mgluino,asb1,asb2,theb,amuvdiv) 
      elseif(ni.eq.2) then
         SD_grbchar = SD_grbchar + 1.D0/2.D0*alsbot(2,nj)*(
     .        SD_delztl(amqt,mgluino,ast1,ast2,thet,amuv,lamv) +
     .        SD_delzst(amqb,mgluino,asb2,theb,amuv,lamv,2) ) +
     .        1.D0/(dsqrt(2.D0)*amw*dcos(bet))*u(nj,2)*dcos(theb)*
     .        SD_delmtdiv(amqb,mgluino,asb1,asb2,theb,amuvdiv,lamv)*
     .        runmb +
     .        u(nj,1)*dcos(theb)*
     .        SD_delthdiv(amqb,mgluino,asb1,asb2,theb,amuvdiv) +
     .        runmb*u(nj,2)/dsqrt(2.D0)/amw/dcos(bet)*(-dsin(theb))*
     .        SD_delthdiv(amqb,mgluino,asb1,asb2,theb,amuvdiv)
      endif

      SD_grbchar = (-1.D0)*SD_grbchar

      return 

      end

c -------------------------------------------------------------------- c

      subroutine SD_ftfunctions(fnt1,fnt2,fnt1ik,fnt2ik,fnt3ik,fnt4ik,
     .     fnt5ik,fnt6ik,fnt7ik,fct1,fct2,fct1ik,fct2ik,fct3ik,fct4ik,
     .     fct5ik,fct6ik,fct7ik)

      implicit double precision (a-h,k-z)
      complex*16 SD_C03,SD_C0_lam
      integer k

      dimension fnt1(2,4),fnt2(2,4),fct1(2,2),fct2(2,2),
     .     fnt1ik(2,4,2),fnt2ik(2,4,2),fnt3ik(2,4,2),fnt4ik(2,4,2),
     .     fnt5ik(2,4,2),fnt6ik(2,4,2),fnt7ik(2,4,2),
     .     fct1ik(2,2,2),fct2ik(2,2,2),fct3ik(2,2,2),fct4ik(2,2,2),
     .     fct5ik(2,2,2),fct6ik(2,2,2),fct7ik(2,2,2)
      dimension gmst(2),gmsb(2),amneut(4),xmneut(4),amchar(2)

      COMMON/SD_qcdscales/amuv,lamv
      COMMON/SD_decindex/idec
      COMMON/SD_fermion/amt,amb,amtau
      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_gluino/mgluino
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2

      gmst(1) = ast1
      gmst(2) = ast2
      gmsb(1) = asb1
      gmsb(2) = asb2

      amqt = amt
      amqb = amb

      do i=1,2,1
         do j=1,4,1
            fnt1(i,j) = SD_B02(gmst(i)**2,lamv,gmst(i),amuv**2) + 
     .        2.D0*amqt**2*dreal(SD_C0_lam(amqt,gmst(i),amneut(j),lamv))
     .         -2.D0*gmst(i)**2*(
     .         SD_C1_lam(amqt,gmst(i),amneut(j),amqt,lamv,gmst(i),amuv,
     .                lamv)-
     .         SD_C2_lam(amqt,gmst(i),amneut(j),amqt,lamv,gmst(i),amuv,
     .                lamv))
     .         +2.D0*amneut(j)**2*
     .         SD_C1_lam(amqt,gmst(i),amneut(j),amqt,lamv,gmst(i),amuv,
     .                lamv) 

            fnt2(i,j) = -2.D0*amqt*amneut(j)*(
     .         dreal(SD_C0_lam(amqt,gmst(i),amneut(j),lamv)) +
     .         SD_C1_lam(amqt,gmst(i),amneut(j),amqt,lamv,gmst(i),amuv,
     .                lamv) )

            do k=1,2,1
               fnt1ik(i,j,k) = mgluino*amneut(j)*(
     .              dreal(SD_C03(amqt**2,gmst(i)**2,amneut(j)**2,
     .                             gmst(k),mgluino,amqt)) +
     .              SD_C2(amqt,gmst(i),amneut(j),gmst(k),mgluino,
     .                      amqt,amuv) )
               fnt2ik(i,j,k) = amneut(j)*(amqt*(
     .              dreal(SD_C03(amqt**2,gmst(i)**2,amneut(j)**2,
     .              gmst(k),mgluino,amqt)) +
     .              SD_C1(amqt,gmst(i),amneut(j),gmst(k),mgluino,
     .                      amqt,amuv) ) + amqt*
     .              SD_C2(amqt,gmst(i),amneut(j),gmst(k),mgluino,
     .                      amqt,amuv) )
               fnt3ik(i,j,k) = amneut(j)*(-amqt*(
     .              dreal(SD_C03(amqt**2,gmst(i)**2,amneut(j)**2,
     .              gmst(k),mgluino,amqt)) +
     .              SD_C1(amqt,gmst(i),amneut(j),gmst(k),mgluino,
     .                      amqt,amuv) ) + amqt*
     .              SD_C2(amqt,gmst(i),amneut(j),gmst(k),mgluino,
     .                      amqt,amuv) )
               fnt4ik(i,j,k) = mgluino*(amqt*
     .              dreal(SD_C03(amqt**2,gmst(i)**2,amneut(j)**2,
     .              gmst(k),mgluino,amqt)) + amqt*(
     .              SD_C1(amqt,gmst(i),amneut(j),gmst(k),mgluino,
     .                      amqt,amuv) -
     .              SD_C2(amqt,gmst(i),amneut(j),gmst(k),mgluino,
     .                      amqt,amuv) ) )
               fnt5ik(i,j,k) = mgluino*(amqt*
     .              dreal(SD_C03(amqt**2,gmst(i)**2,amneut(j)**2,
     .              gmst(k),mgluino,amqt)) - amqt*(
     .              SD_C1(amqt,gmst(i),amneut(j),gmst(k),mgluino,
     .                      amqt,amuv) -
     .              SD_C2(amqt,gmst(i),amneut(j),gmst(k),mgluino,
     .                      amqt,amuv) ) )
               fnt6ik(i,j,k) = gmst(k)**2*
     .              dreal(SD_C03(amqt**2,gmst(i)**2,amneut(j)**2,
     .              gmst(k),mgluino,amqt)) + amqt*amqt*(
     .              dreal(SD_C03(amqt**2,gmst(i)**2,amneut(j)**2,
     .              gmst(k),mgluino,amqt)) +
     .              SD_C1(amqt,gmst(i),amneut(j),gmst(k),mgluino,
     .                      amqt,amuv) -
     .              SD_C2(amqt,gmst(i),amneut(j),gmst(k),mgluino,
     .                      amqt,amuv) ) + amqt**2*(
     .              SD_C1(amqt,gmst(i),amneut(j),gmst(k),mgluino,
     .                      amqt,amuv) -
     .              SD_C2(amqt,gmst(i),amneut(j),gmst(k),mgluino,
     .                      amqt,amuv) ) + amneut(j)**2*
     .              SD_C2(amqt,gmst(i),amneut(j),gmst(k),mgluino,
     .                      amqt,amuv) +
     .              SD_B02(gmst(i)**2,mgluino,amqt,amuv**2) 
               fnt7ik(i,j,k) = gmst(k)**2* 
     .              dreal(SD_C03(amqt**2,gmst(i)**2,amneut(j)**2,
     .              gmst(k),mgluino,amqt)) - amqt*amqt*(
     .              dreal(SD_C03(amqt**2,gmst(i)**2,amneut(j)**2,
     .              gmst(k),mgluino,amqt)) +
     .              SD_C1(amqt,gmst(i),amneut(j),gmst(k),mgluino,
     .                      amqt,amuv) -
     .              SD_C2(amqt,gmst(i),amneut(j),gmst(k),mgluino,
     .                      amqt,amuv) ) + amqt**2*(
     .              SD_C1(amqt,gmst(i),amneut(j),gmst(k),mgluino,
     .                      amqt,amuv) -
     .              SD_C2(amqt,gmst(i),amneut(j),gmst(k),mgluino,
     .                      amqt,amuv) ) + amneut(j)**2*
     .              SD_C2(amqt,gmst(i),amneut(j),gmst(k),mgluino,
     .                      amqt,amuv) +
     .              SD_B02(gmst(i)**2,mgluino,amqt,amuv**2) 
            enddo
         enddo
      enddo

      do i=1,2,1
         do j=1,2,1
            fct1(i,j) = SD_B02(gmst(i)**2,lamv,gmst(i),amuv**2) + 
     .       2.D0*amqb**2*dreal(SD_C0_lam(amqb,gmst(i),amchar(j),lamv)) 
     .         -2.D0*gmst(i)**2*(
     .         SD_C1_lam(amqb,gmst(i),amchar(j),amqb,lamv,gmst(i),amuv,
     .                lamv) -
     .         SD_C2_lam(amqb,gmst(i),amchar(j),amqb,lamv,gmst(i),amuv,
     .                lamv))
     .         +2.D0*amchar(j)**2*
     .         SD_C1_lam(amqb,gmst(i),amchar(j),amqb,lamv,gmst(i),amuv,
     .                lamv)

            fct2(i,j) = -2.D0*amqb*amchar(j)*(
     .         dreal(SD_C0_lam(amqb,gmst(i),amchar(j),lamv)) +
     .         SD_C1_lam(amqb,gmst(i),amchar(j),amqb,lamv,gmst(i),amuv,
     .                lamv) )

            do k=1,2,1
               fct1ik(i,j,k) = mgluino*amchar(j)*(
     .              dreal(SD_C03(amqb**2,gmst(i)**2,amchar(j)**2,
     .              gmsb(k),mgluino,amqt)) +
     .              SD_C2(amqb,gmst(i),amchar(j),gmsb(k),mgluino,
     .                      amqt,amuv) )
               fct2ik(i,j,k) = amchar(j)*(amqb*(
     .              dreal(SD_C03(amqb**2,gmst(i)**2,amchar(j)**2,
     .              gmsb(k),mgluino,amqt)) +
     .              SD_C1(amqb,gmst(i),amchar(j),gmsb(k),mgluino,
     .                      amqt,amuv) ) + amqt*
     .              SD_C2(amqb,gmst(i),amchar(j),gmsb(k),mgluino,
     .                      amqt,amuv) )
               fct3ik(i,j,k) = amchar(j)*(-amqb*(
     .              dreal(SD_C03(amqb**2,gmst(i)**2,amchar(j)**2,
     .              gmsb(k),mgluino,amqt)) +
     .              SD_C1(amqb,gmst(i),amchar(j),gmsb(k),mgluino,
     .                      amqt,amuv) ) + amqt*
     .              SD_C2(amqb,gmst(i),amchar(j),gmsb(k),mgluino,
     .                      amqt,amuv) )
               fct4ik(i,j,k) = mgluino*(amqt*
     .              dreal(SD_C03(amqb**2,gmst(i)**2,amchar(j)**2,
     .              gmsb(k),mgluino,amqt)) + amqb*(
     .              SD_C1(amqb,gmst(i),amchar(j),gmsb(k),mgluino,
     .                      amqt,amuv) -
     .              SD_C2(amqb,gmst(i),amchar(j),gmsb(k),mgluino,
     .                      amqt,amuv) ) )
               fct5ik(i,j,k) = mgluino*(amqt*
     .              dreal(SD_C03(amqb**2,gmst(i)**2,amchar(j)**2,
     .              gmsb(k),mgluino,amqt)) - amqb*(
     .              SD_C1(amqb,gmst(i),amchar(j),gmsb(k),mgluino,
     .                      amqt,amuv) -
     .              SD_C2(amqb,gmst(i),amchar(j),gmsb(k),mgluino,
     .                      amqt,amuv) ) )
               fct6ik(i,j,k) = gmsb(k)**2* 
     .              dreal(SD_C03(amqb**2,gmst(i)**2,amchar(j)**2,
     .              gmsb(k),mgluino,amqt)) + amqt*amqb*(
     .              dreal(SD_C03(amqb**2,gmst(i)**2,amchar(j)**2,
     .              gmsb(k),mgluino,amqt)) +
     .              SD_C1(amqb,gmst(i),amchar(j),gmsb(k),mgluino,
     .                      amqt,amuv) -
     .              SD_C2(amqb,gmst(i),amchar(j),gmsb(k),mgluino,
     .                      amqt,amuv) ) + amqb**2*(
     .              SD_C1(amqb,gmst(i),amchar(j),gmsb(k),mgluino,
     .                      amqt,amuv) -
     .              SD_C2(amqb,gmst(i),amchar(j),gmsb(k),mgluino,
     .                      amqt,amuv) ) + amchar(j)**2*
     .              SD_C2(amqb,gmst(i),amchar(j),gmsb(k),mgluino,
     .                      amqt,amuv) +
     .              SD_B02(gmst(i)**2,mgluino,amqt,amuv**2)
               fct7ik(i,j,k) = gmsb(k)**2*
     .              dreal(SD_C03(amqb**2,gmst(i)**2,amchar(j)**2,
     .              gmsb(k),mgluino,amqt)) - amqt*amqb*(
     .              dreal(SD_C03(amqb**2,gmst(i)**2,amchar(j)**2,
     .              gmsb(k),mgluino,amqt)) +
     .              SD_C1(amqb,gmst(i),amchar(j),gmsb(k),mgluino,
     .                      amqt,amuv) -
     .              SD_C2(amqb,gmst(i),amchar(j),gmsb(k),mgluino,
     .                      amqt,amuv) ) + amqb**2*(
     .              SD_C1(amqb,gmst(i),amchar(j),gmsb(k),mgluino,
     .                      amqt,amuv) -
     .              SD_C2(amqb,gmst(i),amchar(j),gmsb(k),mgluino,
     .                      amqt,amuv) ) + amchar(j)**2*
     .              SD_C2(amqb,gmst(i),amchar(j),gmsb(k),mgluino,
     .                      amqt,amuv) +
     .              SD_B02(gmst(i)**2,mgluino,amqt,amuv**2) 
            enddo
         enddo
      enddo

      end

c -------------------------------------------------------------------- c

      subroutine SD_fbfunctions(fnb1,fnb2,fnb1ik,fnb2ik,fnb3ik,fnb4ik,
     .     fnb5ik,fnb6ik,fnb7ik,fcb1,fcb2,fcb1ik,fcb2ik,fcb3ik,fcb4ik,
     .     fcb5ik,fcb6ik,fcb7ik)

      implicit double precision (a-h,k-z)
      complex*16 SD_C03,SD_C0_lam
      integer k

      dimension fnb1(2,4),fnb2(2,4),fcb1(2,2),fcb2(2,2),
     .     fnb1ik(2,4,2),fnb2ik(2,4,2),fnb3ik(2,4,2),fnb4ik(2,4,2),
     .     fnb5ik(2,4,2),fnb6ik(2,4,2),fnb7ik(2,4,2),
     .     fcb1ik(2,2,2),fcb2ik(2,2,2),fcb3ik(2,2,2),fcb4ik(2,2,2),
     .     fcb5ik(2,2,2),fcb6ik(2,2,2),fcb7ik(2,2,2)
      dimension gmst(2),gmsb(2),amneut(4),xmneut(4),amchar(2)

      COMMON/SD_qcdscales/amuv,lamv
      COMMON/SD_decindex/idec
      COMMON/SD_fermion/amt,amb,amtau
      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_gluino/mgluino
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2

      gmst(1) = ast1
      gmst(2) = ast2
      gmsb(1) = asb1
      gmsb(2) = asb2

c      call SD_runmass(gmsb(idec),0.D0,0.D0,runmb,runmt)

      amqt = amt
      amqb = amb

      do i=1,2,1
         do j=1,4,1
            fnb1(i,j) = SD_B02(gmsb(i)**2,lamv,gmsb(i),amuv**2) + 
     .       2.D0*amqb**2*dreal(SD_C0_lam(amqb,gmsb(i),amneut(j),lamv))
     .         -2.D0*gmsb(i)**2*(
     .         SD_C1_lam(amqb,gmsb(i),amneut(j),amqb,lamv,gmsb(i),amuv,
     .                lamv)-
     .         SD_C2_lam(amqb,gmsb(i),amneut(j),amqb,lamv,gmsb(i),amuv,
     .                lamv))
     .         +2.D0*amneut(j)**2*
     .         SD_C1_lam(amqb,gmsb(i),amneut(j),amqb,lamv,gmsb(i),amuv,
     .                lamv) 

            fnb2(i,j) = -2.D0*amqb*amneut(j)*(
     .         dreal(SD_C0_lam(amqb,gmsb(i),amneut(j),lamv)) +
     .         SD_C1_lam(amqb,gmsb(i),amneut(j),amqb,lamv,gmsb(i),amuv,
     .                lamv) )

            do k=1,2,1
               fnb1ik(i,j,k) = mgluino*amneut(j)*(
     .              dreal(SD_C03(amqb**2,gmsb(i)**2,amneut(j)**2,
     .                             gmsb(k),mgluino,amqb)) +
     .              SD_C2(amqb,gmsb(i),amneut(j),gmsb(k),mgluino,
     .                      amqb,amuv) )
               fnb2ik(i,j,k) = amneut(j)*(amqb*(
     .              dreal(SD_C03(amqb**2,gmsb(i)**2,amneut(j)**2,
     .              gmsb(k),mgluino,amqb)) +
     .              SD_C1(amqb,gmsb(i),amneut(j),gmsb(k),mgluino,
     .                      amqb,amuv) ) + amqb*
     .              SD_C2(amqb,gmsb(i),amneut(j),gmsb(k),mgluino,
     .                      amqb,amuv) )
               fnb3ik(i,j,k) = amneut(j)*(-amqb*(
     .              dreal(SD_C03(amqb**2,gmsb(i)**2,amneut(j)**2,
     .              gmsb(k),mgluino,amqb)) +
     .              SD_C1(amqb,gmsb(i),amneut(j),gmsb(k),mgluino,
     .                      amqb,amuv) ) + amqb*
     .              SD_C2(amqb,gmsb(i),amneut(j),gmsb(k),mgluino,
     .                      amqb,amuv) )
               fnb4ik(i,j,k) = mgluino*(amqb*
     .              dreal(SD_C03(amqb**2,gmsb(i)**2,amneut(j)**2,
     .              gmsb(k),mgluino,amqb)) + amqb*(
     .              SD_C1(amqb,gmsb(i),amneut(j),gmsb(k),mgluino,
     .                      amqb,amuv) -
     .              SD_C2(amqb,gmsb(i),amneut(j),gmsb(k),mgluino,
     .                      amqb,amuv) ) )
               fnb5ik(i,j,k) = mgluino*(amqb*
     .              dreal(SD_C03(amqb**2,gmsb(i)**2,amneut(j)**2,
     .              gmsb(k),mgluino,amqb)) - amqb*(
     .              SD_C1(amqb,gmsb(i),amneut(j),gmsb(k),mgluino,
     .                      amqb,amuv) -
     .              SD_C2(amqb,gmsb(i),amneut(j),gmsb(k),mgluino,
     .                      amqb,amuv) ) )
               fnb6ik(i,j,k) = gmsb(k)**2*
     .              dreal(SD_C03(amqb**2,gmsb(i)**2,amneut(j)**2,
     .              gmsb(k),mgluino,amqb)) + amqb*amqb*(
     .              dreal(SD_C03(amqb**2,gmsb(i)**2,amneut(j)**2,
     .              gmsb(k),mgluino,amqb)) +
     .              SD_C1(amqb,gmsb(i),amneut(j),gmsb(k),mgluino,
     .                      amqb,amuv) -
     .              SD_C2(amqb,gmsb(i),amneut(j),gmsb(k),mgluino,
     .                      amqb,amuv) ) + amqb**2*(
     .              SD_C1(amqb,gmsb(i),amneut(j),gmsb(k),mgluino,
     .                      amqb,amuv) -
     .              SD_C2(amqb,gmsb(i),amneut(j),gmsb(k),mgluino,
     .                      amqb,amuv) ) + amneut(j)**2*
     .              SD_C2(amqb,gmsb(i),amneut(j),gmsb(k),mgluino,
     .                      amqb,amuv) +
     .              SD_B02(gmsb(i)**2,mgluino,amqb,amuv**2)
               fnb7ik(i,j,k) = gmsb(k)**2* 
     .              dreal(SD_C03(amqb**2,gmsb(i)**2,amneut(j)**2,
     .              gmsb(k),mgluino,amqb)) - amqb*amqb*(
     .              dreal(SD_C03(amqb**2,gmsb(i)**2,amneut(j)**2,
     .              gmsb(k),mgluino,amqb)) +
     .              SD_C1(amqb,gmsb(i),amneut(j),gmsb(k),mgluino,
     .                      amqb,amuv) -
     .              SD_C2(amqb,gmsb(i),amneut(j),gmsb(k),mgluino,
     .                      amqb,amuv) ) + amqb**2*(
     .              SD_C1(amqb,gmsb(i),amneut(j),gmsb(k),mgluino,
     .                      amqb,amuv) -
     .              SD_C2(amqb,gmsb(i),amneut(j),gmsb(k),mgluino,
     .                      amqb,amuv) ) + amneut(j)**2*
     .              SD_C2(amqb,gmsb(i),amneut(j),gmsb(k),mgluino,
     .                      amqb,amuv) +
     .              SD_B02(gmsb(i)**2,mgluino,amqb,amuv**2) 
            enddo
         enddo
      enddo

      do i=1,2,1
         do j=1,2,1
            fcb1(i,j) = SD_B02(gmsb(i)**2,lamv,gmsb(i),amuv**2) + 
     .       2.D0*amqt**2*dreal(SD_C0_lam(amqt,gmsb(i),amchar(j),lamv)) 
     .         -2.D0*gmsb(i)**2*(
     .         SD_C1_lam(amqt,gmsb(i),amchar(j),amqt,lamv,gmsb(i),amuv,
     .                lamv) -
     .         SD_C2_lam(amqt,gmsb(i),amchar(j),amqt,lamv,gmsb(i),amuv,
     .                lamv))
     .         +2.D0*amchar(j)**2*
     .         SD_C1_lam(amqt,gmsb(i),amchar(j),amqt,lamv,gmsb(i),amuv,
     .                lamv)

            fcb2(i,j) = -2.D0*amqt*amchar(j)*(
     .         dreal(SD_C0_lam(amqt,gmsb(i),amchar(j),lamv)) +
     .         SD_C1_lam(amqt,gmsb(i),amchar(j),amqt,lamv,gmsb(i),amuv,
     .                lamv) )

            do k=1,2,1
               fcb1ik(i,j,k) = mgluino*amchar(j)*(
     .              dreal(SD_C03(amqt**2,gmsb(i)**2,amchar(j)**2,
     .              gmst(k),mgluino,amqb)) +
     .              SD_C2(amqt,gmsb(i),amchar(j),gmst(k),mgluino,
     .                      amqb,amuv) )
               fcb2ik(i,j,k) = amchar(j)*(amqt*(
     .              dreal(SD_C03(amqt**2,gmsb(i)**2,amchar(j)**2,
     .              gmst(k),mgluino,amqb)) +
     .              SD_C1(amqt,gmsb(i),amchar(j),gmst(k),mgluino,
     .                      amqb,amuv) ) + amqb*
     .              SD_C2(amqt,gmsb(i),amchar(j),gmst(k),mgluino,
     .                      amqb,amuv) )
               fcb3ik(i,j,k) = amchar(j)*(-amqt*(
     .              dreal(SD_C03(amqt**2,gmsb(i)**2,amchar(j)**2,
     .              gmst(k),mgluino,amqb)) +
     .              SD_C1(amqt,gmsb(i),amchar(j),gmst(k),mgluino,
     .                      amqb,amuv) ) + amqb*
     .              SD_C2(amqt,gmsb(i),amchar(j),gmst(k),mgluino,
     .                      amqb,amuv) )
               fcb4ik(i,j,k) = mgluino*(amqb*
     .              dreal(SD_C03(amqt**2,gmsb(i)**2,amchar(j)**2,
     .              gmst(k),mgluino,amqb)) + amqt*(
     .              SD_C1(amqt,gmsb(i),amchar(j),gmst(k),mgluino,
     .                      amqb,amuv) -
     .              SD_C2(amqt,gmsb(i),amchar(j),gmst(k),mgluino,
     .                      amqb,amuv) ) )
               fcb5ik(i,j,k) = mgluino*(amqb*
     .              dreal(SD_C03(amqt**2,gmsb(i)**2,amchar(j)**2,
     .              gmst(k),mgluino,amqb)) - amqt*(
     .              SD_C1(amqt,gmsb(i),amchar(j),gmst(k),mgluino,
     .                      amqb,amuv) -
     .              SD_C2(amqt,gmsb(i),amchar(j),gmst(k),mgluino,
     .                      amqb,amuv) ) )
               fcb6ik(i,j,k) = gmst(k)**2* 
     .              dreal(SD_C03(amqt**2,gmsb(i)**2,amchar(j)**2,
     .              gmst(k),mgluino,amqb)) + amqb*amqt*(
     .              dreal(SD_C03(amqt**2,gmsb(i)**2,amchar(j)**2,
     .              gmst(k),mgluino,amqb)) +
     .              SD_C1(amqt,gmsb(i),amchar(j),gmst(k),mgluino,
     .                      amqb,amuv) -
     .              SD_C2(amqt,gmsb(i),amchar(j),gmst(k),mgluino,
     .                      amqb,amuv) ) + amqt**2*(
     .              SD_C1(amqt,gmsb(i),amchar(j),gmst(k),mgluino,
     .                      amqb,amuv) -
     .              SD_C2(amqt,gmsb(i),amchar(j),gmst(k),mgluino,
     .                      amqb,amuv) ) + amchar(j)**2*
     .              SD_C2(amqt,gmsb(i),amchar(j),gmst(k),mgluino,
     .                      amqb,amuv) +
     .              SD_B02(gmsb(i)**2,mgluino,amqb,amuv**2)
               fcb7ik(i,j,k) = gmst(k)**2*
     .              dreal(SD_C03(amqt**2,gmsb(i)**2,amchar(j)**2,
     .              gmst(k),mgluino,amqb)) - amqb*amqt*(
     .              dreal(SD_C03(amqt**2,gmsb(i)**2,amchar(j)**2,
     .              gmst(k),mgluino,amqb)) +
     .              SD_C1(amqt,gmsb(i),amchar(j),gmst(k),mgluino,
     .                      amqb,amuv) -
     .              SD_C2(amqt,gmsb(i),amchar(j),gmst(k),mgluino,
     .                      amqb,amuv) ) + amqt**2*(
     .              SD_C1(amqt,gmsb(i),amchar(j),gmst(k),mgluino,
     .                      amqb,amuv) -
     .              SD_C2(amqt,gmsb(i),amchar(j),gmst(k),mgluino,
     .                      amqb,amuv) ) + amchar(j)**2*
     .              SD_C2(amqt,gmsb(i),amchar(j),gmst(k),mgluino,
     .                      amqb,amuv) +
     .              SD_B02(gmsb(i)**2,mgluino,amqb,amuv**2) 
            enddo
         enddo
      enddo

      end

c -------------------------------------------------------------------- c

      double precision function SD_delmt(amq,mgluino,ast1,ast2,thet,
     .                                amuv,lamv)

      implicit double precision (a-h,k-z)

      SD_delmt = 1.D0/2.D0*(
     .     SD_sigmar(amq,mgluino,ast1,ast2,thet,amuv,lamv) +
     .     SD_sigmal(amq,mgluino,ast1,ast2,thet,amuv,lamv) ) +
     .     SD_sigmas(amq,mgluino,ast1,ast2,thet,amuv,lamv)

      return 
      
      end 

c -------------------------------------------------------------------- c

      double precision function SD_delmtdiv(amq,mgluino,ast1,ast2,thet,
     .                                   amuv,lamv)

      implicit double precision (a-h,k-z)

      SD_delmtdiv = 1.D0/2.D0*(
     .     SD_sigmardiv(amq,mgluino,ast1,ast2,thet,amuv,lamv) +
     .     SD_sigmaldiv(amq,mgluino,ast1,ast2,thet,amuv,lamv) ) +
     .     SD_sigmasdiv(amq,mgluino,ast1,ast2,thet,amuv,lamv)

      return 
      
      end 

c -------------------------------------------------------------------- c

      double precision function SD_delztr(amq,mgluino,ast1,ast2,thet,
     .                                 amuv,lamv)

      implicit double precision (a-h,k-z)

      SD_delztr = -SD_sigmar(amq,mgluino,ast1,ast2,thet,amuv,lamv) -
     .     amq**2*(SD_sigmalp(amq,mgluino,ast1,ast2,thet,amuv,lamv) +
     .     SD_sigmarp(amq,mgluino,ast1,ast2,thet,amuv,lamv) +
     .     2.D0*SD_sigmasp(amq,mgluino,ast1,ast2,thet,amuv,lamv) )

      return

      end

c -------------------------------------------------------------------- c

      double precision function SD_delztl(amq,mgluino,ast1,ast2,thet,
     .                                 amuv,lamv)

      implicit double precision (a-h,k-z)

      SD_delztl = -SD_sigmal(amq,mgluino,ast1,ast2,thet,amuv,lamv) -
     .     amq**2*(SD_sigmalp(amq,mgluino,ast1,ast2,thet,amuv,lamv) +
     .     SD_sigmarp(amq,mgluino,ast1,ast2,thet,amuv,lamv) +
     .     2.D0*SD_sigmasp(amq,mgluino,ast1,ast2,thet,amuv,lamv) )

      return

      end

c -------------------------------------------------------------------- c

      double precision function SD_delzst(amqt,mgluino,amsq,thet,
     .                                 amuv,lamv,ni)

      implicit double precision (a-h,k-z)
      integer ni

      SD_delzst = 2.D0*(-2.D0*SD_B1(amsq**2,amsq,lamv,amuv**2)
     .     -2.D0*amsq**2*SD_BP1(amsq**2,amsq,lamv,amuv**2) +
     .     (amqt**2+mgluino**2-amsq**2)*
     .     SD_BP02(amsq**2,amqt,mgluino,amuv**2) -
     .     SD_B02(amsq**2,amqt,mgluino,amuv**2) + 
     .     (-1.D0)**ni*2.D0*dsin(2.D0*thet)*amqt*mgluino*
     .     SD_BP02(amsq**2,amqt,mgluino,amuv**2) )

      return

      end

c -------------------------------------------------------------------- c

      double precision function SD_sigmar(amq,mgluino,ast1,ast2,thet,
     .                                 amuv,lamv)

      implicit double precision (a-h,k-z)

      SD_sigmar = -(2.D0*SD_B1(amq**2,amq,lamv,amuv**2)+ 
     .     (1.D0-dcos(2.D0*thet))*SD_B1(amq**2,mgluino,ast1,amuv**2)
     .    +(1.D0+dcos(2.D0*thet))*SD_B1(amq**2,mgluino,ast2,amuv**2)
     .     )

      return

      end 

c -------------------------------------------------------------------- c

      double precision function SD_sigmardiv(amq,mgluino,ast1,ast2,thet,
     .                                    amuv,lamv)

      implicit double precision (a-h,k-z)

      SD_sigmardiv = -(2.D0*SD_B1_DIV(amq**2,amq,lamv,amuv**2)+ 
     .     (1.D0-dcos(2.D0*thet))*SD_B1_DIV(amq**2,mgluino,ast1,amuv**2)
     .    +(1.D0+dcos(2.D0*thet))*SD_B1_DIV(amq**2,mgluino,ast2,amuv**2)
     .     )

      return

      end 

c -------------------------------------------------------------------- c

      double precision function SD_sigmarp(amq,mgluino,ast1,ast2,thet,
     .                                 amuv,lamv)

      implicit double precision (a-h,k-z)

      SD_sigmarp = -(2.D0*SD_BP1(amq**2,amq,lamv,amuv**2)+ 
     .     (1.D0-dcos(2.D0*thet))*SD_BP1(amq**2,mgluino,ast1,amuv**2)
     .    +(1.D0+dcos(2.D0*thet))*SD_BP1(amq**2,mgluino,ast2,amuv**2)
     .     )

      return

      end 

c -------------------------------------------------------------------- c

      double precision function SD_sigmal(amq,mgluino,ast1,ast2,thet,
     .                                 amuv,lamv)

      implicit double precision (a-h,k-z)

      SD_sigmal = -(2.D0*SD_B1(amq**2,amq,lamv,amuv**2)+ 
     .     (1.D0+dcos(2.D0*thet))*SD_B1(amq**2,mgluino,ast1,amuv**2)
     .    +(1.D0-dcos(2.D0*thet))*SD_B1(amq**2,mgluino,ast2,amuv**2)
     .     )

      return

      end 

c -------------------------------------------------------------------- c

      double precision function SD_sigmaldiv(amq,mgluino,ast1,ast2,thet,
     .                                    amuv,lamv)

      implicit double precision (a-h,k-z)

      SD_sigmaldiv = -(2.D0*SD_B1_DIV(amq**2,amq,lamv,amuv**2)+ 
     .     (1.D0+dcos(2.D0*thet))*SD_B1_DIV(amq**2,mgluino,ast1,amuv**2)
     .    +(1.D0-dcos(2.D0*thet))*SD_B1_DIV(amq**2,mgluino,ast2,amuv**2)
     .     )

      return

      end 

c -------------------------------------------------------------------- c

      double precision function SD_sigmalp(amq,mgluino,ast1,ast2,thet,
     .                                 amuv,lamv)

      implicit double precision (a-h,k-z)

      SD_sigmalp = -(2.D0*SD_BP1(amq**2,amq,lamv,amuv**2)+ 
     .     (1.D0+dcos(2.D0*thet))*SD_BP1(amq**2,mgluino,ast1,amuv**2)
     .    +(1.D0-dcos(2.D0*thet))*SD_BP1(amq**2,mgluino,ast2,amuv**2)
     .     )

      return

      end 

c -------------------------------------------------------------------- c

      double precision function SD_sigmas(amq,mgluino,ast1,ast2,thet,
     .                                 amuv,lamv)

      implicit double precision (a-h,k-z)

      SD_sigmas = -(4.D0*SD_B02(amq**2,amq,lamv,amuv**2)+ 
     .     mgluino/amq*dsin(2.D0*thet)*(
     .     SD_B02(amq**2,mgluino,ast1,amuv**2)
     .    -SD_B02(amq**2,mgluino,ast2,amuv**2)
     .     ) )

      return

      end 

c -------------------------------------------------------------------- c

      double precision function SD_sigmasdiv(amq,mgluino,ast1,ast2,thet,
     .                                    amuv,lamv)

      implicit double precision (a-h,k-z)

      SD_sigmasdiv = -(4.D0*SD_B02_DIV(amq**2,amq,lamv,amuv**2)+ 
     .     mgluino/amq*dsin(2.D0*thet)*(
     .     SD_B02_DIV(amq**2,mgluino,ast1,amuv**2)
     .    -SD_B02_DIV(amq**2,mgluino,ast2,amuv**2)
     .     ) )

      return

      end 

c -------------------------------------------------------------------- c

      double precision function SD_sigmasp(amq,mgluino,ast1,ast2,thet,
     .                                 amuv,lamv)

      implicit double precision (a-h,k-z)

      SD_sigmasp = -(4.D0*SD_BP02(amq**2,amq,lamv,amuv**2)+ 
     .     mgluino/amq*dsin(2.D0*thet)*(
     .     SD_BP02(amq**2,mgluino,ast1,amuv**2)
     .    -SD_BP02(amq**2,mgluino,ast2,amuv**2)
     .     ) )

      return

      end 

c -------------------------------------------------------------------- c

      double precision function SD_delthdiv(amqt,mgluino,ast1,ast2,
     .                                   thet,amuv)

      implicit double precision (a-h,k-z)

      SD_delthdiv = 1.D0/(ast1**2-ast2**2)*(4.D0*amqt*mgluino*
     .     dcos(2.D0*thet)*SD_B02_DIV(ast2**2,amqt,mgluino,amuv**2) +
     .     dcos(2.D0*thet)*dsin(2.D0*thet)*
     .     (ast2**2-ast1**2)*dlog(amuv**2) )

      return

      end

c -------------------------------------------------------------------- c
c ----------------------- The real corrections ----------------------- c

      double precision function SD_corrreali(amq,mcharneut,amsti,lamv,
     .     icharneut,isign,ni,nj,idec)

      implicit double precision (a-h,k-z)
      dimension atopr(2,4),btopr(2,4),alstor(2,2),akstor(2,2),
     .     abot(2,4),bbot(2,4),alsbot(2,2),aksbot(2,2)
      integer ni,nj
      complex*16 SD_ccspen,SD_kappa

      COMMON/SD_param/sdgf,sdmz,sdmw,pi,g2
      COMMON/SD_scala/scalb,scalt
      COMMON/SD_yukawa/ytewsb,ybewsb,ytauewsb
      COMMON/SD_runcoupscale/scalechoice,scaleofcoupling,inumloop
      COMMON/SD_runmcalc/rmtc,rmbc,rmtauc

      external SD_runmass,SD_yuk,SD_kappa

c --- the running couplings ---

      if(scalechoice.eq.1.D0) then
         scalb = ybewsb/dsqrt(g2)
         scalt = ytewsb/dsqrt(g2)
         runmt = rmtc
         runmb = rmbc
      elseif(scalechoice.eq.2.D0) then         
         call SD_runmass(amsti,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      elseif(scalechoice.eq.3.D0) then
         call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      endif

      call SD_neutstoptop(atopr,btopr)
      call SD_charstopbot(alstor,akstor)
      call SD_neutsbotbot(abot,bbot) 
      call SD_charsbottop(alsbot,aksbot)

c ----------------------------

      kap = dreal(SD_kappa(amsti**2,amq**2,mcharneut**2,0.D0))

      b0 = (amsti**2-amq**2-mcharneut**2+kap)/(2.D0*amq*mcharneut)
      b1 = (amsti**2-amq**2+mcharneut**2-kap)/(2.D0*amsti*mcharneut)
      b2 = (amsti**2+amq**2-mcharneut**2-kap)/(2.D0*amsti*amq)

      lb0 = dreal(cdlog(dcmplx(b0)))
      lb1 = dreal(cdlog(dcmplx(b1)))
      lb2 = dreal(cdlog(dcmplx(b2)))
      lb12 = dreal(cdlog(dcmplx(b1/b2)))
      lb02 = dreal(cdlog(dcmplx(b0/b2)))

      hi00 = 1.D0/4.D0/amsti**4*(kap*
     .     dlog(kap**2/(lamv*amsti*amq*mcharneut)) - kap -
     .     (amq**2-mcharneut**2)*lb12 - amsti**2*lb0 )
      hi11 = 1.D0/4.D0/(amq**2*amsti**2)*(kap*
     .     dlog(kap**2/(lamv*amsti*amq*mcharneut)) - kap -
     .     (amsti**2-mcharneut**2)*lb02 - amq**2*lb1)
      hi01 = dreal(1.D0/(4.D0*amsti**2)*(-2.D0*
     .     dlog((lamv*amsti*amq*mcharneut)/kap**2)*lb2 + 
     .     2.D0*lb2**2 - lb0**2 - lb1**2 +
     .     2.D0*SD_ccspen(dcmplx(1.D0-b2**2)) - 
     .     SD_ccspen(dcmplx(1-b0**2))
     .     - SD_ccspen(dcmplx(1-b1**2)) ) )
      hi = 1.D0/(4.D0*amsti**2)*(kap/2.D0*
     .     (amsti**2+amq**2+mcharneut**2) + 2.D0*amsti**2*amq**2*
     .     lb2 + 2.D0*amsti**2*mcharneut**2*lb1 + 
     .     2.D0*amq**2*mcharneut**2*lb0)
      hi0 = 1.D0/(4.D0*amsti**2)*(-2.D0*amq**2*lb2
     .     -2.D0*mcharneut**2*lb1-kap)
      hi1 = 1.D0/(4.D0*amsti**2)*(-2.D0*amsti**2*lb2 
     .     -2.D0*mcharneut**2*lb0-kap)
      hi10 = 1.D0/(4.D0*amsti**2)*(amsti**4*lb2-
     .     mcharneut**2*(2.D0*amq**2-2.D0*amsti**2+mcharneut**2)*
     .     lb0 - kap/4.D0*(amq**2-3.D0*amsti**2+
     .     5.D0*mcharneut**2) )

      if(icharneut.eq.1.and.idec.eq.1) then
         cli = - btopr(ni,nj)
         cri = - atopr(ni,nj)
      elseif(icharneut.eq.2.and.idec.eq.1) then
         cli = - akstor(ni,nj)
         cri = - alstor(ni,nj)
      elseif(icharneut.eq.1.and.idec.eq.2) then
         cli = - bbot(ni,nj)
         cri = - abot(ni,nj)
      elseif(icharneut.eq.2.and.idec.eq.2) then
         cli = - aksbot(ni,nj)
         cri = - alsbot(ni,nj)
      endif

      if(isign.eq.1) then
         epschi = -1.D0
      elseif(isign.eq.0) then
         epschi = 1.D0
      endif
         
      SD_corrreali = 8.D0*cli*cri*amq*mcharneut*epschi*((amsti**2+amq**2
     .     -mcharneut**2)*hi01+amsti**2*hi00+amq**2*hi11+hi0+hi1)
     .     +(cli**2+cri**2)*(2.D0*(amq**2+mcharneut**2-amsti**2)*
     .     (amsti**2*hi00+amq**2*hi11+hi0+hi1) + 2.D0*(amq**4-
     .     (mcharneut**2-amsti**2)**2)*hi01-hi-hi10)

      return

      end

c -------------------------------------------------------------------- c
c ----------------------- The real corrections ----------------------- c
c ----------- for the processes gaugino -> squark + quark ------------ c

      double precision function SD_realicorr(amq,mcharneut,amsti,lamv,
     .     icharneut,isign,ni,nj,idec)

      implicit double precision (a-h,k-z)
      dimension atopr(2,4),btopr(2,4),alstor(2,2),akstor(2,2),
     .     abot(2,4),bbot(2,4),alsbot(2,2),aksbot(2,2)
      integer ni,nj
      complex*16 SD_ccspen,SD_kappa

      COMMON/SD_param/sdgf,sdmz,sdmw,pi,g2
      COMMON/SD_scala/scalb,scalt
      COMMON/SD_yukawa/ytewsb,ybewsb,ytauewsb
      COMMON/SD_runcoupscale/scalechoice,scaleofcoupling,inumloop
      COMMON/SD_runmcalc/rmtc,rmbc,rmtauc

      external SD_runmass,SD_yuk,SD_kappa

c --- the running couplings ---

      if(scalechoice.eq.1.D0) then
         scalb = ybewsb/dsqrt(g2)
         scalt = ytewsb/dsqrt(g2)
         runmt = rmtc
         runmb = rmbc
      elseif(scalechoice.eq.2.D0) then         
         call SD_runmass(mcharneut,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      elseif(scalechoice.eq.3.D0) then
         call SD_runmass(scaleofcoupling,0.D0,0.D0,runmb,runmt)
         scalb = SD_yuk(2,runmb)
         scalt = SD_yuk(1,runmt)
      endif

      call SD_neutstoptop(atopr,btopr)
      call SD_charstopbot(alstor,akstor)
      call SD_neutsbotbot(abot,bbot) 
      call SD_charsbottop(alsbot,aksbot)

c ----------------------------

      kap = dreal(SD_kappa(amsti**2,amq**2,mcharneut**2,0.D0))

      b0 = (mcharneut**2-amq**2-amsti**2+kap)/(2.D0*amq*amsti)
      b1 = (mcharneut**2-amq**2+amsti**2-kap)/(2.D0*amsti*mcharneut)
      b2 = (mcharneut**2+amq**2-amsti**2-kap)/(2.D0*mcharneut*amq)

      lb0 = dreal(cdlog(dcmplx(b0)))
      lb1 = dreal(cdlog(dcmplx(b1)))
      lb2 = dreal(cdlog(dcmplx(b2)))
      lb12 = dreal(cdlog(dcmplx(b1/b2)))
      lb01 = dreal(cdlog(dcmplx(b0/b1)))
      lb02 = dreal(cdlog(dcmplx(b0/b2)))

      hi11 = 1.D0/4.D0/(amq**2*mcharneut**2)*(kap*
     .     dlog(kap**2/(lamv*amsti*amq*mcharneut)) - kap -
     .     (mcharneut**2-amsti**2)*lb02 - amq**2*lb1)
      hi22 = 1.D0/4.D0/(mcharneut**2*amsti**2)*(kap*
     .     dlog(kap**2/(lamv*amsti*amq*mcharneut)) - kap -
     .     (mcharneut**2-amq**2)*lb01 - amsti**2*lb2)
      hi21 = dreal(1.D0/(4.D0*mcharneut**2)*(-2.D0*
     .     dlog((lamv*amsti*amq*mcharneut)/kap**2)*lb0 + 
     .     2.D0*lb0**2 - lb2**2 - lb1**2 +
     .     2.D0*SD_ccspen(dcmplx(1.D0-b0**2)) - 
     .     SD_ccspen(dcmplx(1-b2**2))
     .     - SD_ccspen(dcmplx(1-b1**2)) ) )
      hi = 1.D0/(4.D0*mcharneut**2)*(kap/2.D0*
     .     (mcharneut**2+amq**2+amsti**2) + 2.D0*mcharneut**2*amq**2*
     .     lb2 + 2.D0*amsti**2*mcharneut**2*lb1 + 
     .     2.D0*amq**2*amsti**2*lb0)
      hi2 = 1.D0/(4.D0*mcharneut**2)*(-2.D0*mcharneut**2*lb1
     .     -2.D0*amq**2*lb0-kap)
      hi1 = 1.D0/(4.D0*mcharneut**2)*(-2.D0*mcharneut**2*lb2 
     .     -2.D0*amsti**2*lb0-kap)
      hi12 = 1.D0/(4.D0*mcharneut**2)*(amsti**4*lb0-
     .     mcharneut**2*(2.D0*amq**2-2.D0*amsti**2+mcharneut**2)*
     .     lb2 - kap/4.D0*(amq**2-3.D0*amsti**2+
     .     5.D0*mcharneut**2) )

      if(icharneut.eq.1.and.idec.eq.1) then
         cli = - btopr(ni,nj)
         cri = - atopr(ni,nj)
      elseif(icharneut.eq.2.and.idec.eq.1) then
         cli = - akstor(ni,nj)
         cri = - alstor(ni,nj)
      elseif(icharneut.eq.1.and.idec.eq.2) then
         cli = - bbot(ni,nj)
         cri = - abot(ni,nj)
      elseif(icharneut.eq.2.and.idec.eq.2) then
         cli = - aksbot(ni,nj)
         cri = - alsbot(ni,nj)
      endif

      if(isign.eq.1) then
         epschi = -1.D0
      elseif(isign.eq.0) then
         epschi = 1.D0
      endif
         
      SD_realicorr = 8.D0*cli*cri*amq*mcharneut*epschi*((amsti**2+amq**2
     .     -mcharneut**2)*hi21+amsti**2*hi22+amq**2*hi11+hi2+hi1)
     .     +(cli**2+cri**2)*(2.D0*(amq**2+mcharneut**2-amsti**2)*
     .     (amsti**2*hi22+amq**2*hi11+hi2+hi1) + 2.D0*(amq**4-
     .     (mcharneut**2-amsti**2)**2)*hi21-hi-hi12)

      return

      end

c -------------------------------------------------------------------- c
c ---------- Beenakker, Hoepker and Zerwas, hep-ph/9602378 ----------- c
c -------------------------------------------------------------------- c

c - QCD corrections to the decays light squark -> light quark + gluino c

      double precision function SD_gama(r)
 
      implicit double precision (a-h,k-z)
      complex*16 SD_ccspen

      pi = 4.D0*datan(1.D0)

      SD_gama = 3.D0/(r-1.D0)*dreal(SD_ccspen(dcmplx(1.D0-r))) - 
     .     r/(r-1.D0)*dreal(SD_ccspen(dcmplx(-r))) 
     .     + (5.D0*r-6.D0)/(12.D0*(r-1.D0))*pi**2 +
     .     59.D0/24.D0 + r/(4.D0*(r-1.D0)) + 
     .     ( (3.D0+r)/(2.D0*(r-1.D0))*dlog(r) - 2.D0)*
     .     dlog(dabs(1.D0-r)) + 
     .     ( (r*(5.D0*r-6.D0))/(4.D0*(r-1.D0)**2) - 
     .     r/(r-1.D0)*dlog(1.D0+r) )*dlog(r) 

      return

      end

c -------------------------------------------------------------------- c

      double precision function SD_gamfcap(r)

      implicit double precision (a-h,k-z)
      complex*16 SD_ccspen

      pi = 4.D0*datan(1.D0)

      SD_gamfcap = -2.D0/(r-1.D0)*dreal(SD_ccspen(dcmplx(1.D0-r))) + 
     .     (2.D0*r)/(r-1.D0)*dreal(SD_ccspen(dcmplx(-r))) + 
     .     (4.D0-3.D0*r)/(6.D0*(r-1.D0))*pi**2 + 5.D0/2.D0 - r/2.D0 + 
     .     ( r- r**2/2.D0 - (r+1.D0)/(r-1.D0)*dlog(r) )*
     .     dlog(dabs(1.D0-r)) + 
     .     ( 2.D0*r/(r-1.D0)*dlog(1.D0+r)-r+r**2/2.D0)*dlog(r) 

      return

      end

c -------------------------------------------------------------------- c

      double precision function SD_gamf(r)

      implicit double precision (a-h,k-z)

      SD_gamf = -3.D0/(4.D0*r) + 
     .     ((r-1.D0)*(r+3.D0))/(4.D0*r**2)*dlog(dabs(1.D0-r))

      return

      end

c -------------------------------------------------------------------- c

c maggie changed with respect to the paper 26/3/03

      double precision function SD_gamrendec(amsq,amst1,amst2,amt,amsb1,
     .     amsb2,amgl,scala)

      implicit double precision (a-h,k-z)

      mur = scala

      SD_gamrendec = 3.D0/4.D0*dlog(mur**2/amsq**2) - 1.D0/4.D0

      SD_gamrendec =  SD_gamrendec + 4.D0/12.D0*dlog(mur**2/amsq**2)
     .     + 1.D0/24.D0*dlog(mur**2/amsb1**2) + 1.D0/24.D0*
     .     dlog(mur**2/amsb2**2) 
     .     + 1.D0/24.D0*dlog(mur**2/amst1**2) + 1.D0/24.D0*
     .     dlog(mur**2/amst2**2) + 1.D0/6.D0*dlog(mur**2/amt**2)
     .     + 1.D0/2.D0*dlog(mur**2/amgl**2) 

      return

      end

c end maggie changed

c -------------------------------------------------------------------- c
c ------ Beenakker, Hoepker, Plehn and Zerwas, hep-ph/9610313 -------- c
c -------------------------------------------------------------------- c

c -------- QCD corrections to the decay stop1/2 -> top gluino -------- c
c -------- and sbottom1/2 -> bottom gluino, gluino -> stop1/2 top ---- c
c -------- gluino -> sbottom1/2 bottom ------------------------------- c

      double precision function SD_gamtop1(amst1,amst2,amt,amgl,thet,
     .                                     ival,amuv,lamv)

      implicit double precision (a-h,k-z)
      double precision isign

      pi = 4.D0*datan(1.D0)

      if(ival.eq.1) then
         isign = 1.D0
      elseif(ival.eq.2) then
         isign = -1.D0
      endif 

      sig2t = isign*amt*amgl*dsin(2.D0*thet)

      SD_gamtop1 = 2.D0*SD_A01(amt**2,amuv**2) -2.D0*amt**2 + 
     .   2.D0*SD_A01(amgl**2,amuv**2) - SD_A01(amst1**2,amuv**2)
     .   - SD_A01(amst2**2,amuv**2) +
     .   (amt**2+amst1**2-amgl**2)*SD_B02(amt**2,amgl,amst1,amuv**2)
     .  +(amt**2+amst2**2-amgl**2)*SD_B02(amt**2,amgl,amst2,amuv**2)
     .   -4.D0*amt**2*sig2t*(SD_BP02(amt**2,amgl,amst1,amuv**2) 
     .   - SD_BP02(amt**2,amgl,amst2,amuv**2) ) + 2.D0*amt**2*(
     .   (amgl**2+amt**2-amst1**2)*SD_BP02(amt**2,amgl,amst1,amuv**2)
     .  +(amgl**2+amt**2-amst2**2)*SD_BP02(amt**2,amgl,amst2,amuv**2)
     .  -4.D0*amt**2*SD_BP02(amt**2,lamv,amt,amuv**2) )

      SD_gamtop1 = -1.D0/16.D0/pi**2*SD_gamtop1

      return

      end

c -------------------------------------------------------------------- c

      double precision function SD_gamtop2(amst1,amst2,amt,amgl,thet,
     .     ival,amuv)

      implicit double precision (a-h,k-z)
      double precision isign

      pi = 4.D0*datan(1.D0)

      if(ival.eq.1) then
         isign = 1.D0
      elseif(ival.eq.2) then
         isign = -1.D0
      endif 

      SD_gamtop2 = SD_A01(amst2**2,amuv**2) - 
     .  SD_A01(amst1**2,amuv**2)
     .  -(amgl**2+amt**2-amst1**2)*SD_B02(amt**2,amgl,amst1,amuv**2)
     .  +(amgl**2+amt**2-amst2**2)*SD_B02(amt**2,amgl,amst2,amuv**2)

      SD_gamtop2 = (isign*dcos(2.D0*thet))**2*(amgl**2+amt**2-amst1**2)*
     .     SD_gamtop2

      SD_gamtop2 = -1.D0/16.D0/pi**2*SD_gamtop2

      return

      end

c -------------------------------------------------------------------- c

      double precision function SD_gamglui1(amst1,amst2,amsq,amt,amgl,
     .     amuv)

      implicit double precision (a-h,k-z)

      pi = 4.D0*datan(1.D0)

      SD_gamglui1 = -SD_A01(amsq**2,amuv**2)+(amsq**2+amgl**2)*
     .     SD_B02(amgl**2,amsq,0.D0,amuv**2) + 2.D0*amgl**2*
     .     (amgl**2-amsq**2)*SD_BP02(amgl**2,amsq,0.D0,amuv**2)

      SD_gamglui1 = -1.D0/16.D0/pi**2*SD_gamglui1

      return

      end

c -------------------------------------------------------------------- c

      double precision function SD_gamglui2(amst1,amst2,amt,thet,amsb1,
     .     amsb2,amb,theb,amgl,ival,amuv)

      implicit double precision (a-h,k-z)
      double precision isign

      pi = 4.D0*datan(1.D0)

      if(ival.eq.1) then
         isign = 1.D0
      elseif(ival.eq.2) then
         isign = -1.D0
      endif 

      sig2t = isign*amt*amgl*dsin(2.D0*thet)
      sig2b = isign*amb*amgl*dsin(2.D0*theb)

      SD_gamglui2 = 2.D0*SD_A01(amt**2,amuv**2) -
     .     SD_A01(amst1**2,amuv**2) - SD_A01(amst2**2,amuv**2)
     .     + (amst1**2+amgl**2-amt**2)*
     .     SD_B02(amgl**2,amst1,amt,amuv**2) + 
     .     (amst2**2+amgl**2-amt**2)*
     .     SD_B02(amgl**2,amst2,amt,amuv**2) - 
     .     4.D0*amgl**2*sig2t*( SD_BP02(amgl**2,amst1,amt,amuv**2)
     .     - SD_BP02(amgl**2,amst2,amt,amuv**2) )
     .     + 2.D0*amgl**2*( (amgl**2+amt**2-amst1**2)*
     .     SD_BP02(amgl**2,amst1,amt,amuv**2) + 
     .     (amgl**2+amt**2-amst2**2)*
     .     SD_BP02(amgl**2,amst2,amt,amuv**2) )

c maggie changed with respect to the paper 26/3/03
      SD_gamglui2 = SD_gamglui2 +
     .     2.D0*SD_A01(amb**2,amuv**2) -
     .     SD_A01(amsb1**2,amuv**2) - SD_A01(amsb2**2,amuv**2)
     .     + (amsb1**2+amgl**2-amb**2)*
     .     SD_B02(amgl**2,amsb1,amb,amuv**2) + 
     .     (amsb2**2+amgl**2-amb**2)*
     .     SD_B02(amgl**2,amsb2,amb,amuv**2) - 
     .     4.D0*amgl**2*sig2b*( SD_BP02(amgl**2,amsb1,amb,amuv**2)
     .     - SD_BP02(amgl**2,amsb2,amb,amuv**2) )
     .     + 2.D0*amgl**2*( (amgl**2+amb**2-amsb1**2)*
     .     SD_BP02(amgl**2,amsb1,amb,amuv**2) + 
     .     (amgl**2+amb**2-amsb2**2)*
     .     SD_BP02(amgl**2,amsb2,amb,amuv**2) )
c end maggie changed

      SD_gamglui2 = -1.D0/16.D0/pi**2*SD_gamglui2

      return

      end

c -------------------------------------------------------------------- c

      double precision function SD_gamglui3(amgl,amuv,lamv)

      implicit double precision (a-h,k-z)

      pi = 4.D0*datan(1.D0)

      SD_gamglui3 =  SD_A01(amgl**2,amuv**2) - amgl**2 - 
     .     4.D0*amgl**4*SD_BP02(amgl**2,lamv,amgl,amuv**2)

      SD_gamglui3 = -1.D0/16.D0/pi**2*SD_gamglui3

      return

      end

c -------------------------------------------------------------------- c

      double precision function SD_gam11(amst1,amst2,amt,amgl,thet,ival,
     .     amuv,lamv)

      implicit double precision (a-h,k-z)
      double precision isign

      pi = 4.D0*datan(1.D0)

      if(ival.eq.1) then
         isign = 1.D0
      elseif(ival.eq.2) then
         isign = -1.D0
      endif 

      sig2t = isign*amt*amgl*dsin(2.D0*thet)

      SD_gam11 = SD_B02(amst1**2,amgl,amt,amuv**2) - 
     .     SD_B02(amst1**2,lamv,amst1,amuv**2) + 
     .     2.D0*sig2t*SD_BP02(amst1**2,amgl,amt,amuv**2) -
     .     (amgl**2+amt**2-amst1**2)*
     .     SD_BP02(amst1**2,amgl,amt,amuv**2) - 2.D0*amst1**2*
     .     SD_BP02(amst1**2,lamv,amst1,amuv**2)

      SD_gam11 = -1.D0/16.D0/pi**2*SD_gam11

      return

      end

c -------------------------------------------------------------------- c

      double precision function SD_gam12(amst1,amst2,amt,amgl,thet,ival,
     .     amuv,lamv,scala)

      implicit double precision (a-h,k-z)
      double precision isign

      pi = 4.D0*datan(1.D0)

      if(ival.eq.1) then
         isign = 1.D0
      elseif(ival.eq.2) then
         isign = -1.D0
      endif 

      sig2t = isign*amt*amgl*dsin(2.D0*thet)

      SD_gam12 = SD_A01(amst2**2,amuv**2) - SD_A01(amst1**2,amuv**2)
     .     + 4.D0*amt**2*amgl**2/sig2t*
     .     SD_B02(amst1**2,amgl,amt,amuv**2)

      SD_gam12 = SD_gam12 - 
     .     ( SD_A01_DIV(amst2**2,(amuv/scala)**2) 
     .     - SD_A01_DIV(amst1**2,(amuv/scala)**2)
     .     + 4.D0*amt**2*amgl**2/sig2t*
     .       SD_B02_DIV(amst1**2,amgl,amt,(amuv/scala)**2) )

      SD_gam12 = 1.D0/(amst1**2-amst2**2)*sig2t*dcos(2.D0*thet)**2*
     .     SD_gam12

      SD_gam12 = -1.D0/16.D0/pi**2*SD_gam12

      return

      end

c -------------------------------------------------------------------- c

      double precision function SD_gamvirt(amst1,amst2,amtop,amgl,thet,
     .     ival,amuv,lamv)

      implicit double precision (a-h,k-z)
      double precision isign

      dimension fffunc(3),fafunc(3)

      COMMON/SD_qcdscales/amuvv,lamvv
      COMMON/SD_relmasses/mst1,mst2,mgl,mtop

      amuvv = amuv
      lamvv = lamv
      mst1  = amst1
      mst2  = amst2
      mgl   = amgl
      mtop  = amtop

      pi = 4.D0*datan(1.D0)

      if(ival.eq.1) then
         isign = 1.D0
      elseif(ival.eq.2) then
         isign = -1.D0
      endif

      sig2t = isign*amtop*amgl*dsin(2.D0*thet)

      call SD_fifafunctions(fffunc,fafunc,fbfunc)

      SD_gamvirt = 64.D0/9.D0*pi*
     .     ( fffunc(1) + sig2t*fffunc(2) + sig2t**2*fffunc(3) ) +
     .     8.D0*pi*
     .     (fafunc(1) + sig2t*fafunc(2) + sig2t**2*fafunc(3)) +
     .     16.D0/3.D0*pi*
     .     (-(amgl**2+mtop**2-amst1**2)+2.D0*sig2t)*fbfunc

      return

      end

c -------------------------------------------------------------------- c
c --- this function is for the stop1/2, sbottom1/2 decays --- 

      double precision function SD_gamreal(amst1,amt,amgl,thet,ival,
     .                                     lamv)

      implicit double precision (a-h,k-z)
      double precision ist1gl,ist1t,iglgl,ist1st1,itt,igl,ist1,it,
     .     itgl,iglst1
      double precision isign

      complex*16 SD_kappa,SD_ccspen

      pi = 4.D0*datan(1.D0)

      if(ival.eq.1) then
         isign = 1.D0
      elseif(ival.eq.2) then
         isign = -1.D0
      endif

      sig2t = isign*amt*amgl*dsin(2.D0*thet)

      m0 = amst1
      m1 = amt
      m2 = amgl

      kap = dreal(SD_kappa(m0**2,m1**2,m2**2,0.D0))

      b0 = (m0**2-m1**2-m2**2+kap)/(2.D0*m1*m2)
      b1 = (m0**2-m1**2+m2**2-kap)/(2.D0*m0*m2)
      b2 = (m0**2+m1**2-m2**2-kap)/(2.D0*m0*m1)

      ist1gl = dreal( 
     .     1.D0/(4.D0*m0**2)*(-2.D0*dlog((lamv*m0*m1*m2)/kap**2)*
     .     dlog(b1) + 2.D0*(dlog(b1))**2 - (dlog(b0))**2 - 
     .     (dlog(b2))**2 + 2.D0*SD_ccspen(dcmplx(1.D0-b1**2)) 
     .     - SD_ccspen(dcmplx(1.D0-b0**2)) - 
     .     SD_ccspen(dcmplx(1.D0-b2**2)) ) )

      ist1t = dreal( 
     .     1.D0/(4.D0*m0**2)*(-2.D0*dlog((lamv*m0*m1*m2)/kap**2)*
     .     dlog(b2) + 2.D0*(dlog(b2))**2 - (dlog(b0))**2 - 
     .     (dlog(b1))**2 + 2.D0*SD_ccspen(dcmplx(1.D0-b2**2)) 
     .     - SD_ccspen(dcmplx(1.D0-b0**2)) - 
     .     SD_ccspen(dcmplx(1.D0-b1**2)) ) )

      iglgl = 1.D0/(4.D0*m2**2*m0**2)*(kap*dlog(kap**2/(lamv*m0*m1*m2))
     .     -kap-(m0**2-m1**2)*dlog(b0/b1)-m2**2*dlog(b2) )

      ist1st1 = 1.D0/(4.D0*m0**4)*(kap*dlog(kap**2/(lamv*m0*m1*m2))
     .     -kap-(m1**2-m2**2)*dlog(b1/b2)-m0**2*dlog(b0))

      itt = 1.D0/(4.D0*m1**2*m0**2)*(kap*dlog(kap**2/(lamv*m0*m1*m2))
     .     -kap-(m0**2-m2**2)*dlog(b0/b2)-m1**2*dlog(b1) )

      igl = 1.D0/(4.D0*m0**2)*(-2.D0*m0**2*dlog(b1)-2.D0*m1**2*dlog(b0)
     .     -kap)

      ist1 = 1.D0/(4.D0*m0**2)*(-2.D0*m1**2*dlog(b2)-
     .     2.D0*m2**2*dlog(b1)-kap)

      it = 1.D0/(4.D0*m0**2)*(-2.D0*m0**2*dlog(b2)-2.D0*m2**2*dlog(b0)
     .     -kap)

      itgl = -1.D0/(4.D0*m0**2)*(-m2**4*dlog(b0)+m0**2*(2.D0*m1**2
     .     -2.D0*m2**2)*dlog(b2) + m0**4*dlog(b2) + 
     .     kap/4.D0*(m1**2+5.D0*m0**2-3.D0*m2**2) )
      
      iglst1 = 1.D0/(4.D0*m0**2)*(m0**4*dlog(b1)-m1**2*(2.D0*m2**2
     .     -2.D0*m0**2+m1**2)*dlog(b0) -kap/4.D0*(m2**2-3.D0*m0**2
     .     +5.D0*m1**2) )

      SD_gamreal = 8.D0/pi/amst1*(-(amgl**2+amt**2-amst1**2)+
     .     2.D0*sig2t)*(-(amst1**2-amt**2)*ist1gl+amt**2*ist1t
     .     -amgl**2*iglgl-igl) +
     .     32.D0/9.D0/pi/amst1*(-(amgl**2+amt**2-amst1**2)+
     .     2.D0*sig2t)*(-amst1**2*ist1st1-amt**2*itt-
     .     (amt**2+amst1**2-amgl**2)*ist1t-ist1-it) +
     .     4.D0/3.D0/pi/amst1*(4.D0/3.D0*itgl-3.D0*iglst1)

      return

      end

c -------------------------------------------------------------------- c
c --- this function is for the gluino decays --- 

      double precision function SD_gamrealgl(amst1,amt,amgl,thet,ival,
     .                                       lamv)

      implicit double precision (a-h,k-z)
      double precision ist1gl,ist1t,iglgl,ist1st1,itt,igl,ist1,it,
     .     itgl,iglst1
      double precision isign

      complex*16 SD_kappa,SD_ccspen

      pi = 4.D0*datan(1.D0)

      if(ival.eq.1) then
         isign = 1.D0
      elseif(ival.eq.2) then
         isign = -1.D0
      endif

      sig2t = isign*amt*amgl*dsin(2.D0*thet)

      m0 = amgl
      m1 = amt
      m2 = amst1

      kap = dreal(SD_kappa(m0**2,m1**2,m2**2,0.D0))

      b0 = (m0**2-m1**2-m2**2+kap)/(2.D0*m1*m2)
      b1 = (m0**2-m1**2+m2**2-kap)/(2.D0*m0*m2)
      b2 = (m0**2+m1**2-m2**2-kap)/(2.D0*m0*m1)

      ist1gl = dreal( 
     .     1.D0/(4.D0*m0**2)*(-2.D0*dlog((lamv*m0*m1*m2)/kap**2)*
     .     dlog(b1) + 2.D0*(dlog(b1))**2 - (dlog(b0))**2 - 
     .     (dlog(b2))**2 + 2.D0*SD_ccspen(dcmplx(1.D0-b1**2)) 
     .     - SD_ccspen(dcmplx(1.D0-b0**2)) - 
     .     SD_ccspen(dcmplx(1.D0-b2**2)) ) )

      ist1t = dreal( 
     .     1.D0/(4.D0*m0**2)*(-2.D0*dlog((lamv*m0*m1*m2)/kap**2)*
     .     dlog(b0) + 2.D0*(dlog(b0))**2 - (dlog(b1))**2 - 
     .     (dlog(b2))**2 + 2.D0*SD_ccspen(dcmplx(1.D0-b0**2)) 
     .     - SD_ccspen(dcmplx(1.D0-b1**2)) - 
     .     SD_ccspen(dcmplx(1.D0-b2**2)) ) )

      iglgl = 1.D0/(4.D0*m0**4)*(kap*dlog(kap**2/(lamv*m0*m1*m2))
     .     -kap-(m1**2-m2**2)*dlog(b1/b2)-m0**2*dlog(b0) )

      ist1st1 = 1.D0/(4.D0*m2**2*m0**2)*(
     .     kap*dlog(kap**2/(lamv*m0*m1*m2))
     .     -kap-(m0**2-m1**2)*dlog(b0/b1)-m2**2*dlog(b2))

      itt = 1.D0/(4.D0*m1**2*m0**2)*(kap*dlog(kap**2/(lamv*m0*m1*m2))
     .     -kap-(m0**2-m2**2)*dlog(b0/b2)-m1**2*dlog(b1) )

      igl = 1.D0/(4.D0*m0**2)*(-2.D0*m1**2*dlog(b2)-2.D0*m2**2*dlog(b1)
     .     -kap)

      ist1 = 1.D0/(4.D0*m0**2)*(-2.D0*m0**2*dlog(b1)
     .      -2.D0*m1**2*dlog(b0)-kap)

      it = 1.D0/(4.D0*m0**2)*(-2.D0*m0**2*dlog(b2)-2.D0*m2**2*dlog(b0)
     .     -kap)

      itgl = -1.D0/(4.D0*m0**2)*(-m0**4*dlog(b2)+m2**2*(2.D0*m1**2
     .     -2.D0*m0**2)*dlog(b0) + m2**4*dlog(b0) + 
     .     kap/4.D0*(m1**2+5.D0*m2**2-3.D0*m0**2) )

      iglst1 = 1.D0/(4.D0*m0**2)*(m2**4*dlog(b1)-m1**2*(2.D0*m0**2
     .     -2.D0*m2**2+m1**2)*dlog(b2) -kap/4.D0*(m0**2-3.D0*m2**2
     .     +5.D0*m1**2) )

      SD_gamrealgl = 8.D0/pi/amst1*(-(amgl**2+amt**2-amst1**2)+
     .     2.D0*sig2t)*(-(amst1**2-amt**2)*ist1gl+amt**2*ist1t
     .     -amgl**2*iglgl-igl) +
     .     32.D0/9.D0/pi/amst1*(-(amgl**2+amt**2-amst1**2)+
     .     2.D0*sig2t)*(-amst1**2*ist1st1-amt**2*itt-
     .     (amt**2+amst1**2-amgl**2)*ist1t-ist1-it) +
     .     4.D0/3.D0/pi/amst1*(4.D0/3.D0*itgl-3.D0*iglst1)

      return

      end

c -------------------------------------------------------------------- c

      double precision function SD_gamcfdec(amst1,amst2,amt,amsb1,amsb2,
     .     amb,amgl,amsq,amuv,scala)

      implicit double precision (a-h,k-z)

      mur = scala

      SD_gamcfdec = -(-dlog(mur**2/amuv**2) )*3.D0 - 1.D0

      SD_gamcfdec = SD_gamcfdec + 8.D0/3.D0

c maggie changed with respect to the paper 26/3/03
      SD_gamcfdec = SD_gamcfdec + 4.D0*( 4.D0/12.D0*dlog(mur**2/amsq**2)
     .     + 1.D0/24.D0*dlog(mur**2/amsb1**2) + 1.D0/24.D0*
     .     dlog(mur**2/amsb2**2) 
     .     + 1.D0/24.D0*dlog(mur**2/amst1**2) + 1.D0/24.D0*
     .     dlog(mur**2/amst2**2) + 1.D0/6.D0*dlog(mur**2/amt**2)
     .     + 1.D0/2.D0*dlog(mur**2/amgl**2) )
c maggie changed with respect to the paper 26/3/03

      return

      end

c -------------------------------------------------------------------- c

      subroutine SD_fifafunctions(fffunc,fafunc,fbfunc)

      implicit double precision (a-h,k-z)

      complex*16 SD_C03,SD_C0_lam

      dimension fffunc(3),fafunc(3)

      COMMON/SD_qcdscales/amuv,lamv
      COMMON/SD_relmasses/amst1,amst2,amgl,amt

      pi = 4.D0*datan(1.D0)

      fffunc(1) = 2.D0*(amt**2+amgl**2)*
     .   SD_B02(amst1**2,amgl,amt,amuv**2) + 
     .   (amst1**2+amt**2+amgl**2)*SD_B02(amst1**2,lamv,amst1,amuv**2)
     .   + 2.D0*(amgl**2-amst1**2)*SD_B02(amt**2,lamv,amt,amuv**2)
     .   - 2.D0*amt**2*SD_B02(amt**2,amgl,amst2,amuv**2)
     .   - 4.D0*amgl**2*SD_B02(amgl**2,amt,amst1,amuv**2)
     .   + 4.D0*amgl**2*(amst1**2-amgl**2)*
     .   dreal( SD_C03(amst1**2,amt**2,amgl**2,amt,amgl,amst1) )
     .   + 2.D0*amt**2*(amst1**2+amst2**2-2.D0*amt**2)* 
     .   dreal( SD_C03(amst1**2,amt**2,amgl**2,amt,amgl,amst2) )

      fffunc(2) = -2.D0*SD_B02(amst1**2,lamv,amst1,amuv**2) 
     .   -2.D0*SD_B02(amt**2,lamv,amt,amuv**2) 
     .   -4.D0*SD_B02(amst1**2,amgl,amt,amuv**2) 
     .   +2.D0*SD_B02(amt**2,amgl,amst1,amuv**2) 
     .   +4.D0*SD_B02(amgl**2,amt,amst1,amuv**2)
     .   +4.D0*(amgl**2+amt**2-amst1**2)*
     .   dreal( SD_C03(amst1**2,amt**2,amgl**2,amt,amgl,amst1) )
     .   +2.D0*(amst1**2-amst2**2)*
     .   dreal( SD_C03(amst1**2,amt**2,amgl**2,amt,amgl,amst2) )

      fffunc(3) = 1.D0/(amgl**2*amt**2)*( 2.D0*amt**2*(
     .   SD_B02(amt**2,amgl,amst2,amuv**2) - 
     .   SD_B02(amt**2,amgl,amst1,amuv**2) ) + 
     .   (amgl**2+amt**2-amst1**2)*( (amgl**2+amt**2-amst1**2) - 4.D0*
     .   amt**2 )*
     .   dreal( SD_C03(amst1**2,amt**2,amgl**2,amt,amgl,amst1) ) 
     .   -((amgl**2+amt**2-amst1**2)*(amgl**2+amt**2-amst2**2) - 
     .   2.D0*amt**2*(amgl**2+amt**2-amst1**2) - 2.D0*amt**2*
     .   (amgl**2+amt**2-amst2**2) )*
     .   dreal( SD_C03(amst1**2,amt**2,amgl**2,amt,amgl,amst2) ) )

      fafunc(1) = -2.D0*(amgl**2+amt**2-amst1**2) + 
     .   4.D0*(amt**2-amst1**2)*SD_B02(amgl**2,lamv,amgl,amuv**2)
     .   +2.D0*amt**2*( SD_B02(amt**2,amgl,amst2,amuv**2) -
     .   SD_B02(amt**2,amgl,amst1,amuv**2) ) + 4.D0*amgl**2*
     .   SD_B02(amgl**2,amt,amst1,amuv**2)  
     .   + 4.D0*amgl**2*(amgl**2-amst1**2)* 
     .   dreal( SD_C03(amst1**2,amt**2,amgl**2,amt,amgl,amst1) )
     .   -2.D0*amt**2*(amst1**2+amst2**2-2.D0*amt**2)*
     .   dreal( SD_C03(amst1**2,amt**2,amgl**2,amt,amgl,amst2) )

      fafunc(2) = 4.D0 - 4.D0*SD_B02(amgl**2,lamv,amgl,amuv**2)
     .   -4.D0*SD_B02(amgl**2,amt,amst1,amuv**2) 
     .   -4.D0*(amgl**2+amt**2-amst1**2)*
     .   dreal( SD_C03(amst1**2,amt**2,amgl**2,amt,amgl,amst1) )
     .   -2.D0*(amst1**2-amst2**2)*
     .   dreal( SD_C03(amst1**2,amt**2,amgl**2,amt,amgl,amst2) )

      fafunc(3) = 1.D0/(amgl**2*amt**2)*( 
     .   2.D0*amt**2*( SD_B02(amt**2,amgl,amst1,amuv**2) 
     .   - SD_B02(amt**2,amgl,amst2,amuv**2) ) 
     .   + (amgl**2+amt**2-amst1**2)*(4.D0*amt**2-(amgl**2+amt**2-
     .   amst1**2))*
     .   dreal( SD_C03(amst1**2,amt**2,amgl**2,amt,amgl,amst1) )
     .   + ( (amgl**2+amt**2-amst1**2)*(amgl**2+amt**2-amst2**2) 
     .   -2.D0*amt**2*(amgl**2+amt**2-amst1**2) - 2.D0*amt**2*
     .   (amgl**2+amt**2-amst2**2) )*
     .   dreal( SD_C03(amst1**2,amt**2,amgl**2,amt,amgl,amst2) ))

      fbfunc = 3.D0*( (amt**2+amst1**2-amgl**2)*
     .   dreal( SD_C0_lam(amst1,amt,amgl,lamv) )
     .   - (amgl**2+amt**2-amst1**2)*
     .   dreal( SD_C0_lam(amt,amgl,amst1,lamv) )
     .   - (amst1**2+amgl**2-amt**2)*
     .   dreal( SD_C0_lam(amgl,amst1,amt,lamv) ) )
     .   - 8.D0/3.D0*(amt**2+amst1**2-amgl**2)*
     .   dreal( SD_C0_lam(amst1,amt,amgl,lamv) ) 

      do i=1,3,1
         fffunc(i) = -1.D0/16.D0/pi**2*fffunc(i)
         fafunc(i) = -1.D0/16.D0/pi**2*fafunc(i)
      end do
         fbfunc    = -1.D0/16.D0/pi**2*fbfunc

      end

c -------------------------------------------------------------------- c
c ---------- The A function for the higher order corrections --------- c

      double precision function SD_A01(s,mu2)

      implicit double precision (a-h,k-z)

      SD_A01 = s*(-dlog(s/mu2)+1.D0)

      return

      end

c -------------------------------------------------------------------- c
c ---------------------- The divergent piece of A01 ------------------ c

      double precision function SD_A01_DIV(s,mu2)

      implicit double precision (a-h,k-z)

      SD_A01_DIV = s*dlog(mu2)

      return

      end

c -------------------------------------------------------------------- c
c -------- The function B1 for the higher order corrections ---------- c

      double precision function SD_B1(s,m1,m2,mu2)

      implicit double precision (a-h,k-z)

      SD_B1 = 1.D0/2.D0/s*( SD_A01(m1**2,mu2)-SD_A01(m2**2,mu2)
     .     +(m2**2-m1**2-s)*SD_B02(s,m1,m2,mu2) )
      
      return 

      end 

c -------------------------------------------------------------------- c
c ----------------------- The divergent piece of B1 ------------------ c

      double precision function SD_B1_DIV(s,m1,m2,mu2)

      implicit double precision (a-h,k-z)

      SD_B1_DIV = 1.D0/2.D0/s*( m1**2*log(mu2)-m2**2*log(mu2)
     .     +(m2**2-m1**2-s)*SD_B02_DIV(s,m1,m2,mu2) )
      
      return 

      end 

c -------------------------------------------------------------------- c
c ------------------- The derivative of B1: dB1/ ds ------------------ c

      double precision function SD_BP1(s,m1,m2,mu2)

      implicit double precision (a-h,k-z)

      SD_BP1 = -1.D0/2.D0/s**2*( SD_A01(m1**2,mu2)-
     .     SD_A01(m2**2,mu2)+(m2**2-m1**2)*SD_B02(s,m1,m2,mu2) )
     .     +1.D0/2.D0/s*(m2**2-m1**2)*SD_BP02(s,m1,m2,mu2)
     .     -1.D0/2.D0*SD_BP02(s,m1,m2,mu2)

      return 

      end 

c -------------------------------------------------------------------- c
c ------- The C function for a small mass lambda: -------------------- c
c ------- C0(msqp**2,msq**2,mphi**2,msqp,lamv,msq) =     ------------- c
c ------- C0(msq**2,mphi**2,msqp**2,lamv,msq,msqp) =     ------------- c
c - 4.2.2003 M. Muehlleitner ----------------------------------------- c
c -------------------------------------------------------------------- c

      function SD_C0_lam(msqp,msq,mphi,lamv)

      implicit real*8 (a-h,o-z)

      real*8 m1,m2,lamv,msq,msqp,mphi

      complex*16 SD_C0_lam,SD_ccspen,dlxs,dlfc,ieps,ys,xs

      ieps = dcmplx(0.d0,1.d-17)
      pi   = 4.D0*datan(1.D0)

      m1 = msqp
      m2 = msq
      s  = mphi**2

      ys = cdsqrt(1.D0 - (4.D0*m1*m2)/(s-(m1-m2)**2+ieps))

      xs = (ys-1.D0)/(ys+1.D0)

      dlxs = cdlog(xs)
      dlfc = cdlog(1.D0-xs**2)

      SD_C0_lam = xs/(m1*m2*(1.D0-xs**2))*( 
     .     dlxs*(-dlog(lamv**2/(m1*m2))-1.D0/2.D0*dlxs+
     .     2.D0*dlfc ) +
     .     SD_ccspen(1.D0-xs*m1/m2) + 
     .     SD_ccspen(1.D0-xs*m2/m1) + SD_ccspen(xs**2) +
     .     1.D0/2.D0*(dlog(m1/m2))**2 - pi**2/6.D0 )

      return

      end

c -------------------------------------------------------------------- c
c --      The B and C functions for the higher order corrections ----- c
c --      Spence function.                                       ----- c
c -- taken from hdecay.f Version 3.0,                            ----- c
c -- authors: A.Djouadi, J.Kalinowski and M.Spira                ----- c
c -------------------------------------------------------------------- c

      function SD_kappa(a,b,c,d)

      real*8 a,b,c,d
      complex*16 SD_kappa,ieps

      ieps = dcmplx(0.d0,1.d-17)

      if(A.eq.B) then 
         SD_KAPPA = cdsqrt((C*(C-4.D0*A))*(1+IEPS*D))
      elseif(B.eq.C) then
         SD_KAPPA = cdsqrt((A*(A-4.D0*B))*(1+IEPS*D))
      elseif(A.eq.C) then
         SD_KAPPA = cdsqrt((B*(B-4.D0*A))*(1+IEPS*D))
      else
         SD_KAPPA = CDSQRT((A**2+B**2+C**2-2*(A*B+A*C+B*C))
     .        * (1+IEPS*D))
      endif

      end

************************************************************************
      FUNCTION SD_C03(P1,P2,P3,M1,M2,M3)
************************************************************************
*  SCALAR 3-POINT FUNCTION                                             *
*  P1,P2,P3 = SQUARED EXTERNAL MOMENTA  			       *
*----------------------------------------------------------------------*
*  5.12.96  M. SPIRA    					       *
************************************************************************
      IMPLICIT REAL*8 (A-H,O-Z)
      REAL*8 M1,M2,M3
      REAL*8 R(0:2)
      COMPLEX*16 SD_C03,SD_CCSPEN,SD_ETA,IEPS,IM
      COMPLEX*16 ALP(0:2),X(0:2,2),Y0(0:2),Y(0:2,2)
      COMPLEX*16 CDUM
C     REAL*8 SD_KAPPA
      COMPLEX*16 SD_KAPPA
c maggie changed 17/2/03
      COMPLEX*16 ALPHA
C     SD_KAPPA(A,B,C) = DSQRT(A**2+B**2+C**2-2*(A*B+A*C+B*C))
C     SD_KAPPA(A,B,C) = DSQRT(DABS(A**2+B**2+C**2-2*(A*B+A*C+B*C)))
c     SD_KAPPA(A,B,C) = CDSQRT(DCMPLX(A**2+B**2+C**2-2*(A*B+A*C+B*C)))

c      if(A.eq.B) then 
c         SD_KAPPA(A,B,C,D) = cdsqrt((C*(C-4.D0*A))*(1+IEPS*D))
c      elseif(B.eq.C) then
c         SD_KAPPA(A,B,C,D) = cdsqrt((A*(A-4.D0*B))*(1+IEPS*D))
c      elseif(A.eq.C) then
c         SD_KAPPA(A,B,C,D) = cdsqrt((B*(B-4.D0*A))*(1+IEPS*D))
c      else
c         SD_KAPPA(A,B,C,D) = CDSQRT((A**2+B**2+C**2-2*(A*B+A*C+B*C))
c     .        * (1+IEPS*D))
c      endif

      EPS = 1.D-8*(P1+P2+P3)
      IM = DCMPLX(0.D0,1.D0)
c>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
      IEPS = DCMPLX(0.D0,1.D-17)
c     IEPS = DCMPLX(0.D0,1.D-20)
      PI = 4*DATAN(1.D0)
      XX = 0.D0
C     IF(P1.LT.0.D0.OR.P2.LT.0.D0.OR.P3.LT.0.D0) XX=1.D0
      IF(P1.NE.0.D0.OR.XX.NE.0.D0)THEN
       Q10 = P1
      ELSE
       Q10 = EPS
      ENDIF
      IF(P3.NE.0.D0.OR.XX.NE.0.D0)THEN
       Q20 = P3
      ELSE
       Q20 = EPS
      ENDIF
      IF(P2.NE.0.D0.OR.XX.NE.0.D0)THEN
       Q21 = P2
      ELSE
       Q21 = EPS
      ENDIF
      R(0) = P2
      R(1) = P3
      R(2) = P1
      SM0 = M1**2
      SM1 = M2**2
      SM2 = M3**2
c>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
c     ALPHA  = SD_KAPPA(Q10,Q21,Q20)
c     ALP(0) = SD_KAPPA(Q21,SM1,SM2)*(1+IEPS*Q21)
c     ALP(1) = SD_KAPPA(Q20,SM2,SM0)*(1+IEPS*Q20)
c     ALP(2) = SD_KAPPA(Q10,SM0,SM1)*(1+IEPS*Q10)
      ALPHA  = SD_KAPPA(Q10,Q21,Q20,1.D0)
      ALP(0) = SD_KAPPA(Q21,SM1,SM2,DSIGN(1.D0,Q21))
      ALP(1) = SD_KAPPA(Q20,SM2,SM0,DSIGN(1.D0,Q20))
      ALP(2) = SD_KAPPA(Q10,SM0,SM1,DSIGN(1.D0,Q10))
      X(0,1) = (Q21 - SM1 + SM2 + ALP(0))/2/Q21
      X(0,2) = (Q21 - SM1 + SM2 - ALP(0))/2/Q21
      X(1,1) = (Q20 - SM2 + SM0 + ALP(1))/2/Q20
      X(1,2) = (Q20 - SM2 + SM0 - ALP(1))/2/Q20
      X(2,1) = (Q10 - SM0 + SM1 + ALP(2))/2/Q10
      X(2,2) = (Q10 - SM0 + SM1 - ALP(2))/2/Q10
      Y0(0) = (Q21*(Q21-Q20-Q10+2*SM0-SM1-SM2) - (Q20-Q10)*(SM1-SM2)
     .      + ALPHA*(Q21-SM1+SM2))/2/ALPHA/Q21
      Y0(1) = (Q20*(Q20-Q10-Q21+2*SM1-SM2-SM0) - (Q10-Q21)*(SM2-SM0)
     .      + ALPHA*(Q20-SM2+SM0))/2/ALPHA/Q20
      Y0(2) = (Q10*(Q10-Q21-Q20+2*SM2-SM0-SM1) - (Q21-Q20)*(SM0-SM1)
     .      + ALPHA*(Q10-SM0+SM1))/2/ALPHA/Q10
      Y(0,1) = Y0(0) - X(0,1)
      Y(0,2) = Y0(0) - X(0,2)
      Y(1,1) = Y0(1) - X(1,1)
      Y(1,2) = Y0(1) - X(1,2)
      Y(2,1) = Y0(2) - X(2,1)
      Y(2,2) = Y0(2) - X(2,2)
      CDUM=0.D0
      DO I=0,2
       DO J=1,2
        CDUM = CDUM+SD_CCSPEN((Y0(I)-1)/Y(I,J))-SD_CCSPEN(Y0(I)/Y(I,J))
        CX = SD_ETA(1-X(I,J),1/Y(I,J))
        IF(CX.NE.0.D0)THEN
         CDUM = CDUM + CX*CDLOG((Y0(I)-1)/Y(I,J))
        ENDIF
        CY = SD_ETA(-X(I,J),1/Y(I,J))
        IF(CY.NE.0.D0)THEN
         CDUM = CDUM - CY*CDLOG(Y0(I)/Y(I,J))
        ENDIF
       ENDDO
       CX = SD_ETA(-X(I,1),-X(I,2))
       IF(CX.NE.0.D0)THEN
        CDUM = CDUM - CX*CDLOG((1-Y0(I))/(-Y0(I)))
       ENDIF
       CY = SD_ETA(Y(I,1),Y(I,2))
       IF(CY.NE.0.D0)THEN
        CDUM = CDUM + CY*CDLOG((1-Y0(I))/(-Y0(I)))
       ENDIF
       A = -R(I)
       B = -DIMAG(Y(I,1)*Y(I,2))
       IF(A.GT.0.D0.AND.B.GT.0.D0) THEN
        CDUM = CDUM + 2*PI*IM*CDLOG((1-Y0(I))/(-Y0(I)))
       ENDIF
      ENDDO
      SD_C03 = CDUM/ALPHA
      RETURN
      END

CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
C                                                                      C
C        SUBROUTINE CALCULATING THE FINITE REAL PART OF THE            C
C          GENERAL MASSIVE TWO POINT FUNCTION                          C
C                                                                      C
C           SD_B02(P.P,M1,M2,MU**2)                                    C
C           SD_BP02(P.P,M1,M2,MU**2)                                   C
C                                                                      C
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC

c -------------------------------------------------------------------- c

      real*8 function SD_B02(s,m1,m2,mu2)

      implicit none 

      real*8     s,m1,m2,mu2,m12,m22 
      complex*16 zkappa,x1,x2 

      m12 = m1**2 
      m22 = m2**2 

      if(s.eq.m22) then
         zkappa = cdsqrt(dcmplx(m12*(m12-4.D0*s)))
      elseif(s.eq.m12) then
         zkappa = cdsqrt(dcmplx(m22*(m22-4.D0*s)))
      elseif(m12.eq.m22) then
         zkappa = cdsqrt(dcmplx(s*(s-4.D0*m12)))
      else
         zkappa=cdsqrt(dcmplx(s**2+m12**2+m22**2
     .        -2.D0*(s*m12+s*m22+m12*m22)))
      endif

      if (s.eq.0.D0) then
         if (m12.eq.m22) then
            SD_B02=-dlog(m12/mu2) 
         else
            SD_B02=1.D0 - m12/(m12-m22)*dlog(m12/mu2)
     .                 + m22/(m12-m22)*dlog(m22/mu2) 
         endif
      else 
         if ((m12.eq.0.D0).and.(m22.eq.0.D0)) then 
            SD_B02=2.D0 - dlog(s/mu2)
         elseif ((m12.eq.s).and.(m22.eq.0.D0)) then 
            SD_B02=2.D0 - dlog(m12/mu2)
         elseif ((m22.eq.s).and.(m12.eq.0.D0)) then 
            SD_B02=2.D0 - dlog(m22/mu2)
         elseif (m12.eq.0.D0) then
            SD_B02=2.D0 - (s-m22)/s*dlog( dabs(m22-s)/m22 )
     .                 - dlog(m22/mu2)
         elseif (m22.eq.0.D0) then
            SD_B02=2.D0 - (s-m12)/s*dlog( dabs(m12-s)/m12 ) 
     .                 - dlog(m12/mu2)
         else
            x1=dcmplx( (s-m22+m12+zkappa)/(2.D0*s) )
            x2=dcmplx( (s-m22+m12-zkappa)/(2.D0*s) )
            SD_B02=dreal( 2.D0+ dlog(mu2/m22) 
     .                       + x1*cdlog(1.D0-1.D0/x1) 
     .                       + x2*cdlog(1.D0-1.D0/x2))
         endif
      endif 

      return
      end

c -------------------------------------------------------------------- c

      real*8 function SD_BP02(s,m1,m2,mu2)
      
      implicit none 

      real*8     s,m1,m2,mu2,m12,m22 
      complex*16 zkappa,x1,x2
      
      m12 = m1**2
      m22 = m2**2 

      if(s.eq.m22) then
         zkappa = cdsqrt(dcmplx(m12*(m12-4.D0*s)))
      elseif(s.eq.m12) then
         zkappa = cdsqrt(dcmplx(m22*(m22-4.D0*s)))
      elseif(m12.eq.m22) then
         zkappa = cdsqrt(dcmplx(s*(s-4.D0*m12)))
      else
         zkappa=cdsqrt(dcmplx(s**2+m12**2+m22**2
     .        -2.D0*(s*m12+s*m22+m12*m22)))
      endif

      if (s.eq.0.D0) then
         if (m12.eq.m22) then
            SD_BP02=1.D0/(6.D0*m12)
         else
            SD_BP02=( (m12+m22)/2.D0 
     .        - m12*m22/(m12-m22)*dlog(m12/m22) )/(m12-m22)**2 
         endif
      elseif ((s.eq.m12).and.(m22.eq.0.D0)) then 
         SD_BP02=( -1.D0 + dlog(m12/mu2)/2.D0 )/m12
      elseif ((s.eq.m22).and.(m12.eq.0.D0)) then 
         SD_BP02=( -1.D0 + dlog(m22/mu2)/2.D0 )/m22
      elseif (m22.eq.0.D0) then
         if(m12.ge.s) then
            SD_BP02=( -1.D0 - m12/s*dlog((m12-s)/m12) )/s
         elseif(m12.lt.s) then
            SD_BP02=( -1.D0 - m12/s*dlog((-m12+s)/m12) )/s
         endif
      else 
         x1=dcmplx( (s-m22+m12+zkappa)/(2.D0*s) )
         x2=dcmplx( (s-m22+m12-zkappa)/(2.D0*s) )
         SD_BP02=dreal( -1.D0 + ( x1*(1.D0-x1)*cdlog(1.D0-1.D0/x1)
     .                     - x2*(1.D0-x2)*cdlog(1.D0-1.D0/x2) )  
     .                                                  /(x1-x2) )/s
      endif 

      return
      end

************************************************************************
        FUNCTION SD_ETA(C1,C2)
************************************************************************
*       COMPLEX ETA-FUNKTION                                           *
*----------------------------------------------------------------------*
*       8.06.90    ANSGAR DENNER                                       *
************************************************************************
        IMPLICIT   LOGICAL(A-Z)                                        
        COMPLEX*16 SD_ETA,C1,C2
        REAL*8     PI,IM1,IM2,IM12                                     
                                                                       
        PI     = 4D0*DATAN(1D0)                                        
        IM1    = DIMAG(C1)                                             
        IM2    = DIMAG(C2)                                             
        IM12   = DIMAG(C1*C2)                                          
                                                                       
        IF(IM1.LT.0D0.AND.IM2.LT.0D0.AND.IM12.GT.0D0) THEN             
            SD_ETA = DCMPLX(0D0,2D0*PI)
        ELSE IF (IM1.GT.0D0.AND.IM2.GT.0D0.AND.IM12.LT.0D0) THEN       
            SD_ETA = DCMPLX(0D0,-2D0*PI)
        ELSE                                                           
            SD_ETA = DCMPLX(0D0)
        END IF                                                         
        END                                  

CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
        FUNCTION SD_CCSPEN(Z)
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
C       SPENCE-FUNKTION KOMPLEX, FREI NACH HOLLIK                      C
C----------------------------------------------------------------------C
C       20.07.83    LAST CHANGED 10.05.89        ANSGAR DENNER         C
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
        COMPLEX*16 SD_CCSPEN,W,SUM,Z,U
        REAL*8 RZ,AZ,A1
        REAL*8 B(9)/
     1   0.1666666666666666666666666667D0,
     2  -0.0333333333333333333333333333D0,
     3   0.0238095238095238095238095238D0,
     4  -0.0333333333333333333333333333D0,
     5   0.0757575757575757575757575758D0,
     6  -0.2531135531135531135531135531D0,
     7   1.1666666666666666666666666667D0,
     8  -7.09215686274509804D0         ,
     9  54.97117794486215539D0         /
C     BEACHTE:                 B(N)=B2N
C     B(1)=1./6.
C     B(2)=-1./30.
C     B(3)=1./42.
C     B(4)=-1./30.
C     B(5)=5./66.
C     B(6)=-691./2730.
C     B(7)=7./6.
C     B(8)=-3617./510.
C     B(9)=43867./798.
C     B(10)=-174611./330.
C     B(11)=854513./138.
C     PI=3.1415926535897932384
C     PI*PI/6.=1.6449..., PI*PI/3=3.28986...
C
c      write(*,*) 'z:',z
      Z =Z*DCMPLX(1D0)
      RZ=DREAL(Z)
      AZ=CDABS(Z)
      A1=CDABS(1D0-Z)
c      write(*,*)'z, rz, az, a1:',z,rz,az,a1
C     IF((SNGL(RZ) .EQ. 0.0) .AND. (SNGL(DIMAG(Z)) .EQ. 0.0)) THEN
C ---> CHANGED  10.5.89
      IF(AZ .LT. 1D-20) THEN
        SD_CCSPEN=-CDLOG(1D0-Z)
c        write(*,*) 'ccspen:', ccspen
        RETURN
      END IF
      IF((SNGL(RZ) .EQ. 1.0) .AND. (SNGL(DIMAG(Z)) .EQ. 0.0)) THEN
        SD_CCSPEN=1.64493406684822643D0
c        write(*,*) 'ccspen:', ccspen
        RETURN
      END IF
      IF(RZ.GT.5D-1) GOTO 20
      IF(AZ.GT.1D0) GOTO 10
      W=-CDLOG(1D0-Z)
      SUM=W-0.25D0*W*W
      U=W
      IF(CDABS(U).LT.1D-10) GOTO 2
c      write(*,*) 'u:',u
c      write(*,*) 'sum:',sum
      DO 1 K=1,9
      U=U*W*W/DFLOAT(2*K*(2*K+1))
      IF(CDABS(U*B(K)/SUM).LT.1D-20) GOTO 2
      SUM=SUM+U*B(K)
 1    CONTINUE
 2    SD_CCSPEN=SUM
c        write(*,*) 'ccspen:', ccspen
      RETURN
10    W=-CDLOG(1D0-1D0/Z)
      SUM=W-0.25D0*W*W
      U=W
      IF(CDABS(U).LT.1D-10) GOTO 12

      DO 11 K=1,9
      U=U*W*W/DFLOAT(2*K*(2*K+1))
      IF(CDABS(B(K)*U/SUM).LT.1D-20) GOTO 12
      SUM=SUM+U*B(K)
11    CONTINUE
12    SD_CCSPEN=-SUM-1.64493406684822643D0-.5D0*CDLOG(-Z)**2
c        write(*,*) 'ccspen:', ccspen
      RETURN
20    IF(A1.GT.1D0) GOTO 30
      W=-CDLOG(Z)
      SUM=W-0.25D0*W*W
      U=W
      IF(CDABS(U).LT.1D-10) GOTO 22
      DO 21 K=1,9
      U=U*W*W/DFLOAT(2*K*(2*K+1))
      IF(CDABS(U*B(K)/SUM).LT.1D-20) GOTO 22
      SUM=SUM+U*B(K)
21    CONTINUE
22    SD_CCSPEN=-SUM+1.64493406684822643D0-CDLOG(Z)*CDLOG(1D0-Z)
c        write(*,*) 'ccspen:', ccspen
      RETURN
30    W=CDLOG(1D0-1D0/Z)
      SUM=W-0.25D0*W*W
      U=W
      IF(CDABS(U).LT.1D-10) GOTO 32
      DO 31 K=1,9
      U=U*W*W/DFLOAT(2*K*(2*K+1))
      IF(CDABS(U*B(K)/SUM).LT.1D-20) GOTO 32
      SUM=SUM+U*B(K)
31    CONTINUE
32    SD_CCSPEN=SUM+3.28986813369645287D0
     *               +.5D0*CDLOG(Z-1D0)**2-CDLOG(Z)*CDLOG(1D0-Z)
50    CONTINUE
c        write(*,*) 'ccspen:', ccspen
      END

c ==================================================================== c
c                     The C11 and C12 functions                        c
c                    C_mu = p1_mu*C11 + p2_mu*C12                      c
c  11.2.03 M.Muehlleitner                                              c
c  p1,p2,p3 squared external momenta                                   c
c ==================================================================== c

      real*8 function SD_C1(p1,p2,p3,m1,m2,m3,amuv)

      implicit real*8 (a-h,o-z)
      real*8 m1,m2,m3
      complex*16 SD_C03

      f1 = m2**2-m1**2-p1**2
      f2 = m3**2-m2**2-p3**2+p1**2

      den = p1**2*p2**2- (p3**2-p1**2-p2**2)**2/4.D0

      r1 = 1.D0/2.D0*( 
     .     f1*dreal(SD_C03(p1**2,p2**2,p3**2,m1,m2,m3)) +
     .     SD_B02(p3**2,m1,m3,amuv**2) -
     .     SD_B02(p2**2,m2,m3,amuv**2) )

      r2 = 1.D0/2.D0*( 
     .     f2*dreal(SD_C03(p1**2,p2**2,p3**2,m1,m2,m3)) +
     .     SD_B02(p1**2,m1,m2,amuv**2) -
     .     SD_B02(p3**2,m1,m3,amuv**2) )

      SD_C1 = 1.D0/den*( p2**2*r1 - (p3**2-p1**2-p2**2)/2.D0*r2 )

      return 

      end

c -------------------------------------------------------------------- c

      real*8 function SD_C2(p1,p2,p3,m1,m2,m3,amuv)

      implicit real*8 (a-h,o-z)
      real*8 m1,m2,m3
      complex*16 SD_C03

      f1 = m2**2-m1**2-p1**2
      f2 = m3**2-m2**2-p3**2+p1**2

      den = p1**2*p2**2 - (p3**2-p1**2-p2**2)**2/4.D0

      r1 = 1.D0/2.D0*( 
     .     f1*dreal(SD_C03(p1**2,p2**2,p3**2,m1,m2,m3)) +
     .     SD_B02(p3**2,m1,m3,amuv**2) -
     .     SD_B02(p2**2,m2,m3,amuv**2) )

      r2 = 1.D0/2.D0*( 
     .     f2*dreal(SD_C03(p1**2,p2**2,p3**2,m1,m2,m3)) +
     .     SD_B02(p1**2,m1,m2,amuv**2) -
     .     SD_B02(p3**2,m1,m3,amuv**2) )

      SD_C2 = 1.D0/den*( -(p3**2-p1**2-p2**2)/2.D0*r1 + p1**2*r2 )

      return 

      end

c -------------------------------------------------------------------- c

      real*8 function SD_C1_lam(p1,p2,p3,m1,m2,m3,amuv,lamv)

      implicit real*8 (a-h,o-z)
      real*8 m1,m2,m3,lamv
      complex*16 SD_C0_lam

      f1 = m2**2-m1**2-p1**2
      f2 = m3**2-m2**2-p3**2+p1**2

      den = p1**2*p2**2- (p3**2-p1**2-p2**2)**2/4.D0

      r1 = 1.D0/2.D0*( f1*dreal(SD_C0_lam(p1,p2,p3,lamv)) +
     .     SD_B02(p3**2,m1,m3,amuv**2) -
     .     SD_B02(p2**2,m2,m3,amuv**2) )

      r2 = 1.D0/2.D0*( f2*dreal(SD_C0_lam(p1,p2,p3,lamv)) +
     .     SD_B02(p1**2,m1,m2,amuv**2) -
     .     SD_B02(p3**2,m1,m3,amuv**2) )

      SD_C1_lam = 1.D0/den*( p2**2*r1 - (p3**2-p1**2-p2**2)/2.D0*r2 )

      return 

      end

c -------------------------------------------------------------------- c

      real*8 function SD_C2_lam(p1,p2,p3,m1,m2,m3,amuv,lamv)

      implicit real*8 (a-h,o-z)
      real*8 m1,m2,m3,lamv
      complex*16 SD_C0_lam

      f1 = m2**2-m1**2-p1**2
      f2 = m3**2-m2**2-p3**2+p1**2

      den = p1**2*p2**2 - (p3**2-p1**2-p2**2)**2/4.D0

      r1 = 1.D0/2.D0*( f1*dreal(SD_C0_lam(p1,p2,p3,lamv)) +
     .     SD_B02(p3**2,m1,m3,amuv**2) -
     .     SD_B02(p2**2,m2,m3,amuv**2) )

      r2 = 1.D0/2.D0*( f2*dreal(SD_C0_lam(p1,p2,p3,lamv)) +
     .     SD_B02(p1**2,m1,m2,amuv**2) -
     .     SD_B02(p3**2,m1,m3,amuv**2) )

      SD_C2_lam = 1.D0/den*( -(p3**2-p1**2-p2**2)/2.D0*r1 + p1**2*r2 )

      return 

      end
      
c -------------------------------------------------------------------- c
c            The divergent pieces of the B functions                   c
c -------------------------------------------------------------------- c

      real*8 function SD_B02_DIV(s,m1,m2,mu2)

      implicit none 

      real*8 s,m1,m2,mu2,m12,m22 

      m12 = m1**2 
      m22 = m2**2 

      if (s.eq.0.D0) then
         if (m12.eq.m22) then
            SD_B02_DIV=dlog(mu2) 
         else
            SD_B02_DIV= + m12/(m12-m22)*dlog(mu2)
     .               - m22/(m12-m22)*dlog(mu2) 
         endif
      else 
         if ((m12.eq.0.D0).and.(m22.eq.0.D0)) then 
            SD_B02_DIV= dlog(mu2)
         elseif ((m12.eq.s).and.(m22.eq.0.D0)) then 
            SD_B02_DIV= dlog(mu2)
         elseif ((m22.eq.s).and.(m12.eq.0.D0)) then 
            SD_B02_DIV= dlog(mu2)
         elseif (m12.eq.0.D0) then
            SD_B02_DIV= dlog(mu2)
         elseif (m22.eq.0.D0) then
            SD_B02_DIV= dlog(mu2)
         else
            SD_B02_DIV= dlog(mu2) 
         endif
      endif 

      return
      end

c -------------------------------------------------------------------- c

      real*8 function SD_BP02_DIV(s,m1,m2,mu2)
      
      implicit none 

      real*8 s,m1,m2,mu2,m12,m22 
      
      m12 = m1**2
      m22 = m2**2 

      if (s.eq.0.D0) then
         if (m12.eq.m22) then
            SD_BP02_DIV=0.D0
         else
            SD_BP02_DIV=0.D0
         endif
      elseif ((s.eq.m12).and.(m22.eq.0.D0)) then 
         SD_BP02_DIV=( - dlog(mu2)/2.D0 )/m12
      elseif ((s.eq.m22).and.(m12.eq.0.D0)) then 
         SD_BP02_DIV=( - dlog(mu2)/2.D0 )/m22
      else 
         SD_BP02_DIV= 0.D0
      endif 

      return
      end


c Y.Mambrini takes the responsability for the programmation of this 
c channel.
c ==================================================================== c
c                       The stop 4-body decays                         c
c ==================================================================== c

      subroutine SD_st4bod(etot,sigmato,sigmasn,sigmaw,sigmah,ainter,
     .                     sigmae,sigmaq)
  
      implicit double precision (a-h,m,o-z) 
      double precision mfin

      integer m
      integer irunz 
      integer irunw
      integer irunsl

      dimension amneut(4),xmneut(4),amchar(2)
      dimension uu(2,2),vv(2,2),zz(4,4),zp(4,4)
      dimension ahl(4,4),ahh(4,4),aa(4,4)
      dimension gkhlr(2,2),gkhll(2,2),gkhhr(2,2),gkhhl(2,2),gkhar(2,2),
     .          gkhal(2,2)
      dimension ql(4,2),qr(4,2),or(4,2),ol(4,2)
      dimension opl(2,2),opr(2,2),onl(4,4),onr(4,4)
      dimension ale(2,2),altau(2,2),alsne(2,2),blsne(2,2),alsnt(2,2),
     .          blsnt(2,2)
      dimension alsbo(2,2),aksbo(2,2),alsto(2,2),aksto(2,2)
      dimension alup(2,2),aldo(2,2)
      dimension alup4bod(2,2),aldo4bod(2,2)
      dimension ae(2,4),be(2,4),atau(2,4),btau(2,4),anu(2,4),bnu(2,4),
     .          antau(2,4),bntau(2,4)
      dimension ae4bod(2,4),be4bod(2,4),ale4bod(2,2)
      dimension atop(2,4),btop(2,4),abo(2,4),bbo(2,4)
      dimension aup(2,4),bup(2,4),ado(2,4),bdo(2,4)
      dimension aup4bod(2,4),bup4bod(2,4),ado4bod(2,4),bdo4bod(2,4)
      dimension gltt(2,2),ghtt(2,2)
      dimension glbb(2,2),ghbb(2,2)
      dimension gctb(2,2),chctb(2,2)
      dimension gztt(2,2),gzbb(2,2),gztautau(2,2)
      dimension gwtb(2,2),gwntau(2,2)
      dimension gul(2),gur(2),gdl(2),gdr(2),gtl(2),gtr(2),gbl(2),gbr(2)

      dimension mfin(100),pfin(4,100)
      dimension ato(2,4),bto(2,4)
      dimension alto(2,2)
      dimension alsneu(2),aksne(2)
      dimension aw(2,2)
      dimension p0(4),pb(4),pf(4),pfb(4),pw(4),psb(4),pt(4),pchi(4)
      dimension psto(4),psn(4),dsto(2),dsb(2),dchi(2)
      dimension p(4)

      COMMON/SD_IRUN4BOD/IRUNZ
c      COMMON/SU_qcdflag/nnlo,idrflag
c      COMMON/SD_flagmixang/flagcu,flagcd,flagce
      COMMON/SD_param/sdgf,sdmz,sdmw,pi,g2
      COMMON/SD_massgino/amneut,xmneut,amchar
      COMMON/SD_squarktb/ast1,ast2,asb1,asb2
      COMMON/SD_squarkud/asup1,asup2,asdown1,asdown2
      COMMON/SD_sfermionetau/ase1,ase2,astau1,astau2
      COMMON/SD_sneutrino/asne1,asne2,asntau1,asntau2
      COMMON/SD_gluino/mgluino
      COMMON/SD_hmass/ama,aml,amh,amch,amar
      COMMON/SD_mixang/alp_mssm,tanbeta
      COMMON/SD_mixmat/uu,vv,zz,zp
      COMMON/SD_weinberg/sw,cw
      COMMON/SD_sfmixang/thet,theb,thel,cum,sum,cdm,sdm,cem,sem
      COMMON/SD_fermion/samt,samb,samtau
      COMMON/SD_break/sdatop,sdabot,sdatau,sdmu
      COMMON/SD_runmcalc/rmtc,rmbc,rmtauc
      COMMON/SD_refscale/amuref
      COMMON/SD_pizz/sdpizz
      COMMON/SD_piww/sdpiww
      COMMON/SD_scaleofewsb/scaleofewsb
      COMMON/SD_coup1/ahl,ahh,aa
      COMMON/SD_coup2/gkhll,gkhhl,gkhal,gkhlr,gkhhr,gkhar
      COMMON/SD_coup3/ql,qr,ol,or
      COMMON/SD_coup4/opl,opr,onl,onr
      COMMON/SD_coup5/ale,altau,alsne,blsne,alsnt,blsnt
      COMMON/SD_coup6/alsto,aksto,alsbo,aksbo
      COMMON/SD_coup7/alup,aldo
      COMMON/SD_coup8/ae,be,atau,btau,anu,bnu,antau,bntau      
      COMMON/SD_coup9/atop,btop,abo,bbo
      COMMON/SD_coup10/aup,bup,ado,bdo
      COMMON/SD_coup11/gltt,ghtt,gatt
      COMMON/SD_coup12/glbb,ghbb,gabb
      COMMON/SD_coup13/gctb,chctb
      COMMON/SD_coup14/chctbl,chctbr,chctaunur,chctaunul
      COMMON/SD_coup15/achtop,vchtop,achtau,vchtau
      COMMON/SD_coup16/czttl,czttr,czbbl,czbbr,cztautaul,cztautaur,
     .                 cznunul,cznunur
      COMMON/SD_coup17/azztoptop,vzztoptop,azztautau,vzztautau,
     .                 azzneutneut,vzzneutneut,azzbotbot,vzzbotbot
      COMMON/SD_coup18/awff,vwff
      COMMON/SD_coup19/gztt,gzbb,gztautau
      COMMON/SD_coup20/gwtb,gwntau
      COMMON/SD_coup21/gtr,gtl,gbr,gbl,gur,gul,gdr,gdl
      COMMON/SD_yukawa/yt,yb,ytau
      COMMON/SD_coupewsb/alsew,g2ew,g1ew
      COMMON/SD_runcoupscale/scalechoice,scaleofcoupling,inumloop
      COMMON/SD_scheme/idrbar
      COMMON/SD_nx1/nx1t,ny1t
      COMMON/SD_mwmzpole/amwp,amzp

      irunz=15000
      irunw=irunz
      irunsl=irunz

      bet = datan(tanbeta)
      tw  = sw/cw

c -- assignments old-new names of variables --

      amt=samt
      amb=samb
      amtau=samtau
      amw=sdmw
      amz=sdmz
      asl1=astau1
      asl2=astau2
      amsell=ase1
      amsn1=asne1
      amsupl=asup1
      amsdownl=asdown1
      do i=1,2
         do j=1,2
            alto(i,j)=altau(i,j)
            ato(i,j)=atau(i,j)
            bto(i,j)=btau(i,j)
            aw(i,j)=gwtb(i,j)/dsqrt(2.d0)
         enddo
      enddo
      do i=1,2
         alsneu(i)=-alsne(1,j)
         aksne(j)=-blsnt(1,j)
      enddo

      asnl=anu(1,1)
            
      do k=1,2
         ale4bod(1,k)=0.d0
         ale4bod(2,k)=uu(k,1)
      enddo
      
      do k=1,4
         ae4bod(1,k)=0.d0
         ae4bod(2,k)=-dsqrt(2.d0)*(zp(k,1)*sw+(0.5d0-sw**2)*zp(k,2)/cw)
         be4bod(1,k)=dsqrt(2.d0)*sw*(zp(k,2)*tw-zp(k,1))
         be4bod(2,k)=0.d0	
      enddo
      
      do k=1,4
         ado4bod(1,k)=0.d0
         ado4bod(2,k)=-dsqrt(2.d0)*(zp(k,1)*sw/3.d0+(0.5d0-1.d0/3.d0*
     .                sw**2)*zp(k,2)/cw)
         bdo4bod(1,k)=dsqrt(2.d0)*sw*(zp(k,2)*tw-zp(k,1))/3.d0
         bdo4bod(2,k)=0.d0
      enddo

      do k=1,4
         aup4bod(1,k)=0.d0
         aup4bod(2,k)=dsqrt(2.d0)*(2.d0/3.d0*zp(k,1)*sw+(0.5d0-
     .                2.d0/3.d0*sw**2)*zp(k,2)/cw)
         bup4bod(1,k)=-2*dsqrt(2.d0)*sw*(zp(k,2)*tw-zp(k,1))/3.d0
         bup4bod(2,k)=0.d0
      enddo

      do k=1,2
         aldo4bod(1,k)=0.d0
         aldo4bod(2,k)=uu(k,1)
      enddo

      do k=1,2
         alup4bod(1,k)=0.d0
         alup4bod(2,k)=vv(k,1)
      enddo

c -- end of assignements --

      cb=dcos(theb)
      sb=dsin(theb)
      ct=dcos(thet)
      st=dsin(thet)
      cl=dcos(thel)
      sl=dsin(thel)

c ------------------------- slepton exchange ------------------------- c

      if (ast1.gt.amneut(1)) then

         resuto   = 0.d0
         resusn1  = 0.d0
         resutosn = 0.d0
         resuesn  = 0.d0
         resususd = 0.d0

         mfin(1)=amneut(1)
         mfin(2)=0.d0
         mfin(3)=0.d0
         mfin(4)=0.d0

         sigma=0.d0
         resu=0.d0

         do j=1,irunsl
            call SD_rambo(4,etot,mfin,pfin,wt)

            do i=1,4
               p0(i)=pfin(i,1)
               pb(i)=pfin(i,2)
               pf(i)=pfin(i,3)
               pfb(i)=pfin(i,4)
               psto(i)=p0(i)+pfb(i)
               psn(i)=p0(i)+pf(i)
               pchi(i)=psto(i)+pf(i)
            enddo

            p0pb=SD_scal(p0,pb)
            p0pf=SD_scal(p0,pf)
            p0pfb=SD_scal(p0,pfb)
            pbpf=SD_scal(pb,pf)
            pbpfb=SD_scal(pb,pfb)
            pfpfb=SD_scal(pf,pfb)
            pchipb=SD_scal(pchi,pb)
            pchipfb=SD_scal(pchi,pfb)
            pchipf=SD_scal(pchi,pf)
            pchipchi=SD_scal(pchi,pchi)
            pstopsto=SD_scal(psto,psto)
            psnpsn=SD_scal(psn,psn)

            do i=1,2
               dchi(i)=pchipchi-amchar(i)**2
            enddo
            dsto(1)=pstopsto-asl1**2
            dsto(2)=pstopsto-asl2**2
            dsel=pstopsto-amsell**2
            dsn=psnpsn-amsn1**2
            dsu=psnpsn-amsupl**2
            dsd=pstopsto-amsdownl**2

            atoato=0.d0
            asn1asn1=0.d0
            atosnatosn=0.d0
            aesnaesne=0.d0
            aesnaesnsn=0.d0
            aesnaesnesn=0.d0
            asusdasusdsu=0.d0
            asusdasusdsd=0.d0
            asusdasusdsusd=0.d0	
            asusdsusdsu=0.D0
            
            do i=1,2
               do k=1,2
                  do m=1,2
                     do n=1,2
                        atoato=atoato
     .                   +4.d0/Dchi(i)/Dchi(k)/Dsto(m)/Dsto(n)*alto(m,i)
     .                   *alto(n,k)*(bto(m,1)*bto(n,1)+ato(m,1)*
     .                   ato(n,1))*p0pfb*(aksto(1,i)*aksto(1,k)*(2.d0*
     .                   pchipb*pchipf-pbpf*pchipchi)+amchar(i)*
     .                   amchar(k)*pbpf*alsto(1,k)*alsto(1,i))
                     enddo
                  enddo
               enddo
            enddo

            do i=1,2
               do k=1,2
                  asn1asn1=asn1asn1
     .                 +4.d0/Dchi(i)/Dchi(k)/Dsn**2
     .                 *(asnL**2)*p0pf*((
     .                 alsto(1,i)*alsto(1,k)*alsneu(i)*alsneu(k)
     .                 +aksto(1,i)*aksto(1,k)*aksne(i)*aksne(k)
     .                 )*(2.d0*pchipb*pchipfb-pbpfb*pchipchi)
     .                 +amchar(i)*amchar(k)*pbpfb*(
     .                 aksto(1,k)*aksto(1,i)*alsneu(i)*alsneu(k)
     .                 +alsto(1,k)*alsto(1,i)*aksne(i)*aksne(k)
     .                 ))
                  do m=1,2
                     atosnatosn=atosnatosn
     .                    +(2.d0*amchar(i)/Dchi(i)/Dchi(k)/Dsn/Dsto(m)
     .                    *amneut(1)*asnL*ato(m,1)*alsto(1,i)*
     .                    alsto(1,k)*alto(m,i)*alsneu(k))
     .                    *(pchipb*pfpfb-pbpfb*pchipf+pbpf*pchipfb)
                  enddo
               enddo
            enddo


c ---------------------- non-massive slepton case -------------------- c

            do i=1,2
               do k=1,2
                  aesnaesnsn=aesnaesnsn
     .                 +4.d0/Dchi(i)/Dchi(k)/Dsn**2
     .                 *(asnL**2)*p0pf*
     .                 (alsto(1,i)*alsto(1,k)*alsneu(i)*alsneu(k)
     .                 *(2.d0*pchipb*pchipfb-pbpfb*pchipchi)
     .                 +amchar(i)*amchar(k)*pbpfb*
     .                 aksto(1,k)*aksto(1,i)*alsneu(i)*alsneu(k))
               enddo
            enddo

            do i=1,2
               do k=1,2
                  aesnaesne=aesnaesne
     .                 +4.d0/Dchi(i)/Dchi(k)/Dsel**2
     .                 *ale4bod(2,i)*ale4bod(2,k)*
     .                 ale4bod(2,1)**2*p0pfb
     .                 *(aksto(1,i)*aksto(1,k)*(2.d0*pchipb*pchipf
     .                 -pbpf*pchipchi)
     .                 +amchar(i)*amchar(k)*pbpf*alsto(1,k)*alsto(1,i))
               enddo
            enddo

            do i=1,2
               do k=1,2
                  aesnaesnesn=aesnaesnesn
     .                 +(2.d0*amchar(i)*amneut(1)/Dchi(i)/Dchi(k)/Dsn/
     .                 Dsel*asnL*ale4bod(2,1)*alsto(1,i)*alsto(1,k)*
     .                 ale4bod(2,i)*alsneu(k))
     .                 *(pchipb*pfpfb-pbpfb*pchipf+pbpf*pchipfb)
               enddo
            enddo

            aesnaesn=aesnaesne+aesnaesnsn+2.d0*aesnaesnesn

c ---------------------- non-massive squark case --------------------- c

            do i=1,2
               do k=1,2
                  asusdsusdsu=asusdsusdsu
     .                 +4.d0/Dchi(i)/Dchi(k)/Dsu**2
     .                 *(aup4bod(2,1)**2)*p0pf*
     .                 alsto(1,i)*alsto(1,k)*alup4bod(2,i)*alup4bod(2,k)
     .                 *((2.d0*pchipb*pchipfb-pbpfb*pchipchi)
     .                 +amchar(i)*amchar(k)*pbpfb*
     .                 aksto(1,k)*aksto(1,i)*alup4bod(2,i)*alup4bod(2,k)
     .                 )
               enddo
            enddo

            do i=1,2
               do k=1,2
                  asusdasusdsd=asusdasusdsd
     .                 +4.d0/Dchi(i)/Dchi(k)/Dsd**2
     .                 *aldo4bod(2,i)*aldo4bod(2,k)*
     .                 ado4bod(2,1)**2*p0pfb
     .                 *(aksto(1,i)*aksto(1,k)*(2.d0*pchipb*pchipf-
     .                 pbpf*pchipchi)
     .                 +amchar(i)*amchar(k)*pbpf*alsto(1,k)*alsto(1,i))
               enddo
            enddo

            do i=1,2
               do k=1,2
                  asusdasusdsusd=asusdasusdsusd
     .                 +(2.d0*amchar(i)*amneut(1)/Dchi(i)/Dchi(k)/Dsu/
     .                 Dsd
     .                 *aup4bod(2,1)*ado4bod(2,1)*alsto(1,i)*alsto(1,k)
     .                 *aldo4bod(2,i)*alup4bod(2,k))
     .                 *(pchipb*pfpfb-pbpfb*pchipf+pbpf*pchipfb)
               enddo
            enddo

            asusdasusd=asusdasusdsu+asusdasusdsd+2.d0*asusdasusdsusd

            resuto=resuto+wt*atoato/irunsl
            resusn1=resusn1+wt*asn1asn1/irunsl
            resutosn=resutosn+wt*atosnatosn/irunsl
            resuesn=resuesn+wt*aesnaesn/irunsl
            resususd=resususd+wt*asusdasusd/irunsl

         enddo

         sigmato=resuto/2.d0/ast1/(2.d0*pi)**8*g2**3
         sigmasn=resusn1/2.d0/ast1/(2.d0*pi)**8*g2**3
         sigmatosn=resutosn/2.d0/ast1/(2.d0*pi)**8*g2**3
         sigmato=sigmato+sigmasn+2.d0*sigmatosn
         sigmaesn=resuesn/2.d0/ast1/(2.d0*pi)**8*g2**3
         sigmasusd=resususd/2.d0/ast1/(2.d0*pi)**8*g2**3
      else
         sigmato=0.d0
         sigmasn=0.d0
         sigmatosn=0.d0
         sigmaesn=0.d0
         sigmasusd=0.d0
      endif

c ---------------------------- W exchange ---------------------------- c

      if (ast1.gt.amneut(1)) then

         resuw=0.d0
         resuinter=0.d0
         resueW=0.d0
         resusuW=0.d0

         mfin(1)=amneut(1)
         mfin(2)=0.d0
         mfin(3)=0.d0
         mfin(4)=0.d0
         resu=0.d0

         do k=1,irunw
            call SD_rambo(4,etot,mfin,pfin,wt)

            do i=1,4
               p0(i)=pfin(i,1)
               pb(i)=pfin(i,2)
               pf(i)=pfin(i,3)
               pfb(i)=pfin(i,4)
               p(i)=0.d0
               pw(i)=pf(i)+pfb(i)
               psb(i)=pb(i)+p0(i)
               pt(i)=pw(i)+pb(i)
               pchi(i)=pw(i)+p0(i)
               psto(i)=p0(i)+pfb(i)
               psn(i)=pf(i)+p0(i)
            enddo

            p(4)=etot
            pp=SD_scal(p,p)
            p0pb=SD_scal(p0,pb)
            p0pf=SD_scal(p0,pf)
            p0pfb=SD_scal(p0,pfb)
            p0p=SD_scal(p0,p)
            p0pchi=SD_scal(p0,pchi)
            pbpf=SD_scal(pb,pf)
            pbpfb=SD_scal(pb,pfb)
            pbpchi=SD_scal(pb,pchi)
            ppb=SD_scal(p,pb)
            pfpfb=SD_scal(pf,pfb)
            pp0=SD_scal(p,p0)
            ppb=SD_scal(p,pb)
            ppf=SD_scal(p,pf)
            ppfb=SD_scal(p,pfb)
            pwp0=SD_scal(pw,p0)
            pwpb=SD_scal(pw,pb)
            pwpf=SD_scal(pw,pf)
            pwpfb=SD_scal(pw,pfb)
            pwp=SD_scal(pw,p)
            ptpf=SD_scal(pt,pf)
            ptpfb=SD_scal(pt,pfb)
            ptp0=SD_scal(pt,p0)
            ptpb=SD_scal(pt,pb)
            ptpchi=SD_scal(pt,pchi)
            ptp=SD_scal(pt,p)
            pchipf=SD_scal(pchi,pf)
            pchipfb=SD_scal(pchi,pfb)
            pchipb=SD_scal(pchi,pb)
            pchip=SD_scal(pchi,p)
            psbpsb=SD_scal(psb,psb)
            pwpw=SD_scal(pw,pw)
            ptpt=SD_scal(pt,pt)
            pchipchi=SD_scal(pchi,pchi)
            pstopsto=SD_scal(psto,psto)	
            psnpsn=SD_scal(psn,psn)
            
            Dsb(1)=(psbpsb-asb1**2)
            Dsb(2)=(psbpsb-asb2**2)
            Dt=(ptpt-amt**2)
            Dsto(1)=pstopsto-asl1**2
            Dsto(2)=pstopsto-asl2**2
            Dsel=pstopsto-amselL**2
            Dsn=psnpsn-amsn1**2
            Dsu=psnpsn-amsupL**2
            Dsd=pstopsto-amsdownL**2
            do i=1,2
               Dchi(i)=(pchipchi-amchar(i)**2)
            enddo

            Dw=(pwpw-amwp**2)

c ------------------------- top exchange ----------------------------- c

            a1a1=0.d0

            a=2.d0*g2**3/Dt**2/Dw**2
            pa2=4.d0*ptp0*ptpfb*pbpf-2.d0*ptpt*p0pfb*pbpf
            pb2=2.d0*pbpf*p0pfb
            pab=2.d0*pbpf*ptpfb
            
            a1a1=a*(atop(1,1)**2*pa2+btop(1,1)**2*amt**2*pb2
     .           -2.d0*amneut(1)*amt*atop(1,1)*btop(1,1)*pab)

c ------------------------- sbottom exchange ------------------------- c

            abab=0.d0
            do i=1,2
               do j=1,2
                  a=8.d0*g2**3*AW(1,i)*AW(1,j)/Dsb(i)/Dsb(j)/Dw**2
                  pa2=2.d0*ppf*ppfb-AST1**2*pfpfb
                  pb2=p0pb
                  abab=abab+a*pb2*pa2*(bbo(i,1)*bbo(j,1)+
     .                 abo(i,1)*abo(j,1))
               enddo
            enddo

c --------------------------- chargino exchange ---------------------- c

            achiachi=0.d0
            do i=1,2
               do j=1,2
                  a=4.d0*g2**3/Dw**2/Dchi(i)/Dchi(j)
                  
                  p1=2.d0*p0pf*pchipfb*pchipb+2.d0*p0pfb*pchipf*pchipb
     .                 -pchipchi*pbpfb*p0pf-pchipchi*p0pfb*pbpf
                  p2=pbpfb*p0pf+pbpf*p0pfb
                  p3=pfpfb*pchipb+pbpf*pchipfb-pchipf*pbpfb
                  p4=pfpfb*pchipb+pbpf*pchipfb-pchipf*pbpfb
                  a1=alsto(1,i)*alsto(1,j)*OL(1,i)*OL(1,j)
     .                 +aksto(1,i)*aksto(1,j)*OR(1,i)*OR(1,j)
                  a2=alsto(1,i)*alsto(1,j)*OR(1,i)*OR(1,j)
     .                 +aksto(1,i)*aksto(1,j)*OL(1,i)*OL(1,j)
                  a3=alsto(1,i)*alsto(1,j)*OL(1,i)*OR(1,j)
     .                 +aksto(1,i)*aksto(1,j)*OR(1,i)*OL(1,j)
                  a4=alsto(1,i)*alsto(1,j)*OR(1,i)*OL(1,j)
     .                 +aksto(1,i)*aksto(1,j)*OL(1,i)*OR(1,j)
                  
                  achiachi=achiachi+a*(a1*p1+amchar(i)*amchar(j)*a2*p2
     .                 -xmneut(1)*amchar(j)*a3*p3-xmneut(1)*
     .                 amchar(i)*a4*p4)
               enddo
            enddo

c -------------------------- Interferences --------------------------- c

c ---------------------- interference btilde t ----------------------- c

            atab=0.d0
            do i=1,2
               a=-2.d0*g2**3*aw(1,i)*abo(i,1)/dsqrt(2.d0)/dw**2/
     .           dt/dsb(i)
               a1=atop(1,1)
               a2=btop(1,1)
               p1=ptpfb*p0pb*ppf+ppfb*ptpf*p0pb-pfpfb*ptp*p0pb
     .              -ppf*p0pfb*ptpb-ppfb*p0pf*ptpb+pfpfb*p0p*ptpb
     .              +ppf*pbpfb*ptp0+ppfb*pbpf*ptp0-pfpfb*ppb*ptp0
     .              +ptpf*ppb*p0pfb-ptpf*pbpfb*p0p-p0pf*ppb*ptpfb
     .              +pbpf*p0p*ptpfb+p0p*pbpfb*ptp-ppb*p0pfb*ptp
               p2=pbpfb*ppf+ppfb*pbpf-pfpfb*ppb
               atab=atab+a*(a1*p1-amneut(1)*amt*a2*p2)
            enddo

c ------------------------ interference btilde chi+ ------------------ c

            abachi=0.d0
            
            do i=1,2
               do j=1,2
                  a=4.d0*g2**3*aw(1,i)/dw**2/dsb(i)/dchi(j)
                  a1=abo(i,1)*ol(1,j)*alsto(1,j)+bbo(i,1)*or(1,j)*
     .                 aksto(1,j)
                  a2=bbo(i,1)*ol(1,j)*aksto(1,j)+abo(i,1)*or(1,j)*
     .                 alsto(1,j)
                  p1=p0pb*pchipf*ppfb+pchipfb*p0pb*ppf-pfpfb*pchip*p0pb
     .                 -pbpf*ppfb*p0pchi-pbpfb*p0pchi*ppf+pfpfb*
     .                 p0pchi*ppb
     .                 +pchipb*(p0pf*ppfb+p0pfb*ppf-pfpfb*p0p)
     .                 +p0pf*ppb*pchipfb-p0pf*pbpfb*pchip-pchipf*
     .                 ppb*p0pfb
     .                 +pbpf*pchip*p0pfb+pchipf*pbpfb*p0p-pbpf*
     .                 pchipfb*p0p
                  p2=pbpf*ppfb+pbpfb*ppf-pfpfb*ppb
                  abachi=abachi+a*(a1*p1+amneut(1)*amchar(j)*a2*p2)
               enddo
            enddo

c -------------------------- interference chi+ t --------------------- c

            achiat=0.d0
            do i=1,2
               a=-2.d0*g2**3/dsqrt(2.d0)/dw**2/dt/dchi(i)
               a1=atop(1,1)*ol(1,i)*alsto(1,i)
               a2=atop(1,1)*or(1,i)*alsto(1,i)
               a3=btop(1,1)*ol(1,i)*alsto(1,i)
               a4=btop(1,1)*or(1,i)*alsto(1,i)
               p1=+2.d0*pfpfb*pbpchi*ptp0
     .              -2.d0*p0pchi*(pbpf*ptpfb+pbpfb*ptpf-ptpb*pfpfb)
     .              -2.d0*ptpb*(pchipf*p0pfb+pchipfb*p0pf)
     .              +2.d0*p0pb*(ptpf*pchipfb+ptpfb*pchipf-pfpfb*ptpchi)
     .              +2.d0*ptpchi*(pbpf*p0pfb+pbpfb*p0pf)
     .              +2.d0*(+pbpf*pchipfb*ptp0+p0pf*pchipb*ptpfb
     .              -pchipf*pbpfb*ptp0)
               p2=4.d0*(pbpfb*ptpf)
               p3=2.d0*(pchipb*pfpfb+pbpfb*pchipf-pchipfb*pbpf)
               p4=4.d0*(pbpfb*p0pf)
               achiat=achiat+a*(a1*p1+amchar(i)*amneut(1)*a2*p2
     .              +amneut(1)*amt*a3*p3-amchar(i)*amt*a4*p4)
            enddo

c --------------------- interference stau bottom --------------------- c

            astoasb=0.d0
            pa=(pbpf*ppfb-ppb*pfpfb+pbpfb*ppf)
            
            do i=1,2
               do j=1,2
                  do m=1,2
                     astoasb=astoasb+2.d0*g2**3*
     .                    dsqrt(2.d0)*aw(1,m)*abo(m,1)*ato(j,1)*
     .                    alsto(1,i)*alto(j,i)
     .                    *amchar(i)*amneut(1)/(dw*dchi(i)*dsto(j)*
     .                    dsb(m))*pa
                  enddo
               enddo
            enddo

c ---------------------- interference stau top ----------------------- c

            astoato=0.d0

            do i=1,2
               do j=1,2
                  a1=btop(1,1)*amt
                  a2=atop(1,1)*amneut(1)
                  p1=pbpf*p0pfb
                  p2=pbpf*ptpfb
                  astoato=astoato-4.d0*g2**3*ato(j,1)*alsto(1,i)*
     .                 alto(j,i)
     .                 *amchar(i)/(dw*dt*dchi(i)*dsto(j))*(a1*p1-a2*p2)
               enddo
            enddo

c -------------------------- interference stau chi ------------------- c

	astoachi=0.d0

	do i=1,2
           do j=1,2
              do m=1,2
                 a1=amneut(1)*ol(1,i)
                 a2=amchar(i)*or(1,i)
                 p1=pbpf*pchipfb-pbpfb*pchipf+pbpchi*pfpfb
                 p2=pbpf*p0pfb
                 astoachi=astoachi+4.d0*g2**3*alsto(1,i)*ato(m,1)*
     .                alsto(1,j)
     .                *alto(m,j)*amchar(j)/(dsqrt(2.d0)*dw*dsto(m)*
     .                dchi(i)*dchi(j))
     .                *(a1*p1-2.d0*a2*p2)
              enddo
           enddo
	enddo

c -------------------- interference sneutrino sbottom ---------------- c

	asnasbo=0.d0

	p1=ppb*pchipfb*p0pf - pbpfb*pchip*p0pf +
     .       ppb*p0pchi*pfpfb - p0pb*pchip*pfpfb - pbpfb*p0pchi*ppf +
     .       p0pb*pchipfb*ppf - ppb*pchipf*p0pfb + pbpf*pchip*p0pfb +
     .       pchipb*ppf*p0pfb + pbpfb*pchipf*p0p - pbpf*pchipfb*p0p - 
     .       pchipb*pfpfb*p0p + p0pb*pchipf*ppfb - pbpf*p0pchi*ppfb + 
     .       pchipb*p0pf*ppfb

	do i=1,2
           do j=1,2
              asnasbo=asnasbo-dsqrt(2.d0)*g2**3*alsto(1,i)*asnl*aw(1,j)
     .             *abo(j,1)*alsneu(i)/(dsb(j)*dw*dsn*dchi(i))*2.d0*p1
           enddo
	enddo

c ------------------------ interference sneutrino top ---------------- c

	asnatop=0.d0

	do i=1,2
           a1=btop(1,1)*amneut(1)*amt
           a2=atop(1,1)
           p1=pbpf*pchipfb-pbpfb*pchipf+pchipb*pfpfb
           p2=pbpfb*ptpchi*p0pf - ptpb*pchipfb*p0pf - pbpfb*p0pchi*ptpf
     .          + p0pb*pchipfb*ptpf+ptpb*p0pchi*pfpfb-p0pb*ptpchi*pfpfb 
     .          + pbpfb*pchipf*ptp0-pbpf*pchipfb*ptp0-pchipb*pfpfb*ptp0
     .          - ptpb*pchipf*p0pfb+pbpf*ptpchi*p0pfb+pchipb*ptpf*p0pfb
     .          + p0pb*pchipf*ptpfb-pbpf*p0pchi*ptpfb-pchipb*p0pf*ptpfb
           asnatop=asnatop-2.d0*g2**3*alsto(1,i)*alsneu(i)*asnl/
     .          (dw*dt*dchi(i)*dsn)*(a1*p1+a2*p2)
	enddo

c ----------------------- interference sneutrino chi ----------------- c

	asnachi=0.d0
	do i=1,2
           do j=1,2
              asnachi=asnachi+4.d0*g2**3*alsto(1,i)*alsto(1,j)*alsneu(j)
     .             *asnl/
     .             (dsqrt(2.d0)*dchi(i)*dw*dchi(j)*dsn)*
     .             (amchar(i)*amneut(1)*or(1,i)*(pbpfb*pchipf-pbpf*
     .             pchipfb)
     .             -2.d0*ol(1,i)*pchipchi*pbpfb*p0pf+4.d0*ol(1,i)*
     .             pchipb*pchipfb
     .             *p0pf-amchar(i)*amneut(1)*or(1,i)*pchipb*pfpfb)
           enddo
	enddo

c ------------------- interference selectron sbottom ----------------- c

	aeasb=0.d0
	pa=(pbpf*ppfb-ppb*pfpfb+pbpfb*ppf)
        
	do i=1,2
           do m=1,2
              aeasb=aeasb+2.d0*g2**3*
     .             dsqrt(2.d0)*aw(1,m)*abo(m,1)*ale4bod(2,1)*
     .             alsto(1,i)*ale4bod(2,i)
     .             *amchar(i)*amneut(1)/(dw*dchi(i)*dsel*dsb(m))*pa
           enddo
	enddo

c -------------------- interference selectron top -------------------- c

	aeatop=0.d0

	do i=1,2
           a1=btop(1,1)*amt
           a2=atop(1,1)*amneut(1)
           p1=pbpf*p0pfb
           p2=pbpf*ptpfb
           aeatop=aeatop-4.d0*g2**3*ale4bod(2,1)*alsto(1,i)*ale4bod(2,i)
     .          *amchar(i)/(DW*Dt*Dchi(i)*Dsel)*(a1*p1-a2*p2)
	enddo
        
c --------------------- interference selectron chi ------------------- c

	aeachi=0.d0

	do i=1,2
           do j=1,2
              a1=amneut(1)*ol(1,i)
              a2=amchar(i)*or(1,i)
              p1=pbpf*pchipfb-pbpfb*pchipf+pbpchi*pfpfb
              p2=pbpf*p0pfb
              aeachi=aeachi+4.d0*g2**3*alsto(1,i)*ale4bod(2,1)*
     .             alsto(1,j)
     .             *ale4bod(2,j)*amchar(j)/(dsqrt(2.d0)*DW*Dsel*
     .             Dchi(i)*Dchi(j))
     .             *(a1*p1-2.d0*a2*p2)
           enddo
	enddo

c ------------------ interference sneutrino_el sbottom --------------- c

	asneasbo=0.d0

	p1=ppb*pchipfb*p0pf - pbpfb*pchip*p0pf +
     .       ppb*p0pchi*pfpfb - p0pb*pchip*pfpfb - pbpfb*p0pchi*ppf +
     .       p0pb*pchipfb*ppf - ppb*pchipf*p0pfb + pbpf*pchip*p0pfb +
     .       pchipb*ppf*p0pfb + pbpfb*pchipf*p0p - pbpf*pchipfb*p0p - 
     .       pchipb*pfpfb*p0p + p0pb*pchipf*ppfb - pbpf*p0pchi*ppfb + 
     .       pchipb*p0pf*ppfb
        
	do i=1,2
           do j=1,2
              asneasbo=asneasbo-dsqrt(2.d0)*g2**3*alsto(1,i)*asnl*
     .             aw(1,j)
     .             *abo(j,1)*alsneu(i)/(dsb(j)*dw*dsn*dchi(i))*2.d0*p1
           enddo
	enddo

c ------------------- interference sneutrino_el top ------------------ c

	asneatop=0.d0

	do i=1,2
           a1=btop(1,1)*amneut(1)*amt
           a2=atop(1,1)
           p1=pbpf*pchipfb-pbpfb*pchipf+pchipb*pfpfb
           p2=pbpfb*ptpchi*p0pf - ptpb*pchipfb*p0pf - pbpfb*p0pchi*ptpf
     .          + p0pb*pchipfb*ptpf+ptpb*p0pchi*pfpfb-p0pb*ptpchi*pfpfb 
     .          + pbpfb*pchipf*ptp0-pbpf*pchipfb*ptp0-pchipb*pfpfb*ptp0
     .          - ptpb*pchipf*p0pfb+pbpf*ptpchi*p0pfb+pchipb*ptpf*p0pfb
     .          + p0pb*pchipf*ptpfb-pbpf*p0pchi*ptpfb-pchipb*p0pf*ptpfb
           asneatop=asneatop-2.d0*g2**3*alsto(1,i)*alsneu(i)*asnl/
     .          (dw*dt*dchi(i)*dsn)*(a1*p1+a2*p2)
	enddo

c --------------------- interference sneutrino_el chi ---------------- c

	asneachi=0.d0
	do i=1,2
           do j=1,2
              asneachi=asneachi+4.d0*g2**3*alsto(1,i)*alsto(1,j)*
     .             alsneu(j)*asnl/
     .             (dsqrt(2.d0)*dchi(i)*dw*dchi(j)*dsn)*
     .             (amchar(i)*amneut(1)*or(1,i)*(pbpfb*pchipf-
     .             pbpf*pchipfb)
     .             -2.d0*ol(1,i)*pchipchi*pbpfb*p0pf+4.d0*ol(1,i)*
     .             pchipb*pchipfb
     .             *p0pf-amchar(i)*amneut(1)*or(1,i)*pchipb*pfpfb)
           enddo
	enddo

c ----------------------- interference sdown sbottom ----------------- c

	asdasb=0.d0
	pa=(pbpf*ppfb-ppb*pfpfb+pbpfb*ppf)

	do i=1,2
           do m=1,2
              asdasb=asdasb+2.d0*g2**3*
     .             dsqrt(2.d0)*aw(1,m)*abo(m,1)*ado4bod(2,1)*
     .             alsto(1,i)*aldo4bod(2,i)
     .             *amchar(i)*amneut(1)/(dw*dchi(i)*dsd*dsb(m))*pa
           enddo
	enddo

c ------------------------ interference sdown top -------------------- c

	asdatop=0.d0

	do i=1,2
           a1=btop(1,1)*amt
           a2=atop(1,1)*amneut(1)
           p1=pbpf*p0pfb
           p2=pbpf*ptpfb
           asdatop=asdatop-4.d0*g2**3*ado4bod(2,1)*alsto(1,i)*
     .          aldo4bod(2,i)
     .          *amchar(i)/(DW*Dt*Dchi(i)*Dsd)*(a1*p1-a2*p2)
	enddo

c ------------------------- interference sdown chi ------------------- c

	asdachi=0.d0

	do i=1,2
           do j=1,2
              a1=amneut(1)*ol(1,i)
              a2=amchar(i)*or(1,i)
              p1=pbpf*pchipfb-pbpfb*pchipf+pbpchi*pfpfb
              p2=pbpf*p0pfb
              asdachi=asdachi+4.d0*g2**3*alsto(1,i)*ado4bod(2,1)*
     .             alsto(1,j)
     .             *aldo4bod(2,j)*amchar(j)/(dsqrt(2.d0)*dw*dsd*
     .             dchi(i)*dchi(j))
     .             *(a1*p1-2.d0*a2*p2)
           enddo
	enddo

c ----------------------- interference sup sbottom ------------------- c

	asuasbo=0.d0

	p1=ppb*pchipfb*p0pf - pbpfb*pchip*p0pf +
     .       ppb*p0pchi*pfpfb - p0pb*pchip*pfpfb - pbpfb*p0pchi*ppf +
     .       p0pb*pchipfb*ppf - ppb*pchipf*p0pfb + pbpf*pchip*p0pfb +
     .       pchipb*ppf*p0pfb + pbpfb*pchipf*p0p - pbpf*pchipfb*p0p - 
     .       pchipb*pfpfb*p0p + p0pb*pchipf*ppfb - pbpf*p0pchi*ppfb + 
     .       pchipb*p0pf*ppfb
        
	do i=1,2
           do j=1,2
              asuasbo=asuasbo-dsqrt(2.d0)*g2**3*alsto(1,i)
     .             *aup4bod(2,1)*aw(1,j)
     .             *abo(j,1)*alup4bod(2,i)/(dsb(j)*dw*dsu*dchi(i))*
     .             2.d0*p1
           enddo
	enddo

c ------------------------ interference sup top ---------------------- c

	asuatop=0.d0

	do i=1,2
           a1=btop(1,1)*amneut(1)*amt
           a2=atop(1,1)
           p1=pbpf*pchipfb-pbpfb*pchipf+pchipb*pfpfb
           p2=pbpfb*ptpchi*p0pf - ptpb*pchipfb*p0pf - pbpfb*p0pchi*ptpf
     .          + p0pb*pchipfb*ptpf+ptpb*p0pchi*pfpfb-p0pb*ptpchi*pfpfb 
     .          + pbpfb*pchipf*ptp0-pbpf*pchipfb*ptp0-pchipb*pfpfb*ptp0
     .          - ptpb*pchipf*p0pfb+pbpf*ptpchi*p0pfb+pchipb*ptpf*p0pfb
     .          + p0pb*pchipf*ptpfb-pbpf*p0pchi*ptpfb-pchipb*p0pf*ptpfb
           asuatop=asuatop-2.d0*g2**3*alsto(1,i)*alup4bod(2,i)
     .          *aup4bod(2,1)/
     .          (dw*dt*dchi(i)*dsu)*(a1*p1+a2*p2)
	enddo

c ------------------------- interference sup chi --------------------- c

	asuachi=0.d0
	do i=1,2
           do j=1,2
              asuachi=asuachi+4.d0*g2**3*alsto(1,i)*alsto(1,j)
     .             *alup4bod(2,j)*aup4bod(2,1)/
     .             (dsqrt(2.d0)*Dchi(i)*DW*Dchi(j)*Dsu)*
     .             (amchar(i)*amneut(1)*or(1,i)*(pbpfb*pchipf-
     .             pbpf*pchipfb)
     .             -2.d0*ol(1,i)*pchipchi*pbpfb*p0pf+4.d0*ol(1,i)*
     .             pchipb*pchipfb
     .             *p0pf-amchar(i)*amneut(1)*or(1,i)*pchipb*pfpfb)
           enddo
	enddo

c -------------------------------- result ---------------------------- c
	
	atotatot=a1a1+achiachi+abab+2.d0*achiat+2.d0*atab+2.d0*abachi
	ainterainter=+(astoasb+astoato+
     .                 astoachi+asnasbo+asnatop+asnachi)	
	aewaew=atotatot+2*(aeasb+aeatop+aeachi+asneasbo+asneatop+
     .                     asneachi)
	asuwasuw=atotatot+2*(asdasb+asdatop+asdachi
     .                       +asuasbo+asuatop+asuachi)
        
	resuw=resuw+wt*atotatot/irunw
	resuinter=resuinter+ainterainter/irunw*wt
	resuew=resuew+wt*aewaew/irunw
	resusuw=resusuw+asuwasuw/irunw*wt	
      enddo

      sigmaw=resuw/2.d0/ast1/(2.d0*pi)**8
      ainter=resuinter/2.d0/ast1/(2.d0*pi)**8
      sigmaew=resuew/2.d0/ast1/(2.d0*pi)**8
      sigmasuw=resusuw/2.d0/ast1/(2.d0*pi)**8
      sigmae=sigmaesn+sigmaew
      sigmaq=sigmasusd+sigmasuw

      a1a1=0.d0

      a=2.d0*g2**3/dt**2/dw**2
      pa2=4.d0*ptp0*ptpfb*pbpf-2.d0*ptpt*p0pfb*pbpf
      pb2=2.d0*pbpf*p0pfb
      pab=2.d0*pbpf*ptpfb

      a1a1=a*(atop(1,1)**2*pa2+btop(1,1)**2*amt**2*pb2
     .     -2.d0*amneut(1)*amt*atop(1,1)*btop(1,1)*pab)

      else
         sigmaw=0.d0
         ainter=0.d0
         sigmae=0.d0
         sigmaq=0.d0
      endif

c ---------------------------- Higgs exchange ------------------------ c

      if (ast1.gt.amneut(1)) then

         mfin(1)=amneut(1)
         mfin(2)=0.d0
         mfin(3)=0.d0
         mfin(4)=0.d0
         resuh=0.d0
         irun=15000
         do j=1,irun
            call SD_rambo(4,etot,mfin,pfin,wt)
            do i=1,4
               p0(i)=pfin(i,1)
               pb(i)=pfin(i,2)
               pf(i)=pfin(i,3)
               pfb(i)=pfin(i,4)
               p(i)=0.d0
               pw(i)=pf(i)+pfb(i)
               psb(i)=pb(i)+p0(i)
               pt(i)=pw(i)+pb(i)
               pchi(i)=pw(i)+p0(i)
               psto(i)=p0(i)+pfb(i)
            enddo
            p(4)=etot
            pp=SD_scal(p,p)
            p0pb=SD_scal(p0,pb)
            p0pf=SD_scal(p0,pf)
            p0pfb=SD_scal(p0,pfb)
            p0pt=SD_scal(p0,pt)
            p0pchi=SD_scal(p0,pchi)
            pbpf=SD_scal(pb,pf)
            pbpfb=SD_scal(pb,pfb)
            pbpt=SD_scal(pb,pt)
            pbpchi=SD_scal(pb,pchi)
            pfpfb=SD_scal(pf,pfb)
            pp0=SD_scal(p,p0)
            ppb=SD_scal(p,pb)
            ppf=SD_scal(p,pf)
            ppfb=SD_scal(p,pfb)
            pwp0=SD_scal(pw,p0)
            pwpb=SD_scal(pw,pb)
            pwpf=SD_scal(pw,pf)
            pwpfb=SD_scal(pw,pfb)
            pwp=SD_scal(pw,p)
            ptp0=SD_scal(pt,p0)
            ptpb=SD_scal(pt,pb)
            ptpchi=SD_scal(pt,pchi)
            pchipb=SD_scal(pchi,pb)
            psbpsb=SD_scal(psb,psb)
            pwpw=SD_scal(pw,pw)
            ptpt=SD_scal(pt,pt)
            pchipchi=SD_scal(pchi,pchi)
            pstopsto=SD_scal(psto,psto)	
            
            dsb(1)=(psbpsb-asb1**2)
            dsb(2)=(psbpsb-asb2**2)
            dt=(ptpt-amt**2)
            do i=1,2
               dchi(i)=(pchipchi-amchar(i)**2)
            enddo
            dhiggs=(pwpw-amch**2)

c -------------------------- top exchange ---------------------------- c

            a=g2**3*amt**2*amtau**2*pfpfb/amw**4/dhiggs**2/dt**2
            a1=btop(1,1)**2
            a2=btop(1,1)*atop(1,1)
            a3=atop(1,1)**2
            p1=2.d0*ptpb*ptp0-ptpt*p0pb
            p2=ptpb
            p3=p0pb
            
            ahtaht=a*(a1*p1-2.d0*amt*amneut(1)*a2*p2+amt**2*a3*p3)     

c ------------------------- sbottom exchange ------------------------- c

            ahbahb=0.d0
            do i=1,2
               do k=1,2
                  a=2.d0*chctb(1,i)*chctb(1,k)*amtau**2*dtan(bet)**2
     .                 /amw**2/dsb(i)/dsb(k)/dhiggs**2
                  
                  a1=bbo(i,1)*bbo(k,1)+abo(i,1)*abo(k,1)
                  ahbahb=ahbahb+a*a1*pfpfb*p0pb                  
               enddo
            enddo

c --------------------------- chi exchange --------------------------- c

            ahchiahchi=0.d0
            do i=1,2
               do k=1,2
                  
                  a=4.d0*pfpfb*g2**3*amtau**2*dtan(bet)**2
     .                 /2.d0/amw**2/dchi(i)/dchi(k)/dhiggs**2
                  a1=alsto(1,i)*alsto(1,k)*ql(1,i)*qr(1,k)
     .                 +aksto(1,i)*aksto(1,k)*qr(1,i)*qr(1,k)
                  a2=alsto(1,i)*alsto(1,k)*qr(1,i)*ql(1,k)
     .                 +aksto(1,i)*aksto(1,k)*ql(1,i)*qr(1,k)
                  a3=alsto(1,i)*alsto(1,k)*qr(1,i)*qr(1,k)
     .                 +aksto(1,i)*aksto(1,k)*ql(1,i)*ql(1,k)
                  a4=alsto(1,i)*alsto(1,k)*ql(1,i)*qr(1,k)
     .                 +aksto(1,i)*aksto(1,k)*qr(1,i)*ql(1,k)
                  p1=pchipb*p0pchi-p0pb*pchipchi+pchipb*p0pchi
                  p2=pchipb
                  p3=p0pb
                  p4=pchipb
                  ahchiahchi=ahchiahchi+a*(a1*p1+amchar(i)*amneut(1)*
     .                 a2*p2+
     .                 amchar(i)*amchar(k)*a3*p3+amneut(1)*amchar(k)*
     .                 a4*p4)	
               enddo
            enddo

c ---------------------- interference top sbottom -------------------- c

            ahtahb=0.d0
            do i=1,2
               a=2.d0*g2**6*amt*amtau*abo(i,1)*pfpfb
     .              /amw**3/dsqrt(2.d0)/dt/dhiggs**2/dsb(i)
               a1=atop(1,1)
               a2=btop(1,1)
               p1=p0pb
               p2=ptpb
               ahtahb=ahtahb-a*(a1*amt*p1-amneut(1)*a2*p2)	
            enddo

c ---------------------- interference sbottom chi -------------------- c

            ahbahchi=0.d0
            do i=1,2
               do k=1,2
                  a=2.d0*g2**3*amtau**2*dtan(bet)**2*chctb(1,i)*pfpfb
     .                 /amw**2/dhiggs**2/dchi(i)/dchi(k)
                  a1=alsto(1,k)*ql(1,k)*abo(i,1)+aksto(1,k)*qr(1,k)*
     .                 bbo(i,1)
                  a2=alsto(1,k)*qr(1,k)*abo(i,1)+aksto(1,k)*ql(1,k)*
     .                 bbo(i,1)
                  p1=pchipb
                  p2=p0pb
                  ahbahchi=ahbahchi-a*(amneut(1)*a1*p1+amchar(k)*a2*p2)
               enddo
            enddo

c ----------------------- interference top chi ----------------------- c

            achiat=0.d0
            do i=1,2
               a=2.d0*g2**3*amtau**2*amt*dtan(bet)*alsto(1,i)*pfpfb
     .              /dsqrt(2.d0)/amw**3/dchi(i)/dt/dhiggs**2
               a1=ql(1,i)*bbo(1,1)
               a2=ql(1,i)*abo(1,1)
               a3=qr(1,i)*abo(1,1)
               a4=qr(1,i)*bbo(1,1)
               p1=pchipb*ptp0-p0pb*ptpchi+ptpb*p0pchi
               p2=pchipb
               p3=p0pb
               p4=ptpb
               achiat=a*(a1*p1-amchar(i)*amt*a2*p2-amchar(i)*amt*a3*p3
     .              +amneut(1)*amchar(i)*a4*p4)
            enddo
            
            atotatot=ahtaht+ahbahb+2.d0*ahtahb
            resuh=resuh+wt*atotatot/irun
            sigmah=resuh/2.d0/ast1/(2.d0*pi)**8
         enddo
      else 
         sigmah=0.d0
      endif
      
      end

c -------------------------------------------------------------------- c
c In case a spectrum file in the SUSY Les Houches Accord is read in    c
c this routine is called in order to initialize SD_runm for a first    c
c time. SD_runm then gives mbpole calculated from mb(mb)_MSbar         c
c -------------------------------------------------------------------- c

      subroutine SD_runmbmb(amzp,runmbz)

      implicit double precision (a-h,m,o-z)

      COMMON/SD_mbpoleflag/idrmbpole
      COMMON/SD_fermion/amt0,amb0,amtau0
      COMMON/SD_strangecharm/amsb,amc0
      COMMON/SD_als/xlambda,amc,amb,amt,n0
      COMMON/SD_runcoupscale/scalechoice,scaleofcoupling,inumloop
      COMMON/SD_coupewsb/alsew,g2ew,g1ew
      COMMON/SD_refscale/amuref
c
      COMMON/SD_outparam/salpha_MS,alphasmzms

      pi = 4.D0*datan(1.D0) 

      amc = amc0
      amb = amb0
      amt = amt0

      idrmbpole = 0

c -- calculate alpha_S^MSbar --
      alsewsb = alphasmzms
      amewsb  = amzp

      if(amewsb.ge.amt0) then
         n0 = 6
      else
         n0 = 5
      endif
      acc  = 1.d-10
      loop = inumloop

      xlambda = SD_xitla(amewsb,n0,loop,alsewsb,acc)
      call SD_alsini(acc)

c -- call SD_runm in order to calculate mb_pole --
      runmbz = SD_runm(amzp,5)

      end

c -------------------------------------------------------------------- c
      SUBROUTINE SD_RAMBO(N,ET,XM,P,WT)
C -------------------------------------------------------------------- C
C
C                       RAMBO
C
C    RA(NDOM)  M(OMENTA)  B(EAUTIFULLY)  O(RGANIZED)
C
C    A DEMOCRATIC MULTI-PARTICLE PHASE SPACE GENERATOR
C    AUTHORS@D  S.D. ELLIS,  R. KLEISS,  W.J. STIRLING
C    THIS IS VERSION 1.0 -  WRITTEN BY R. KLEISS
C
C    N  = NUMBER OF PARTICLES (>1, IN THIS VERSION <101)
C    ET = TOTAL CENTRE-OF-MASS ENERGY
C    XM = PARTICLE MASSES ( DIM=100 )
C    P  = PARTICLE MOMENTA ( DIM=(4,100) )
C    WT = WEIGHT OF THE EVENT
C
C -------------------------------------------------------------------- C
      IMPLICIT DOUBLE PRECISION(A-H,O-Z)
      DIMENSION XM(100),P(4,100),Q(4,100),Z(100),R(4),
     .     B(3),P2(100),XM2(100),E(100),V(100),IWARN(5)
      DATA ACC/1.D-14/,ITMAX/6/,IBEGIN/0/,IWARN/5*0/

C LA LIGNE SUIVANTE A ETE AJOUTEE POUR QUE LA SOUS-ROUTINE
C RAMBO N'OUBLIT PAS CES VARIABLES: Z, TWOPI, PO2LOG.
C "ELLE EST NECESSAIRE POUR LE 'LPSHPD'."          
          SAVE TWOPI

C
C INITIALIZATION STEP@D FACTORIALS FOR THE PHASE SPACE WEIGHT
	      IF(IBEGIN.NE.0) GOTO 103
	      IBEGIN=1
	      TWOPI=8.*DATAN(1.D0)
	      PO2LOG=DLOG(TWOPI/4.)
	      Z(2)=PO2LOG
	      DO 101 K=3,100
 101          Z(K)=Z(K-1)+PO2LOG-2.*DLOG(DFLOAT(K-2))
	      DO 102 K=3,100
 102          Z(K)=(Z(K)-DLOG(DFLOAT(K-1)))
C
C CHECK ON THE NUMBER OF PARTICLES
 103          IF(N.GT.1.AND.N.LT.101) GOTO 104
	      PRINT 1001,N
	      STOP
C
C CHECK WHETHER TOTAL ENERGY IS SUFFICIENT. COUNT NONZERO MASSES
 104          XMT=0.
	      NM=0
	      DO 105 I=1,N
	      IF(XM(I).NE.0.D0) NM=NM+1
 105          XMT=XMT+DABS(XM(I))
	      IF(XMT.LE.ET) GOTO 201
	      PRINT 1002,XMT,ET
	      STOP

C
C THE PARAMETER VALUES ARE NOW ACCEPTED
C
C GENERATE N MASSLESS MOMENTA IN INFINITE PHASE SPACE
 201          DO 202 I=1,N
	      C=2.*SD_RN(1)-1.
c	write(*,*)'µµµµµµµµµµRN(1)',RN(1),RN(2),RN(3),RN(4)
	      S=DSQRT(1.-C*C)
	      F=TWOPI*SD_RN(2)
	      Q(4,I)=-DLOG(SD_RN(3)*SD_RN(4))
	      Q(3,I)=Q(4,I)*C
	      Q(2,I)=Q(4,I)*S*DCOS(F)
 202          Q(1,I)=Q(4,I)*S*DSIN(F)
C
C CALCULATE THE PARAMETERS OF THE CONFORMAL TRANSFORMATION
	      DO 203 I=1,4
 203          R(I)=0.
	      DO 204 I=1,N
	      DO 204 K=1,4
 204          R(K)=R(K)+Q(K,I)
	      RMAS=DSQRT(R(4)**2-R(3)**2-R(2)**2-R(1)**2)
c	write(*,*)"Proutbou", R(4)**2-R(3)**2-R(2)**2-R(1)**2,
c     .R(4)**2,R(3)**2,R(2)**2,R(1)**2
	      DO 205 K=1,3
 205          B(K)=-R(K)/RMAS
	      G=R(4)/RMAS
	      A=1./(1.+G)
	      X=ET/RMAS
c	write(*,*)'X',X,ET,RMAS
C
C TRANSFORM THE Q'S CONFORMALLY INTO THE P'S
	      DO 207 I=1,N
c	write(*,*)'P(K,I)1',P(4,1)
	      BQ=B(1)*Q(1,I)+B(2)*Q(2,I)+B(3)*Q(3,I)
	      DO 206 K=1,3
c	      write(*,*)'*****ET*****',ET
 206          P(K,I)=X*(Q(K,I)+B(K)*(Q(4,I)+A*BQ))
c	write(*,*)'P2(I)2',P(4,I),X,Q(4,I),B(3),A,BQ
 207          P(4,I)=X*(G*Q(4,I)+BQ)
C
C CALCULATE WEIGHT AND POSSIBLE WARNINGS
	      WT=DLOG(TWOPI/4.)
c	write(*,*)'*********wt1*********',WT,PO2LOG,
c     .TWOPI/4.,DLOG(TWOPI/4.)
	      IF(N.NE.2) WT=(2.*N-4.)*DLOG(ET)+Z(N)
c	write(*,*)'*********wt2*********',WT
	      IF(WT.GE.-180.D0) GOTO 208
	      IF(IWARN(1).LE.5) PRINT 1004,WT
	      IWARN(1)=IWARN(1)+1
 208           IF(WT.LE. 174.D0) GOTO 209
	      IF(IWARN(2).LE.5) PRINT 1005,WT
c	write(*,*)"PROUTRAMBO",WT
	      IWARN(2)=IWARN(2)+1

C
C RETURN FOR WEIGHTED MASSLESS MOMENTA
 209          IF(NM.NE.0) GOTO 210
	      WT=DEXP(WT)
	      RETURN
C
C MASSIVE PARTICLES@D RESCALE THE MOMENTA BY A FACTOR X
	    
 210          XMAX=DSQRT(1.-(XMT/ET)**2)
	      DO 301 I=1,N
	      XM2(I)=XM(I)**2
 301          P2(I)=P(4,I)**2
c	write(*,*)'P2(I)3',P2(1)
	      ITER=0
	      X=XMAX
	      ACCU=ET*ACC
c	write(*,*)'X1',X
c	write(*,*)'*****ACCU*****',ACCU
 302          F0=-ET
c	write(*,*)'X2',X
	      G0=0.D0
c	write(*,*)'X3',X
	      X2=X*X
c	write(*,*)'XMAX',XMAX,XMT,ET,X
c	write(*,*)'=XM(I)',XM2(1),X2,P2(1)
	      DO 303 I=1,N
c	write(*,*)'*****F01*****',F0,ET
	      E(I)=DSQRT(XM2(I)+X2*P2(I))
	      F0=F0+E(I)
c	write(*,*)'E(I)',E(1),E(2)
 303          G0=G0+P2(I)/E(I)
	      IF(DABS(F0).LE.ACCU) GOTO 305
	      ITER=ITER+1
	      IF(ITER.LE.ITMAX) GOTO 304
	      PRINT 1006,ITMAX
	      GOTO 305
 304          X=X-F0/(X*G0)
	      GOTO 302
 305          DO 307 I=1,N
	      V(I)=X*P(4,I)
	      DO 306 K=1,3
 306          P(K,I)=X*P(K,I)
 307          P(4,I)=E(I)
C
C CALCULATE THE MASS-EFFECT WEIGHT FACTOR
	      WT2=1.
	      WT3=0.
	      DO 308 I=1,N
	      WT2=WT2*V(I)/E(I)
 308          WT3=WT3+V(I)**2/E(I)
	      WTM=(2.*N-3.)*DLOG(X)+DLOG(WT2/WT3*ET)
C
C RETURN FOR  WEIGHTED MASSIVE MOMENTA
	      WT=WT+WTM
	      IF(WT.GE.-180.D0) GOTO 309
	      IF(IWARN(3).LE.5) PRINT 1004,WT
	      IWARN(3)=IWARN(3)+1
 309           IF(WT.LE. 174.D0) GOTO 310
	      IF(IWARN(4).LE.5) PRINT 1005,WT
	      IWARN(4)=IWARN(4)+1
 310          WT=DEXP(WT)
	      RETURN
C
 1001         FORMAT(' RAMBO FAILS@D # OF PARTICLES =',I5,
     . ' IS NOT ALLOWED')
 1002         FORMAT(' RAMBO FAILS@D TOTAL MASS =',D15.6,' IS NOT',
     .		 ' SMALLER THAN TOTAL ENERGY =',D15.6)
 1004         FORMAT(' RAMBO WARNS@D WEIGHT = EXP(',F20.9,
     . ') MAY UNDERFLOW')
 1005	      FORMAT(' RAMBO WARNS@D WEIGHT = EXP(',F20.9,
     . ') MAY  OVERFLOW')
 1006         FORMAT(' RAMBO WARNS@D',I3,' ITERATIONS DID NOT GIVE THE',
     . 		 ' DESIRED ACCURACY =',D15.6)
	      END
 
 
C -------------------------------------------------------------------- C
 
      DOUBLE PRECISION FUNCTION SD_RN(IDMY)
 
C  CAN BE REPLACED BY ANY RANDOM NUMBER GENERATOR !!
 
C   1 IDMY=IDMY
C     RN=DRANF()
C     IF(RN.NE.0.) RETURN
C     PRINT 2,I,C,J,RN
C   2 FORMAT(' RN WARNING: WRONG VALUE OCCURED'/,
C    .     'I,C,J,RN :',I15,D15.6,I15,D15.6)
C     GOTO 1
 
c    1 IDMY=IDMY
	      SD_RN=DBLE(SD_UNIV(IDMY))
	      RETURN
	      END
c 
c PPT16340
 
	        FUNCTION SD_UNIV(IDMY)
	 
C----------------------------------------------------------------------
C  A UNIVERSAL RANDOM NUMBER GENERATOR
 
	        REAL U(97)
	        COMMON /SET1/ U,C,CD,CM,I,J
	        SD_UNIV=U(I)-U(J)
	        IF(SD_UNIV.LT.0.) SD_UNIV=SD_UNIV+1.
	        U(I)=SD_UNIV
	        I=I-1
	        IF(I.EQ.0) I=97
	        J=J-1
	        IF(J.EQ.0) J=97
	        C=C-CD
	        IF(C.LT.0.) C=C+CM
	        SD_UNIV=SD_UNIV-C
	        IF(SD_UNIV.LT.0.) SD_UNIV=SD_UNIV+1
	        RETURN
	        END
	 
	        SUBROUTINE SD_RSTART(I,J,K,L)
 
C----------------------------------------------------------------------
C INITIALIZING THE RANDOM NUMBER GENERATOR
C TO INITIALIZE CALL RSTART(12,34,56,78)
 
	        REAL U(97)
	        COMMON /SET1/ U,C,CD,CM,ISTART,JSTART
	
		IP=I
		JP=J
		KP=K
		LP=L
	
	        IF ((IP.LT.0).OR.(IP.GT.178 )) STOP 
     &		    'FIRST SEED .LT.0 OR .GT.178'
	        IF ((JP.LT.0).OR.(JP.GT.178 )) STOP 
     &		    'SECOND SEED .LT.0 OR .GT.178'
	        IF ((KP.LT.0).OR.(KP.GT.178 )) STOP 
     &  	    'THIRD SEED .LT.0 OR .GT.178'
	        IF ((LP.LT.0).OR.(LP.GT.168 )) STOP 
     &  	    'FOURTH SEED .LT.0 OR .GT.168'
	        IF ( (IP.EQ.1).AND.(JP.EQ.1).AND.(KP.EQ.1) ) STOP
     &  	    'FIRST, SECOND AND THIRD SEEDS ARE ALL EQUAL TO 1'
	        ISTART=97
	        JSTART=33
	        DO 2 II=1,97
	        S=0.
	        T=.5
	        DO 3 JJ=1,24
	          M=MOD(MOD(IP*JP,179)*KP,179)
	          IP=JP
	          JP=KP
	          KP=M
	          LP=MOD(53*LP+1,169)
	          IF(MOD(LP*M,64).GE.32) S=S+T
   3            T=.5*T
   2            U(II)=S
	        C=362436./16777216.
	        CD=7654321./16777216.
	        CM=16777213./16777216.
	        RETURN
	        END

C     ************* FUNCTION SCALAR PRODUCTS *************************
      DOUBLE PRECISION FUNCTION SD_SCAL(A,B)
      IMPLICIT REAL*8 (A-H,K-Z)
      DIMENSION A(4),B(4)
      DUM=A(4)*B(4)
      DO 77 ID=1,3
77    DUM=DUM-A(ID)*B(ID)
      SD_SCAL=DUM
      RETURN
      END     


