Skip to content

Instantly share code, notes, and snippets.

@pozdneev
Created April 21, 2018 09:11
Show Gist options
  • Save pozdneev/1c8637266cd131d3df84e0d095233097 to your computer and use it in GitHub Desktop.
Save pozdneev/1c8637266cd131d3df84e0d095233097 to your computer and use it in GitHub Desktop.
(De)serialization of Fortran basic data types
program uio
real :: a(10), b(12)
a(:) = 1
b(:) = 2
open(37, file='uio.bin', form='unformatted')
write(37) a, b
close(37)
open(37, file='uio.bin', form='unformatted')
read(37) a, b
close(37)
print *, a
print *, b
end program uio
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment