debug rubarBE format

ci-test
Theophile Terraz 2025-11-14 11:48:02 +01:00
parent 02db91f3d7
commit c1905aa7e1
2 changed files with 13 additions and 6 deletions

View File

@ -575,8 +575,12 @@ class Rubar3(CommandLineSolver):
for bc in bcs:
f.write(f"{len(bc)}\n")
for d0, d1 in bc.data:
f.write(f"{d1} {d0}\n")
if bc.bctype == "ZD":
for d0, d1 in bc.data:
f.write(f"{d1} {d0}\n")
else:
for d0, d1 in bc.data:
f.write(f"{d0} {d1}\n")
def read_profil(self, study, fname, results, qlog=None, name="0"):
logger.info(f"read: profil.{name}")
@ -590,7 +594,10 @@ class Rubar3(CommandLineSolver):
def read_data_line(f):
line = f.readline().split()
return tuple(map(float, line))
if len(line) > 3:
return tuple(map(float, line))
else:
return (0.0, 0.0, 0.0, 0.0)
def set_and_compute_limites(reach, ind, z, q, s):
reach.set(ind, timestamp, "Z", z)
@ -628,9 +635,9 @@ class Rubar3(CommandLineSolver):
h, s, q, z = read_data_line(f)
set_and_compute_limites(
reach, ind,
(ph + pz + ph + h) / 2,
(pz + s) / 2,
(pq + q) / 2
(pz + z + ph + h) / 2,
(pq + q) / 2,
(ps + s) / 2
)
ph = h