[Fortran] syntaxhighlighter_viewsource syntaxhighlighter_copycode
subroutine Stiffb
    common/fem1/npoin,nelem,nboun,nprop,nnode,nevab,nsvab,ndofn,ndime,nstre
    common/fem2/props(5,2),coord(50,2),lnods(75,2),ifpre(100),fixed(100),rload(50,2),eload(75,4),&
         matno(75),stres(75,1),xdisp(100),tdisp(50,2),treac(50,2),astif(100,100),aslod(100),react(100)
    dimension estif(4,4)
!
!  evaluation of member stiffness matrices
!  for pin-jointed plane frameworks
!
    open(unit=10,file='input.txt')
    open(unit=12,file='output.txt')
    open(unit=11,file='between.txt')
    rewind 11
    do 20 ielem=1,nelem
    lprop=matno(ielem)
    young=props(lprop,1)
    xarea=props(lprop,2)
    node1=lnods(ielem,1)
    node2=lnods(ielem,2)
    xproj=coord(node2,1)-coord(node1,1)
    yproj=coord(node2,2)-coord(node1,2)
    eleng=sqrt(xproj**2+yproj**2)
    sinth=yproj/eleng
    costh=xproj/eleng
    fmult=young*xarea/eleng
    estif(1,1)=fmult*costh**2
    estif(1,2)=fmult*sinth*costh
    estif(2,1)=fmult*sinth*costh
    estif(2,2)=fmult*sinth**2
    do 10 inode=1,nnode
    do 10 jnode=1,nnode
    kount=(-1)**inode*(-1)**jnode
    do 10 knode=1,nnode
    do 10 lnode=1,nnode
    index=(inode-1)*nnode+knode
    jndex=(jnode-1)*nnode+lnode
 10 estif(index,jndex)=kount*estif(knode,lnode)
    write(11) estif                          !问题在此行
 20 continue
    return
  end