Project

General

Profile

no discernable X coordinate

Added by Muhammad Rahiz over 13 years ago

I ran some commands in cdo, and got an output file. However, I'm not able to view it in grads. Error message prints;

ga-> sdfopen afgcx.rain.1949-2099.nc
Scanning self-describing file: afgcx.rain.1949-2099.nc
gadsdf: SDF file has no discernable X coordinate.

can anyone advise how i can overcome this problem? i suspect there have to be some options in cdo that i need to pass to ensure that the output is readable in grads.

thanks


Replies (4)

RE: no discernable X coordinate - Added by Ralf Mueller over 13 years ago

Hi Muhammad,
it would be very helpfull to have the input file for further analysis, or at least the description of variables and attributes
you can use ncdump for that purpose

regards
ralf

RE: no discernable X coordinate - Added by Muhammad Rahiz over 13 years ago

Dear Ralf,

Attached is one of my datafile which i encountered no problem opening in grads. To illustrate the problem, i merely ran a simple cdo command on the file;

cdo selvar,pr afgcxa.peq3aug.nc out.nc

and then open in the output file in grads. The following message occurs.

ga-> sdfopen out.nc
Scanning self-describing file: out.nc
gadsdf: SDF file has no discernable X coordinate.

thanks for your assistance.

Muhammad

RE: no discernable X coordinate - Added by Uwe Schulzweida over 13 years ago

Dear Muhammad,

There are two problems. The first problem is that each data variables in your netCDF file have two grid description. The original grid description is a rotated lon/lat grid and the true lon/lat coordinates are on a curvilinear grid. CDO can assign only one grid description to each data variable. Because of the attribute 'coordinates' the curvilinear grid is used and the information about the rotated coordinates will be lost. GrADS can't process data on curvilinear grids. In this case you can set the environment variable IGNORE_ATT_COORDINATES to
ignore the attribute 'coordinates'. Then the rotated lon/lat coordinates are used in CDO and the curvilinear grid information will be lost.

export IGNORE_ATT_COORDINATES=1
cdo selvar,pr afgcxa.peq3aug.nc out.nc
The second problem is that GrADS needs also the 'axis' attribute for the coordinate variables. This attribute is not needed in CDO and therefor not written to the output file. The next CDO version will add this attribute to the coordinate variables.
As a workaround you can add this attribute with the NCO command ncatted.

Regards,
Uwe

RE: no discernable X coordinate - Added by Carlos Renato Souza over 6 years ago

Hi,

I am a grads user and i always had the same problem for years...

This post is a little old, but if this is still usefull, here goes one simple solve for this NC-grads problem:

Suppose my NC file has this header:
(ncdump -h file.nc)

netcdf NATL_salt217_2147_2810 {
dimensions:
time = 7859 ;
variables:
double time(time) ;
time:long_name = "Time" ;
time:units = "minutes since 2147-02-01 00:00" ;
float outp(time) ;
outp:_FillValue = -9.99e+08f ;
}

And the GrADS complains that "SDF file has no discernable X coordinate".

This happens because there is same space coordinates informations missing in the header of file.nc.

First, i convert the file.nc in ascii format: ncdump file.nc > file.txt

Then i insert those missing information in the file.txt, like this:

netcdf NATL_salt217_2147_2810 {
dimensions:
time = 7859 ;
longitude = 1 ;
latitude = 1 ;

variables:
*float latitude(latitude);
latitude:units = "degrees_N";
float longitude(longitude);
longitude:units = "degrees_E"; *
double time(time) ;
time:long_name = "Time" ;
time:units = "minutes since 2147-02-01 00:00" ;
float outp(time) ;
outp:_FillValue = -9.99e+08f ;
data:

*latitude = 1;
longitude = 1;*
time = 0, 40320,...

Now, i convert the file.txt to file.nc again: ncgen file.txt -o file.nc

That's it!

I hope this helps...
Sorry about my english, and good luck!

    (1-4/4)