sp2gp/gp2sp fail for some cubic octahedral grids
Added by Klaus Wyser over 5 years ago
Sorry to bother you again with the cubic octahedral grids that ECMMWF is introducing. It's great that there already is a lot of support for this kind of grids in cdo. When using transformations to/from spherical harmonics I noticed that some Tco grids work well while others fail.
This works fine with cdo 1.9.7.1:
cdo sinfo -sp2gp,cubic -gp2sp,cubic -random,o320
It starts from a CO320 grid, then transforms it to a T319 grid and then back to a CO320 grid (which corresponds to ECMWF's Tco319).
But when trying to do the same thing for the Tco159 grid I get:
cdo sinfo -sp2gp,cubic -gp2sp,cubic -random,o160 cdo(1) sp2gp: Process started cdo(2) gp2sp: Process started cdo(3) random: Process started FFT does not work with len=656 (N41)!
For Tco159 I can trick cdo by replacing the CO160 grid with a similar N80 grid in the beginning and everything works fine again:
cdo sinfo -sp2gp,cubic -gp2sp,cubic -random,n80
But for e.g. Tco255 even this trick doesn't work any longer:
cdo sinfo -sp2gp,cubic -gp2sp,cubic -random,n128 cdo(1) sp2gp: Process started cdo(2) gp2sp: Process started cdo(3) random: Process started FFT does not work with len=528 (N11)!
The problem seems to be rooted in the FFT. I am not a specialist on this topic, but I thought that the restriction to specific array lengths has disappeared with newer FFT libraries.
Replies (3)
RE: sp2gp/gp2sp fail for some cubic octahedral grids - Added by Klaus Wyser over 5 years ago
Just for clarification: I'm using the random,o...
command to create a grid that is similar to any of the Tco grids that I get from ECMWF. I am not interested in creating this grid per se, using random
is just a convenient way for others to reproduce a field with the same structure without having to download a lot of data.
The problem that I am trying to address is that sp2gp
or gp2sp
seem to have problems for some of the grids that I'm actually using (e.g. Tco159), and I wonder if this could be fixed somehow.
RE: sp2gp/gp2sp fail for some cubic octahedral grids - Added by Uwe Schulzweida over 5 years ago
That's right, CDO is using a very old FFT, which has restriction in the length of the array.
We will optionally replaced it with the fftw3 library (http://www.fftw.org/) in the next CDO release 1.9.8. A prerelease for testing is available in the download area.
You have to add the configure option --with_fftw3 to activate this feature. In this case, the fftw3 library must be available in the default path.
Cheers,
Uwe
RE: sp2gp/gp2sp fail for some cubic octahedral grids - Added by Klaus Wyser over 5 years ago
Thanks a lot, Uwe. However, since I am using a system-wide installation of cdo and all libraries I don't want spend my own time right now on testing the new fftw library feature but wait until it becomes available with the next cdo release and then ask the sys admins to install it.
Best regards,
Klaus