<div dir="ltr"><div>Actually, Cathy's '<b>ncks</b>' method could be used from within a script using just about any language. <br></div><div>An NCL example where an NCO operator is invoked is at: <br></div><div><br></div><div><a href="http://www.ncl.ucar.edu/Applications/system.shtml"><b>http://www.ncl.ucar.edu/Applications/system.shtml</b></a></div><div><br></div><div>See the section: <b><br></b></div><div><b>     Using NCL with environment variables to set variables from within a shell script</b></div><div><b><br></b></div><div>Create a <b>NCO</b> or <b>CDO</b> command and execute it via <b>system</b>. The example uses <b>ncrcat </b>but<b> ncks </b>[any <b>NCO</b>] could be used<b>.</b><br></div><div><b></b></div><div>[snip]<b><br></b></div><div><pre>      ncocmd= "<b><font color="red">ncrcat</font></b> -v TEMP " + diri + fili + "*.nc "+diro+filo+nyear+".nc"
      <b>print</b> ("ncocmd = "+ncocmd)  ; echo for tracking purposes
      <b>system</b> (ncocmd)
</pre></div><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jun 10, 2019 at 12:34 PM Micah Sklut <<a href="mailto:micahs2005@gmail.com">micahs2005@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Okay, great. Thanks for your help, ncks looks like the tool I've been looking for. </div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jun 10, 2019 at 2:18 PM Cathy Smith <<a href="mailto:cathy.smith@noaa.gov" target="_blank">cathy.smith@noaa.gov</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF">
    <p>You could use ncks for a single line extraction (see PSD page
      below that Dennis helpfully supplied). e.g. <br>
    </p>
    <p> ncks -v lat
<a class="gmail-m_1702545632514671676gmail-m_8827068505650226276moz-txt-link-freetext" href="https://www.esrl.noaa.gov/psd/thredds/dodsC/Datasets/interp_OLR/olr.mon.mean.nc" target="_blank">https://www.esrl.noaa.gov/psd/thredds/dodsC/Datasets/interp_OLR/olr.mon.mean.nc</a>
      <a href="http://a.nc" target="_blank">a.nc</a></p>
    <p>or</p>
    <p>ncks -v olr
<a class="gmail-m_1702545632514671676gmail-m_8827068505650226276moz-txt-link-freetext" href="https://www.esrl.noaa.gov/psd/thredds/dodsC/Datasets/interp_OLR/olr.mon.mean.nc" target="_blank">https://www.esrl.noaa.gov/psd/thredds/dodsC/Datasets/interp_OLR/olr.mon.mean.nc</a>
      <a href="http://a.nc" target="_blank">a.nc</a></p>
    <p>(ncks keeps coordinate variables too)<br>
    </p>
    <p>NCL will read and write a netCDF file with a single variable
      usinfg the OPEnDAP URL though you have to write a few lines of
      code. You could even make that work as command line routine and
      read in variable/file to save.<br>
    </p>
    <p>I'm sure there are other ways, too.<br>
    </p>
    <p>Cathy<br>
    </p>
    <p><br>
    </p>
    <div class="gmail-m_1702545632514671676gmail-m_8827068505650226276moz-cite-prefix">On 6/10/19 11:35 AM, Dennis Shea wrote:<br>
    </div>
    <blockquote type="cite">
      
      <div dir="ltr">
        <div><br>
        </div>
        <div>re: " ... <b>only downloading specific variables of a
            NetCDF file"</b></div>
        <div><br>
        </div>
        <div>The question is unclear. In what context? <br>
        </div>
        <div>Are you talking about accessing a variable from a remote
          site [ eg: a NOAA server ] from within a NCL script? <br>
        </div>
        <div>     See: <a href="https://www.ncl.ucar.edu/Applications/opendap.shtml" target="_blank"><b>https://www.ncl.ucar.edu/Applications/opendap.shtml</b></a></div>
        <div><br>
        </div>
        <div>----</div>
        <div><br>
        </div>
        <div>The ESRL: PSD site provides <br>
        </div>
        <div><a href="https://www.esrl.noaa.gov/psd/data/gridded/using_dods.html#software" target="_blank"><b>https://www.esrl.noaa.gov/psd/data/gridded/using_dods.html#software</b></a></div>
        <div><br>
        </div>
        <div>links to a number of tools to do what you want</div>
        <div><br>
        </div>
        <div>Good luck<br>
        </div>
      </div>
      <br>
      <div class="gmail_quote">
        <div dir="ltr" class="gmail_attr">On Mon, Jun 10, 2019 at 10:01
          AM Micah Sklut <<a href="mailto:micahs2005@gmail.com" target="_blank">micahs2005@gmail.com</a>> wrote:<br>
        </div>
        <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
          <div dir="ltr">
            <div>I haven't found any info regarding only downloading
              specific variables of a NetCDF file, but I just wanted to
              check with the NCL community in case I am missing
              something. </div>
            <div><br>
            </div>
            <div>Thank you. </div>
            <div><br>
            </div>
          </div>
          _______________________________________________<br>
          ncl-talk mailing list<br>
          <a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
          List instructions, subscriber options, unsubscribe:<br>
          <a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
        </blockquote>
      </div>
      <br>
      <fieldset class="gmail-m_1702545632514671676gmail-m_8827068505650226276mimeAttachmentHeader"></fieldset>
      <pre class="gmail-m_1702545632514671676gmail-m_8827068505650226276moz-quote-pre">_______________________________________________
ncl-talk mailing list
<a class="gmail-m_1702545632514671676gmail-m_8827068505650226276moz-txt-link-abbreviated" href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a>
List instructions, subscriber options, unsubscribe:
<a class="gmail-m_1702545632514671676gmail-m_8827068505650226276moz-txt-link-freetext" href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a>
</pre>
    </blockquote>
    <pre class="gmail-m_1702545632514671676gmail-m_8827068505650226276moz-signature" cols="72">-- 
----------------------------------------------
NOAA/ESRL PSD and CU CIRES
303-497-6263
<a class="gmail-m_1702545632514671676gmail-m_8827068505650226276moz-txt-link-freetext" href="https://www.esrl.noaa.gov/psd/people/cathy.smith/" target="_blank">https://www.esrl.noaa.gov/psd/people/cathy.smith/</a>

Emails about data/webpages may get quicker responses from emailing 
<a class="gmail-m_1702545632514671676gmail-m_8827068505650226276moz-txt-link-abbreviated" href="mailto:esrl.psd.data@noaa.gov" target="_blank">esrl.psd.data@noaa.gov</a></pre>
  </div>

</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail-m_1702545632514671676gmail_signature">Micah Sklut<br><br></div>
</blockquote></div>