legacy/src/main/java/ucar/nc2/dt/grid/CFGridWriter.java
private long processTransformationVars(ArrayList<Variable> varList, ArrayList<String> varNameList, NetcdfDataset ncd, ucar.nc2.dt.GridDataset gds,
                                         GridDatatype grid, Range timeRange, Range zRangeUse, LatLonRect llbb, int z_stride, int y_stride, int x_stride,
                                         List<CoordinateAxis> axisList) throws InvalidRangeException {

    List<Range> yxRanges = new ArrayList<Range>(2);

    if (llbb == null) {
      yxRanges.add(null);
      yxRanges.add(null);
    } else {
      yxRanges = grid.getCoordinateSystem().getRangesFromLatLonRect(llbb);
    }

    return processTransformationVars(varList, varNameList, ncd, gds, grid, timeRange, zRangeUse, yxRanges.get(0), yxRanges.get(1), z_stride, y_stride, x_stride);
  }
private long processTransformationVars(ArrayList<Variable> varList, ArrayList<String> varNameList, NetcdfDataset ncd, ucar.nc2.dt.GridDataset gds,
                                         GridDatatype grid, Range timeRange, Range zRangeUse, LatLonRect llbb, int z_stride, int y_stride, int x_stride,
                                         List<CoordinateAxis> axisList) throws InvalidRangeException {

    List<Range> yxRanges = new ArrayList<Range>(2);

    if (llbb == null) {
      yxRanges.add(null);
      yxRanges.add(null);
    } else {
      yxRanges = grid.getCoordinateSystem().getRangesFromLatLonRect(llbb);
    }

    return processTransformationVars(varList, varNameList, ncd, gds, grid, timeRange, zRangeUse, yxRanges.get(0), yxRanges.get(1), z_stride, y_stride, x_stride);
  }
Process the coordinate transformations (formula_terms) and adds the variables needed for performing that transformation to the list of variables in the new file.
Also, subsets the grids variables, if needed.

@param varList
@param varNameList
@param ncd
@param gds
@param grid
@param timeRange
@param zRangeUse
@param llbb
@param z_stride
@param y_stride
@param x_stride
@return size of the added variables
@throws InvalidRangeException