Meijian An's Tips on Seismological/seismic softwares

 

  1. Bugs in passcal package.
  2. Bugs in SAC (Seismic Analysis Code).
 

Tips

  1. Bugs in passcal package.
    • Some math functions does not work for GNU gcc compiler. For example, the function, atof(string), always return 0.00 no matter what string is used. This is because atof is defined in "stdlib.h", but some codes in passcal package did not include it. So the solution is to include the head file "stdlib.h" in codes (e.g., pas_utils.h).
    • definiation of some function has not argument, but it should have. for example,  "double cabs()" in codes (e.g., cmplx.c). this function is called like "cabs(real, imag)". The solution is to change definition as "double cabs(float, float)" in codes.
    • Total sample number is wrong. For example, the total sample number in segymerge is calculated by:

            tot_num_samps = (length / 1000.) / delta

      The corrected should be:

            tot_num_samps = (length / 1000.) / delta + 1

  2. Bugs in SAC (Seismic Analysis Code).
    Since the codes of SAC are not open, there are not bug-fixed solutions.

    • Sac program has never to release memory after a file is read. For example, when you repeat to read a file for many times, the SAC will crash when total memory is exhausted. There is no solution unless you close the program.
    • In Linux, all graph colors in Xwindows(X11) are black, but the colors in sgf file (which can be converted to ps file) are correct.