Hello,
I am using a fortran code called EPW and would like to extract a matrix A(ibnd,imode,ik) from the code. This is how I have tried to extract the matrix:
Open file to write to
Allocate(A(nbnd,nmodes,nkf))
Loop iq ! from 1 to nqf
Loop ik ! from 1 to nkf
Loop ibnd ! from 1 to nbnd
Loop imode ! from 1 to nmodes
A(ibnd,imode,ik) is calculated here
ENDDO ! loop imode
ENDDO ! loop ibnd
ENDDO ! loop ik
WRITE A(1,1,1) to file ! to get the first element for each iq
ENDDO ! loop iq
Deallocate(A)
Close file
Without the WRITE and Allocation statements, the code runs fine. With them, it segfaults.
I would really appreciate any suggestions you may have.
Thank you,
Vahid
I am using a fortran code called EPW and would like to extract a matrix A(ibnd,imode,ik) from the code. This is how I have tried to extract the matrix:
Open file to write to
Allocate(A(nbnd,nmodes,nkf))
Loop iq ! from 1 to nqf
Loop ik ! from 1 to nkf
Loop ibnd ! from 1 to nbnd
Loop imode ! from 1 to nmodes
A(ibnd,imode,ik) is calculated here
ENDDO ! loop imode
ENDDO ! loop ibnd
ENDDO ! loop ik
WRITE A(1,1,1) to file ! to get the first element for each iq
ENDDO ! loop iq
Deallocate(A)
Close file
Without the WRITE and Allocation statements, the code runs fine. With them, it segfaults.
I would really appreciate any suggestions you may have.
Thank you,
Vahid