Problem converting netcdf to grib2 - different wind fields
Added by Anonymous over 13 years ago
Hi,
I have a problem converting netcdf to grib2.
I use the following commands:
cdo splitname b30.030e.cam2.h3.UBOT.1970-01-01_cat_1979-12-31.nc b30.030e.cam2.h3.UBOT.1970-01-01_cat_1979-12-31_
cdo -f grb2 -a -setparam,2.2.0 b30.030e.cam2.h3.UBOT.1970-01-01_cat_1979-12-31_UBOT.nc b30.030e.cam2.h3.UBOT.1970-01-01_cat_1979-12-31_UBOT.grb2
cdo splitname b30.030e.cam2.h3.VBOT.1970-01-01_cat_1979-12-31.nc b30.030e.cam2.h3.VBOT.1970-01-01_cat_1979-12-31_
cdo -f grb2 -a -setparam,3.2.0 b30.030e.cam2.h3.VBOT.1970-01-01_cat_1979-12-31_VBOT.nc b30.030e.cam2.h3.VBOT.1970-01-01_cat_1979-12-31_VBOT.grb2
Everything works fine but when I plot the netcdf and the grib2 files, using GRADS, I get different wind fields.
Thanks in advance,
Alexandre
CDO V1.5.0
GRADS V2.0.a9
Replies (4)
RE: Problem converting netcdf to grib2 - different wind fields - Added by Uwe Schulzweida over 13 years ago
Hi Alexandre,
could you please provide an example file and the GrADS command to display wind fields?
Cheers, Uwe
RE: Problem converting netcdf to grib2 - different wind fields - Added by Anonymous over 13 years ago
Hi Uwe,
Thanks for the reply.
I used the following commands:
cdo seldate,1970-01-01T00:00:00,1970-01-01T00:00:00 b30.030e.cam2.h3.UBOT.1970-01-01_cat_1979-12-31_UBOT.nc UBOT_1970-01-01T00.nc
cdo seldate,1970-01-01T00:00:00,1970-01-01T00:00:00 b30.030e.cam2.h3.VBOT.1970-01-01_cat_1979-12-31_VBOT.nc VBOT_1970-01-01T00.nc
cdo -f grb2 -a -setparam,2.2.0 UBOT_1970-01-01T00.nc UBOT_1970-01-01T00.grb2
cdo -f grb2 -a -setparam,3.2.0 VBOT_1970-01-01T00.nc VBOT_1970-01-01T00.grb2
./g2ctl UBOT_1970-01-01T00.grb2 >UBOT_1970-01-01T00.ctl
./g2ctl VBOT_1970-01-01T00.grb2 >VBOT_1970-01-01T00.ctl
gribmap -i UBOT_1970-01-01T00.ctl
gribmap -i VBOT_1970-01-01T00.ctl
GRADS:
ga-> open UBOT_1970-01-01T00.ctl
ga-> open VBOT_1970-01-01T00.ctl
ga-> u=ugrdsfc
ga-> set dfile 2
ga-> v=vgrdsfc
ga-> set lat 0 70
ga-> set lon 280 360
ga-> d u;v
ga-> quit
ga-> xdfopen UBOT_1970-01-01T00.desc
ga-> xdfopen VBOT_1970-01-01T00.desc
ga-> u=ubot
ga-> set dfile 2
ga-> v=vbot
ga-> set lat 0 70
ga-> set lon 280 360
ga-> d u;v
Cheers,
Alexandre
VBOT_1970-01-01T00.ctl (1.61 KB) VBOT_1970-01-01T00.ctl | |||
UBOT_1970-01-01T00.grb2.idx (16 Bytes) UBOT_1970-01-01T00.grb2.idx | |||
VBOT_1970-01-01T00.grb2.idx (16 Bytes) VBOT_1970-01-01T00.grb2.idx | |||
UBOT_1970-01-01T00.desc (103 Bytes) UBOT_1970-01-01T00.desc | |||
UBOT_1970-01-01T00.nc (136 KB) UBOT_1970-01-01T00.nc | |||
VBOT_1970-01-01T00.nc (136 KB) VBOT_1970-01-01T00.nc | |||
UBOT_1970-01-01T00.grb2 (64.2 KB) UBOT_1970-01-01T00.grb2 | |||
VBOT_1970-01-01T00.grb2 (64.2 KB) VBOT_1970-01-01T00.grb2 | |||
VBOT_1970-01-01T00.desc (103 Bytes) VBOT_1970-01-01T00.desc | |||
UBOT_1970-01-01T00.ctl (1.61 KB) UBOT_1970-01-01T00.ctl |
RE: Problem converting netcdf to grib2 - different wind fields - Added by Uwe Schulzweida over 13 years ago
The plots of the netCDF wind fields are correct. The GRIB2 files are also (technicaly) correct. I have the suspicion that the GRIB2 wind fields are swap in GrADS from South->North to North-South. I can't figure out why. It seems that GrADS expects the wind fields from North->South.
You can try to check it by inverting the latitudes with CDO invertlat:
cdo -f grb2 -a invertlat -setparam,2.2.0 UBOT_1970-01-01T00.nc UBOT_1970-01-01T00.grb2
cdo -f grb2 -a invertlat -setparam,3.2.0 VBOT_1970-01-01T00.nc VBOT_1970-01-01T00.grb2
RE: Problem converting netcdf to grib2 - different wind fields - Added by Anonymous over 13 years ago
Thanks a lot, it really helped me!
When I open the grib2 file converted without the option invertlat whith other program, insted of grads, I have the same problem. I believe the problem may be in the cdo routine that converts netcdf to grib2. That routine should identify the direction of the field and them code grib2 acording to it.
Regards,
Alexandre