If I write data to a file as follows:
program main
implicit none
integer :: err
real (kind=4), dimension(3) :: buffer
buffer(1) = 1.2
buffer(2) = 3.7
buffer(3) = 0.1
open(unit=36, file='test.dat', iostat=err, form='unformatted', action='write', status='new')
write(36) buffer
close(36)
end program
I would expect the file to be 12 bytes since the size of the real data type is 4 and I am inserting 3 real values in the file (4x3=12). However, if I type the following in my shell:
$ ls -lh test.dat
it says the file is 20 bytes.