mikibelavista
Technical User
- Jan 18, 2012
- 32
program col2
implicit none
real,dimension(5,4) :: a
real,dimension(4) :: a1,a2
integer :: i,j
open(10,file='m.dat',status='old')
do i=1,5
read(10,*)(a(i,j),j=1,4)
end do
a1=a(1,
call comp(a1,a2)
write(*,*)a2
end program
subroutine comp(b1,b)
real,dimension(4),intent(in) :: b1
real,dimension(4),intent(out) :: b
where (b1 >= 0.32)
b=1
end where
where (b1 >= 0.36)
b=11
end where
where (b1 >= 0.4)
b=111
end where
end subroutine
This is my code,I want sonehow to have more points,so I need extraction process a1=a(1, to be done authomatically,but do not know how.Like if i=1
a1 takes first column if i=2 second and so on...
implicit none
real,dimension(5,4) :: a
real,dimension(4) :: a1,a2
integer :: i,j
open(10,file='m.dat',status='old')
do i=1,5
read(10,*)(a(i,j),j=1,4)
end do
a1=a(1,
call comp(a1,a2)
write(*,*)a2
end program
subroutine comp(b1,b)
real,dimension(4),intent(in) :: b1
real,dimension(4),intent(out) :: b
where (b1 >= 0.32)
b=1
end where
where (b1 >= 0.36)
b=11
end where
where (b1 >= 0.4)
b=111
end where
end subroutine
This is my code,I want sonehow to have more points,so I need extraction process a1=a(1, to be done authomatically,but do not know how.Like if i=1
a1 takes first column if i=2 second and so on...