...
Excerpt |
---|
|
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 |
How do I detect keys whose values are missing in a BUFR message?
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:
...
...
These 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:
...
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 |
...
...
<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 |
...
...
<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> |
Related articles
Content by Label |
---|
showLabels | false |
---|
max | 5 |
---|
spaces | ~usa |
---|
showSpace | false |
---|
sort | modified |
---|
reverse | true |
---|
type | page |
---|
cql | label = in ("kb-how-to-article","eccbufr-faqs","keys","missing","bufr") and type = "page" and space = "~usaUDOC" |
---|
labels | kb-how-to-article |
---|
|