Hi Meri,
What resolution are you running OpenIFS at? The WAM grid changes form with higher resolutions.
When I run OpenIFS at T159 I get a regular lat-lon grid from the WAM model in the MPP* GRIB output file.
If I do a 'grib_dump' on that file I can see the following parameters (grib_dump comes with grib_api or eccodes libraries):
grib_dump MPP20171201000024
... lots of output....
Ni = 240;
Nj = 121;
latitudeOfFirstGridPointInDegrees = 90;
longitudeOfFirstGridPointInDegrees = 0;
earthIsOblate = 0;
uvRelativeToGrid = 0;
latitudeOfLastGridPointInDegrees = -90;
longitudeOfLastGridPointInDegrees = 358.5;
This is a regular lat-lon grid with 121 latitudes from -90 to 90 and 240 longitude points starting at 0 degrees longitude.
However at higher resolutions the WAM model uses a semi-regular grid, equal spacing in latitude but irregular in longitude. In this case, you will see:
in the grib dump and there will be a new grib key called 'pl' which lists the number of longitude points per latitude.
I am not that familiar with cdo but I would guess it should be able to handle the first case but not necessarily the second. I will ask here if someone knows how to do it.
Alternately if you have metview installed in Helsinki then you can use a simple metview macro to do the interpolation to a regular grid and then cdo or grib_to_netcdf to do the conversion to netcdf for you.
#Metview Macro
# will interpolate on a 0.36x0.36 grid an input grib file specified by 'source'
# to output file: mpp_reg.grb
input = read(
source : “MPP20171201000024”,
grid : [0.36,0.36]
)
output = write( “mpp_reg.grb”, input )
Save this metview macro in your metview directory as, say, mpp.mv, put the MPP* file in the same directory and then run it with metview in batch (or start metview and right click 'execute'):
and this will give you a regular lat-lon GRIB file that cdo should be able to handle. If not, try the grib_to_netcdf command that comes with either grib_api or eccodes. You should already have this on your system if you are running OpenIFS.
Note that you will probably need to change the 'grid' values above to match the WAM resolution you have. I suggest setting it to the spacing of latitudes as given by the 'grib_dump' above.
Hope that helps. If I find a cdo solution I will let you know (or if you figure it out let me know).
Cheers, Glenn
p.s. with thanks to our resident wave model expert for explaining this to me