-
Notifications
You must be signed in to change notification settings - Fork 24
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
Consistency between NetCDF output grid and internal grid? #146
Comments
What is map = Grid(vor[:,:,1,1])
S = SpectralTransform(map) # create a spectral transform based on the size/resolution of map
spectral(map,S) # use that spectral transform struct, allocate memory, do transform
spectral(map) # recompute a spectral transform struct, allocate memory, then do transform
P,D,M = initialize_speedy()
gridded(P.layers[1].leapfrog[1].vor) # create a spectral transform based on the size of the LowerTriangularMatrix vor
gridded(P.layers[1].leapfrog[1].vor,M.spectral_transform) # reuse the precomputed spectral transform I've tried to implement all convenient methods for julia> alms = LowerTriangularMatrix(randn(ComplexF32,65,64)) # T63
julia> P,D,M = initialize_speedy() # spectral transform for T31
julia> gridded(alms,M.spectral_transform)
ERROR: BoundsError
Stacktrace:
[1] gridded!(map::...
julia> almst = spectral_truncation(alms,32,31); # truncate T63 to T31
julia> gridded(almst,M.spectral_transform)
4608-element FullGaussianGrid{Float64}:
1.0241511954278444
1.305803380654694
1.6143697638450374
1.9524110446149656
2.3229442295681544
... |
On that note, I believe the error message could be specified, in your situation something like "ERROR: BoundsError, Spectral resolutions do not match, T31 spectral transform with T63 data." |
So, yeah, I can do map = Grid(vor[:,:,1,1])
S = SpectralTransform(map) # create a spectral transform based on the size/resolution of map
spectral(map,S) # use that spectral transform struct, allocate memory, do transform and put a But I am still confused why the netcdf output is a different grid, when I do look at the routines that I seemed to me that it just saves the full grid directly? |
The netcdf output shouldn't be on a different grid, but just because you say |
Yes, this is the logic we discussed in #134.
However note that with |
Ah, I see, this is what I did not think about. I just assumed restart continues exactly the same model setup. Thanks for the quick reply |
No, we could change that though. We'd need
|
The solution I went for myself as a temporary fix is to just save the |
But that's hardly reproducible whenever we change the default kwargs for Parameters. As in, while the kwargs may not specify a keyword argument that same argument may be different in the version used to create the restart.jld2 than in the version that uses the restart file. restart.jld2 already contains a field |
Yeah, that would make sense |
Btw, with #226 merged, you can now output onto any (full) grid at any resolution ( |
Closing this as I believe it's solved, but definitely also outdated as we now output on arbitrary full grids via interpolation (#233, #226). We still have the situation that restarting from file doesn't automatically copy over the spectral resolution, which is more a feature than a bug because you may want to change the resolution at restart. Feel free to reopen if this is still causing problems. |
I might misunderstand the way the netCDF is written, but at least for a
FullGaussianGrid
I expected this to work:So half the grid points. What am I missing there?
This also results in things like
spectral(Grid(vor[:,:,1,1], S)
not working. It would be nice to an easy way to load the netCDF data and then work with the transforms etc from the library.The text was updated successfully, but these errors were encountered: