function lat=oct_readlat(ncid)
% OCT_READLAT Read latitude using procedural oct_netcdf API
try
  lat = oct_netcdf.getVar(ncid,oct_netcdf.inqVarID(ncid,'lat_rho'));
catch
  try
    lat = 1e-5 * oct_netcdf.getVar(ncid,oct_netcdf.inqVarID(ncid,'y_rho'));
  catch
    error('OCT_READLAT: no horizontal coordinate found')
  end
end
return
