Read out the content of a Fortran binary file based on the limited information given by its hexadecimal representation

Reading the source file nonsymm.f90, in particular the READ(11) statements and the declarations of the variables in the IOLists of those READ statements, answers all the questions that remained unanswered earlier.

The input file is a Fortran unformatted sequential file. Here are the READ statements that use that file.


nonsymm.f90:207:      read(11) DoubNum, spacegroupsymbol
nonsymm.f90:248:         read(11) SymElemR(:,:,i),SymElemt(:,i),Df(:,:)
nonsymm.f90:347:      read(11)  Numk,tnir
nonsymm.f90:350:        read(11) ListIrrep
            371:     irk: DO J=1,DoubNum
nonsymm.f90:372:            read(11) itmp,itmp
            373:            IF(itmp==1) THEN
nonsymm.f90:376:               read(11) itmp;
            378:               IF(itmp==1) THEN         
nonsymm.f90:379:                  read(11) abcde(1:2)
            380:               ELSEIF(itmp==2) THEN
nonsymm.f90:381:                  read(11) abcde(1:5)

The number of records read, as well as the sizes of the records, are dependent on the input data, rather than being fixed, because of the DO loops with loop count dependent on input data, and locating some of the READs inside the IF…THEN…ELSEIF…ENDIF.

As I did earlier, I recommend that you read documentation to understand the rules that govern Fortran unformatted I/O. They do not have to be mysteries.