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)
Allocatable arrays
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)