<div dir="ltr"><div><div>Station data and netCDF: See Chapter 9<br> <a href="http://cfconventions.org/cf-conventions/v1.6.0/cf-conventions.pdf" target="_blank">http://cfconventions.org/cf-conventions/v1.6.0/cf-conventions.pdf</a><br><br></div>Punch line ... this can be a bit of a nuisance! <br></div>As noted by RickB, even with the following a good portion of the data will likely be _FillValue. I suggest you write netCDF4 to take advantage of compression.<br><br> <a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/setfileoption.shtml">http://www.ncl.ucar.edu/Document/Functions/Built-in/setfileoption.shtml</a><br> <strong>setfileoption</strong>("nc","Format","NetCDF4")<div><div>===<br><div><br>7020019480101039999 8<br>21 98600B 7 -210B-9999 360 150<br>10 85000 1088B -272B-9999 10 230<br>10 70000 2497B -278B-9999 350 140<br>10 50000 4870B -371B-9999 170 130<br>10 40000 6386B -463B-9999 140 150<br>10 30000 8242B -561B-9999 150 130<br>10 25000 9400B -552B-9999 160 70<br>10 20000 10824B -547B-9999-9999-9999<br>#7020019480101169999 5<br>21 99000B 7 -292B-9999 330 130<br>10 85000 1091B -286B-9999 360 130<br>10 70000 2478B -290B-9999 350 200<br>10 50000 4866B -365B-9999 30 70<br>10 40000 6375B -475B-9999 70 40<br></div><div>[snip]<br><br></div><div>[a] header has ID / time stamp / # observations<br></div><div>[b] The 1st line after each header is (I speculate) the 'surface' values<br></div><div>[c] Subsequent values are associated with standard pressure levels<br><br></div><div>[1] <br>Create a 'time' array ... find the 1st and last dates on the file and create a time array yyymmdd that spans all days including leap years<br><br></div><div> time@units = "days since 1948-01-01 ....."<br><br></div><div>You may wish to look at the code used by <br><br><a href="http://www.ncl.ucar.edu/Document/Functions/Contributed/yyyymmdd_time.shtml">http://www.ncl.ucar.edu/Document/Functions/Contributed/yyyymmdd_time.shtml</a><br><br></div><div>These times are not CF compliant. If they are not to your liking, extract the code from contributed.ncl and change to your liking.<br></div><div><br></div><div>[2] create PSFC(time), TSFC(time), ...<br><br></div><div> PSFC = new (ntime, "float", -9999.0)<br></div><div> etc<br></div><div><br></div><div>[3] create coordinate pressure array (say) plevel(klev)<br></div><div> plevel = (/100000, 85000, ... /)<br></div><div> plevel@long_name = "standard pressure level"<br></div><div> plevel@units = "Pa"<br> plevel!0 = "plevel"<br></div><div> plevel&plevel = plevel<br></div><div> klev = dimsizes(plevel)<br></div><div><br></div><div>[4] create T(time,plevel), ...... for each variable<br><br></div><div> T = new( (/ntim,klev/), "float", -9999.0)<br></div><div> etc'<br></div><div><br></div><div>[5] <br>Loop: For each date (time) use 'ind' to associate the observation with the appropriate 'time' and 'level<br><br><br></div><div> <br></div><div><br></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Mar 21, 2016 at 9:35 AM, Rick Brownrigg <span dir="ltr"><<a href="mailto:brownrig@ucar.edu" target="_blank">brownrig@ucar.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>Hi,<br><br></div>The script you sent runs to completion, and creates a NetCDF file. You don't say what's wrong with it. The variables do seem to be comprised of mostly _FillValues (?)<br><br></div>Rick<br></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Sat, Mar 19, 2016 at 3:43 PM, Stanley Edwin <span dir="ltr"><<a href="mailto:sedwin@alaska.edu" target="_blank">sedwin@alaska.edu</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr"><div class="gmail_chip gmail_drive_chip" style="width:396px;min-height:18px;max-height:18px;background-color:#f5f5f5;padding:5px;color:#222;font-family:arial;font-style:normal;font-weight:bold;font-size:13px;border:1px solid #ddd;line-height:1"><a href="https://drive.google.com/a/alaska.edu/file/d/0B5e9G7If5LpKNnpnYXc0a3NfODg/view?usp=drive_web" style="display:inline-block;max-width:366px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-decoration:none;padding:1px 0;border:none" target="_blank"><img style="vertical-align:bottom;border:none" src="https://ssl.gstatic.com/docs/doclist/images/icon_10_generic_list.png"> <span dir="ltr" style="color:#15c;text-decoration:none;vertical-align:bottom">70200.dat.gz</span></a><img style="float:right"></div><br><div>I could not get this dat file to convert properly to NetCDF, files from NWS</div><div><br></div><div>Thank You</div><div><br></div><div>Stanley G. Edwin</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>
<br></blockquote></div><br></div>
<br>_______________________________________________<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/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>