<div dir="ltr">Many thanks to Shea and Dave.<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jul 5, 2019 at 12:13 AM Dennis Shea <<a href="mailto:shea@ucar.edu">shea@ucar.edu</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>PLEASE READ:  <a href="http://www.ncl.ucar.edu/Applications/method_1.shtml" target="_blank"><b>http://www.ncl.ucar.edu/Applications/method_1.shtml</b></a></div><div><br></div><div>As noted by Dave Allured:</div><div><br></div><div>   rh = ....</div><div>   rh@long_name = "Relative Humidity"   ; @ to associate attribute with a variable<br></div><div>   rh@units = "%"        <br></div><div><br></div><div>    dir_nc = "./"                       ; output directory  [  ./  ] is current directory<br></div><div>    fil_nc  = "RH_WRF.nc"</div><div>    pth_nc = dir_nc+fil_nc</div><div><br></div><div>    <a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/system.shtml" target="_blank"><strong>system</strong></a>("/bin/rm -f "+pth_nc)   ; explicitly remove any pre-existing file</div><div><div>    ncdf = addfile (pth_nc,"c")</div><div>    <br></div><div>    f->RHUM = rh</div><div><br></div><div>========</div><div>Likely, you have to add XLAT, XLONG, TIME variables also.<br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jul 4, 2019 at 12:02 PM Dave Allured - NOAA Affiliate via ncl-talk <<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</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">Arshitha,<div><br></div><div>Here is the simplest possible way to write a netcdf file with one attribute.  Try this first.  Use ncdump -h to inspect your output file.  Suppose you already calculated a variable named "rh" in NCL.</div><div><br></div><div>    f = addfile ("<a href="http://filename.nc" target="_blank">filename.nc</a>","c")</div><div>    rh@att1 = "test"</div><div>    f->rhum = rh</div><div>    exit</div><div><div><br></div>For more details, please see this documentation:<br><a href="https://www.ncl.ucar.edu/Applications/method_1.shtml" target="_blank">https://www.ncl.ucar.edu/Applications/method_1.shtml</a></div><div><br><div>--Dave</div><div><br></div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jul 4, 2019 at 9:29 AM arshitha anand via ncl-talk <<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</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="auto"><div dir="ltr"><div style="font-family:sans-serif;font-size:13.696px" dir="auto"><div style="margin:16px 0px"><div dir="auto">Dear all, <div dir="auto"><br></div><div dir="auto">I have an inssue in writing netcdf file. </div><div dir="auto">I calculated relative humidity from wrf ouput file. Then I need to write it as a netcdf file.</div><div dir="auto">Does anyone know  how to define the attribute  and also, how can I write it as a netcdf file. </div><div dir="auto"><span style="font-size:13.696px"> Kindly note my script, attached below.</span><br></div></div></div></div></div><div dir="ltr"><br></div><div dir="ltr">Thank you for your suggestions in advance.</div><div dir="ltr"><br>-- <br><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><div><span style="color:rgb(0,0,255)"><i><span style="font-family:arial,helvetica,sans-serif">Regards,</span></i></span></div><div><span style="font-family:arial,helvetica,sans-serif"><b><br></b></span></div><div><span style="color:rgb(0,0,255)"><span style="font-family:arial,helvetica,sans-serif"><b>Arshitha Anand K A</b><br></span></span></div><span style="color:rgb(0,0,255)"><span style="font-family:arial,helvetica,sans-serif">Project Associate<br></span></span></div><div><span style="color:rgb(0,0,255)"><span style="font-family:arial,helvetica,sans-serif">Department of civil engineering<br></span></span></div><div><span style="color:rgb(0,0,255)"><span style="font-family:arial,helvetica,sans-serif">Indian Institute of Technology Madras</span></span></div><div><span style="color:rgb(0,0,255)"><span style="font-family:arial,helvetica,sans-serif">Chennai - 600036<br></span></span></div><span style="color:rgb(0,0,255)"><span style="font-family:arial,helvetica,sans-serif"></span></span></div></div></div></div></div></div></blockquote></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></blockquote></div>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div><div><div><span style="color:rgb(0,0,255)"><i><span style="font-family:arial,helvetica,sans-serif">Regards,</span></i></span></div><div><span style="font-family:arial,helvetica,sans-serif"><b><br></b></span></div><div><span style="color:rgb(0,0,255)"><span style="font-family:arial,helvetica,sans-serif"><b>Arshitha Anand K A</b><br></span></span></div><span style="color:rgb(0,0,255)"><span style="font-family:arial,helvetica,sans-serif">Project Associate<br></span></span></div><div><span style="color:rgb(0,0,255)"><span style="font-family:arial,helvetica,sans-serif">Department of civil engineering<br></span></span></div><div><span style="color:rgb(0,0,255)"><span style="font-family:arial,helvetica,sans-serif">Indian Institute of Technology Madras</span></span></div><div><span style="color:rgb(0,0,255)"><span style="font-family:arial,helvetica,sans-serif">Chennai - 600036<br></span></span></div><span style="color:rgb(0,0,255)"><span style="font-family:arial,helvetica,sans-serif"></span></span></div></div><div><div><div><div><div><br></div></div></div></div></div></div></div></div></div></div></div>