<div dir="ltr"><div class="gmail_default" style="font-size:small">Ying,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Sorry about the delay, I've been out-of-town.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Were you able to figure out the problem? Did you try the "trGridType" setting that the message recommended? This is needed if your lat/lon coordinates contain missing values.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"> If you are still having a problem, it would help if I could have access to your data file and the latest version of your script.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">You can upload these to our ftp site:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default"><a href="http://www.ncl.ucar.edu/ftp_files.shtml">http://www.ncl.ucar.edu/ftp_files.shtml</a><br></div><div class="gmail_default"><br></div><div class="gmail_default">--Mary</div><div class="gmail_default"><br></div><div class="gmail_default" style="font-size:small"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Sep 8, 2017 at 2:58 AM, Ying Song <span dir="ltr"><<a href="mailto:ying.song@sjsu.edu" target="_blank">ying.song@sjsu.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">Hello, Mary, <div><br></div><div>I modified my script following your first suggestion. The problem is still there. The warning msg shows:</div><div>------------------------------<wbr>-------------------</div><div><div>Variable: o3_p</div><div>Type: float</div><div>Total Size: 831744 bytes</div><div> 207936 values</div><div>Number of Dimensions: 2</div><div>Dimensions and sizes: [lat | 361] x [lon | 576]</div><div>Coordinates:</div><span class=""><div> lat: [ -90.. 90]</div><div> lon: [-180..179.375]</div></span><div>Number Of Attributes: 13</div><div> lev : 900</div><div> time : 540</div><div> long_name : ozone mixing ratio</div><div> units : ppbv</div><span class=""><div> _FillValue : 1e+15</div><div> missing_value : 1e+15</div><div> fmissing_value : 1e+15</div><div> scale_factor : 1</div><div> add_offset : 0</div><div> standard_name : ozone_mass_mixing_ratio</div><div> vmax : 1e+15</div><div> vmin : -1e+15</div><div> valid_range : ( -1e+15, 1e+15 )</div></span><span class=""><div>warning:ContourPlotDraw: out of range coordinates encountered; standard AreaFill rendering method may be unreliable;</div><div> consider setting the resource trGridType to "TriangularMesh" if coordinates contain missing values</div></span></div><div>------------------------------<wbr>-------</div><div>And I attached the updated script. I wounder if I need to add triangular meshes resource in my script?</div><div><br></div><div>Thanks! </div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Sep 7, 2017 at 8:46 AM, Mary Haley <span dir="ltr"><<a href="mailto:haley@ucar.edu" target="_blank">haley@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 class="gmail_default" style="font-size:small">I think the issue is that "o3_p", which is the variable you are trying to plot, doesn't have any metadata attached to it.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">When you do calculations like this in NCL:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><div class="gmail_default"> o3= a->O3(3,4,:,:) ; 18GTM = 11AM PST </div><div class="gmail_default"> printVarSummary(o3)</div><div class="gmail_default"> o3_p =(o3*1e9)*(28.97/48)<br></div><div class="gmail_default"><br></div><div class="gmail_default">The "o3" will have metadata because no computations were done when you read the variable off the file.</div><div class="gmail_default"><br></div><div class="gmail_default">However, since o3_p involves calculations, NCL will strip all the metadata and the only thing that o3_p will retain from o3 is the _FillValue attribute, if any.</div><div class="gmail_default"><br></div><div class="gmail_default">As a "trick", you can force o3_p to have the same metadata by doing the following:</div><div class="gmail_default"><br></div><div class="gmail_default"><div class="gmail_default"><font face="monospace, monospace"> o3_p = a->O3(3,4,:,:) ; 18GTM = 11AM PST </font></div><div class="gmail_default"><font face="monospace, monospace"> o3_p =(o3_p*1e9)*(28.97/48)</font></div><div class="gmail_default"><br></div><div class="gmail_default">The first line will read the data into o3_p, and the metadata will all be there. Then, when you do the calculation, since o3_p already exists, no metadata will be removed.</div><div class="gmail_default"><br></div><div class="gmail_default">Note that I removed the use of o3, just to save memory. If you need to keep o3 and o3_p around, then you can do:</div><div class="gmail_default"><br></div><div class="gmail_default"><div class="gmail_default"><font face="monospace, monospace"> o3 = a->O3(3,4,:,:) ; 18GTM = 11AM PST <br> o3_p = o3 ; trick to copy metadata</font></div><div class="gmail_default"><font face="monospace, monospace"> o3_p =(o3*1e9)*(28.97/48)</font></div></div><div class="gmail_default"><br></div><div class="gmail_default">You should however, update the long_name and units attributes of o3_p, to reflect what the new values represent.</div><div class="gmail_default"><br></div><div class="gmail_default">--Mary</div><div class="gmail_default"><br></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="m_6220905520815541298h5">On Wed, Sep 6, 2017 at 5:05 PM, Ying Song <span dir="ltr"><<a href="mailto:ying.song@sjsu.edu" target="_blank">ying.song@sjsu.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="m_6220905520815541298h5"><div dir="ltr">Hello, ncl helper,<div><br></div><div>I trying to plot MERRA-2 reanalysis data in NCL using gsn_contour_map. I am only interested in west coast of US. But I can not get the zoom in plot correctly by using resources:</div><div><div><br></div><div> res@mpMinLatF = 30</div><div> res@mpMaxLatF = 45</div><div> res@mpMinLonF = -130</div><div> res@mpMaxLonF = -110</div></div><div><br></div><div>The warning shows:</div><div><div>warning:ContourPlotDraw: out of range coordinates encountered; standard AreaFill rendering method may be unreliable;</div><div> consider setting the resource trGridType to "TriangularMesh" if coordinates contain missing values</div></div><div><br></div><div>Attachment is my script. The info of MERRA-2 O3 data from printVarSummary is:</div><div> -----------------------------<wbr>-</div><div><div>Variable: o3</div><div>Type: float</div><div>Total Size: 279465984 bytes</div><div> 69866496 values</div><div>Number of Dimensions: 4</div><div>Dimensions and sizes: [time | 8] x [lev | 42] x [lat | 361] x [lon | 576]</div><div>Coordinates:</div><div> time: [0..1260]</div><div> lev: [1000..0.1000000014901161]</div><div> lat: [ -90.. 90]</div><div> lon: [-180..179.375]</div><div>Number Of Attributes: 11</div><div> long_name : ozone_mass_mixing_ratio</div><div> units : kg kg-1</div><div> _FillValue : 1e+15</div><div> missing_value : 1e+15</div><div> fmissing_value : 1e+15</div><div> scale_factor : 1</div><div> add_offset : 0</div><div> standard_name : ozone_mass_mixing_ratio</div><div> vmax : 1e+15</div><div> vmin : -1e+15</div><div> valid_range : ( -1e+15, 1e+15 )</div></div><div>------------------------------<wbr>---------------------------</div></div>
<br></div></div>______________________________<wbr>_________________<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/mailma<wbr>n/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>