Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Binary codes for the head and tail of data output by Fortran using unformatted format #1995

Open
lilinling509 opened this issue Oct 3, 2022 · 0 comments

Comments

@lilinling509
Copy link

I come across a problem in editing a binary file which includes a large array outputted by Fortran in unformatted data format. As I know that the unformatted method will add 4 bytes at both the head and the tail of the array to indicate the number of bytes taking by the array. I can read in that 4 bytes using Julia read function as Int32, finding them equal and it works when the number is less than 2147483647. But I recently get a far larger array and I find there is 4 bytes at the head but 12 bytes at the tail. I can't understand what is happening. Any one can help? By the way, the large array is the CFD flow field in format plot3d.
我在编辑一个二进制文件时遇到了一个问题,其中包括一个由Fortran以未格式化数据格式输出的大数组。我知道未格式化的方法会在数组的头部和尾部增加4个字节来表示数组所占的字节数。我可以使用Julia读函数将这4个字节作为Int32读入,发现它们相等,当数字小于2147483647时,它是有效的。但是我最近得到了一个大得多的数组,我发现在头部有4个字节,但是在尾部有12个字节。我不明白发生了什么。有谁能帮忙吗?顺便说一下,这个大数组是格式为plot3d的CFD流场。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant