<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" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<p>Dear ncl-team</p>
<p> I've a file containg the bathymetry (nx * ny) and I would like to mask a subdomain containg inside a closed polyline.</p>
<p><br>
</p>
<p> For a square polyline a try the solution below, but I would like to extend this procedure to a generic closed polyline.</p>
<p> Is there in ncl a function which allow me to mask a particular region of a 2d-field?
<br>
</p>
<p><br>
</p>
<p><br>
</p>
<p><br>
</p>
<p><br>
</p>
<p>if(lonWest_isletoMask .ge. lon1dt_surf(0) .or. lonEast_isletoMask .le. lon1dt_surf(nx(inest)-1)) then<br>
if(latSout_isletoMask .ge. lat1dt_surf(0) .or. latNort_isletoMask .le. lat1dt_surf(ny(inest)-1)) then<br>
idxlon_isletoMask = ind((lon1dt_surf(0:nx-1) .ge. lonWest_isletoMask) .and. (lon1dt_surf(0:nx-1) .le. lonEast_isletoMask))<br>
idxlat_isletoMask = ind((lat1dt_surf(0:ny-1) .ge. latSout_isletoMask) .and. (lat1dt_surf(0:ny-1) .le. latNort_isletoMask))<br>
do j=0,dimsizes(idxlat_isletoMask)-1 <br>
do i=0,dimsizes(idxlon_isletoMask)-1 <br>
if((.not.ismissing(idxlon_isletoMask(i))) .and. (.not.ismissing(idxlat_isletoMask(j))))
<br>
bathy(idxlat_isletoMask(j),idxlon_isletoMask(i)) = 0.<br>
end if<br>
end do<br>
;print(" ")<br>
end do<br>
delete(idxlon_isletoMask)<br>
delete(idxlat_isletoMask)<br>
end if<br>
end if</p>
<p><br>
</p>
<p><br>
</p>
<p><br>
</p>
<p>thanks</p>
<p>Francesco<br>
</p>
</body>
</html>