<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
<div id="divtagdefaultwrapper" style="font-size:10pt;color:#2672EC;background-color:#FFFFFF;font-family:Arial,Helvetica,sans-serif;">
<p>Hi,</p>
<p><br>
</p>
<p>Earlier I was using <br>
</p>
<p><br>
</p>
<p><font face="Arial,Helvetica,sans-serif" color="#2672EC" size="2"><span style="font-size:10pt;background-color:white;" id="divtagdefaultwrapper"><font color="red"><b><font color="#4BA524">shp_mask = shapefile_mask_data(var,filename,opt) , so here I got the
 error:</font></b></font></span></font></p>
<p><font face="Arial,Helvetica,sans-serif" color="#2672EC" size="2"><span style="font-size:10pt;background-color:white;" id="divtagdefaultwrapper"><font color="red"><b><font color="#4BA524"><br>
</font></b></font></span></font></p>
<p><font face="Arial,Helvetica,sans-serif" color="#2672EC" size="2"><span style="font-size:10pt;background-color:white;" id="divtagdefaultwrapper"><font color="red"><b><font color="#4BA524"></font></b></font></span></font><font face="Arial,Helvetica,sans-serif" color="#2672EC" size="2"><span style="font-size:10pt;background-color:white;" id="divtagdefaultwrapper"><font color="red"><b>(0)&nbsp;&nbsp;
 &nbsp;shapefile_mask_data: Error: not a valid rectilinear, curvilinear, or unstructured grid</b></font><font color="red"><b><br>
</b></font></span></font></p>
<p><br>
</p>
<p>so then I used <br>
</p>
<p><br>
</p>
<p><font face="Arial,Helvetica,sans-serif" color="#2672EC" size="2"><span style="font-size:10pt;background-color:white;" id="divtagdefaultwrapper"><font color="red"><b><font color="#4BA524">shp_mask = shapefile_mask_data(var(0,:,:),filename,opt) , but I got
 this error,</font></b></font></span></font></p>
<p><font face="Arial,Helvetica,sans-serif" color="#2672EC" size="2"><span style="font-size:10pt;background-color:white;" id="divtagdefaultwrapper"><font color="red"><b><font color="#4BA524"><br>
</font></b></font></span></font></p>
<p><font face="Arial,Helvetica,sans-serif" color="#2672EC" size="2"><span style="font-size:10pt;background-color:white;" id="divtagdefaultwrapper"><font color="red"><b><font color="#4BA524"></font></b></font></span></font><font face="Arial,Helvetica,sans-serif" color="#2672EC" size="2"><span style="font-size:10pt;background-color:white;" id="divtagdefaultwrapper"><font face="Arial,Helvetica,sans-serif" color="red"><b>fatal:Number
 of subscripts do not match number of dimensions of variable,(3) Subscripts used, (2) Subscripts expected</b></font></span></font></p>
<p><br>
</p>
<p>so please suggest how to mention my variable in which has three dimensions <font face="Arial,Helvetica,sans-serif" color="#2672EC" size="2">
<span style="font-size:10pt;background-color:white;" id="divtagdefaultwrapper"><font color="red"><b><font color="#4BA524">var(0,:,:) i.e. time, lon, lat so that shapefile_mask_data works.</font></b></font></span></font></p>
<p><font face="Arial,Helvetica,sans-serif" color="#2672EC" size="2"><span style="font-size:10pt;background-color:white;" id="divtagdefaultwrapper"><font color="red"><b><font color="#4BA524"><br>
</font></b></font></span></font></p>
<p><font face="Arial,Helvetica,sans-serif" color="#2672EC" size="2"><span style="font-size:10pt;background-color:white;" id="divtagdefaultwrapper"><font color="red"><b><font color="#4BA524">Regards</font></b></font></span></font></p>
<p><font face="Arial,Helvetica,sans-serif" color="#2672EC" size="2"><span style="font-size:10pt;background-color:white;" id="divtagdefaultwrapper"><font color="red"><b><font color="#4BA524">Amit</font></b></font></span></font><br>
</p>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Guido Cioni &lt;guidocioni@gmail.com&gt;<br>
<b>Sent:</b> Wednesday, August 3, 2016 5:01:47 PM<br>
<b>To:</b> Amit Kumar<br>
<b>Cc:</b> ncl-talk@ucar.edu<br>
<b>Subject:</b> Re: [ncl-talk] Issue with Masking with shapefile</font>
<div>&nbsp;</div>
</div>
<div>Just judging from what you are saying (I didn&#8217;t read the script), you had some error regarding the shape file which was blocking the execution of the script at line xxx, but then you fixed that error and now you have another error at line yyy (with yyy
 &gt; xxx likely to be) that wasn&#8217;t detected before since you didn&#8217;t actually reach that line while executing the script.
