How to use PARAMETERS in a DATA statement?

How to use PARAMETERS in a DATA statement?

2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

How about this?

integer, parameter :: MUL = 7

integer :: i, a(3) = (/(i,i=1,3)/)*MUL

write(*,*)a

end

OR, equivalently,


integer, parameter :: MUL = 7

integer :: i, a(3) = [1:3]*MUL

write(*,*)a

end

Leave a Comment

Please sign in to add a comment. Not a member? Join today