Project

General

Profile

Warning (cdfInqContents): Coordinates variable latitude can't be assigned!

Added by Jeisson Javier Leal Rojas about 1 year ago

Hi everyone

I am trying to use remapnn to interpolate grids.

I have a land_mask.nc file that looks like this when I type cdo sinfon land_mask.nc

   File format : NetCDF4 zip
    -1 : Institut Source   T Steptype Levels Num    Points Num Dtype : Parameter name
     1 : unknown  unknown  c instant       1   1   5040000   1  I8 z : land_mask     
     2 : unknown  unknown  c instant       1   1   5040000   1  I8 z : e5l_diff      
     3 : unknown  unknown  c instant       1   1   5040000   1  I8 z : sd_diff       
   Grid coordinates :
     1 : generic                  : points=5040000 (3600x1400)
                        longitude : -179.95 to 179.95 by 0.1 
                         latitude : 83.95 to -55.95 by -0.1 
   Vertical coordinates :
     1 : surface                  : levels=1
cdo    sinfon: Processed 3 variables [0.01s 22MB].

I created a target text file to do the interpolation by typing: cdo griddes land_mask.nc > tgt_grid.txt

This is how tgt_grid.txt file looks like:

#
# gridID 1
#
gridtype  = generic
gridsize  = 5040000
xsize     = 3600
ysize     = 1400
xname     = longitude
yname     = latitude
xfirst    = -179.95
xinc      = 0.1
yfirst    = 83.95
yinc      = -0.1

Because land_mask.nc has a generic coordinate system I had issues when doing: cdo remapnn,tgt_grid.txt input.nc output.nc

I was getting this error: cdo remapnn (Abort): Unsupported target grid type (generic)!

I found a possible way to fix that error by an old post here in this forum: https://code.mpimet.mpg.de/boards/1/topics/55

I typed ncatted -a coordinates,land_mask,c,c,"longitude latitude" land_mask.nc as it was recommended in the post.

Then, I tried again to create a tgt_grid.txt as following: cdo griddes land_mask_compressed.nc > tgt_grid.txt
Here is where I got this error message twice:

Warning (cdfInqContents): Coordinates variable longitude can't be assigned!
Warning (cdfInqContents): Coordinates variable latitude can't be assigned!

This new tgt_grid.txt looks exactly there same as before when typing something like cat tgt_grid.txt:

#
# gridID 1
#
gridtype  = generic
gridsize  = 5040000
xsize     = 3600
ysize     = 1400
xname     = longitude
yname     = latitude
xfirst    = -179.95
xinc      = 0.1
yfirst    = 83.95
yinc      = -0.1

Does anyone have any idea on how to tackle this issue and finally be able to apply remapnn?

Kind regards,

Jeisson Leal


    (1-1/1)