Parallel processing netcdf

Hi all, i am, for the first time, trying to use foreach and dopar to compute some stat from a netcdf file, but the output is NA. here is the code

ncores <- detectCores()
cl <- makeCluster(ncores)

max <- nc_open("")
lons <- ncvar_get(max, varid = "lon")
lats <- ncvar_get(max, varid = "lat")
nx <- length(lons)
ny <- length(lats)
obs <- ncvar_get(max, "flow")

foreach (x = 1:nx) %dopar% {
  for (y in 1:ny) {
     flo = ts(obs[x, y, ], start = c(1981), frequency = 12)
head (riv)
......... simple stat continues like mean and sd

This topic was automatically closed 42 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.