<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:10pt;color:#2672EC;background-color:#FFFFFF;font-family:Arial,Helvetica,sans-serif;">
<p></p>
<div><br>
Hi, <br>
<br>
I'm truing to do masking using shapefile, script is attached.<br>
<br>
I'm getting following error:<br>
<br>
<span><b><span style="color: rgb(255, 0, 0);">(0)&nbsp;&nbsp; &nbsp;shapefile_mask_data: Error: not a valid rectilinear, curvilinear, or unstructured grid<br>
<br>
</span></b><span style="color: rgb(255, 0, 0);"><span style="color: rgb(0, 111, 201);"></span><span style="color: rgb(0, 111, 201);">so I made following changes:</span></span><b><span style="color: rgb(255, 0, 0);"><br>
<br>
<div><span style="color: rgb(75, 165, 36);">opt&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = True</span><br>
<span style="color: rgb(75, 165, 36);">&nbsp; opt@return_mask = True</span><br>
<span style="color: rgb(75, 165, 36);">&nbsp; shp_mask = shapefile_mask_data(var(0,:,:),filename,opt)</span><br>
<span style="color: rgb(75, 165, 36);">shp_mask_3d = conform_dims(dimsizes(var),shp_mask,(/1,2/))
</span><br>
<br>
<span style="color: rgb(75, 165, 36);">var_shp_mask = where(shp_mask_3d.eq.1,var,var@_FillValue)</span><br>
<span style="color: rgb(75, 165, 36);">copy_VarMeta(var,var_shp_mask)</span><br>
<br>
<span style="color: rgb(75, 165, 36);">;---For shapefile plot, use the shapefile outlines.</span><br>
<span style="color: rgb(75, 165, 36);">&nbsp; res@mpOutlineOn&nbsp; = False</span><br>
<br>
<span style="color: rgb(75, 165, 36);">;---Create plot of original data masked by shapefile outlines</span><br>
<span style="color: rgb(75, 165, 36);">&nbsp; res@tiMainString = &quot;Original data masked by shapefile outlines&quot;</span><br>
<span style="color: rgb(75, 165, 36);">&nbsp; var_shp_plot = gsn_csm_contour_map(wks,var_shp_mask,res)</span><br>
<span style="color: rgb(75, 165, 36);">&nbsp; dum = gsn_add_shapefile_polylines(wks,var_shp_plot,filename,False)</span><br>
<span style="color: rgb(75, 165, 36);">&nbsp;draw(plot)</span><br>
<span style="color: rgb(75, 165, 36);">&nbsp;frame(wks)</span><br>
<span style="color: rgb(75, 165, 36);">&nbsp;end</span><br>
</div>
<br>
</span></b><span style="color: rgb(255, 0, 0);"><span style="color: rgb(0, 111, 201);"></span><span style="color: rgb(0, 111, 201);">after these changes earlier error is rectified but now I'm getting following error:</span></span><b><span style="color: rgb(255, 0, 0);"><br>
</span></b></span><br>
<font face="Arial,Helvetica,sans-serif" color="#2672EC" size="2"><span style="font-size:10pt; background-color:white"><font color="black"><font face="Arial,Helvetica,sans-serif" color="#2672EC"><font color="red"><b>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>
<br>
<font face="Arial,Helvetica,sans-serif" color="#2672EC" size="2"><span style="font-size:10pt; background-color:white"><font color="black"><font face="Arial,Helvetica,sans-serif" color="#2672EC">Please suggest how to proceed further.</font></font></span></font></div>
<br>
<p></p>
</div>
</body>
</html>