mirror of https://gitlab.com/pamhyr/pamhyr2
AdisTT: Fake 0.0 in files to match AdisTS pollutants description
parent
bb2e83b6ce
commit
02be084faf
|
|
@ -459,20 +459,29 @@ class AdisTTwc(AdisTT):
|
||||||
) as f:
|
) as f:
|
||||||
|
|
||||||
TEM_ICs = (
|
TEM_ICs = (
|
||||||
study.river._InitialConditionsTemperature.Initial_Conditions_List[0]
|
study.river._InitialConditionsTemperature
|
||||||
|
.Initial_Conditions_List
|
||||||
)
|
)
|
||||||
|
|
||||||
if TEM_ICs._temperature is not None:
|
TEM_IC = TEM_ICs[0] if TEM_ICs else None
|
||||||
|
print(f"TEM_IC: {TEM_IC}")
|
||||||
|
|
||||||
|
if TEM_IC and TEM_IC._temperature is not None:
|
||||||
|
print(f"TEM_IC._temperature: {TEM_IC._temperature}")
|
||||||
f.write(f"file_ini = {name}.INI\n")
|
f.write(f"file_ini = {name}.INI\n")
|
||||||
self._export_ICs_AdisTT(
|
self._export_ICs_AdisTT(
|
||||||
study, repertory, TEM_ICs, qlog, name
|
study, repertory, TEM_IC, qlog, name
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
logger.info(
|
||||||
|
"No TEM initial conditions defined, skipping export"
|
||||||
)
|
)
|
||||||
|
|
||||||
TEM_BCs =(
|
TEM_BCs = (
|
||||||
study.river._BoundaryConditionsTemperature.BCs_Temperature_List
|
study.river._BoundaryConditionsTemperature.BCs_Temperature_List
|
||||||
)
|
)
|
||||||
|
|
||||||
if len(TEM_BCs) != 0:
|
if TEM_BCs:
|
||||||
f.write(f"file_cl = {name}.CDT\n")
|
f.write(f"file_cl = {name}.CDT\n")
|
||||||
self._export_BCs_AdisTT(
|
self._export_BCs_AdisTT(
|
||||||
study, repertory, TEM_BCs, qlog, name
|
study, repertory, TEM_BCs, qlog, name
|
||||||
|
|
@ -517,7 +526,9 @@ class AdisTTwc(AdisTT):
|
||||||
), "w+") as f:
|
), "w+") as f:
|
||||||
f.write(f"*État initial pour le polluant {TEM_name}\n")
|
f.write(f"*État initial pour le polluant {TEM_name}\n")
|
||||||
f.write(" ".join(("DEFAULT =",
|
f.write(" ".join(("DEFAULT =",
|
||||||
f"{TEM_IC_default.temperature}\n")))
|
f"{TEM_IC_default.temperature}",
|
||||||
|
"0.0 0.0 0.0\n")))
|
||||||
|
# fake 0 to match adists
|
||||||
|
|
||||||
if len(TEM_IC_default._data) != 0:
|
if len(TEM_IC_default._data) != 0:
|
||||||
self._export_ICs_AdisTT_Spec(
|
self._export_ICs_AdisTT_Spec(
|
||||||
|
|
@ -539,7 +550,9 @@ class AdisTTwc(AdisTT):
|
||||||
f"{study.river.get_edge_id(reach)+1}",
|
f"{study.river.get_edge_id(reach)+1}",
|
||||||
f"{ic_spec.start_rk}",
|
f"{ic_spec.start_rk}",
|
||||||
f"{ic_spec.end_rk}",
|
f"{ic_spec.end_rk}",
|
||||||
f"{ic_spec.temperature}\n")))
|
f"{ic_spec.temperature}"
|
||||||
|
f"0.0 0.0 0.0 0.0\n")))
|
||||||
|
# fake 0 to match adists
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -321,7 +321,7 @@ def timestamp_to_old_pamhyr_date_adists(time: int):
|
||||||
minutes = (dt.seconds % 3600) // 60
|
minutes = (dt.seconds % 3600) // 60
|
||||||
seconds = dt.seconds % 60
|
seconds = dt.seconds % 60
|
||||||
|
|
||||||
s = f"{dt.days:>3}:{hours:>2}:{minutes:>2}:{seconds:>2}"
|
s = f"{dt.days:>3}:{hours:>2}:{minutes:>2}"
|
||||||
s = s.replace(" ", "0")
|
s = s.replace(" ", "0")
|
||||||
|
|
||||||
return s
|
return s
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue