<标题>气候数据操作符(CDO) < / h1 > < h2 >定义网格< / h2 > < p >我们定义一个lat-lon目标网格与1°x1°网格单元尺寸30 x30网格细胞从40°N和-10°E (= 10°W): < / p > < pre > <代码> gridtype = lonlat xsize = 30 ysize = 30 xfirst = -10 xinc 40 yinc = 1 = 1 yfirst = < /代码> < / pre > < p >这段文本写入一个文本文件。看到< a href = " https://code.zmaw.de/projects/cdo/embedded/index.html x1-150001.3.2”>部分1.3.2 CDO手册< / >详情和进一步的例子。< / p > < p >如果你已经有一个netCDF文件在你的目标网格数据,您还可以从这个文件中提取网格定义:< / p > < pre > <代码> cdo griddes FILE_WITH_TARGET_GRID。数控祝辞myGridDef < /代码> < / pre > < p > <代码> myGridDef > < /代码是一个文本文件。< / p > < h2 > < / h2 > < p >插入数据,我认为我们做了双线性插值。这是完成了<代码> remapbil通过:< /代码>操作符< / p > < pre > <代码> cdo remapbil, myGridDef INPUT_FILE。数控OUTPUT_FILE。数控代码< / > < / pre > < p >输入数据的网格需要正确输入文件中定义(通常是一个问题)。< / p > < h2 >正确定义的网格替代1 < / h2 > < h3 > < / h3 > < p >数据变量的空间维度下面的例子(SST)需要被命名为<代码>经度< /代码>和<代码> lat > < /代码。此外,<代码>经度坐标变量代码< / >和<代码> lat > < /代码已经存在(时间独立!)。这些需要正确的坐标变量属性(见下面的例子)。< / p > < p >例子:< / p > < pre > <代码>维度:经度= 30; lat = 30 ; time = UNLIMITED ; // (24 currently) variables: double lon(lon) ; lon:standard_name = "longitude" ; lon:long_name = "longitude" ; lon:units = "degrees_east" ; lon:axis = "X" ; double lat(lat) ; lat:standard_name = "latitude" ; lat:long_name = "latitude" ; lat:units = "degrees_north" ; lat:axis = "Y" ; double time(time) ; time:standard_name = "time" ; time:long_name = "time" ; time:units = "seconds since 1900-01-01 00:00:00" ; time:calendar = "standard" ; time:axis = "T" ; float SST(time, lat, lon) ; SST:long_name = "sea_surface_temperature" ; SST:units = "degree celsius" ; SST:_FillValue = NaNf ; SST:missing_value = NaNf ; SST:var_desc = "sea surface temperature" ; Alternative 2
The spatial dimensions and corresponding variables exist in the source file but are not denoted as lon
and lat
. Then each data variable (SST, in this example) needs to have an attribute coordinates
that holds the names of the coordinate variables.
SST:coordinates = "lon lat" ;
Example:
dimensions: TSTEP = UNLIMITED ; // (24 currently) COL = 112 ; ROW = 106 ; variables: " ; double lon(ROW, COL) ; lon:standard_name = "longitude" ; lon:long_name = "longitude coordinate" ; lon:units = "degrees_east" ; lon:_CoordinateAxisType = "Lon" ; double lat(ROW, COL) ; lat:standard_name = "latitude" ; lat:long_name = "latitude coordinate" ; lat:units = "degrees_north" ; lat:_CoordinateAxisType = "Lat" ; double time(TSTEP) ; time:standard_name = "time" ; time:long_name = "time" ; time:units = "seconds since 1900-01-01 00:00:00" ; time:calendar = "standard" ; float SST(TSTEP, ROW, COL) ; SST:long_name = "sea_surface_temperature" ; SST:units = "degree celsius" ; SST:coordinates = "lon lat" ; SST:var_desc = "sea surface temperature" ;
Note:
If the coordinate variables are missing, then they can be created via the setgrid
operator. If we want to add a grid definition to the source file then we need the source file's grid definition in the text file (see 'define grid').
cdo setgrid,mySourceGridDef INFILE_NO_COORDS.nc INFILE_WI_COORDS.nc