[gradsusr] can't load netcdf variable
Andrew Friedman
andfried at gmail.com
Thu Jun 30 11:13:59 EDT 2016
Hi all,
I found the problem with my file: the time axis units were not in a
proper GrADS-readable format. When I changed the time axis with the
following, I was able to open the file in GrADS:
ncatted -a units,time,o,c,"months since 1970-01-01 00:00:0.0"
sss_postobj_7013_ATL50N30Sreg1x1.nc
I also changed the fill value to a GrADS-readable format, which
allowed the data to scale properly:
ncatted -a _FillValue,,o,d,1e9 sss_postobj_7013_ATL50N30Sreg1x1.nc
Andrew
On Wed, Jun 29, 2016 at 3:05 PM, Andrew Friedman <andfried at gmail.com> wrote:
> Hi GrADS users,
>
> I'm having trouble reading a variable from a netcdf file in GrADS. The
> ncdump -h output is pasted at bottom (along with the original URL for
> the file). It's a sea surface salinity (SSS) dataset, with a land-sea
> mask. I'm able to open the file using 'sdfopen' and the land-sea mask,
> but not the main variable 'sss'.
>
> I know that the SSS data are there because there is output when I use
> 'ncdump -v sss.'
>
> The same problem occurs when I write a control file with the following lines :
> ...
> VARS 2
> sss=>sss
> mask=>mask
> ...
> In this case, only 'mask' loads.
>
> Does anyone have any ideas about why the variable might not be
> loading? I assume there is something about the way the netcdf file is
> written that makes the variable invisible to GrADS.
>
> I'm runing OpenGrADS 2.1.a2.oga.1.
>
> Thanks, Andrew
>
> Original source: ftp://ftp.legos.obs-mip.fr/pub/soa/salinite/sss_atl/
>
> ncdump -h sss_postobj_7013_ATL50N30Sreg1x1.nc
> netcdf sss_postobj_7013_ATL50N30Sreg1x1 {
> dimensions:
> time = UNLIMITED ; // (528 currently)
> longitude = 116 ;
> latitude = 81 ;
> variables:
> double err(time, longitude, latitude) ;
> err:_FillValue = "1e+9" ;
> err:long_name = "Normalized Estimated Error" ;
> err:units = "none" ;
> double latitude(latitude) ;
> latitude:units = "degrees_north" ;
> double longitude(longitude) ;
> longitude:units = "degrees_east" ;
> double mask(longitude, latitude) ;
> mask:long_name = "Land / Sea Mask" ;
> mask:units = "none" ;
> double sss(time, longitude, latitude) ;
> sss:_FillValue = "1e+9" ;
> sss:long_name = "Sea Surface Salinity" ;
> sss:units = "none" ;
> double time(time) ;
> time:units = "months since January 1970" ;
>
> // global attributes:
> :description = "Created by MATLAB Version7.5 (2007b)" ;
> :convention = "COARDS" ;
> :title = "MONTHLY SSS & ESTIMATED ERRORS 1970-2013 1degx1deg
> AFTER OBJECTIVE ANALYSIS" ;
> :author = "Gilles REVERDIN and Elodie KESTENARE" ;
> :date = "23-Mar-2015 18:07" ;
> :history = "Tue Jun 28 19:58:53 2016: ncrename --attribute
> .missing_value,_FillValue sss_postobj_7013_ATL50N30Sreg1x1.nc\n",
> "Tue Jun 28 19:55:41 2016: ncks --overwrite --mk_rec_dmn
> time sss_postobj_7013_ATL50N30Sreg1x1.nc
> sss_postobj_7013_ATL50N30Sreg1x1.nc" ;
> :NCO = "\"4.5.2\"" ;
More information about the gradsusr
mailing list