[ncl-talk] how to process string variable

Dennis Shea shea at ucar.edu
Mon Aug 26 18:04:40 MDT 2019


No need for fortran code.

*https://www.ncl.ucar.edu/Document/Functions/Contributed/get1Dindex.shtml*
<https://www.ncl.ucar.edu/Document/Functions/Contributed/get1Dindex.shtml>

========================
            ;        0             1            *2*            3
4               <==
  cvsid = (/"76373", "76612", "*XRKF*", "PRUK", "DENB"/)
  obsid = (/"*XRKF*", "76737", "BSRK"/)

  i = *get1Dindex*(cvsid, obsid)
  print(i)
  print("====")

  ni = num(.not.ismissing(i))
  print("ni="+ni)
  print("====")
==================================
Variable: i
Type: integer
Total Size: 12 bytes
            3 values
Number of Dimensions: 1
Dimensions and sizes: [3]
Coordinates:
Number Of Attributes: 3
  _FillValue : -2147483647
  index_info : Out of nWant=3 : multiple index occurrences=0
  nMultInd : 0

(0) *2*
(1) -2147483647   <=== No match for *76737*
(2) -2147483647   <=== No match for *BSRK*
(0) ====
(0) ni=*1                 *<=== only one match
(0) ====

On Mon, Aug 26, 2019 at 5:30 PM Ming Chen via ncl-talk <ncl-talk at ucar.edu>
wrote:

> Dear All,
>
> I am trying to match two sets of in-situ observations. First of all, I
> need to match stations between the two sets of data. However, my scrip
> failed with the error message below:
>
> fatal:Argument type mismatch on argument (1) of (mpr_match) can not coerce
> fatal:["Execute.c":8637]:Execute: Error occurred at or near line 19 in
> file test4.ncl
>
> I attach the sample ncl script and fortran code. Any help will be highly
> appreciated.
>
> Ming
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190826/9df99fae/attachment.html>


More information about the ncl-talk mailing list