GET_VARCOORDS - Cannot find "coordinates" attribute

General scientific issues regarding ROMS

Moderators: arango, robertson

Post Reply
Message
Author
kee
Posts: 44
Joined: Fri Mar 15, 2013 1:30 pm
Location: Nanjing Uni. of Info. Sci. & Tech. (nanjing institute of meterology)

GET_VARCOORDS - Cannot find "coordinates" attribute

#1 Unread post by kee »

Hi all,

I made the atmpheric forcing file in my own way, and tried to run the model.
However, it doesnot work, and the messages is below.
Can anyone give some ideas?
Thanks in advance!

Code: Select all

GET_VARCOORDS - Cannot find "coordinates" attribute for variable:  uwnd
                 in file:  ./Inputs/roms_blk.nc

                 This attribute is needed to interpolate input data
                 to model grid. Following CF compliance, we need:

                 float my_var(time, lat, lon) ;
                       my_var:long_name = "my variable long name" ;
                       my_var:units = "my variable units" ;
                       my_var:coordinates = "lon lat" ;
                       my_var:time = "my_var_time" ;


 GET_2DFLD   - error while reading variable: uwnd   at TIME index =      12
Information of my roms_blk.nc file is

Code: Select all

	double uwnd(bulk_time, eta_u, xi_u) ;
		uwnd:long_name = "u-wind" ;
		uwnd:units = "m/s" ;
	double vwnd(bulk_time, eta_v, xi_v) ;
		vwnd:long_name = "v-wind" ;
		vwnd:units = "m/s" ;

User avatar
kate
Posts: 4088
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: GET_VARCOORDS - Cannot find "coordinates" attribute

#2 Unread post by kate »

It is telling you that you need to add a coordinates attribute to your variables. You can use ncatted from the NCO package to edit your attributes. I expect you need a time attribute as well, pointing to the time variable dimensioned bulk_time.

mtonelli
Posts: 3
Joined: Mon Nov 09, 2009 6:24 pm
Location: University of Sao Paulo

Re: GET_VARCOORDS - Cannot find "coordinates" attribute

#3 Unread post by mtonelli »

I'm getting the same error at the very first time step:

Code: Select all

GET_VARCOORDS - Cannot find "coordinates" attribute for variable:  uwnd
                 in file:  raw_inputs/u_10_zero.nc

                 This attribute is needed to interpolate input data
                 to model grid. Following CF compliance, we need:

                 float my_var(time, lat, lon) ;
                       my_var:long_name = "my variable long name" ;
                       my_var:units = "my variable units" ;
                       my_var:coordinates = "lon lat" ;
                       my_var:time = "my_var_time" ;


 GET_2DFLD   - error while reading variable: uwnd   at TIME index =    1
I'm using CORE inter-annual forcing and I want ROMS to internally interpolate it to a Lat-Lon following grid. I've changed the variables and dimensions names as suggested in the wiki (here) and set the first time step to zero.

This is the ncdump -h for my u_10_zero.nc:

Code: Select all

netcdf u_10_zero {
dimensions:
	wind_time = UNLIMITED ; // (87600 currently)
	lat = 94 ;
	lon = 192 ;
	bnds = 2 ;
variables:
	double wind_time(wind_time) ;
		wind_time:axis = "T" ;
		wind_time:bounds = "TIME_bnds" ;
		wind_time:calendar = "NOLEAP" ;
		wind_time:time_origin = "1-JAN-1948" ;
		wind_time:units = "days since 1948-01-01 00:00:00" ;
	double lat(lat) ;
		lat:units = "degrees_north" ;
		lat:point_spacing = "uneven" ;
		lat:axis = "Y" ;
	double lon(lon) ;
		lon:units = "degrees_east" ;
		lon:modulo = 360. ;
		lon:point_spacing = "even" ;
		lon:axis = "X" ;
	double TIME_bnds(wind_time, bnds) ;
	float uwnd(wind_time, lat, lon) ;
		uwnd:missing_value = -1.e+34f ;
		uwnd:_FillValue = -1.e+34f ;
		uwnd:long_name = "10m U Wind" ;
		uwnd:units = "m/s" ;
Any thoughts? :?
Thanks in advance!

User avatar
arango
Site Admin
Posts: 1347
Joined: Wed Feb 26, 2003 4:41 pm
Location: DMCS, Rutgers University
Contact:

Re: GET_VARCOORDS - Cannot find "coordinates" attribute

#4 Unread post by arango »

You cannot use this file as it is in ROMS. It needs the coordinates attribute as mentioned in the error message. ROMS needs this attribute to process your data. It is very simple to fix. Use the provided nc_attadd from ROMS Matlab reposiotry:

nc_attadd('u_10_zero.nc', 'coordinates', 'lon lat wind_time', 'uwnd')

Notice that your CORE file has large values for the _FillValue attribute. ROMS will replace such values with zeros before interpolating. The missing_value is a deprecated attribute and not CF compliant. ROMS will not process the missing_value attribute. You need to check the data to see it actually have missing values and process them accordingly. They should be replaced with a _FillValue or a data value.

Now, ROMS metadata is specified in the file ROMS/External/varinfo.dat. For wind we have the following variable names:

Code: Select all

  'Uwind'                                          ! Input
  'surface u-wind component'
  'meter second-1'                                 ! [m/s]
  'u-wind, scalar, series'
  'wind_time'
  'idUair'
  'r2dvar'
  1.0d0

'Vwind'                                            ! Input
  'surface v-wind component'
  'meter second-1'                                 ! [m/s]
  'v-wind, scalar, series'
  'wind_time'
  'idVair'
  'r2dvar'
  1.0d0
Your variable (uwnd) does not have the same name as the above entries for wind (Uwind). You need to have a copy of this file in your application directory and edit the metadata appropriately to reflect the names in your input NetCDF file. Or you need to rename the variable in your NetCDF file:

status=nc_vrename('u_10_zero.nc', 'uwnd', 'Uwind')

This script is in ROMS Matlab repository.

yourgod_mwt_cn
Posts: 5
Joined: Wed Jun 18, 2014 12:50 pm
Location: Second Institute of Oceanography, NMR, China

Re: GET_VARCOORDS - Cannot find "coordinates" attribute

#5 Unread post by yourgod_mwt_cn »

I checked the forcing data in the dir. of the case test. The attribute should be as

Code: Select all

variables:
	double sst_time(sst_time) ;
		sst_time:long_name = "time for sea surface temperature" ;
		sst_time:units = "days since 1968-05-23 00:00:00 GMT" ;
		sst_time:calendar = "gregorian" ;
	float SST(sst_time, eta_rho, xi_rho) ;
		SST:long_name = "sea surface temperature" ;
		SST:units = "Celsius" ;
		SST:time = "sst_time" ;
		SST:coordinates = "lon lat" ;
		SST:flag_values = 9.999e+30f ;
		SST:flag_meanings = "land" ;
	float lon(eta_rho, xi_rho) ;
		lon:long_name = "longitude" ;
		lon:units = "degree_east" ;
		lon:standard_name = "longitude" ;
	float lat(eta_rho, xi_rho) ;
		lat:long_name = "latitude" ;
		lat:units = "degree_north" ;
		lat:standard_name = "latitude" ;
	float landval(one) ;

Post Reply