Commit adde10c0 authored by Alberto Ramos's avatar Alberto Ramos

Bug in replica ID's

parent e979d31d
...@@ -328,13 +328,14 @@ function read_bdio(fb, ws::wspace, mapids::Dict{Int64, Int64}) ...@@ -328,13 +328,14 @@ function read_bdio(fb, ws::wspace, mapids::Dict{Int64, Int64})
is = ie + 1 is = ie + 1
end end
ids_obs = Vector{Int64}(undef, nid)
if BDIO.BDIO_eor(fb) if BDIO.BDIO_eor(fb)
is = 1 is = 1
for i in 1:nid for i in 1:nid
ie = is + nrep[i] - 1 ie = is + nrep[i] - 1
id = convert(Int64, ids[i]) ids_obs[i] = convert(Int64, ids[i])
add_maps(id, ws, convert(Vector{Int64}, ivrep[is:ie])) add_maps(ids_obs[i], ws, convert(Vector{Int64}, ivrep[is:ie]))
get_name_from_id(id, ws) get_name_from_id(ids_obs[i], ws)
is = ie + 1 is = ie + 1
end end
...@@ -347,13 +348,14 @@ function read_bdio(fb, ws::wspace, mapids::Dict{Int64, Int64}) ...@@ -347,13 +348,14 @@ function read_bdio(fb, ws::wspace, mapids::Dict{Int64, Int64})
BDIO.BDIO_read(fb, ifoo) BDIO.BDIO_read(fb, ifoo)
str = BDIO.BDIO_read_str(fb) str = BDIO.BDIO_read_str(fb)
id = get_id_from_name(str, ws) ids_obs[i] = get_id_from_name(str, ws)
add_maps(id, ws, convert(Vector{Int64}, ivrep[is:ie])) add_maps(ids_obs[i], ws, convert(Vector{Int64}, ivrep[is:ie]))
is = ie + 1 is = ie + 1
end end
end end
# Here not to use ids[i]
if BDIO.BDIO_eor(fb) if BDIO.BDIO_eor(fb)
for i in 1:nid for i in 1:nid
v = Vector{String}(undef, nrep[i]) v = Vector{String}(undef, nrep[i])
...@@ -362,7 +364,7 @@ function read_bdio(fb, ws::wspace, mapids::Dict{Int64, Int64}) ...@@ -362,7 +364,7 @@ function read_bdio(fb, ws::wspace, mapids::Dict{Int64, Int64})
for j in 1:nrep[i] for j in 1:nrep[i]
v[j] = str*"_r"*string(j) v[j] = str*"_r"*string(j)
end end
add_repnames(convert(Int64, ids[i]), ws, v) add_repnames(convert(Int64, ids_obs[i]), ws, v)
end end
else else
for i in 1:nid for i in 1:nid
...@@ -371,7 +373,7 @@ function read_bdio(fb, ws::wspace, mapids::Dict{Int64, Int64}) ...@@ -371,7 +373,7 @@ function read_bdio(fb, ws::wspace, mapids::Dict{Int64, Int64})
for j in 1:nrep[i] for j in 1:nrep[i]
v[j] = BDIO.BDIO_read_str(fb) v[j] = BDIO.BDIO_read_str(fb)
end end
add_repnames(convert(Int64, ids[i]), ws, v) add_repnames(convert(Int64, ids_obs[i]), ws, v)
end end
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment