subroutine B_gen(n, Bg, job)

real(8) Bg(n,n), M(n,n)

character(20) job
real(8) cm_sup, cm_inf
real(8) m0, NO


Job_If: &
IF(job =='0') THEN
bg(1,1) =1
bg(1,2) =-sqrt(2.)/2
bg(1,3)=0

bg(2,1) =bg(1,2)
bg(2,2) =1.5
bg(2,3) =-2/sqrt(5.)

bg(3,1) =0
bg(3,2) =bg(2,3)
bg(3,3) =2.4

ELSEIF(job =='csa0-Lin_Din')	THEN	! 
bg =0D0

M =0.

cm_sup =1223.25	! kg
cm_inf =30.

nn =n/2

DO in =1, nn
if(mod(in,2) /=0) then  !1,3,...

do igl =1,2
il =(in-1)*2+igl
m(il,il) =cm_sup
enddo

else		!2,4,...

do igl =1,2
il =(in-1)*2+igl
m(il,il) =cm_inf
enddo

endif

ENDDO

bg =M



ELSEIF(job =='Jen_Din-case1')	THEN	! 
bg =0D0

M =0.

cm_sup =0.03	! kg
cm_inf =1.

nn =n/2

DO in =1, nn
if(mod(in,2) /=0) then  !1,3,...

do igl =1,2
il =(in-1)*2+igl
m(il,il) =cm_sup
enddo

else		!2,4,...

do igl =1,2
il =(in-1)*2+igl
m(il,il) =cm_inf
enddo

endif

ENDDO

bg =M

ELSEIF(job =='Lucr_Sc_Doct')	THEN
bg =0D0
NO =10.; ngl =6;

m0= 440	! kN*sec2/m

do i =1,ngl
bg(i,i) =m0 +i*NO
enddo




ENDIF Job_If


END

