program viz C C --- This reads the output of the bundle modeler program and converts C --- the results to PV-Wave proceedure lines.Pro C Character*24 filein, fileout C Data iuntin, iuntout/2, 3/ C C --- open external files C write(*,*) 'Enter the bundle modeler output file name' read(*,'(A)') filein open(iuntin, FILE = filein, READONLY, STATUS = 'OLD') open(iuntout, FILE = 'lin.dat', 1 STATUS = 'NEW') C C --- read the output file of the bundle model C call redout(iuntin) C C --- write the graphics file C call wrtlin(iuntout) C end C --------------------------------------------------- subroutine redout(iuntin) C common /datstyp/ diam(10), bdiam(10), htap(10) common /datster/ istyp(100), xpos(100), zpos(100) common /datdsp/ xdisp(1000), ydisp(1000), zdisp(1000) common /datrot/ xrot(1000), zrot(1000) common /datnod/ ypos(1000), idster(1000), nodeps(100) common /datscl/ nnode, ngnode, npar, nster C character*80 phrase C C read stereocilia type data C do while (phrase .ne. 'Stereocilia Type Data') read (iuntin,10) phrase C write (*,*) phrase enddo read (iuntin,20) nstyp C write (*,*) 'number of types:', nstyp C read(iuntin, 25) do i = 1, nstyp read (iuntin,*) idum, diam(i), bdiam(i), htap(i) C write (*,*) 'type ',idum enddo 10 format (a) 20 format (//9x, i3////) C 25 format (///) C C read stereocilia data C read (iuntin,30) nster C write (*,*) 'Number of stereocilia', nster 30 format(////9x, i4////) do i = 1, nster read (iuntin,*) idum, istyp(i), xpos(i), zpos(i) C write (*,*) idum enddo C C --- read displacements C do while (phrase .ne. 'Results of FEA Analysis') read (iuntin,40) phrase C write (*,*) phrase enddo 40 format (a) read(iuntin, 50) in = 1 nodeps(1) = 1 do is = 1, nster read(iuntin, 60) idone = 0 inps = 0 do while (idone .eq. 0) read (iuntin,*, IOSTAT = idone) 1 idum, ypos(in), xdisp(in), ydisp(in), zdisp(in), 2 zrot(in), xrot(in) C write (*,*) 'node ',idum, in idster(in) = is if (idone .eq. 0) then in = in + 1 inps = inps + 1 endif enddo write (*,*) in, ypos(in-1) nodeps(is+1) = in enddo nnode = in - 1 50 format(//) 60 format(////) return end subroutine wrtlin(iuntout) C --------------------------------------------------- common /datstyp/ diam(10), bdiam(10), htap(10) common /datster/ istyp(100), xpos(100), zpos(100) common /datdsp/ xdisp(1000), ydisp(1000), zdisp(1000) common /datrot/ xrot(1000), zrot(1000) common /datnod/ ypos(1000), idster(1000), nodeps(100) common /datscl/ nnode, ngnode, npar, nster dimension nps(100) C C --- write the number of stereocilia C write(iuntout, '(i4)') nster C C --- write number of nodes per stereocilia, and x and y positions C write (iuntout, '(20i4)' )(nodeps(i+1) - nodeps(i), i=1, nster) write (iuntout,'(7e11.3)')(xpos(i), i = 1, nster) write (iuntout,'(7e11.3)')(zpos(i), i = 1, nster) call maxes(xmin, ymin, zmin, xmax, ymax, zmax) write (iuntout, '(6e11.3)') xmin, ymin, zmin, xmax, ymax, zmax C C --- y positions and nodal displacements (x, y, and z) C do is = 1, nster istrt = nodeps(is) ifnsh = nodeps(is+1) - 1 write (iuntout,'(7e11.3)') (ypos(i), i = istrt,ifnsh ) write (iuntout,'(7e11.3)') (xdisp(i), i = istrt, ifnsh) write (iuntout,'(7e11.3)') (ydisp(i), i = istrt, ifnsh) write (iuntout,'(7e11.3)') (zdisp(i), i = istrt, ifnsh) enddo C return end subroutine maxes(xmin, ymin, zmin, xmax, ymax, zmax) C --------------------------------------------------- common /datstyp/ diam(10), bdiam(10), htap(10) common /datster/ istyp(100), xpos(100), zpos(100) common /datdsp/ xdisp(1000), ydisp(1000), zdisp(1000) common /datnod/ ypos(1000), idster(1000), nodeps(100) common /datscl/ nnode, ngnode, npar, nster do is = 1, nster istrt = nodeps(is) ifnsh = nodeps(is+1) - 1 rad = diam(istyp(is))/2. do j = istrt,ifnsh x = xpos(is) + xdisp(j) y = ypos(j) + ydisp(j) z = zpos(is) + zdisp(j) if (x + rad .gt. xmax) xmax = x + rad if (x - rad .lt. xmin) xmin = x - rad if (y .gt. ymax) ymax = y if (y .lt. ymin) ymin = y if (z + rad .gt. zmax) zmax = z + rad if (z - rad .lt. zmin) zmin = z - rad enddo enddo return end