subroutine ufxord(xord,ncrd,n) c c CONTACT: ap@marc.de c implicit real*8 (a-h,o-z) dp c* * * * * * c c User subroutine to enter or modify nodal coordinates. c c* * * * * * c* * * * * * c c Used here to read the coordinates from a MENTATII .mfd file. c The name must be: jobid_name.mfd, where jobid_name is the c name of the input file whitout the '.dat' suffix. c c The nodes specified in the ufxord option must be in the c same order as their appearance in the .mfd file. c c* * * * * * c* * * * * * c c INPUT: ncrd number of coordinates per node c n node number c OUTPUT: xord nodal coordinates c c* * * * * * character*80 jidnam common/jname/jidnam(4),ilen(4) c character*80 line dimension xord(ncrd) c logical is_open c c... open MENTAT .mfd file if not yet open inquire(99,opened=is_open) if (.not.is_open) then ios = 0 open(99,file = jidnam(1)(1:ilen(1))//'.mfd', * status = 'old', * form = 'formatted', * iostat = ios) if (ios.ne.0) then write(0,*) 'file: '//jidnam(1)(1:ilen(1))//'.mfd' write(0,*) 'error opening above MENTAT .mfd file from ufxord.' stop endif endif c c... position on start of nodes block if (n.eq.1) then rewind(99) 10 read(99,1000,err=9990) line if (line(1:10).ne.'=beg= 100') go to 10 endif c c... read line with node id and its coordinates read(99,1000,end=9991) line if (line(1:5).ne.'=end=') then read(line(1:20),*) nid if (nid.eq.n) then read(line(21:40),*) xord(1) read(line(41:60),*) xord(2) if (ncrd.eq.3) read(line(61:80),*) xord(3) c write(1,*) n,(xord(ijk),ijk=1,ncrd) else write(0,*) 'mismatch in node sequences on .dat and .mfd files' stop endif else write(0,*) 'unexpected end of nodes block in MENTAT .mfd file' stop endif c c... read additional lines read(99,1000,end=9991) line read(99,1000,end=9991) line read(99,1000,end=9991) line c return c 9990 write(0,*) 'no nodes block in MENTAT .mfd file.' stop 9991 write(0,*) 'unexpected end of file in MENTAT .mfd file.' stop c 1000 format(a80) c end