- #1
solarblast
- 152
- 2
I'd like to create some test data to read 2-dim arrays in f90 with namelists. Suppose I have this in the main program:
integer, dimension(2,3) array_in, array_out
namelist /WW_ARRAY/ array_in, array_out
...
Open(unit=WW_ARRAY_infile, file="WW_ARRAY_in.dat", status = "OLD")
...
ww_array_in.dat might look like this:
&WW_ARRAY
array_in(1:1) = 1,
array_in(1:2) = 2,
array_in(2:1) = 3,
array_in(2:2) = 4
but maybe there's any easier way to write this?
integer, dimension(2,3) array_in, array_out
namelist /WW_ARRAY/ array_in, array_out
...
Open(unit=WW_ARRAY_infile, file="WW_ARRAY_in.dat", status = "OLD")
...
ww_array_in.dat might look like this:
&WW_ARRAY
array_in(1:1) = 1,
array_in(1:2) = 2,
array_in(2:1) = 3,
array_in(2:2) = 4
but maybe there's any easier way to write this?