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

Copying old metadata to new resized file #77

Open
mredenti opened this issue Aug 19, 2022 · 4 comments
Open

Copying old metadata to new resized file #77

mredenti opened this issue Aug 19, 2022 · 4 comments

Comments

@mredenti
Copy link
Contributor

mredenti commented Aug 19, 2022

Copying the metadata from a BOUT.restart.*.nc file to the resized BOUT.restart.*.nc file is a bad idea. I mean, you are resizing the grid and therefore parameters like "nx" (and others) should be obviously updated to match the size of the new grid.

attributes = old.attributes(var)

@johnomotani
Copy link
Contributor

Yes, true. I believe it's not an issue in practice as only the evolving variables (which are probably Field3Ds) are actually read from the restart files by BOUT++. PR to improve this would be welcome though!

@mredenti
Copy link
Contributor Author

Yes, true. I believe it's not an issue in practice as only the evolving variables (which are probably Field3Ds) are actually read from the restart files by BOUT++. PR to improve this would be welcome though!

I will have a go at it

@mredenti
Copy link
Contributor Author

mredenti commented Aug 19, 2022

Yes, true. I believe it's not an issue in practice as only the evolving variables (which are probably Field3Ds) are actually read from the restart files by BOUT++. PR to improve this would be welcome though!

I don't think that is actually the case. If you look into in the reference code below you will see that BOUT++ reads other parameters from the BOUT.restart.*.nc files.
https://github.com/boutproject/BOUT-dev/blob/ab69d52f362dcaaddb22f3bd3b16aa7bab924d84/src/fileio/datafile.cxx#L1093-L1118

I know this for a fact: when creating restart files with the boutdata.restart.create much of the metadata is missing (for example "MXG" - # guard cells in the x-direction). Older version of BOUT++ (version v4.3.0 for example) did not read these parameters but the current version of BOUT++ does and won't restart the simulation if restarting from a file created with boutdata.restart.create

@johnomotani
Copy link
Contributor

Ah, in that case you're right and the metadata definitely needs updating!

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

No branches or pull requests

2 participants