function lon=oct_readlon(ncid)
% OCT_READLON Read longitude using procedural oct_netcdf API
try
  lon = oct_netcdf.getVar(ncid,oct_netcdf.inqVarID(ncid,'lon_rho'));
catch
  try
    lon = 1e-5 * oct_netcdf.getVar(ncid,oct_netcdf.inqVarID(ncid,'x_rho'));
  catch
    error('OCT_READLON: no horizontal coordinate found')
  end
end
return
