<div dir="ltr">Responses should be sent to ncl-talk, with a cc. <div><br><div>This would suggest that <span style="font-family:arial,sans-serif;font-size:13px">TotCH4_A is at no point equal to 1 therefore everything has been masked. Look at your data. If in doubt plot </span><span style="font-family:arial,sans-serif;font-size:13px">TotCH4_A if thats really want you to mask based on and chose your mask based on the data.</span></div>
<div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px">print(num(</span><span style="font-family:arial,sans-serif;font-size:13px">TotCH4_A.eq.1)) will likely reveal 0. </span></div>
</div><div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Thu, Aug 28, 2014 at 8:26 AM, Kunal Bali <span dir="ltr"><<a href="mailto:kunal.bali9@gmail.com" target="_blank">kunal.bali9@gmail.com</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">How to add the valid values in scalar field. I have attached screen-shot of running ncl. please look at that. <br><div><div><div class=""><br>ncl 3> load "/usr/local/lib/ncl/lib/ncarg/nclscripts/csm/gsn_code.ncl"<br>
ncl 4> load "/usr/local/lib/ncl/lib/ncarg/nclscripts/csm/gsn_csm.ncl" <br>ncl 5> begin<br>ncl 6> in = addfile("/home/kunal/<a href="http://14-01.nc" target="_blank">14-01.nc</a>","r")<br>
ncl 7> ts = in->TotCH4_A(:,:)<br></div>
ncl 8> oro = in->TotCH4_A(:,:)<br>ncl 9> land_only = ts<br>ncl 10> land_only = mask(ts,oro,1)<br>ncl 11> wks = gsn_open_wks("x11","mask")<br>ncl 12> gsn_define_colormap(wks,"BlAqGrYeOrRe")<br>
ncl 13> res = True<br>ncl 14> res@cnFillOn = True<br>ncl 15> res@cnLinesOn = False<br>ncl 16> res@tiMainString = "Land Only"<br>ncl 17> plot = gsn_csm_contour_map_ce(wks,land_only,res)<br>ncl 18> end<br>
warning:ContourPlotInitialize: no valid values in scalar field; ContourPlot not possible:[errno=1101]<br><br></div></div></div><div class="gmail_extra"><div class=""><br clear="all"><div><div dir="ltr"><div>Kunal Bali<br>
</div><div>Research Scholar <br>
</div><div>Radio & Atmospheric Science Division <br></div><div>CSIR - National Physical Laboratory<br></div><div>New Delhi - 110012<br><br></div><div><br></div><div><br></div><div><br></div><div><p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;border-collapse:collapse;font-family:Tahoma,Verdana;font-size:12px">
<font color="#1F497D"><br></font></p></div></div></div>
<br><br></div><div><div class="h5"><div class="gmail_quote">On Thu, Aug 28, 2014 at 5:27 PM, Alan Brammer <span dir="ltr"><<a href="mailto:abrammer@albany.edu" target="_blank">abrammer@albany.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">Dear Kunali, <div> The error tells you exactly what is wrong. </div><div><div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px">ncl 5> oro = in->ORO(:,:)</span><br>
</div></div><div><div><span style="font-family:arial,sans-serif;font-size:13px">fatal:["Execute.c":6321]:</span><span style="font-family:arial,sans-serif;font-size:13px">variable (ORO) is not in file (in)</span><br style="font-family:arial,sans-serif;font-size:13px">
<span style="font-family:arial,sans-serif;font-size:13px">fatal:["Execute.c":8565]:</span><span style="font-family:arial,sans-serif;font-size:13px">Execute: Error occurred at or near line 5</span><br></div><div>
<span style="font-family:arial,sans-serif;font-size:13px"><br></span></div></div><div><span style="font-family:arial,sans-serif;font-size:13px">You're trying to load a variable ORO from the file, but a variable by that name does not exist in the file. I'd recommend running ncl_filedump </span><span style="font-size:13px;font-family:arial,sans-serif">/home/kunal/</span><a href="http://14-01.nc/" style="font-size:13px;font-family:arial,sans-serif" target="_blank">14-01.nc</a> and check the variables in the file. </div>
<div>Or add print(getfilevarnames(in)) to the script after you load the file. </div><div><br></div><div><br></div><div>Once past that error, as long as oro is equal to 1 over the ocean then you're good. Otherwise you may want an adjustment on this example from the ncl webpage for (oro.le.0)</div>
<div> <span style="color:rgb(0,0,0);font-family:courier;font-size:13.333333969116211px;line-height:16px">; More advanced case mask a at locations where ma0 is not-equal-to 2</span></div><pre style="margin-top:0px;margin-bottom:0px;padding:0px;font-size:13.333333969116211px;line-height:16px;font-family:courier;border-style:solid;border-width:0px 0px 15px;border-color:transparent;color:rgb(0,0,0)">
;
out1 = <strong style="margin:0px;padding:0px">mask</strong>( a, (ma0.ne.2), True)</pre><div><div><span style="font-family:arial,sans-serif;font-size:13px">ncl 6> land_only = ts</span><br style="font-family:arial,sans-serif;font-size:13px">
<span style="font-family:arial,sans-serif;font-size:13px">ncl 7> land_only = mask(ts,oro,1)</span><br></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br>
</span></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div></div><div><span style="font-family:arial,sans-serif;font-size:13px">Good Luck, </span></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br>
</span></div><div>Alan Brammer</div></div><div class="gmail_extra"><br><br><div class="gmail_quote"><div><div>On Thu, Aug 28, 2014 at 7:41 AM, Kunal Bali <span dir="ltr"><<a href="mailto:kunal.bali9@gmail.com" target="_blank">kunal.bali9@gmail.com</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><div dir="ltr"><div><div>Hello<br></div>I am trying to use the masking scripts for generating data only on land. but i am getting error. My scripts is given below. <br>
<br>In this i am not getting the means of oro (line -5). <br>
Could any one suggest me to how to correct this scripts or how to visualize the data on land only. <br><br>ncl 0> load "/usr/local/lib/ncl/lib/ncarg/nclscripts/csm/gsn_code.ncl"<br>ncl 1> load "/usr/local/lib/ncl/lib/ncarg/nclscripts/csm/gsn_csm.ncl" <br>
ncl 2> begin<br>ncl 3> in = addfile("/home/kunal/<a href="http://14-01.nc" target="_blank">14-01.nc</a>","r")<br>ncl 4> ts = in->TotCH4_A(:,:) <br>ncl 5> oro = in->ORO(:,:)<br>ncl 6> land_only = ts<br>
ncl 7> land_only = mask(ts,oro,1)<br>ncl 8> wks = gsn_open_wks("x11","mask")<br>ncl 9> gsn_define_colormap(wks,"BlAqGrYeOrRe")<br>ncl 10> res = True<br>ncl 11> res@cnFillOn = True<br>
ncl 12> res@cnLinesOn = False<br>ncl 13> res@gsnSpreadColors = True<br>ncl 14> res@gsnSpreadColorStart = 10<br>ncl 15> res@gsnSpreadColorEnd = 96 <br>ncl 16> res@cnLevelSpacingF = 3<br>ncl 17> res@lbLabelString = 4<br>
ncl 18> res@tiMainString = "Land Only"<br>ncl 19> plot = gsn_csm_contour_map_ce(wks,land_onl,res)<br>ncl 20> end<br>fatal:["Execute.c":6321]:variable (ORO) is not in file (in)<br>fatal:["Execute.c":8565]:Execute: Error occurred at or near line 5<br>
<br><br></div>Thank You<span><font color="#888888"><br clear="all"><div><div><div><div><div dir="ltr"><div>Kunal Bali<br></div><div>Research Scholar <br></div><div>Radio & Atmospheric Science Division <br>
</div><div>CSIR - National Physical Laboratory<br>
</div><div>New Delhi - 110012<br><br></div><div><br></div><div><br></div><div><br></div><div><p style="margin:0px;border-collapse:collapse;font-family:Tahoma,Verdana;font-size:12px"><font color="#1F497D"><br></font></p></div>
</div></div>
</div></div></div></font></span></div>
<br></div></div>_______________________________________________<br>
ncl-talk mailing list<br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div></div></div>
</blockquote></div><br></div></div>