My IDE is CodeBlocks with MinGW 9.2.0.
I need a help with writing matrix row by row in textual file.
This is my simple code:
program matrix
integer :: i, j
integer, dimension(2,2) :: a_mat
forall( i = 1 : 2, j = 1, 2 )
a_mat(i,j) = i + j
end forall
open( unit = 15, file = 'matrix_utput.txt', action = 'write' )
write(15,'(*(i2.2,1x))') ( ( a_mat(i,j), j = 1, 2 ), i = 1, 2 )
close( unit = 15 )
end program matrix
In my .txt
file i got this:
02 03 03 04
How to change format to get this:
02 03
03 04