      subroutine impd(lnode,dd,td,xord,f,v,a,ndeg,ncrd)
      include '../common/implicit'
	  include 'concom'
	  include 'creeps'
	  include 'statistics'
c* * * * * *
c
c     user subroutine for output of "displacements".
c
c     lnode(1)      user node number
c     lnode(2)    = 1 structural
c                 = 2 thermal
c                 = 3 fluids
c                 = 4 joule
c                 = 5 pore pressure / diffusion
c                 = 6 electrostatic
c                 = 7 magnetostatic
c                 = 8 electromagnetic
c                 =10 acoustics
c
c     dd           array of incremental displacements of this node
c     td           array of total displacements of this node
c     xord         array of coordinates of this node
c     f            array of reaction forces/residuals
c     v            array of velocity (dynamics only)
c     a            array of acceleration (dynamics only)
c     ndeg         number of degrees of freedom per node
c     ncrd         number of coordinates per node
c
c* * * * * *
c     code by vincent admin@veryword.com

c     ** Start of generated type statements **
      real*8 a, dd, f, valno, valf
      integer lnode, ncrd, ndeg, II
      real*8 td, v, xord
c     ** End of generated type statements **
      dimension lnode(2), valno(3)
      dimension dd(ndeg),td(ndeg),xord(ncrd),f(ndeg),
     *          v(ndeg),a(ndeg)
      integer   bufsize
      parameter (bufsize = 24)
      character buffer1*(bufsize/2),buffer2*(bufsize),buffer3*(bufsize)
	  

c
	common/check/foreInc,iopen,iend
	data iopen,iend/0,0/

	call marc_setinf('ndset',ihav,list,ityp,inum)
	if(iopen.eq.0) then
		iopen=1
		foreInc=inc
		open(50,file='.tmp.dat',status='unknown')
		close(50,status='delete')
		open(50,file='.tmp.dat',status='new')
		call nodvar(5,list,valno,nqncomp,nqdatatype)
		valf=sqrt(valno(1)**2+valno(2)**2+valno(3)**2)
		write(50,*) inc,cptim,valf
	endif

	if(iend.eq.0) then
		if(foreInc.ne.inc) then
			call nodvar(5,list,valno,nqncomp,nqdatatype)
		valf=sqrt(valno(1)**2+valno(2)**2+valno(3)**2)
		write(50,*) inc,cptim,valf
			foreInc=inc
		endif	
	endif

	if(iend==0.and.iend_lcase==1) then
		close(50)
		open(50,file=".tmp.dat")
		open(55,file='fort.txt',status='unknown')
		close(55,status='delete')
		open(55,file='fort.txt',status='new')
		if(ihav==1.and.inum==1) then
			write(55,*) inum
			write(55,*) "X"
			write(55,*) "Y"
			write(55,*) "time:","Reacton force of node",list
			write(55,*) inc+1
		else
			write(55,*) "|-----------------------------------------------------|"
			write(55,*) "|          Incorrect node information in ndset        |"
			write(55,'(" |",I9,"ndset with",I9,"nodes:",I19,"|")') ihav,inum,list
			write(55,*) "|-----------------------------------------------------|"
		endif
		do 10, II=1, 10000
			read(50,*,end=20) buffer1,buffer2,buffer3
			write(55,*) buffer1, buffer2, buffer3
10		continue	
20		close(55)
		iend=1
		close(50,status='delete')
	endif

      return
      end
