Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

load plt file in NATIVE_32 format #348

Open
indra098124 opened this issue Aug 5, 2024 · 3 comments
Open

load plt file in NATIVE_32 format #348

indra098124 opened this issue Aug 5, 2024 · 3 comments
Labels
question Further information is requested

Comments

@indra098124
Copy link

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 !!!

@ax3l
Copy link
Member

ax3l commented Aug 15, 2024

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 ax3l added the question Further information is requested label Aug 15, 2024
@WeiqunZhang
Copy link
Member

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.

@ax3l
Copy link
Member

ax3l commented Sep 6, 2024

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants