- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I need to make an array of arrays, is this possible in Fortran?. Let me explain, I have Xnumbers of networks(the networks are rank 2 arrays), each network contains X aounts data.
For example say I read a file that has 4 networks and each network has 4 coulmns and 4 rows. How can I write a code that will read the number of networks from a file, allocate that many arrays which will contain X amount of rank 2 arrays?
Thnaks
Again
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Not directly, but you can have an array of derived type where that derived type has array components. Something like this:
type t_network
integer, dimension(:,:), allocatable :: data
end type t_network
type(t_network), dimension(:), allocatable :: networks
... read number of networks
allocate (networks(n_networks))
do i=1,n_networks
allocate (networks(i)%data(n_networks,n_networks))
end do
...

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page