<div dir="ltr"><div><div><div><div><div><div><div><div>Hi Jay,<br><br></div>There are probably several ways to do this. One that occurs to me is to create the dimensions in the new file with the "filedimdef" procedure:<br><br> <a href="http://ncl.ucar.edu/Document/Functions/Built-in/filedimdef.shtml">http://ncl.ucar.edu/Document/Functions/Built-in/filedimdef.shtml</a><br><br></div>So in your case, that might look something like:<br><br> filedimdef(f,(/"lat","lon"/),(/1440, 720/), (/False,False/))<br><br></div>You can add the other information directly as global attributes of the file:<br><br></div> f->LatitudeResolution=0.25<br></div> f->LongitudeResolution=0.25<br></div> ...etc...<br><br></div>Hope that helps...<br></div>Rick<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, May 1, 2017 at 12:28 PM, Su, Jian (GSFC-610.2)[ADNET SYSTEMS INC] <span dir="ltr"><<a href="mailto:jian.su@nasa.gov" target="_blank">jian.su@nasa.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="white" link="#0563C1" vlink="#954F72" lang="EN-US">
<div class="m_2209678857491091221WordSection1">
<p class="MsoNormal">Hello,<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I am using ncl to convert HDF5 files to netCDF, and one of them looks like this:<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Variable: f<u></u><u></u></p>
<p class="MsoNormal">Type: file<u></u><u></u></p>
<p class="MsoNormal">filename: out<u></u><u></u></p>
<p class="MsoNormal">path: out.nc4<u></u><u></u></p>
<p class="MsoNormal"> file global attributes:<u></u><u></u></p>
<p class="MsoNormal"> dimensions:<u></u><u></u></p>
<p class="MsoNormal"> DIM_001 = 1440<u></u><u></u></p>
<p class="MsoNormal"> DIM_002 = 720<u></u><u></u></p>
<p class="MsoNormal"> variables:<u></u><u></u></p>
<p class="MsoNormal"> integer pixTot ( DIM_001, DIM_002 )<u></u><u></u></p>
<p class="MsoNormal"> CodeMissingValue : -9999<u></u><u></u></p>
<p class="MsoNormal"> DimensionNames : nlon,nlat<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">How can I change DIM_001 and DIM_002 to lat/lon, and add the grid information eg,<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">LatitudeResolution=0.25;<u></u><u></u></p>
<p class="MsoNormal">LongitudeResolution=0.25;<u></u><u></u></p>
<p class="MsoNormal">NorthBoundingCoordinate=90;<u></u><u></u></p>
<p class="MsoNormal">SouthBoundingCoordinate=-90;<u></u><u></u></p>
<p class="MsoNormal">EastBoundingCoordinate=180;<u></u><u></u></p>
<p class="MsoNormal">WestBoundingCoordinate=-180;<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Thanks,<u></u><u></u></p>
<p class="MsoNormal">Jay<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
<br>______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">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/<wbr>mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>