Fortran 90 (need to read in binary data files into arrays)

In summary, The conversation involved a 3rd year undergrad project on forward radio meteor scatter, with a problem of having over 80Gbs of binary data blocks that needed to be converted and filtered using MatLab and Fortran 90. The person was looking for an easy way to adapt the program to read in binary files into an array and was advised to use a different language like C++ or Java for the conversion.
  • #1
sparkstermaes
1
0
Hello,

I am currently doing a 3rd year undergrad project on forward radio meteor scatter

the problem involves the following:

I have over 80Gbs worth of 10 second data blocks of recorded radio input.

They are stored as date stamped .bin files in binary format, each of order 1700kb or so.

I am using a filter constructed in MatLab and fortran 90

I am reading in the filter to an array... then reading in the binary data blocks in blocks of 10 or 20. multiplying through the filter and outputing to a single .dat data file.

previously i was using test data that was in the ASCII language. now I have to convert the program to operate on binary files.

Is there an easy way to adapt the program to read in binary files into an array?

thank you. any more information, please ask.
 
Physics news on Phys.org
  • #2
The easiest thing would be to convert your data set to a format that the current Fortran/Matlab app can read. Coding in that particular environment is nasty. Use something like C++ or Java to do the conversion.
 
  • #3


Hello,

It sounds like you are working on an interesting project involving radio meteor scatter. Fortran 90 is a great choice for handling large amounts of data and I'm glad to hear you are using it for your project. As for reading in binary data files into arrays, there are a few different approaches you could take.

One option would be to use the Fortran 90 intrinsic function "read" to read in the binary data directly into your array. This function allows you to specify the format of the data being read, so you can ensure that it is being read in correctly. Alternatively, you could use the "transfer" function to convert the binary data into the appropriate data type for your array.

Another approach would be to use the "open" statement to open the binary file and then use the "get" statement to read in the data block by block. This would allow you to control the size of the data being read in at once and potentially improve the efficiency of your program.

I would also recommend looking into any libraries or modules that may be available for Fortran 90 specifically for handling binary data. These could provide you with pre-written functions or routines that may simplify the process for you.

I hope this helps and good luck with your project! If you need any further assistance, please feel free to ask for more information.
 

FAQ: Fortran 90 (need to read in binary data files into arrays)

What is Fortran 90?

Fortran 90 is a programming language commonly used in scientific and engineering applications. It is an extension of the original Fortran language, and includes new features such as dynamic memory allocation, recursion, and improved control structures.

How do I read in binary data files in Fortran 90?

To read in binary data files in Fortran 90, you can use the READ statement with the FORMAT specifier FORTRAN_BINARY. This will allow you to specify the data type of the variables to read in and the number of bytes to be read.

How do I store the binary data from the file into arrays?

To store the binary data from the file into arrays, you can use the READ statement with the FORMAT specifier FORTRAN_BINARY, followed by a list of array variables to be filled with the data. You can also use the OPEN statement to open the file and the READ statement with the IOSTAT specifier to check for any errors while reading the data.

Can Fortran 90 read different types of binary data?

Yes, Fortran 90 can read different types of binary data including integers, floating point numbers, and character strings. You can specify the data type in the READ statement using the appropriate FORMAT specifier, such as I for integers and F for floating point numbers.

Are there any built-in functions in Fortran 90 to manipulate binary data?

Yes, Fortran 90 has built-in functions such as BITS and IBSET that can be used to manipulate binary data. These functions allow you to set, clear, and test individual bits within an integer variable. Additionally, you can also use the TRANSFER function to convert binary data into different data types.

Similar threads

Replies
1
Views
1K
Replies
12
Views
2K
Replies
7
Views
2K
Replies
7
Views
2K
Replies
5
Views
4K
Replies
6
Views
2K
Replies
4
Views
977
Replies
4
Views
3K
Replies
1
Views
3K
Back
Top