pyamrex icon indicating copy to clipboard operation
pyamrex copied to clipboard

load plt file in NATIVE_32 format

Open indra098124 opened this issue 1 year ago • 3 comments
trafficstars

I have a plt file written in FAB_NATIVE_32 format. How do I read this using pyAMRex? I am getting this error amrex::Error::0::convert(Real*,Long,istream&,RealDescriptor&) failed !!!

indra098124 avatar Aug 05 '24 21:08 indra098124

Thanks for the issue. What does written in FAB_NATIVE_32 format mean? You wrote it from a single precision AMReX? If that is the case, you also need to compile pyAMReX in single precision (same options as for AMReX).

Can you please provide a minimal reproducer that write the file and read it back that we can run?

cc @WeiqunZhang @atmyers

ax3l avatar Aug 15 '24 06:08 ax3l

FAB_NATIVE_32 is a Fab I/O format. It means writing a fab (whether the original data is double or float) in single precision. One should be able to read a fab in FAB_NATIVE_32 format in either single or double precision amrex/pyamrex. The format string is embedded in the data. The fab read function knows how to handle it. I just did a test, it worked for me. Using amrex built in double precision, I was able to write a plotfile in single precision, and run fcompare built with double precision to compare the single precision plotfile with another plotfile in double precision.

Maybe you can try to use fcompare (in amrex/Tools/Plotfile) to compare your plotfile with itself to see if the issue exists without pyamrex.

WeiqunZhang avatar Aug 15 '24 14:08 WeiqunZhang

Hi @indra098124,

When you have the time, please see our open questions :)

Maybe you can try to use fcompare (in amrex/Tools/Plotfile) to compare your plotfile with itself to see if the issue exists without pyamrex.

and

Can you please provide a minimal reproducer that write the file and read it back that we can run?

ax3l avatar Sep 06 '24 18:09 ax3l