Project

General

Profile

Merged files with same lat,lon,time attributes leads to inconsistent results during simple raster algebra.

Added by Noam Chomsky over 3 years ago

I am attaching the two files. After I merge them with 'CDO merge' everything seems fine. However when I perform some simple calculations in both R and Ferret, the calculations in Ferret lead to a few incorrect results while the results in R are correct. I have tried to troubleshoot this with the Ferret mailing list and I was told that the problem is related to inconsistent time coordinates. However, after I set both files to the same time coordinates I still have the same problem. In Ferret I do get this " *** NOTE: Ambiguous coordinates on Z axis:" when performing a division of variables with different z levels.

Also when opening the file I get " NOTE: Error in bounds "time_counter_bnds" or bounds do not enclose point on axis time_counter" but as I mentioned in the title the two files seem to have the same time attributes.

I'm wondering if someone here is able to spot any potential issue with the two files.

Thank you


Replies (1)

RE: Merged files with same lat,lon,time attributes leads to inconsistent results during simple raster algebra. - Added by Karin Meier-Fleischer over 3 years ago

Hi Noam,

if you take a closer look at your files you will see that the z-axis dimension variables are different (veget = 1,2,3,..,10; sfc=1,2,3,...,13).

cdo sinfon for-animal-npp.nc

   File format : NetCDF
    -1 : Institut Source   T Steptype Levels Num    Points Num Dtype : Parameter name
     1 : unknown  unknown  v instant      13   1     16200   1  F32  : VEGET_COV_MAX 
     2 : unknown  unknown  v instant      13   1     16200   1  F32  : NPP           
   Grid coordinates :
     1 : lonlat                   : points=16200 (180x90)
                        longitude : -179 to 179 by 2 degrees_east  circular
                         latitude : 89 to -89 by -2 degrees_north
   Vertical coordinates :
     1 : generic                  : levels=13
                            veget : 1 to 13 by 1 1
   Time coordinate :  1 step
     RefTime =  1901-01-01 00:00:00  Units = seconds  Calendar = 365_day  Bounds = true
  YYYY-MM-DD hh:mm:ss  YYYY-MM-DD hh:mm:ss  YYYY-MM-DD hh:mm:ss  YYYY-MM-DD hh:mm:ss
  1901-06-15 00:00:00
cdo    sinfon: Processed 2 variables over 1 timestep [0.00s 9076KB].

cdo sinfon trun24.nc

   File format : NetCDF
    -1 : Institut Source   T Steptype Levels Num    Points Num Dtype : Parameter name
     1 : unknown  unknown  v instant      10   1     16200   1  F32  : anpop         
     2 : unknown  unknown  v instant      10   1     16200   1  F32  : intake        
     3 : unknown  unknown  v instant      10   1     16200   1  F32  : anpop_sd      
     4 : unknown  unknown  v instant      10   1     16200   1  F32  : intake_sd     
   Grid coordinates :
     1 : lonlat                   : points=16200 (180x90)
                        longitude : -179 to 179 by 2 degrees_east  circular
                         latitude : 89 to -89 by -2 degrees_north
   Vertical coordinates :
     1 : generic                  : levels=10
                              sfc : 1 to 10 by 1 
   Time coordinate :  1 step
     RefTime =  1901-01-01 00:00:00  Units = seconds  Calendar = 365_day  Bounds = true
  YYYY-MM-DD hh:mm:ss  YYYY-MM-DD hh:mm:ss  YYYY-MM-DD hh:mm:ss  YYYY-MM-DD hh:mm:ss
  1901-06-15 00:00:00
cdo    sinfon: Processed 4 variables over 1 timestep [0.00s 9140KB].

cdo showlevel trun24.nc

 1 2 3 4 5 6 7 8 9 10
 1 2 3 4 5 6 7 8 9 10
 1 2 3 4 5 6 7 8 9 10
 1 2 3 4 5 6 7 8 9 10
cdo    showlevel: Processed 4 variables [0.00s 9068KB].

cdo showlevel for-animal-npp.nc

 1 2 3 4 5 6 7 8 9 10 11 12 13
 1 2 3 4 5 6 7 8 9 10 11 12 13
cdo    showlevel: Processed 2 variables [0.00s 9012KB].

The time_counter_bnds values are wrong when time_counter is set to

 time_counter = 1.4256e+07 ;
 time_counter_bnds =
  312379200, 31492800 ;

Delete the time_counter_bnds variable and the bounds attribute from both files, here for the trun24.nc file:

ncks -O -x -v time_counter_bnds trun24.nc
ncatted -O -a bounds,,d,, trun24.nc

-Karin

    (1-1/1)