Commit 6ed7f926 authored by Alberto Ramos's avatar Alberto Ramos

Corrected bug reading val +/- err records.

Thanks to Alejandro Saez Gonzalvo <alejandro.saezg@uam.es>

He seguido haciendo pruebas, y parece que si escribes el bdio con
"write2.jl", tambien aparecen los caracteres extraños al leerlo con
"read.jl". Sin embargo, si en write2.jl permutas la linea 3 y 4 (es
decir, si defines antes "a" y luego "Z"), entonces no aparecen los
caracteres extraños, pero si defines primero "Z" y luego "a", entonces
aparecen:

using ADerrors, BDIO

Z = uwreal([1.0,0.1],"Z tag")
a = uwreal(1.0 .+ randn(1000), "MC ensemble")
b = Z*a
uwerr(b)
details(b)

fb = BDIO_open("foo.bdio", "w")
write_uwreal(b, fb, 1)
parent f58a1b1d
......@@ -383,7 +383,12 @@ function read_bdio(fb, ws::wspace, mapids::Dict{Int64, Int64})
else
for i in 1:nid
v = Vector{String}(undef, nrep[i])
idc = Vector{Int32}(undef, nds[i])
if nds[i] == 1
idc = Vector{Int32}(undef, 2)
else
idc = Vector{Int32}(undef, nds[i])
end
BDIO.BDIO_read(fb, ifoo)
for j in 1:nrep[i]
v[j] = BDIO.BDIO_read_str(fb)
......
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