[ncl-talk] About Plotting

Dennis Shea shea at ucar.edu
Tue Dec 20 14:09:39 MST 2016


I am sure if you looked at the error message, the function documentation
and used a few 'printVarSummary' statements, you would find the error.


The error message is telling you exactly what the fatal error message is.

fatal:Number of dimensions in parameter (1) of (gsn_csm_vector_scalar_map)
is (3), (2) dimensions were expected
fatal:["Execute.c":8128]:Execute: Error occurred at or near line 93 in file
nldas_01.ncl

Did you look at line 93?

93   plot(1)=gsn_csm_vector_scalar_map(wks,U,V,spd,vcres)  ; create plot

Did you look at the documentation?

http://www.ncl.ucar.edu/Document/Graphics/Interfaces/gsn_csm_vector_scalar_map.shtml
=====================
U and V are 3D:  (Time, south_north, west_east).

The function documentation clearly states that only 1D or 2D variables are
allowed.

Further, the u and v are clearly protyped as 2D: [*][*]

	function gsn_csm_vector_scalar_map (
		wks     [1] : graphic,
		u    [*][*] : numeric,       <=== prototyped ad 2D
		v    [*][*] : numeric,
		data [*][*] : numeric,
		res     [1] : logical
	)

Arguments
*u, v*

The u and v data for the vector plot; must be two-dimensional.<====


============
Above you use:

  plot(0) = gsn_csm_contour_map(wks,U(0,:,:),res)   ; (0,:,:) is 2D
  plot(1) = gsn_csm_contour_map(wks,V(0,:,:),res)
  gsn_panel(wks,plot,(/2,1/),resP)               ; now draw as one plot

There were no complaints because U(0,:,:) ireduces the 3D to  2D.

So the solutions is
93   plot(1)=gsn_csm_vector_scalar_map(wks,U(0,:,:),V(0,:,:)

============

You have plotted variables from WRF before. You must know by now, that
plots require, the lat2d/lon2d attributes for a variable to be plotted over
a map.

    lat2d = in->XLAT(0,:,:)
    lon2d = in->XLONG(0,:,:)

  PRC  = in->RAINC
  T    = in->T2


  PRC at lat2d = lat2d
  PRC at lon2d = lon2d
  T at lat2d       = lat2d
  T at lon2d      = lon2d

Good luck


On Tue, Dec 20, 2016 at 2:09 AM, isakhar sakhar isakhar <
isakhar.inside13 at gmail.com> wrote:

> Dear NCL Team
>
> I took the file 'nldas_01.ncl' from NCL website 'http://www.ncl.ucar.edu/
> Applications/nldas_gldas.shtml' and use this file to plot variable RAINC,
> Temperature, Wind (U and V), Pressure and solar radiation (DNI,DHI and GHI)
> for my wrfout file and I get error as shown below:
>
> warning:ContourPlotInitialize: scalar field is constant; ContourPlot not
> possible:[errno=1102]
> (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'
>
>
> fatal:Number of dimensions in parameter (1) of (gsn_csm_vector_scalar_map)
> is (3), (2) dimensions were expected
> fatal:["Execute.c":8128]:Execute: Error occurred at or near line 93 in
> file nldas_01.ncl
>
>
>
> I know that before ask, I must try to solve this by myself but I can't.
> Here I attach my 'nldas_01.ncl' and NCDUMP file and some results of
> plotting.
> I really appreciate for any help and suggestion.
>
> Best regards,
> Soares De Araujo
>
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20161220/c9c7ebc7/attachment.html 


More information about the ncl-talk mailing list