Menu

#92 DMO3D Bracewell interpolation problem

v1.0 (example)
closed
None
5
2019-05-11
2019-04-21
seismick
No

DMO3D seemed to run with Intel compiler version 11. When built with Intel
compiler version 15, it crashed with SIGSEGV. With Intel compiler version 13,
it had an array out of bounds for second dimension array hd (68 > 67).
However DMO3D takes single-trace not gathers, so dimension should have been 1.
When built with gfortran version 4.4.7 or 4.8.5, an array out of bounds for
array etr in interp.f90. Again the array dimension in the error message was
wrong. So it looks like some serious corruption is occuring.
Fortunately, gfortran narrowed down where the bug originates. It is in
subroutine interp_1d_con_bw_real, which is called by KDMO process.
The subroutine interp_1d_con_bw_real contains an implied do loop at the line
given in the error message.

    ETR (L:(NT - 5) * INTRP + L:INTRP) = B (K, 1)   * TR (1:NT-4)     &
                                         + B (K, 2) * TR (2:NT-3)     &
                                         + B (K, 3) * TR (3:NT-2)     &
                                         + B (K, 4) * TR (4:NT-1)     &
                                         + B (K, 5) * TR (5:NT)

This is apparently too clever for the compilers. So instead rewrite the
convolution as a do loop:

DO J=1,NT-4
     ETR (L + (J-1)*INTRP) = B(K,1)*TR(J)     &
     + B(K,2)*TR(J+1) + B(K,3)*TR(J+2) + B(K,4)*TR(J+3) + B(K,5)*TR(J+4)
END DO

Then no more crashes.
Subroutines interp_1d_con_bw_real2 and interp_1d_con_bw_cpx contain the same
flaw, but those are not used anywhere in CPSeis.

Processes CODMO also uses KDMO, so would be affected by the same flaw. And the
subroutine interp_1d_con_bw_real is also used by process RES, so this needs to
be fixed up.

The attached file has the patch for the problem.

1 Attachments

Discussion

  • Bill Menger

    Bill Menger - 2019-05-11
    • status: open --> closed
    • assigned_to: Bill Menger
     
  • Bill Menger

    Bill Menger - 2019-05-11

    changed and tested.

     

Log in to post a comment.

MongoDB Logo MongoDB