<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    First obvious thing I've found is that you are rereading all of
    those 3-D fields from the file at every level, resulting in 7x the
    I/O. All of those reads should be moved outside of the inner loop so
    you only read the data once and subset as needed.<br>
    <br>
    - Walter<br>
    <br>
    <div class="moz-cite-prefix">On 2016-03-10 15:57, Andrew Kren - NOAA
      Affiliate wrote:<br>
    </div>
    <blockquote
cite="mid:CAJJ=ypor3XmWLM3XjK7_DdU=gkCZy=3tbzV7M1mSnhE7-go7-g@mail.gmail.com"
      type="cite">
      <div dir="ltr">Dear ncl-talk, 
        <div><br>
        </div>
        <div>I'm running this script (attached) twice daily to grab NAM
          forecast model data and plot results. It plots data at each
          hour and several pressure levels for two regional domains over
          the U.S. The program works great, though it takes 200 minutes
          to finish, and I'm wondering what I may be doing that is
          redundant that is slowing it down? I tried to eliminate some
          things but it didn't seem to help. Are there any suggestions
          for how to make this code more efficient?</div>
        <div><br>
        </div>
        <div>Thanks for your always reliable help!<br clear="all">
          <div><br>
          </div>
          -- <br>
          <div class="gmail_signature">
            <div dir="ltr">
              <div>
                <div dir="ltr">
                  <div>
                    <div dir="ltr">
                      <div>
                        <div dir="ltr">
                          <div>
                            <div dir="ltr">
                              <div>
                                <div dir="ltr">
                                  <div>
                                    <div>Andrew Kren, PhD<br>
                                      Research Scientist I, Global
                                      Observing Systems Analysis (GOSA)
                                      Group<br>
                                      NOAA ESRL Global Systems Division
                                      (Rm 3C515)<br>
                                      325 Broadway, Boulder, CO 80305<br>
                                      <a moz-do-not-send="true"
                                        href="tel:%28303%29%20497-5418"
                                        value="+13034975847"
                                        target="_blank">(303) 497-5418</a><span><font
                                          color="#888888"><br>
                                        </font></span></div>
                                  </div>
                                </div>
                              </div>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </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: 51px; padding-top: 18px;"><a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient&utm_term=oa-2115-f" target="_blank"><img src="https://ipmcdn.avast.com/images/2016/icons/icon-envelope-magnifier-orange-v1.png" /></a></td>
                <td style="width: 470px; padding-top: 20px; color: #41424e; font-size: 13px; font-family: Arial, Helvetica, sans-serif; line-height: 18px;">0 viruses found. <a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient&utm_term=oa-2115-f" target="_blank" style="color: #4453ea;">www.avast.com</a>
                </td>
        </tr>
</table></body>
</html>