<div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Hi Tess,</div><div><br></div><div>The attached is a 'toy' example. <br></div><div><br></div><div>%> ncl toy.ncl<br></div><div><br></div><div>INPUT: (any order)<br></div><div><br></div><div>(0) mslp-an-sfc-ERAI_G-v1-2018010100.nc<br>(1) mslp-an-sfc-ERAI_G-v1-2018010106.nc<br>(2) mslp-an-sfc-ERAI_G-v1-2018010112.nc<br>(3) mslp-an-sfc-ERAI_G-v1-2018010118.nc<br>(4) mslp-an-sfc-ERAI_G-v1-2018010206.nc<br>(5) mslp-an-sfc-ERAI_G-v1-2018010218.nc<br>(6) mslp-an-sfc-ERAI_G-v<b><span style="color:rgb(255,0,0)">1.1</span></b>-<a href="http://2018010100.nc">2018010100.nc</a><br>(7) mslp-an-sfc-ERAI_G-v<span style="color:rgb(255,0,0)"><b>1.1</b></span>-<a href="http://2018010112.nc">2018010112.nc</a><br>(8) mslp-an-sfc-ERAI_G-v<span style="color:rgb(255,0,0)"><b>1.1</b></span>-<a href="http://2018010118.nc">2018010118.nc</a><br>(9) mslp-an-sfc-ERAI_G-v<span style="color:rgb(255,0,0)"><b>1.2</b></span>-<a href="http://2018010112.nc">2018010112.nc</a><br>(10) mslp-an-sfc-ERAI_G-v<span style="color:rgb(255,0,0)"><b>1.3</b></span>-<a href="http://2018010112.nc">2018010112.nc</a><br><br></div><div>OUTPUT:</div><div><br></div><div>(0) mslp-an-sfc-ERAI_G-<b><span style="color:rgb(255,0,0)">v1.1</span>-2018010100</b>.nc<br>(1) mslp-an-sfc-ERAI_G-<b>v1-2018010106</b>.nc<br>(2) mslp-an-sfc-ERAI_G-<b><span style="color:rgb(255,0,0)">v1.3</span>-2018010112</b>.nc<br>(3) mslp-an-sfc-ERAI_G-<b><span style="color:rgb(255,0,0)">v1.1</span>-2018010118</b>.nc<br>(4) mslp-an-sfc-ERAI_G-<b>v1-2018010206</b>.nc<br>(5) mslp-an-sfc-ERAI_G-<b>v1-2018010218</b>.nc<br></div><div><br></div></div></div></div><br><div class="gmail_quote"><div dir="ltr">On Thu, Oct 4, 2018 at 12:02 AM Tess Parker <<a href="mailto:tess.parker@monash.edu">tess.parker@monash.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div dir="ltr">Hi,<div><br></div><div>I need to access a large number of netcdf files from a central repository. </div><div><br></div><div>There is a directory for each year, with a subdirectory for each month. This contains the 6-hourly files for every day of that year/month. The files are named according to the following protocol:</div><div><br></div><div><a href="http://var_name-input_type_1-input_type_2-data_set-version_yyyymmddhh.nc" target="_blank">var_name-input_type_1-input_type_2-data_set-version_yyyymmddhh.nc</a></div><div><br></div><div>The problematic part is that, if a 6-hourly file has been regenerated, then the version number in the file name will change, but all previous versions of the file will also be retained for operational reasons. So every month's directory may contain several versions of the file for the same time step. The initial version number is "v1", with subsequent versions numbered "v1.1", "v1.2", etc.</div><div><br></div><div>My question is, how can I write an NCL script that will access several years worth of data for each variable, but dynamically retrieve only the latest version of the files for each time step? (This would be slightly simpler, I feel, if "v1" were instead "v1.0" but this is not the case.) The options seem to be to find duplicate date/times in the list of file names, and then check for either the version number or perhaps the file modification date?</div><div><br></div><div>The code needs to be flexible enough to be applied to varying lengths of the components of the file name protocol, such as different variable names etc., and also to the retrieval of just e.g. the 06 UTC time steps, etc. It also needs to be efficient in terms of processing time.</div><div><br></div><div>Many thanks for your help!</div><div>Tess</div><div><br clear="all"><div><div dir="ltr" class="m_3343652801879708767gmail-m_7619687583082500853gmail_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>-- <br>Dr Tess Parker<br>Research Fellow<br>Civil Engineering & School of Earth, Atmosphere and Environment<br>Room 232, Building 28<br></div><div>9 Rainforest Walk<br></div><div>Monash University, Clayton VIC 3800<br><br></div><a href="http://users.monash.edu.au/~tess/index.html" target="_blank">http://users.monash.edu.au/~tess/index.html</a><br></div></div></div></div></div></div></div></div></div></div></div></div></div></div></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>