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

Fortran EOF error in adjoint simulations with DOWNSAMPLING #1195

Open
AbolfazlKhanMo opened this issue Nov 19, 2023 · 0 comments
Open

Fortran EOF error in adjoint simulations with DOWNSAMPLING #1195

AbolfazlKhanMo opened this issue Nov 19, 2023 · 0 comments

Comments

@AbolfazlKhanMo
Copy link

AbolfazlKhanMo commented Nov 19, 2023

Hi everyone!

When I set the NTSTEP_BETWEEN_OUTPUT_SAMPLE parameter in the Par_file (for downsampling purposes) to any number other than 1, I get a Fortran End of File error during the adjoint simulations!

It seems the source code (specfem2d/src/specfem2D/compute_arrays_source.f90/read_adj_source) has a bug, and it does not consider the parameter NTSTEP_BETWEEN_OUTPUT_SAMPLE in the following loop at line 225:

      do itime = 1, NSTEP
        read(IIN,*) junk, adj_src_s(itime,icomp)
      enddo`

This error occurs if the user sets the parameter to != 1. I am attaching parts of my Par_file that are related to the issue. If you need more info, please let me know.

Par_file(parts).txt

I am not sure if this the proper way to fix it but this is what I did to fix it:

(1) add NTSTEP_BETWEEN_OUTPUT_SAMPLE to line 173.
(2) add NTSTEP_BETWEEN_OUTPUT_SAMPLE to all corresponding do loops (like the one above).

Thanks!

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