Finding the right set of I,J indices to correspond to a subset of longitude/latitude space takes some doing for curvilinear grids, and the best way to do that involves making a map file as if you were planning to offer regridding to a rectilinear grid, as outlined above, Configuring LAS to regrid to Rectilinear grids. LAS has another means of finding the indices that define a zoomed region, but it is slower and for some grids has turned out not to find the region very well.
Whether you add the option to do that regridding or not, the Ferret scripts can use that mapping file to find the right subset of the grid to show when zooming in XY. (What will be happening behind the scenes is described in this Ferret FAQ: How can I plot a subset of my curvilinear data? )
So, create a map file with a resolution similar to what's in your curvilinear grid - for global curvilinear grid that's 400x200 points, we might use a 1-degree grid in x and y. Or for a fine grid over a small region of the globe, we'd make a grid defined with delta-x and delta-y chosen as small fractions of a degree. The map file takes some time to compute but this only needs to be done once. Save the dataset in a location where your server can use it. Here is a Ferret script that creates a map file for a dataset with curvilinear coordinate variables called xlon and ylat. It defines a 0.01-degree grid in both longitude and latitude. The range of the axes we define is the same as or slightly larger than the range of the variables xlon and ylat.
yes? USE "http://server.pmel.noaa.gov:8080/thredds/dodsC/GDATA"
yes? DEFINE AXIS/X=-98.2:-78:0.1/UNITS=degrees_east xlon
yes? DEFINE AXIS/Y=17.9:30.8:0.1/UNITS=degrees_north ylat
yes? LET a = x[gx=xlon] + y[gy=ylat]
yes? LET map = curv_to_rect_map (lon, lat, a, 0.5)
yes? SAVE/FILE=map_01deg.nc map
Then configure this map file into the xml configuration for a dataset. The map file and map variable are global Ferret properties. For instance, an xml file I use begins like this:
<datasets>
<Fdepths name="Ocean Model" url="http://server.pmel.noaa.gov:8080/thredds/dodsC/GDATA">
<!-- Default properties for this dataset -->
<properties>
<ferret>
<curvi_coord_lon>LON</curvi_coord_lon> <!-- curv. coords -->
<curvi_coord_lat>LAT</curvi_coord_lat> <!-- curv. coords -->
<lon_modulo>0</lon_modulo>
<curv_lon_min>-98.162</curv_lon_min>
<curv_lon_max>-78.042</curv_lon_max>
<curv_lat_min>17.991</curv_lat_min>
<curv_lat_max>30.734</curv_lat_max>
<curvi_coord_mapfile>/home/porter/data/my_las_data/map_01deg.nc</curvi_coord_mapfile>
<curvi_coord_mapvar>map</curvi_coord_mapvar>
</ferret>
</properties>
<variables>
...