<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi Gurbrinder,<div class=""><br class=""></div><div class="">please take a look at the addfiles function to read multiple files:</div><div class=""><br class=""></div><div class=""><a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/addfiles.shtml" class="">http://www.ncl.ucar.edu/Document/Functions/Built-in/addfiles.shtml</a></div><div class=""><br class=""></div><div class="">Bye,</div><div class="">Karin</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">Am 16.07.2016 um 17:10 schrieb gurbrinder aulakh <<a href="mailto:gurbrinderaulakh@yahoo.co.in" class="">gurbrinderaulakh@yahoo.co.in</a>>:</div><br class="Apple-interchange-newline"><div class=""><div class=""><div style="background-color: rgb(255, 255, 255); font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 16px;" class=""><div id="yui_3_16_0_1_1468680997189_4783" class=""><br class=""></div><div id="yui_3_16_0_1_1468680997189_4783" dir="ltr" class="">I want to read u component of wind at different hpa level, variable names are like UGRD_500_ISBL,UGRD_800_ISBL and so on in multiple netcdf files. Can I read these different variable names from multiple .nc files at once......Please help...As otherwise I have to read one by one as in the following script.....</div><div id="yui_3_16_0_1_1468680997189_4783" class=""><br class=""></div><div id="yui_3_16_0_1_1468680997189_4783" class=""><br class=""></div><div id="yui_3_16_0_1_1468680997189_4783" class="">load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"</div><div id="yui_3_16_0_1_1468680997189_4784" class=""> ;</div><div id="yui_3_16_0_1_1468680997189_4785" class=""> ;</div><div id="yui_3_16_0_1_1468680997189_4786" class="">begin</div><div id="yui_3_16_0_1_1468680997189_4787" class=""><br id="yui_3_16_0_1_1468680997189_4788" class=""></div><div id="yui_3_16_0_1_1468680997189_4789" class="">f = addfile("UwindComponent/uwind_850_600gmt.nc" , "r")</div><div id="yui_3_16_0_1_1468680997189_4790" class="">;all_files=systemfunc("uwind_850_600gmt.nc")</div><div id="yui_3_16_0_1_1468680997189_4791" class=""> glond = f->longitude</div><div id="yui_3_16_0_1_1468680997189_4792" class=""> glatd = f->latitude</div><div id="yui_3_16_0_1_1468680997189_4793" class=""> </div><div id="yui_3_16_0_1_1468680997189_4794" class=""><br id="yui_3_16_0_1_1468680997189_4795" class=""></div><div id="yui_3_16_0_1_1468680997189_4796" class=""> </div><div id="yui_3_16_0_1_1468680997189_4797" class=""> dq = str_get_dq() </div><div id="yui_3_16_0_1_1468680997189_4798" class=""><br id="yui_3_16_0_1_1468680997189_4799" class=""></div><div id="yui_3_16_0_1_1468680997189_4800" class=""> latS = 29.66 </div><div id="yui_3_16_0_1_1468680997189_4801" class=""> latN = 34.66</div><div id="yui_3_16_0_1_1468680997189_4802" class=""> lonW = -85.40</div><div id="yui_3_16_0_1_1468680997189_4803" class=""> lonE = -80.40</div><div id="yui_3_16_0_1_1468680997189_4804" class=""> </div><div id="yui_3_16_0_1_1468680997189_4805" class=""> ;printVarSummary(lonW)</div><div id="yui_3_16_0_1_1468680997189_4806" class=""> ;printVarSummary(lonE)</div><div id="yui_3_16_0_1_1468680997189_4807" class=""> </div><div id="yui_3_16_0_1_1468680997189_4808" class=""><br id="yui_3_16_0_1_1468680997189_4809" class=""></div><div id="yui_3_16_0_1_1468680997189_4810" class="">ji = region_ind(glatd,glond, latS, latN, lonW, lonE)</div><div id="yui_3_16_0_1_1468680997189_4811" class=""><br id="yui_3_16_0_1_1468680997189_4812" class=""></div><div id="yui_3_16_0_1_1468680997189_4813" class=""> jStrt = ji(0) ; lat start</div><div id="yui_3_16_0_1_1468680997189_4814" class=""> jLast = ji(1) ; lat last</div><div id="yui_3_16_0_1_1468680997189_4815" class=""> iStrt = ji(2) ; lon start</div><div id="yui_3_16_0_1_1468680997189_4816" class=""> iLast = ji(3) ; lon last</div><div id="yui_3_16_0_1_1468680997189_4817" class=""><br id="yui_3_16_0_1_1468680997189_4818" class=""></div><div id="yui_3_16_0_1_1468680997189_4819" class=""> ;printVarSummary(jStrt)</div><div id="yui_3_16_0_1_1468680997189_4820" class=""> ;print(jLast)</div><div id="yui_3_16_0_1_1468680997189_4821" class=""> ;print(iStrt)</div><div id="yui_3_16_0_1_1468680997189_4822" class=""> ;print(iLast)</div><div id="yui_3_16_0_1_1468680997189_4823" class=""> </div><div id="yui_3_16_0_1_1468680997189_4824" class=""> LAT2D = glatd(jStrt:jLast,iStrt:iLast)</div><div id="yui_3_16_0_1_1468680997189_4825" class=""> LON2D = glond(jStrt:jLast,iStrt:iLast)</div><div id="yui_3_16_0_1_1468680997189_4826" class=""><br id="yui_3_16_0_1_1468680997189_4827" class=""></div><div id="yui_3_16_0_1_1468680997189_4828" class="">; printVarSummary(LAT2D)</div><div id="yui_3_16_0_1_1468680997189_4829" class=""> ;print(LON2D)</div><div id="yui_3_16_0_1_1468680997189_4830" class=""><br id="yui_3_16_0_1_1468680997189_4831" class=""></div><div id="yui_3_16_0_1_1468680997189_4832" class=""> ; read data just for the region of interest</div><div id="yui_3_16_0_1_1468680997189_4833" class=""> x = f->UGRD_500_ISBL(:,jStrt:jLast,iStrt:iLast)</div><div id="yui_3_16_0_1_1468680997189_4834" class="">;print(x)</div><div id="yui_3_16_0_1_1468680997189_4835" class="">csv_filename="mydata.csv"</div><div id="yui_3_16_0_1_1468680997189_4836" class="">fields=(/"LAT","LON","Temperature"/)</div><div id="yui_3_16_0_1_1468680997189_4837" class=""> </div><div id="yui_3_16_0_1_1468680997189_4838" class=""> ; printVarSummary(LAT2D)</div><div id="yui_3_16_0_1_1468680997189_4839" class="">fields=dq+fields+dq</div><div id="yui_3_16_0_1_1468680997189_4840" class=""> header=[/str_join(fields,",")/]</div><div id="yui_3_16_0_1_1468680997189_4841" class=""> </div><div id="yui_3_16_0_1_1468680997189_4842" class=""> alist=[/LAT2D,LON2D,x/]</div><div id="yui_3_16_0_1_1468680997189_4843" class=""> </div><div id="yui_3_16_0_1_1468680997189_4844" class=""> format="%.2f,%.2f,%.2f"</div><div id="yui_3_16_0_1_1468680997189_4845" class=""> </div><div id="yui_3_16_0_1_1468680997189_4846" class=""> system("rm -rf " + csv_filename)</div><div id="yui_3_16_0_1_1468680997189_4847" class=""> write_table(csv_filename,"w",header,"%s")</div><div id="yui_3_16_0_1_1468680997189_4848" class=""> write_table(csv_filename,"a",alist,format)</div><div id="yui_3_16_0_1_1468680997189_4849" class=""> </div><div id="yui_3_16_0_1_1468680997189_4850" class=""> </div><div id="yui_3_16_0_1_1468680997189_4851" class=""> </div><div id="yui_3_16_0_1_1468680997189_4852" class=""> </div><div id="yui_3_16_0_1_1468680997189_4853" class=""> </div><div id="yui_3_16_0_1_1468680997189_4854" class="">end</div><div dir="ltr" id="yui_3_16_0_1_1468680997189_4855" class="">please help</div></div></div>_______________________________________________<br class="">ncl-talk mailing list<br class=""><a href="mailto:ncl-talk@ucar.edu" class="">ncl-talk@ucar.edu</a><br class="">List instructions, subscriber options, unsubscribe:<br class="">http://mailman.ucar.edu/mailman/listinfo/ncl-talk<br class=""></div></blockquote></div><div apple-content-edited="true" class=""><br class="Apple-interchange-newline"><br class="Apple-interchange-newline">
</div>
<br class=""></div></body></html>