Software Archive
Read-only legacy content
17060 Discussions

Allocatable arrays

Intel_C_Intel
Employee
334 Views
I asked a question before dealing with declaring arrays, and 'wilkinson' gave me this example code....

module data
integer max_element
integer, allocatable :: global_array(:)
end module data

prog.f90

program main
use data
integer i
max_element = 1000
allocate (global_array(max_element))
do i = 1, max_element
global_array(i) = i
end do
call sub
end subroutine sub
use data
type *, global_array(max_element/2)
return
end

I used the idea of the code and it worked perfectly. But on the line...
type *, global_array(max_element/2)
what exactly does the ' *, ' do? and how could this line be changed so it wont be prompted in MSDos mode. (I mean...when I run the program, the DOS window fills with zeros every time this line is run, how could I avoid this)
0 Kudos
1 Reply
james1
Beginner
334 Views
Just remove it, I just included it to show that indeed there was data in the newly allocated array, but it doesn't add any functionality.

James
0 Kudos
Reply