<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    Hi Greg,<br>
    <br>
    you can use the conform function to copy the 1D-array to a 2D-array.<br>
    <br>
    <font color="#3333ff"><tt>nx     = 8</tt><tt><br>
      </tt><tt>ny     = 10<br>
        <br>
      </tt><tt></tt><tt>values = fspan(40.,452.,ny)</tt><tt><br>
        <br>
      </tt><tt>a = conform_dims((/ny,nx/),values,0)</tt></font><br>
    <br>
    Bye,<br>
    Karin<br>
    <br>
    <div class="moz-cite-prefix">Am 31.01.19 um 10:04 schrieb Alessandra
      Giannini:<br>
    </div>
    <blockquote type="cite"
      cite="mid:294F6740-1D33-48CA-935B-B52F740A83AA@iri.columbia.edu">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <div class=""><br class="">
      </div>
      <div class="">onedtond!!!</div>
      <div class=""><br class="">
      </div>
      <a
href="http://www.ncl.ucar.edu/Document/Functions/Built-in/onedtond.shtml"
        class="" moz-do-not-send="true">http://www.ncl.ucar.edu/Document/Functions/Built-in/onedtond.shtml</a>
      <div class=""><br class="">
      </div>
      <div class=""><br class="">
      </div>
      <div class=""><br class="">
        <div class="">
          <div dir="auto" style="caret-color: rgb(0, 0, 0); color:
            rgb(0, 0, 0); letter-spacing: normal; text-align: start;
            text-indent: 0px; text-transform: none; white-space: normal;
            word-spacing: 0px; -webkit-text-stroke-width: 0px;
            text-decoration: none; word-wrap: break-word;
            -webkit-nbsp-mode: space; line-break: after-white-space;"
            class="">
            <div dir="auto" style="word-wrap: break-word;
              -webkit-nbsp-mode: space; line-break: after-white-space;"
              class="">
              <div style="caret-color: rgb(0, 0, 0); color: rgb(0, 0,
                0); font-family: Helvetica; font-size: 12px; font-style:
                normal; font-variant-caps: normal; font-weight: normal;
                letter-spacing: normal; text-align: start; text-indent:
                0px; text-transform: none; white-space: normal;
                word-spacing: 0px; -webkit-text-stroke-width: 0px;
                text-decoration: none;">— <br class="">
                Alessandra Giannini<br class="">
                IRI for Climate and Society - The Earth Institute at
                Columbia University<br class="">
                P.O. Box 1000, Palisades NY 10964-8000, U.S.A.</div>
              <div style="caret-color: rgb(0, 0, 0); color: rgb(0, 0,
                0); font-family: Helvetica; font-size: 12px; font-style:
                normal; font-variant-caps: normal; font-weight: normal;
                letter-spacing: normal; text-align: start; text-indent:
                0px; text-transform: none; white-space: normal;
                word-spacing: 0px; -webkit-text-stroke-width: 0px;
                text-decoration: none;"><br class="">
                currently at:<br class="">
                LMD - École Normale Supérieure <br class="">
                24, Rue Lhomond 75231 PARIS CEDEX 05, France<br class="">
              </div>
            </div>
          </div>
        </div>
        <div><br class="">
          <blockquote type="cite" class="">
            <div class="">On Jan 30, 2019, at 5:28 PM, Greg Thompson
              <<a href="mailto:gthompsn@ucar.edu" class=""
                moz-do-not-send="true">gthompsn@ucar.edu</a>> wrote:</div>
            <br class="Apple-interchange-newline">
            <div class="">
              <div dir="ltr" class="">
                <div dir="ltr" class=""><br class="">
                  <div class="">I am struggling (feeling dumb) that I
                    cannot figure out how to write a one-line efficient
                    solution to copy a 1D vector of latitude to all the
                    columns of a 2D grid since the values (of latitude)
                    are constant across my grid in the X-direction.</div>
                  <div class=""><br class="">
                  </div>
                  <div class="">So what I have is this</div>
                  <div class="">
                    <div class="">ny = 8</div>
                    <div class="">nx = 10</div>
                    <div class="">a = new( (/ny,nx/), float)</div>
                    <div class="">a = 0.</div>
                    <div class="">a(:, 0) = fspan(40., 42., ny)</div>
                    <div class="">do n = 1, nx-1</div>
                    <div class="">  a(:, n) = a(:,0)</div>
                    <div class="">end do</div>
                  </div>
                  <div class=""><br class="">
                  </div>
                  <div class="">but that DO-n loop is slow as nx grows
                    large and I thought there was an elegant solution in
                    NCL to treat this array manipulation.</div>
                  <div class=""><br class="">
                  </div>
                  <div class="">Any thoughts?</div>
                  <div class="">Thanks!!!</div>
                  <div class=""><br class="">
                  </div>
                  <div class="">Greg</div>
                  <div class=""><br class="">
                  </div>
                </div>
              </div>
              _______________________________________________<br
                class="">
              ncl-talk mailing list<br class="">
              <a href="mailto:ncl-talk@ucar.edu" class=""
                moz-do-not-send="true">ncl-talk@ucar.edu</a><br class="">
              List instructions, subscriber options, unsubscribe:<br
                class="">
              <a class="moz-txt-link-freetext" href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br
                class="">
            </div>
          </blockquote>
        </div>
        <br class="">
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-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>
  </body>
</html>