Project

General

Profile

sign reversal of yinc when remapping with remapbil

Added by Jason Lambert 4 months ago

Hello

I am trying to regrid a file using remapbil. For a reason that I do not see the yinc variable is always set to the negative of what I expect.
I am 95% sure I am doing something silly but i just can't see it, hence this post.

This is my original grib file grid description.
*jlambert@gribmachine-arm:~$ cdo griddes ocean_grib_dt.grib #
  1. gridID 1 #
    gridtype = lonlat
    gridsize = 744184
    xsize = 959
    ysize = 776
    xname = lon
    xlongname = "longitude"
    xunits = "degrees_east"
    yname = lat
    ylongname = "latitude"
    yunits = "degrees_north"
    xfirst = 100.083
    xinc = 0.083
    yfirst = 0.083
    yinc = 0.083
    scanningMode = 64
    cdo griddes: Processed 2 variables [0.07s 68MB]*
This is my grid description file
*cat overlapped_grid.txt #
  1. gridID 1 #
    gridtype = lonlat
    gridsize = 22801
    xsize = 151
    ysize = 151
    xname = lon
    xlongname = "longitude"
    xunits = "degrees_east"
    yname = lat
    ylongname = "latitude"
    yunits = "degrees_north"
    xfirst = 137.671
    xinc = 0.04
    yfirst = 36.726
    yinc = 0.04
    scanningMode = 64*

However, after running the following the following remapbil command
cdo -remapbil,overlapped_grid.txt ocean_grib_dt.grib ocean_grib_dt_remap.grib

The grib I get has the following grid description. As you can see the yinc is negative of what I expect.

*cdo griddes ocean_grib_dt_remap.grib #
  1. gridID 1 #
    gridtype = lonlat
    gridsize = 22801
    xsize = 151
    ysize = 151
    xname = lon
    xlongname = "longitude"
    xunits = "degrees_east"
    yname = lat
    ylongname = "latitude"
    yunits = "degrees_north"
    xfirst = 137.671
    xinc = 0.04
    yfirst = 36.726
    yinc = -0.04
    scanningMode = 0
    cdo griddes: Processed 2 variables [0.07s 68MB]*

Replies (6)

RE: sign reversal of yinc when remapping with remapbil - Added by Estanislao Gavilan 4 months ago

Hi Jason,

can you attach one time step of your grib file?

Kind regards,

Estanislao

RE: sign reversal of yinc when remapping with remapbil - Added by Estanislao Gavilan 4 months ago

Hi Jason,

I have just checked it in cdo 2.0.4. My output shows a positive yinc. May I ask what cdo version you are using?

RE: sign reversal of yinc when remapping with remapbil - Added by Jason Lambert 4 months ago

Curious,

This is the output of cdo --version on my system

jlambert@gribmachine-arm:~$ cdo --version
Climate Data Operators version 2.1.1 (https://mpimet.mpg.de/cdo)
System: aarch64-unknown-linux-gnu
CXX Compiler: g++ -g -O2 -ffile-prefix-map=/build/cdo-mjilHq/cdo-2.1.1=. -fstack-protector-strong -Wformat -Werror=format-security -fopenmp -pthread
CXX version : g++ (Debian 12.2.0-10) 12.2.0
C Compiler: gcc -g -O2 -ffile-prefix-map=/build/cdo-mjilHq/cdo-2.1.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wall -pedantic -fPIC -fopenmp -pthread -pthread
C version : gcc (Debian 12.2.0-10) 12.2.0
F77 Compiler: f77 -g -O2 -ffile-prefix-map=/build/cdo-mjilHq/cdo-2.1.1=. -fstack-protector-strong
F77 version : GNU Fortran (Debian 12.2.0-10) 12.2.0
Features: 1GB 2threads c++17 OpenMP45 Fortran pthreads HDF5 NC4/HDF5/threadsafe OPeNDAP sz udunits2 proj magics curl fftw3 hirlam_extensions
Libraries: yac/2.6.1 HDF5/1.10.8 proj/9.1.1 curl/7.88.1(h7.86.0) magics/4.13.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.1.1
ecCodes library version : 2.28.0
NetCDF library version : 4.9.0 of Aug 7 2022 23:34:27 $
HDF5 library version : library undefined
exse library version : 1.4.2
FILE library version : 1.9.1

RE: sign reversal of yinc when remapping with remapbil - Added by Uwe Schulzweida 4 months ago

This problem probably only occurs if CDO was compiled with HIRLAM-extensions. Here there was a problem with the GRIB scanningMode. The problem was solved in CDO 2.2.2 (Bug #11367).

    (1-6/6)