Well, I\'ve this problem now. I\'ve a (huge) set of parameters I\'d like to organize in a vector.
Of course, I can do something like:
real, dimension
The problem with the parameter is only that you can't define the constant array to depend on itself. But you could define the fundamental quantities, and then the whole array including the derived quantities, as so:
program foo
implicit none
real, dimension(2), parameter :: basic = [2.4, 1.4]
real, dimension(4), parameter :: all = [basic(1), basic(2), &
basic(1)*basic(2)**basic(1), &
abs(basic(1))]
print *, basic
print *, all
end program foo
and in fact if you want to go that way, you might as well name the fundamental quantities:
program foo
implicit none
real, parameter :: height = 2.4, bodymass = 1.4
real, dimension(4), parameter :: all = [height, bodymass, &
height*bodymass**2, &
abs(height)]
print *, height, bodymass
print *, all
end program foo
I can't imagine height is the sort of thing you need to take the absolute value of, but you see my point.