Ticket #732 (closed defect: fixed)
BUG: hypoinverse produces negative median absolute deviation uncertainty values
Reported by: | paulf | Owned by: | somebody |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | hyp2000 | Version: | 7.10 |
Keywords: | Cc: |
Description
This is for sure a bug. It would be great if we could get the hypoinverse config files and an example phase file that produces the negative value. This was likely introduced in the last version update:
See email chain below from UCB:
A negative "median absolute difference" in mag computations is now produced by hypoinverse, see below. Not quite sure where this bug snuck in. From: Andrei Akimov <andrei.akimov@berkeley.edu> Sent: Friday, February 5, 2021 1:41 PM To: Dietz, Lynn D <dietz@usgs.gov> Cc: Ivan Henson <henson@seismo.berkeley.edu>; Junli ZHANG <junlizhang@berkeley.edu>; millpaul@seismo.berkeley.edu <millpaul@seismo.berkeley.edu>; stephane@seismo.berkeley.edu <stephane@seismo.berkeley.edu> Subject: [EXTERNAL] Re: negative median-absolute-difference of amplitude magnitudes Lynn - This is the version we are experiencing the issue: 12/2018 VERSION 1.43 (CRE, ELEVMAX, TT bug fixes) Andrei On Fri, Feb 5, 2021 at 1:16 PM Stephane Zuzlewski <stephane@seismo.berkeley.edu> wrote: In the example that Andrei provided, it was actually the MAD of duration magnitudes. ....x....1....x....2....x....3....x....4....x....5....x....6....x....7....x....8....x....9....x....0....x....1....x....2....x....3....x....4....x....5....x....6....x....7....x....8 202102041747423038 4886122W4949 284 0 18 54 1 325976 67144 5 22109GEY 19 0 22 65 15 00 40 0 -5GEY WW D 20X 0 00L 0 00 320121D109 40Z 0 002 NC06MT 578 226 105 3 F3.2 Median-absolute-difference of amplitude magnitudes. 108 3 F3.2 Median-absolute-difference of duration magnitudes. Stephane On 2/5/21 12:19 PM, Andrei Akimov wrote: Hi Lynn - I found that hypo2000 from the earthworm_7.10 distribution sometimes produces negative median-absolute-difference of amplitude magnitudes. We used GNU Fortran (GCC) 4.8.5 20150623 on Red Hat Enterprise Linux Server release 7.9 to build it. The MAD value is actually different from the "old" hyp2000 we are currently running even when it's positive. I was wondering if it is a known issue and there is a fix. I would be grateful for any advice. Thanks, Andrei Akimov -- ------------------------------------------------------------------ Stephane Zuzlewski University of California, Berkeley stephane@seismo.berkeley.edu Berkeley Seismological Laboratory Office: 510-664-9029 (Thu) 215 McCone Hall # 4760 Fax: 510-643-5811 Berkeley, CA 94720-4760 Remote: 209-812-4069 (Mon,Tue,Wed,Fri)
Change History
Note: See
TracTickets for help on using
tickets.
Andrei isolated the problem to an argument mismatch in the call to SUBROUTINE MEDWT in SUBROUTINE HYMAG.
The bug was introduced in r7368 when Earthworm was being cleansed of Numerical Recipes' code. The DIMENSION statement in medwt.for
was changed to INTEGER*2
I went through hyp2000 to find all the instances of INTEGER*2 and INTEGER*4 declarations. I changed them all to INTEGER, except in integer.for and mem_structure.inc. I also renamed the two bubble sort subroutines introduced in r7368 to SORT_STA_BY_DISTANCE and SORT_MAGNITUDES, and added Fortran 90 argument intent options in their declarations.
Fixed in r8329.