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
|
type TCol
real, pointer :: Col(:)
end type
type(TCol), allocatable(:) :: A
...
allocate(Ligne(1:N))
do k=1,N
allocate(A(k)%Col(1:NbColRequisePourLaLigne(k)))
enddo
...
call Set(A,i,j,expression)
b = f(Get(A,i,j))
...
contains
function Get(A,i,j)
type(TCol), intent(in) :: A(:)
integer, intent(in) :: i,j
Get = A(i)%Col(j)
end function Get
subroutine Set(A,i,j,V)
type(TCol), intent(inout) :: A(:)
integer, intent(in) :: i,j
real, intent(in) :: V
A(i)%Col(j) = V
end subroutine Set |
Partager