<div class=""><br class="">
<div class="">Please mark the line where the error (subscripts) is happening and go into the code to see all the assignments that you made at that point. Usually a few print statements (printVarSummary) before that line can lead you the way..</div>
<div class="">Without the line where the error is happening you are forcing people to read your code entirely, which many be time consuming :)&nbsp;<br class="">
<div class="">
<div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">
<br class="Apple-interchange-newline">
Guido Cioni</div>
<div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">
<a href="http://guidocioni.altervista.org" class="">http://guidocioni.altervista.org</a>&nbsp;</div>
</div>
<br class="">
<div>
<blockquote type="cite" class="">
<div class="">On 03 Aug 2016, at 13:26, Amit Kumar &lt;<a href="mailto:amitkumar.777@hotmail.com" class="">amitkumar.777@hotmail.com</a>&gt; wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div id="divtagdefaultwrapper" style="font-size: 10pt; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; color: rgb(38, 114, 236); background-color: rgb(255, 255, 255); font-family: Arial, Helvetica, sans-serif;" class="">
<p style="margin-top: 0px; margin-bottom: 0px;" class=""></p>
<div class=""><br class="">
Hi,<span class="Apple-converted-space">&nbsp;</span><br class="">
<br class="">
I'm truing to do masking using shapefile, script is attached.<br class="">
<br class="">
I'm getting following error:<br class="">
<br class="">
<span class=""><b class=""><span style="color: rgb(255, 0, 0);" class="">(0)&nbsp;&nbsp; &nbsp;shapefile_mask_data: Error: not a valid rectilinear, curvilinear, or unstructured grid<br class="">
<br class="">
</span></b><span style="color: rgb(255, 0, 0);" class=""><span style="color: rgb(0, 111, 201);" class=""></span><span style="color: rgb(0, 111, 201);" class="">so I made following changes:</span></span><b class=""><span style="color: rgb(255, 0, 0);" class=""><br class="">
<br class="">
<div class=""><span style="color: rgb(75, 165, 36);" class="">opt&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = True</span><br class="">
<span style="color: rgb(75, 165, 36);" class="">&nbsp; opt@return_mask = True</span><br class="">
<span style="color: rgb(75, 165, 36);" class="">&nbsp; shp_mask = shapefile_mask_data(var(0,:,:),filename,opt)</span><br class="">
<span style="color: rgb(75, 165, 36);" class="">shp_mask_3d = conform_dims(dimsizes(var),shp_mask,(/1,2/))<span class="Apple-converted-space">&nbsp;</span></span><br class="">
<br class="">
<span style="color: rgb(75, 165, 36);" class="">var_shp_mask = where(shp_mask_3d.eq.1,var,var@_FillValue)</span><br class="">
<span style="color: rgb(75, 165, 36);" class="">copy_VarMeta(var,var_shp_mask)</span><br class="">
<br class="">
<span style="color: rgb(75, 165, 36);" class="">;---For shapefile plot, use the shapefile outlines.</span><br class="">
<span style="color: rgb(75, 165, 36);" class="">&nbsp; res@mpOutlineOn&nbsp; = False</span><br class="">
<br class="">
<span style="color: rgb(75, 165, 36);" class="">;---Create plot of original data masked by shapefile outlines</span><br class="">
<span style="color: rgb(75, 165, 36);" class="">&nbsp; res@tiMainString = &quot;Original data masked by shapefile outlines&quot;</span><br class="">
<span style="color: rgb(75, 165, 36);" class="">&nbsp; var_shp_plot = gsn_csm_contour_map(wks,var_shp_mask,res)</span><br class="">
<span style="color: rgb(75, 165, 36);" class="">&nbsp; dum = gsn_add_shapefile_polylines(wks,var_shp_plot,filename,False)</span><br class="">
<span style="color: rgb(75, 165, 36);" class="">&nbsp;draw(plot)</span><br class="">
<span style="color: rgb(75, 165, 36);" class="">&nbsp;frame(wks)</span><br class="">
<span style="color: rgb(75, 165, 36);" class="">&nbsp;end</span><br class="">
</div>
<br class="">
</span></b><span style="color: rgb(255, 0, 0);" class=""><span style="color: rgb(0, 111, 201);" class=""></span><span style="color: rgb(0, 111, 201);" class="">after these changes earlier error is rectified but now I'm getting following error:</span></span><b class=""><span style="color: rgb(255, 0, 0);" class=""><br class="">
</span></b></span><br class="">
<font face="Arial,Helvetica,sans-serif" color="#2672EC" size="2" class=""><span style="font-size: 10pt; background-color: white;" class=""><font class=""><font face="Arial,Helvetica,sans-serif" color="#2672EC" class=""><font color="red" class=""><b class="">fatal:Number
 of subscripts do not match number of dimensions of variable,(3) Subscripts used, (2) Subscripts expected</b></font></font></font></span></font><br class="">
<br class="">
<font face="Arial,Helvetica,sans-serif" color="#2672EC" size="2" class=""><span style="font-size: 10pt; background-color: white;" class=""><font class=""><font face="Arial,Helvetica,sans-serif" color="#2672EC" class="">Please suggest how to proceed further.</font></font></span></font></div>
<br class="">
<p style="margin-top: 0px; margin-bottom: 0px;" class=""></p>
</div>
<span id="cid:60EF5861-A67C-45A5-885B-B4AEE9C82DB5@mpi.zmaw.de">&lt;hem_shp_mask_1.ncl&gt;</span><span style="font-family: Helvetica; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">_______________________________________________</span><br style="font-family: Helvetica; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">
<span style="font-family: Helvetica; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">ncl-talk
 mailing list</span><br style="font-family: Helvetica; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">
<a href="mailto:ncl-talk@ucar.edu" style="font-family: Helvetica; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">ncl-talk@ucar.edu</a><br style="font-family: Helvetica; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">
<span style="font-family: Helvetica; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">List
 instructions, subscriber options, unsubscribe:</span><br style="font-family: Helvetica; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" style="font-family: Helvetica; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a></div>
</blockquote>
</div>
<br class="">
</div>
</div>
</div>
</body>
</html>