docs: def is_mapped_grid(nc, variable):
      '''
      Returns true if the feature-type of variable corresponds to a mapped grid
      type. Characterized by Appedix F of CF-1.6
  
      :param netCDF4.Dataset nc: An open netCDF dataset
      :param str variable: name of the variable to check
      '''
      # x(j, i), y(j, i), z?, t?
      # F(t?, z?, j, i)
  
      # The important and really defining characteristic of mapped grids is that
      # the true latitude and longitude coordinates are functions of (j,i) and
      # that the geophysical variables are also functions of (j,i) in their
      # dimensions.
      dims = nc.variables[variable].dimensions
      # For cases like ROMS, the coordinates are mapped using the coordinates attribute
      variable_coordinates = getattr(nc.variables[variable], 'coordinates', '').split()
  
      lons = get_longitude_variables(nc)
      for lon in lons:
          if lon in variable_coordinates:
              break
      else:
          lon = get_lon_variable(nc)
  
      if lon is None:
          return False
  
      lats = get_latitude_variables(nc)
      for lat in lats:
          if lat in variable_coordinates:
              break
      else:
          lat = get_lat_variable(nc)
  
      if lat is None:
          return False
  
      x = nc.variables[lon].dimensions
      y = nc.variables[lat].dimensions
  
      if len(x) != 2:
          return False
      if x != y:
          return False
  
      comma_dimension = ','.join(dims)
      # Dimensions must be in the same order and the mapping coordinates i and j
      # must be in the same order
      if ','.join(x) not in comma_dimension:
          return False
  
      return True