Open mikekryjak opened 11 months ago
Hi,
I'm also seeing the error Error encountered: Value for option n cannot be converted to a Field3D
(but for a different variable) following a restart. However, in my case, nxpe
is correctly read from the metadata as 32
, and the split is 32
since nype
is 1
.
In my case n
has shape (1001,260,1,256)
originally and (1,260,1,256)
in the restart files.
@mikekryjak did you see any other potential causes of variables being incompatible with Field3D?
Thanks
Hi @davedavemckay, sadly I think my issue was due to nxpe
(at least I hope - it works for now!) and I don't have any other ideas. From your message, it seems like you have already checked that the individual restart files are correctly split?
Hi @mikekryjak - no worries. They do seem to correctly split, in that I see 32 .nc files and loading them in with xbout.open_boutdataset
produces an xarray object with 32 chunks. Although chunksize=10
and nx=260
seems odd, but I assume chunks vary in size. Thanks for the pointer - I'll keep digging.
@davedavemckay what I was going to do to diagnose my issue further was to open each dataset individually and check its shape, and then cross-check this against what would be expected from the BOUT++ algorithm for all of them.
Good idea - I'm just opening *.nc, so I'm looking at the aggregated shape.
It looks like @davedavemckay's issue is due to the time dimension. If the restart files are really 4D, that sounds like a real bug.
For @mikekryjak issue, I think it would be best if BOUT++ would throw better error messages. Reading an input file to guess nxpe might be tricky, as it may be the old input file, and you want to change nxpe ... In which case, boutdata trying to be smart is not going to help ...
@mikekryjak do you mind checking whether the current next version of BOUT++ still has this unhelpful error message?
Also, why do you provide nxpe? Generally, the choice of BOUT++ should be good for field-aligned grids ...
@dschwoerer sorry I haven't got to this yet, I'm working against a deadline on a non-BOUT++ related paper at the moment. I will get to it.
Performing a
redistribute
without providing annxpe
fails in Hermes-3 with the following message, which took me quite a bit of time to work back from:Since not providing a
nxpe
results in an automatic choice as the below comment, I think the failure is because the algorithm generatednxpe
was not the same as what I have in the input file. https://github.com/boutproject/boutdata/blob/908a4c2a80a07d887f78667bb574f9c072c3c2fd/boutdata/restart.py#L559-L563My suggestion for a fix is to print a message whenever
nxpe
is not provided:Alternatively we could parse the input file and check whether
nxpe
is set there. If it is and it is not provided toredistribute
, we could raise anException
. Or we could simply read thenxpe
from the input file and pass it toredistribute
.Let me know what you think.