Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Excerpt
hiddentrue

Each element in the data section of a BUFR can be missing.ecCodes provides a simple way for the user to check if the value of an element is missing by comparing with two constants

Missing values

Step-by-step guide

Each element in the data section of a BUFR can be missing.

ecCodes provides a simple way for the user to check if the value of an element is missing by comparing with two constants:

Code Block
CODES_MISSING_LONG

...


CODES_MISSING_DOUBLE

The constants are available in Python, Fortran 90 and C and the user needs to compare with the appropriate constant depending on the type of the variable used. This is an example of Fortran 90 code:

...

      !declare backscatter as double precision

...

HTML
<pre class="hljs" style="display: block; overflow-x: auto; padding: 0.5em; background-color: rgb(240, 240, 240); color: rgb(68, 68, 68);"><span class="hljs-comment" style="color: rgb(136, 136, 136);">! declare backscatter as double precision</span>
<span class="hljs-keyword" style="font-weight: 700;">real</span>(<span class="hljs-keyword" style="font-weight: 700;">kind</span>=<span class="hljs-number" style="color: rgb(136, 0, 0);">8</span>), <span class="hljs-keyword" style="font-weight: 700;">dimension</span>(:), <span class="hljs-keyword" style="font-weight: 700;">allocatable</span> :: backscatter

<span class="hljs-comment" style="color: rgb(136, 136, 136);">! get the values</span>
<span class="hljs-keyword" style="font-weight: 700;">call</span> codes_get(ibufr,<span class="hljs-string" style="color: rgb(136, 0, 0);">'/beamIdentifier=2/backscatter'</span>,backscatter);

...

<span class="hljs-keyword" style="font-weight: 700;">do</span> i=<span class="hljs-number" style="color: rgb(136, 0, 0);">1</span>,<span class="hljs-built_in" style="color: rgb(57, 115, 0);">size</span>(backscatter)
    <span class="hljs-comment" style="color: rgb(136, 136, 136);">! compare with double precision 

...

missing</span>
    

...

<span class="hljs-keyword" style="font-weight: 700;">if</span> (backscatter(i)/=CODES_MISSING_DOUBLE)

...

 <span class="hljs-keyword" style="font-weight: 700;">then</span>
        <span class="hljs-comment" style="color: rgb(136, 136, 136);">! process non missing 

...

values</span>
    

...

<span class="hljs-keyword" style="font-weight: 700;">else</span>
        <span class="hljs-comment" style="color: rgb(136, 136, 136);">! process missing 

...

values</span>
    

...

<span class="hljs-keyword" style="font-weight: 700;">endif</span>
<span class="hljs-keyword" style="font-weight: 700;">end</span> <span class="hljs-keyword" style="font-weight: 700;">do</span></pre>

Content by Label
showLabelsfalse
max5
spaces~usa
showSpacefalse
sortmodified
reversetrue
typepage
cqllabel = in ("kb-how-to-article","eccbufr-faqs","bufr","missing-values","decode") and type = "page" and space = "~usaUDOC"
labelskb-how-to-article

...

hiddentrue

...