<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Yongil,<br>
    <br>
    Unfortunately, NCL doesn't support custom structures. The best way
    might be to create a list for the intensity with duration and
    location as attributes. Something like this:<br>
    <br>
    <tt>intensityList = NewList("fifo")</tt><tt><br>
    </tt><tt>do i=0, nEvents-1, 1</tt><tt><br>
    </tt><tt>    &lt;read in data&gt;</tt><tt><br>
    </tt><tt>    intensity@duration = duration</tt><tt><br>
    </tt><tt>    intensity@center_lon = center_lon</tt><tt><br>
    </tt><tt>    intensity@center_lat = center_lat</tt><tt><br>
    </tt><tt>    ListPush( intensityList, echo(intensity) )</tt><tt><br>
    </tt><tt>    delete(intensity)</tt><tt><br>
    </tt><tt>    delete(duration)</tt><tt><br>
    </tt><tt>    delete(center_lon)</tt><tt><br>
    </tt><tt>    delete(center_lat)</tt><tt><br>
    </tt><tt>end do</tt><br>
    <br>
    Where echo is a function I often use with lists that returns an
    anonymous copy so the list retains the variable if it is deleted:<br>
    <br>
    <tt>if isdefined("echo") then undef("echo") end if</tt><tt><br>
    </tt><tt>function echo(variable)</tt><tt><br>
    </tt><tt>    local variable2</tt><tt><br>
    </tt><tt>    begin</tt><tt><br>
    </tt><tt>    variable2 = variable</tt><tt><br>
    </tt><tt>    return variable2</tt><tt><br>
    </tt><tt>    end ; echo</tt><br>
    <br>
    The downside to this method is that you can't have metadata on the
    duration or locations. The other option is to create a list for each
    variable, which breaks their connection but allows you to keep the
    metadata.<br>
    <br>
    - Walter<br>
    <br>
    <div class="moz-cite-prefix">On 2016-04-13 11:24, Sitan Heyl wrote:<br>
    </div>
    <blockquote
cite="mid:CAAE83cBrNLf1EaEr2m_fbTwHg+iuAXYg9xO-6h4Op83eL=JJVQ@mail.gmail.com"
      type="cite">
      <div dir="ltr">Hi, All
        <div>  I want to create an array of blocking event, every event
          contains intensity, duration, center_lon(duration),
          center_lat(duration). because center_lon depends on the
          duration, so I wonder if there is one method to create an
          array, in which every member is a list to include variable
          (intensity, duration) and array(center_lon,center_lat). I
          think this is similar to structure in C/C++ Language. Any help
          is welcoming.</div>
        <div><br>
        </div>
        <div>Best,</div>
        <div>Yongli     </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
ncl-talk mailing list
<a class="moz-txt-link-abbreviated" href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a>
List instructions, subscriber options, unsubscribe:
<a class="moz-txt-link-freetext" href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a>
</pre>
    </blockquote>
    <br>
  <br />
<table style="border-top: 1px solid #aaabb6;">
        <tr>
        <td style="width: 55px; padding-top: 13px;"><a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient&utm_term=oa-2200-c" target="_blank"><img src="https://ipmcdn.avast.com/images/2016/icons/icon-envelope-tick-round-orange-border-v1.png" /></a></td>
                <td style="width: 470px; padding-top: 15px; color: #41424e; font-size: 13px; font-family: Arial, Helvetica, sans-serif; line-height: 18px;">Virus-free. <a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient&utm_term=oa-2200-c" target="_blank" style="color: #4453ea;">www.avast.com</a>
                </td>
        </tr>
</table></body>
</html>