Project

General

Profile

cdo remap from reduced Gaussian grid to lat-lon

Added by Sylvia Sullivan 7 months ago

Hello,
I realize there is a lot of documentation of the various cdo remapping commands, but I am still struggling to convert the attached file. I needed to convert ECMWF IFS volumetric soil water to a soil moisture index (https://www.ecmwf.int/en/forecasts/documentation-and-support/evolution-ifs/cycles/change-soil-hydrology-scheme-ifs-cycle). The volumetric soil water values are only available from the ECMWF on their archived reduced Gaussian grids.

After my calculations, I output the soil moisture indices (also on the reduced Gaussian grid) to the attached (tarred) netcdf file. I am not sure which reduced Gaussian grid this is; perhaps N2560 since there are 2560 unique latitudes? Then I would like to convert to a 0.25/0.25 deg latitude longitude grid globally. Looking at this page (https://confluence.ecmwf.int/display/LDAS/Converting+from+grib+to+netCDF+with+cdo), I think the general syntax should be something like

cdo -R -remapbil,r1600x800 -setgridtype,regular ifs_operod2_Tauto_2019051418+0_smi.nc out.nc

But I am not sure what the <r1600x800> specification should be. And when I run a bilinear interpolation, I get this error:
cdo remapbil (Abort): Bilinear/bicubic interpolation doesn't support unstructured source grids

If I try instead with conservative remapping, I get
cdo remapcon (Abort): Source grid cell corner coordinates missing!

I have spent quite a bit of time on this and would be most grateful for any help.
Sylvia


Replies (6)

RE: cdo remap from reduced Gaussian grid to lat-lon - Added by Estanislao Gavilan 7 months ago

Hi Sylvia,

you cannot use remapbil with unstructured grid. Try remapnn like this

cdo -z zip_6 -L -remapnn,r1600x800 ifs_operod2_Tauto_2019051418+0_smi.nc out.nc

PS: z zip_6 is to compress the file

Kind regards,

Estanislao

RE: cdo remap from reduced Gaussian grid to lat-lon - Added by Karin Meier-Fleischer 7 months ago

Hi Sylvia,

the error message tells you that your data on an unstructured grid. And the netcdf file is not CF-convention compliant.

ncdump -h ifs_operod2_Tauto_2019051418+0_smi.nc 

netcdf ifs_operod2_Tauto_2019051418+0_smi {
dimensions:
    values = 6599680 ;
variables:
    int64 time ;
        time:long_name = "initial time of forecast" ;
        time:standard_name = "forecast_reference_time" ;
        time:units = "seconds since 1970-01-01" ;
        time:calendar = "proleptic_gregorian" ;
    double step ;
        step:_FillValue = NaN ;
        step:long_name = "time since forecast_reference_time" ;
        step:standard_name = "forecast_period" ;
        step:units = "hours" ;
    double latitude(values) ;
        latitude:_FillValue = NaN ;
        latitude:units = "degrees_north" ;
        latitude:standard_name = "latitude" ;
        latitude:long_name = "latitude" ;
    double longitude(values) ;
        longitude:_FillValue = NaN ;
        longitude:units = "degrees_east" ;
        longitude:standard_name = "longitude" ;
        longitude:long_name = "longitude" ;
    float smi1(values) ;
        smi1:_FillValue = NaNf ;
        smi1:coordinates = "latitude step time longitude" ;
    float smi2(values) ;
        smi2:_FillValue = NaNf ;
        smi2:coordinates = "latitude step time longitude" ;
    float smi3(values) ;
        smi3:_FillValue = NaNf ;
        smi3:coordinates = "latitude step time longitude" ;
    float smi4(values) ;
        smi4:_FillValue = NaNf ;
        smi4:coordinates = "latitude step time longitude" ;
}
cdo sinfon ifs_operod2_Tauto_2019051418+0_smi.nc 

Warning (cdfInqContents): Coordinates variable step can't be assigned!
Warning (cdfInqContents): Coordinates variable time can't be assigned!
   File format : NetCDF4
    -1 : Institut Source   T Steptype Levels Num    Points Num Dtype : Parameter name
     1 : unknown  unknown  c instant       1   1   6599680   1  F32  : smi1          
     2 : unknown  unknown  c instant       1   1   6599680   1  F32  : smi2          
     3 : unknown  unknown  c instant       1   1   6599680   1  F32  : smi3          
     4 : unknown  unknown  c instant       1   1   6599680   1  F32  : smi4          
   Grid coordinates :
     1 : unstructured             : points=6599680
                        longitude : 0 to 359.9299 degrees_east
                         latitude : -89.94619 to 89.94619 degrees_north
   Vertical coordinates :
     1 : surface                  : levels=1
   Time coordinate :
                             time : 1 step
     RefTime =  1970-01-01 00:00:00  Units = seconds  Calendar = proleptic_gregorian
  YYYY-MM-DD hh:mm:ss  YYYY-MM-DD hh:mm:ss  YYYY-MM-DD hh:mm:ss  YYYY-MM-DD hh:mm:ss
  2019-05-14 18:00:00
cdo    sinfon: Processed 4 variables over 1 timestep [0.14s 119MB].

Btw, to remap to a 0.25x0.25 degrees regular global grid you can use the global_0.25 grid parameter:

cdo -remapbil,global_0.25 infile outfile

RE: cdo remap from reduced Gaussian grid to lat-lon - Added by Karin Meier-Fleischer 7 months ago

Oops, I've forgotten to add the CDO command line for the remapping.

cdo -remapnn,global_0.25 ifs_operod2_Tauto_2019051418+0_smi.nc outfile.nc

The warnings about step and time will still remain.

RE: cdo remap from reduced Gaussian grid to lat-lon - Added by Sylvia Sullivan 7 months ago

Dear Estanislao and Karin,
Many thanks for your responses. The email address in my cdo account was not updated, so I did not receive the notification last week. I have used the nearest neighbors remapping in combination with the "global_0.25" specification and it has worked. Like Karin points out, there are remaining warnings about time and step because the file is not CF compliant.
cdo -remapnn,global_0.25 ifs_operod2_Tauto_2019051418+0_smi.nc ifs_operod2_Tauto_2019051418+0_smi_latlon.nc
Thank you for your help!
Sylvia

RE: cdo remap from reduced Gaussian grid to lat-lon - Added by Sylvia Sullivan 7 months ago

For documentation's sake, I will note that I actually ended up using
cdo -remapnn,r1440x721 ifs_operod2_Tauto_2019051418+0_smi.nc ifs_operod2_Tauto_2019051418+0_smi_latlon.nc
This remaps to a grid with longitudes like (-115, -114.75, -114.5, -114.25,...) rather than a grid with longitudes like (-115.125, -114.875, -114.625, -114.375, ...). The latter would be offset from my other IFS data.
Sylvia

RE: cdo remap from reduced Gaussian grid to lat-lon - Added by Ralf Mueller 7 months ago

thx for posting your solution, Sylvia!

    (1-6/6)