NOAA-EMC / NCEPLIBS-bufr

The NCEPLIBS-bufr library contains routines and utilites for working with the WMO BUFR format.
Other
44 stars 19 forks source link

question about NEMTBAX() #401

Closed edwardhartnett closed 1 year ago

edwardhartnett commented 1 year ago

When I try and call NEMTBAX() with a bad NEMO, it simply exits.

From the documentation I expected it to bort().

Am I missing something?

Here's what I tried (commented out in test_bort.F90)

        open(unit = 11, file = 'testfiles/IN_2', form = 'UNFORMATTED', iostat = ios)
        if (ios .ne. 0) stop 3
        call openbf(11, 'IN', 11)
        call nemtbax(11, 'DUMB', mtyp, msbt, inod)

I expected this to bort(). But it does not.

edwardhartnett commented 1 year ago

I wasn't calling:

ifdef KIND_8

call setim8b(.true.)

endif

Duh! I will fix in my open PR.

jbathegit commented 1 year ago

The reason this isn't calling bort() is noted in the docblock:

C> It is similar to subroutine nemtba(), except it returns an INOD
C> value of 0 if the descriptor is not found in Table A, whereas
C> nemtba() will call subroutine bort() in such cases.

In other words, nemtbax doesn't call bort() in case of a bad mnemonic (such as 'DUMB' ;-), and instead it just returns inod = 0. The only thing nemtbax will call bort() for is if the mnemonic is found in the internal Table A, but then for some reason the corresponding message type or subtype in the internal Table A aren't valid.

edwardhartnett commented 1 year ago

OK, thanks! ;-)