Project

General

Profile

eca_gsl grid size error

Added by Tufan Turp over 4 years ago

Hi all,

I'm facing with a problem while calculating Thermal Growing Season Length index.

cdo eca_gsl infile.nc mask.nc outfile.nc

cdo eca_gsl (Abort): Grid sizes of the input fields do not match!

I couldn't upload my infile since it is 472 MB but I uploaded mask.nc file. Info about my infile is below:

netcdf tasmeanKHIST9112 {
dimensions:
x = 177 ;
y = 83 ;
m2 = 1 ;
time = UNLIMITED ; // (8036 currently)
bnds = 2 ;
variables:
float xlon(y, x) ;
xlon:standard_name = "longitude" ;
xlon:long_name = "longitude" ;
xlon:units = "degrees_east" ;
xlon:_CoordinateAxisType = "Lon" ;
float xlat(y, x) ;
xlat:standard_name = "latitude" ;
xlat:long_name = "latitude" ;
xlat:units = "degrees_north" ;
xlat:_CoordinateAxisType = "Lat" ;
float m2(m2) ;
m2:standard_name = "height" ;
m2:long_name = "Height level" ;
m2:units = "m" ;
m2:positive = "up" ;
m2:axis = "Z" ;
double time(time) ;
time:standard_name = "time" ;
time:long_name = "time" ;
time:bounds = "time_bnds" ;
time:units = "hours since 1949-12-1 00:00:00" ;
time:calendar = "standard" ;
time:axis = "T" ;
double time_bnds(time, bnds) ;
float tasmean(time, m2, y, x) ;
tasmean:long_name = "Mean 2 meter temperature" ;
tasmean:units = "K" ;
tasmean:coordinates = "xlat xlon" ;
tasmean:_FillValue = -9.e+33f ;
tasmean:missing_value = -9.e+33f ;

I will be glad if you can help me to solve this problem.

Thanks,

mask.nc (174 KB) mask.nc

Replies (3)

RE: eca_gsl grid size error - Added by Karin Meier-Fleischer over 4 years ago

Hi Tufan,

you're data and mask file have different grids and you have to remap one of the files to the grid of the other file.

BTW, a mask file should have only 0 and 1 values but your mask contains the value 2 instead of value 1! Use setvals to change it.

 mask =
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 
    2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 
    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 
    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 
    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 
    2, 2, 2, 2, 2, 2, 2, 2,
...
cdo setvals,2,1 mask.nc mask_01.nc

If you use the coarse grid of the mask file

cdo remapcon,mask_01.nc tasmeanKHIST9112.nc tasmeanKHIST9112_177x83.nc

Then use the eca operator eca_gsl

cdo eca_gsl tasmeanKHIST9112_177x83.nc mask_01.nc outfile.nc

-Karin

RE: eca_gsl grid size error - Added by Tufan Turp over 4 years ago

Dear Karin,

First of all, thank you very much for quick and clear answer. Actually, I didn't mention it in my previous post but I have already tried them before by using remapnn and I got the same error. Maybe I missed something. Yet, I will retry it with your commands again. Thank you!

Best,

Tufan

RE: eca_gsl grid size error - Added by Tufan Turp over 4 years ago

Dear Karin,

remapcon command gives a warning "Source grid cell corner coordinates missing!" since my infile is curvilinear including only the cell center locations. When I also tried all the other options "remapnn" or "remapbil" commands and change the places of mask file and infile I got the same error about grid size mismatching. Then I followed these steps and I got the output:

cdo setvals,2,1 mask.nc mask_01.nc

cdo remapcon,tasmeanKHIST9112.nc mask_01.nc mask_02.nc
cdo remapcon (Abort): Source grid cell corner coordinates missing!

cdo eca_gsl tasmeanKHIST9112.nc mask_02.nc outfile.nc

Is it yet OK to use mask_02.nc file although it has not mask values.

-1 : Date Time Level Gridsize Miss : Minimum Mean Maximum : Parameter name
1 : 0000-00-00 00:00:00 0 14691 0 : 24.415 35.500 46.585 : xlon
2 : 0000-00-00 00:00:00 0 14691 0 : 34.728 38.826 42.805 : xlat

My output file seems OK.

Thanks,

Tufan

    (1-3/3)