- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Apparantly CVF 6.6B has support for ALLOCATABLE components of derived types. Does anyone have a code snippet showing how to avail of this F2K feature? (I've looked in the HTML and samples folder but I didn't come across anything relevant.)
Thank you,
Gerry T.
Thank you,
Gerry T.
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Here is an example:
program allcomp implicit none type stuff integer length integer, allocatable :: value(:) end type stuff real h integer max_fields, i, j type (stuff), allocatable :: fields(:) call RANDOM_SEED () max_fields = 20 ! allocate data structure, random number of ! values per field ALLOCATE (fields(max_fields)) do i = 1, max_fields call RANDOM_NUMBER (h) fields(i)%length = FLOOR(h*9.) + 1 ALLOCATE (fields(i)%value(fields(i)%length)) end do ! initialize each existing value to its index do i = 1, max_fields do j = 1, fields(i)%length fields(i)%value(j) = j end do end do ! show what we have do i = 1, max_fields j = fields(i)%length print "(James(x,i1))", fields(i)%value(1:j) end do end program allcomp
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
James:
Your sample is much appreciated.
I dug up ftp://ftp.nag.co.uk/sc22wg5/N1351-N1400/N1379.pdf which might be of interest.
Ciao,
Gerry T.
Your sample is much appreciated.
I dug up ftp://ftp.nag.co.uk/sc22wg5/N1351-N1400/N1379.pdf which might be of interest.
Ciao,
Gerry T.

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