One of the common suggestions for modernization is to replace
real var
data var / 0.0 /
with
real :: var = 0.0
But is there a modern form of the repeat count? For example, this fills a 200-element array.
real y(200)
data y / 50*0.0, 50*1.0, 50*2.0, 25*3.0, 25*4.0 /
But this form doesn’t work:
real,dimension(200) :: y = [ 50*0.0, 50*1.0, 50*2.0, 25*3.0, 25*4.0 ]
init.f90(4): error #7948: In this initialization, there are more variables than values assigned to the variables. [Y]
real,dimension(200) :: y = [ 50*0.0, 50*1.0, 50*2.0, 25*3.0, 25*4.0 ]
-----------------------^
compilation aborted for init.f90 (code 1)