1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
| program unv2msh implicit none integer i,j character*32 input character*32 output character*200 check integer element_num,status integer element_label,fe_id,phsical,material,color,element_node_label input='ideas' output='target.unv'
open(unit=1,file=input,status='old') open(unit=2,file=output,status='replace') check='0' do while (trim(adjustl(check)).ne.'2411') read(1,'(a)') check write(2,'(g0)') trim(check) end do do while (trim(adjustl(check)).ne.'-1') read(1,'(a)') check write(2,'(g0)') trim(check) end do do while (trim(adjustl(check)).ne.'2412') read(1,'(a)') check write(2,'(g0)') trim(check) end do element_label=0 do while(element_label.ne.-1) read(1,*) element_label backspace(1) if(element_label==-1) then do i=1,3 read(1,'(a)') check write(2,'(g0)') trim(check) end do exit end if read(1,*) element_label,fe_id,phsical,material,color,element_node_label write(2,*) element_label,fe_id,color,color,color,element_node_label if((element_node_label==4) .or. & (element_node_label==3) .or. & (element_node_label==6) .or. & (element_node_label==8)) then do i=1,1 read(1,'(a)') check write(2,'(g0)') trim(check) end do else if(element_node_label==2) then do i=1,2 read(1,'(a)') check write(2,'(g0)') trim(check) end do end if end do
status=0 do while (status==0) read(1,'(a)',iostat=status) check if(status.ne.0)exit write(2,'(g0)') trim(check) !if(trim(adjustl(check)).eq.'-1') then ! write(2,'(g0)') trim(check) !else ! write(2,'(g0)') trim(check) !end if end do
close(1) close(2) end
|