Re: ERROR[ coordinates : lat lon (0) check_for_y_lat_coord: Warning: Data either does not contain a valid latitude coordinate array or doesn't contain one at all...

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Tue May 13 2014 - 09:47:28 MDT

Vanúcia,

It looks to me like you have a curvilinear grid and not a rectilinear grid, so you are going to be unable to use coordinate arrays, which is what you were trying to do with this code:

> >lat = f[:]->i
> >lon = f[:]->j
> > t&i = lat
> >t&j = lon

The "printVarSummary" of "t" indicates that your "t" variable has coordinates called "lat" and "lon", and hopefully these are on the file, and are two-dimensional. If so, try this (UNTESTED):

load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"

begin
fils = systemfunc("ls *.nc")
 f = addfiles(fils, "r")
ListSetType(f,"join")
t =f[:]->tos(:,0,:,:

tsm = t - 273.15
media= dim_avg_n_Wrap(tsm, 0)
media@lat2d = lat = f[:]->lat
media@lon2d = f[:]->lon
res = True
plot = gsn_csm_contour_map_ce(wks,media,res)
end

Note that I'm not setting any plot options via "res" here, so you are going to get a very bare-bones plot.

For a sample of some plot options you might want to set, see the templates at:

http://www.ncl.ucar.edu/Applications/Templates/#PlotsOverMapsTemplates

In particular, look at "contour_map_template.ncl".

--Mary

On May 12, 2014, at 1:35 PM, Vanúcia Schumacher <vanucia-schumacher@hotmail.com> wrote:

> Hi users,
>
> I'll trying to plot global map, but lat and lon have different names in variable:
>
> >load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
> >load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
> >load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
>
> >begin
> >fils = systemfunc("ls *.nc")
> >f = addfiles(fils, "r")
> >ListSetType(f,"join")
>
> >t =f[:]->tos(:,0,:,:)
>
> >lat = f[:]->i
> >lon = f[:]->j
> > t&i = lat
> >t&j = lon
> >tsm = t - 273.15
> >media= dim_avg_n_Wrap(tsm, 0)
> >plot = gsn_csm_contour_map_ce(wks,media,res)
> >end
>
> >printVarSummary(t)
>
>
> Variable: t
> Type: float
> Total Size: 108472 bytes
> 27118 values
> Number of Dimensions: 3
> Dimensions and sizes: [ncl_join | 1] x [j | 149] x [i | 182]
> Coordinates:
> j: [1..149]
> i: [1..182]
> Number Of Attributes: 14
> time : 15.5
> standard_name : sea_surface_temperature
> long_name : Sea Surface Temperature
> comment : "this may differ from ""surface temperature"" in regions of sea ice."
> units : K
> original_name : sosstsst
> original_units : degC
> history : 2011-11-09T14:11:22Z altered by CMOR: Converted units from 'degC' to 'K'. 2011-11-09T14:11:22Z altered by CMOR: replaced missing value flag (9.96921e+36) with standard missing value (1e+20).
> cell_methods : time: mean (interval: 30 minutes)
> cell_measures : area: areacello
> missing_value : 1e+20
> _FillValue : 1e+20
> associated_files : baseURL: http://cmip-pcmdi.llnl.gov/CMIP5/dataLocation gridspecFile: gridspec_ocean_fx_IPSL-CM5A-LR_decadal1980_r0i0p0.nc areacello: areacello_fx_IPSL-CM5A-LR_decadal1980_r0i0p0.nc
> coordinates : lat lon
> (0) check_for_y_lat_coord: Warning: Data either does not contain a valid latitude coordinate array or doesn't contain one at all.
> (0) A valid latitude coordinate array should have a 'units' attribute equal to one of the following values:
> (0) 'degrees_north' 'degrees-north' 'degree_north' 'degrees north' 'degrees_N' 'Degrees_north' 'degree_N' 'degreeN' 'degreesN' 'deg north'
> (0) check_for_lon_coord: Warning: Data either does not contain a valid longitude coordinate array or doesn't contain one at all.
> (0) A valid longitude coordinate array should have a 'units' attribute equal to one of the following values:
> (0) 'degrees_east' 'degrees-east' 'degree_east' 'degrees east' 'degrees_E' 'Degrees_east' 'degree_E' 'degreeE' 'degreesE' 'deg east'
>
> Help me!
>
> ---
> Vanúcia Schumacher
> Mestranda em Meteorologia - UFV
> Meteorologista -UFPel
> Departamento de Meteorologia Agrícola - DEA
> Cel: (31) 9978 2522
> DEA: (31) 3899 1890
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue May 13 09:47:39 2014

This archive was generated by hypermail 2.1.8 : Tue May 20 2014 - 10:18:04 MDT