cdo remapnn (Abort): Unsupported target grid type (generic)!
Added by Jeisson Javier Leal Rojas over 1 year ago
I recently downloaded data from https://appeears.earthdatacloud.nasa.gov (Evapotranpiration and Latent heat flux) in MOD16A2 data.
This is how the data looks when ncdump:
netcdf MOD16A2GF.061_500m_2000_1 { dimensions: time = 23 ; lat = 35742 ; lon = 77187 ; variables: byte crs ; crs:grid_mapping_name = "latitude_longitude" ; crs:_CoordinateAxisTypes = "GeoX GeoY" ; crs:spatial_ref = "GEOGCS[\"unknown\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AXIS[\"Longitude\",EAST],AXIS[\"Latitude\",NORTH]]" ; crs:epsg_code = 4326LL ; crs:horizontal_datum_name = "WGS84" ; crs:semi_major_axis = 6378137LL ; crs:inverse_flattening = 298.257223563 ; crs:longitude_of_prime_meridian = 0. ; int time(time) ; time:standard_name = "time" ; time:axis = "T" ; time:calendar = "julian" ; time:units = "days since 2000-01-01 00:00:00" ; double lat(lat) ; lat:standard_name = "latitude" ; lat:units = "degrees_north" ; lat:_CoordinateAxisType = "GeoY" ; lat:axis = "Y" ; double lon(lon) ; lon:standard_name = "longitude" ; lon:units = "degrees_east" ; lon:_CoordinateAxisType = "GeoX" ; lon:axis = "X" ; short ET_500m(time, lat, lon) ; ET_500m:_FillValue = 32767s ; ET_500m:coordinates = "time lat lon" ; ET_500m:grid_mapping = "crs" ; ET_500m:valid_min = -32767s ; ET_500m:valid_max = 32700s ; ET_500m:long_name = "MODIS Gridded 500m 8-day Composite Evapotranspiration (ET)" ; ET_500m:units = "kg/m^2/8day" ; ET_500m:scale_factor_err = 0. ; ET_500m:add_offset_err = 0. ; ET_500m:calibrated_nt = 22 ; ET_500m:scale_factor = 0.1 ; ET_500m:add_offset = 0. ; short LE_500m(time, lat, lon) ; LE_500m:_FillValue = 32767s ; LE_500m:coordinates = "time lat lon" ; LE_500m:grid_mapping = "crs" ; LE_500m:valid_min = -32767s ; LE_500m:valid_max = 32700s ; LE_500m:long_name = "MODIS Gridded 500m 8-day Composite latent heat flux (LE)" ; LE_500m:units = "MJ/m^2/day" ; LE_500m:scale_factor_err = 0. ; LE_500m:add_offset_err = 0. ; LE_500m:calibrated_nt = 22 ; LE_500m:scale_factor = 0.01 ; LE_500m:add_offset = 0. ; short ET_QC_500m(time, lat, lon) ; ET_QC_500m:_FillValue = 255s ; ET_QC_500m:coordinates = "time lat lon" ; ET_QC_500m:grid_mapping = "crs" ; ET_QC_500m:valid_min = 0s ; ET_QC_500m:valid_max = 254s ; ET_QC_500m:long_name = "ET_QC_500m" ; ET_QC_500m:units = "none" ;
In addition I have a tgt_grid.txt that looks like:
# # gridID 1 # gridtype = lonlat gridsize = 5040000 xname = lon xlongname = longitude xunits = degrees_east yname = lat ylongname = latitude yunits = degrees_north xsize = 3600 ysize = 1400 xfirst = -179.95 xinc = 0.1 yfirst = 83.95 yinc = -0.1
I am trying to do remapnn:
cdo remapnn,tgt_grid.txt in.nc out.nc
And I am getting the error:
* cdo remapnn (Abort): Unsupported target grid type (generic)!*
Any ideas what the problem may be?
Replies (8)
RE: cdo remapnn (Abort): Unsupported target grid type (generic)! - Added by Jeisson Javier Leal Rojas over 1 year ago
I have downloaded a sample test file and uploaded it here
test_WGS84.nc (79.7 KB) test_WGS84.nc |
RE: cdo remapnn (Abort): Unsupported target grid type (generic)! - Added by Karin Meier-Fleischer over 1 year ago
Hi Jeisson,
I'm not able to reproduce the error. Which CDO version are you using?
With CDO 2.0.5:
cdo -remapnn,tgt_grid.txt test_WGS84.nc outfile.nc Warning (attribute_to_calendar): calendar >julian< unsupported! cdo remapnn: Nearest neighbor weights from lonlat (105x109) to lonlat (3600x1400) grid, with source mask (4853) cdo remapnn: Nearest neighbor weights from lonlat (105x109) to lonlat (3600x1400) grid, with source mask (5539) cdo remapnn: Processed 171675 values from 3 variables over 5 timesteps [114.80s 1162MB].
cdo sinfon outfile.nc File format : NetCDF4 -1 : Institut Source T Steptype Levels Num Points Num Dtype : Parameter name 1 : unknown AppEEARS v instant 1 1 5040000 1 I16 : ET_500m 2 : unknown AppEEARS v instant 1 1 5040000 1 I16 : LE_500m 3 : unknown AppEEARS v instant 1 1 5040000 1 I16 : ET_QC_500m Grid coordinates : 1 : lonlat : points=5040000 (3600x1400) lon : -179.95 to 179.95 by 0.1 degrees_east circular lat : 83.95 to -55.95 by -0.1 degrees_north Vertical coordinates : 1 : surface : levels=1 Time coordinate : time : 5 steps RefTime = 2000-01-01 00:00:00 Units = days Calendar = standard YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss 2022-11-25 00:00:00 2022-12-03 00:00:00 2022-12-11 00:00:00 2022-12-19 00:00:00 2022-12-27 00:00:00
RE: cdo remapnn (Abort): Unsupported target grid type (generic)! - Added by Jeisson Javier Leal Rojas over 1 year ago
Hi Karin,
When doing cod --version:
─╯
Climate Data Operators version 2.2.0 (https://mpimet.mpg.de/cdo) System: aarch64-apple-darwin22.4.0 CXX Compiler: clang++ -std=gnu++17 -g -O2 -pthread CXX version : Apple clang version 14.0.3 (clang-1403.0.22.14.1) C Compiler: clang -g -O2 -pthread -pthread C version : Apple clang version 14.0.3 (clang-1403.0.22.14.1) F77 Compiler: gfortran -g -O2 F77 version : GNU Fortran (Homebrew GCC 13.1.0) 13.1.0 Features: 16GB 10threads c++17 Fortran pthreads HDF5 NC4/HDF5 OPeNDAP sz Libraries: yac/2.6.1 NetCDF/4.9.2 HDF5/1.14.1(h1.14.0) CDI data types: SizeType=size_t CDI file types: srv ext ieg grb1 grb2 nc1 nc2 nc4 nc4c nc5 nczarr CDI library version : 2.2.1 cgribex library version : 2.1.0 ecCodes library version : 2.30.0 NetCDF library version : 4.9.2 of May 1 2023 09:08:29 $ exse library version : 1.5.0 FILE library version : 1.9.1
I tried it as well on a cluster now. This is the version in a cluster:
Climate Data Operators version 2.0.4 (https://mpimet.mpg.de/cdo) System: x86_64-pc-linux-gnu CXX Compiler: /sw/spack-workplace/spack/lib/spack/env/gcc/g++ -std=gnu++14 -g -O2 -fopenmp -pthread CXX version : g++ (Spack GCC) 11.2.0 C Compiler: /sw/spack-workplace/spack/lib/spack/env/gcc/gcc -g -O2 -fopenmp -pthread -pthread C version : gcc (Spack GCC) 11.2.0 F77 Compiler: /sw/spack-workplace/spack/lib/spack/env/gcc/gfortran -g -O2 F77 version : GNU Fortran (Spack GCC) 11.2.0 Features: 503GB 256threads C++14 OpenMP45 Fortran PTHREADS HDF5 NC4/HDF5/threadsafe OPeNDAP SZ UDUNITS2 PROJ XML2 MAGICS FFTW3 AVX2 Libraries: HDF5/1.12.1 proj/8.1.0 xml2/2.9.7 magics/4.9.3 CDI data types: SizeType=size_t DateType=int64_t CDI file types: srv ext ieg grb1 grb2 nc1 nc2 nc4 nc4c nc5 CDI library version : 2.0.4 cgribex library version : 2.0.1 ecCodes library version : 2.21.0 NetCDF library version : 4.8.1 of Feb 17 2022 15:36:58 $ hdf5 library version : 1.12.1 threadsafe exse library version : 1.4.2 FILE library version : 1.9.1
And I've got this results when doing it in the cluster
cdo -remapnn,tgt_grid.txt test_WGS84.nc outfile.nc
Warning (attribute_to_calendar): calendar >julian< unsupported! cdo remapnn: Nearest neighbor weights from lonlat (105x109) to lonlat (3600x1400) grid, with source mask (4853) cdo remapnn: Nearest neighbor weights from lonlat (105x109) to lonlat (3600x1400) grid, with source mask (5539) ccdo remapnn: Processed 171675 values from 3 variables over 5 timesteps [114.03s 1021MB].
I assume I will have to update my CDO version.
Also, any comments related to the unsupported calendar?
Cheer,
Jeisson
RE: cdo remapnn (Abort): Unsupported target grid type (generic)! - Added by Karin Meier-Fleischer over 1 year ago
Change the calendar to standard calendar (proleptic_gregorian):
cdo -setcalendar,standard infile outfile
RE: cdo remapnn (Abort): Unsupported target grid type (generic)! - Added by Jeisson Javier Leal Rojas over 1 year ago
Thanks for the support. One last question
I think I can do CDO taks in parallel. For example
cdo -P 16 remapnn,tgt_grid.txt nfile outfile cdo -P 16 -setcalendar,standard infile outfile
Could you please point me where I can find more information about this -P.
I would like to know a bit more
regards,
Jeisson Leal.
RE: cdo remapnn (Abort): Unsupported target grid type (generic)! - Added by Karin Meier-Fleischer over 1 year ago
Have a look at 'Parallelized operators' in the documentation https://code.mpimet.mpg.de/projects/cdo/embedded/cdo.pdf#subsection.1.2.4
RE: cdo remapnn (Abort): Unsupported target grid type (generic)! - Added by Jeisson Javier Leal Rojas over 1 year ago
Thanks a lot Karin!
One last question if I may ask.
I was thinking to use cdo -P 16 -setcalendar and cdo -P 16 remapnn,tgt_grid.txt all in one line command instead of the two lines I presented before.
I want to avoid creating two nc files (one for each CDO command line). Is this possible?
I tried some combinations, but I failed.
Cheers,
Jeisson Leal.
RE: cdo remapnn (Abort): Unsupported target grid type (generic)! - Added by Karin Meier-Fleischer over 1 year ago
Hm, the following operator chaining works:
cdo -P 16 -remapnn,tgt_grid.txt -setcalendar,standard test_WGS84.nc outfile.nc