Re: error with gsn_csm_pres_hgt

From: Richard Wartenburger <richard.wartenburger_at_nyahnyahspammersnyahnyah>
Date: Sun Sep 23 2012 - 12:30:24 MDT

Dear Mary,

thanks very much for your help. This solved the problem. Now I also do
understand why the error message was complaining about incompatible data
types.
I will look into the other script and find out why it set the long_name
attribute to a number and not to a string like "time".

Richard

On 22/09/12 00:46, Mary Haley wrote:
> Hi Richard,
>
> It looks like the problem is with your time coordinate array. The "long_name" attribute is there, but it's missing:
>
> integer time ( time )
> units : hours since 1800-01-01 00:00:00
> long_name : -2147483647
> avg_period : -2147483647
> _FillValue : -32767
>
> Internally, NCL is checking the long_name attributes, but apparently not checking to see if they are missing.
> Usually long_name is a string, but here, it looks like it's an integer, since it has an integer missing value.
>
> So, something happened when the long_name (and avg_period) attributes were attached to this variable.
> You may want to look into this and make sure your NetCDF file was created correctly.
>
> Meanwhile, you can temporarily fix this by assiging a valid long_name, or removing it:
> ;
> ;
> ; The "time coordinate" array has a missing long_name that's an integer.
> ; This attribute should be a string, so we have to delete it first, and
> ; then reassign it.
> ;
> delete(var_plot&time@long_name)
> var_plot&time@long_name = "time"
>
>
> --Mary
>
>
> On Sep 21, 2012, at 12:36 PM, Richard Wartenburger wrote:
>
>> Hello ncl-talk group,
>>
>> I am currently working on an extensive script to generate plots for a visual comparison of different climate datasets. The script is actually finished now, but I get a rather strange error message with the plotting routines gsn_csm_pres_hgt and partially also gsn_csm_contour (which I actually dont like to use here; the data is level-time dimensioned):
>> fatal:_NclBuildArray: can not combine character or string types with numeric types, can't continue
>>
>> I am using ncl 6.1.0-beta in an up-to date Debian environment. Maybe this is related to my netcdf file which is already an output of another ncl-based processing step?! The script actually does work fine with other input files which have different dimensions.
>>
>> I appreciate any little help!
>>
>>
>> Here is my code (using the file test.nc in the attachment):
>>
>>
>> begin
>>
>> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
>> 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/shea_util.ncl"
>>
>> file = addfile("test.nc","r")
>> var_plot = file->ylatlonmean_bias
>>
>> type = "newpdf" ; available workstation types: x11, ncgm, ps, eps, epsi, pdf, newps, newpdf, png
>> type@wkOrientation = "landscape"
>> fout = "test.pdf"
>> wks = gsn_open_wks(type, (/fout/))
>> gsn_define_colormap( wks, "BlWhRe" )
>>
>> res = True
>> res@gsnMaximize = True
>> res@gsnPaperOrientation = "portrait"
>> res@gsnDraw = True
>> res@gsnFrame = False
>> res@gsnSpreadColors = True
>> res@lbOrientation = "vertical"
>> res@lbLabelFontHeightF = 0.015
>> res@cnFillOn = True
>> res@cnLineLabelsOn = True
>> res@lbLabelAutoStride = True
>> res@tmYRMode = "Automatic"
>> res@cnLinesOn = False
>> res@tiMainFontHeightF = .018
>>
>> var_plot&lev@standard_name = "pressure_level"
>> var_plot&lev@long_name = "pressure_level"
>> var_plot&lev@units = "hPa"
>> contour = gsn_csm_pres_hgt( wks, var_plot(lev|:, time|:), res )
>> ;contour = gsn_csm_contour( wks, var_plot(lev|:, time|:), res )
>> delete([/ contour, wks, res, fout, var_plot, file /])
>>
>> end
>>
>> --
>> Richard Wartenburger<richard.wartenburger@giub.unibe.ch>
>> Climatology Group
>> Institute of Geography& Oeschger Centre for Climate Change Research
>> University of Bern
>> Hallerstr. 12, CH-3012 Bern
>> Fon: +41 31 631 8868
>> Fax: +41 31 631 8511
>> Web: www.geography.unibe.ch
>>
>>
>> <test.nc>_______________________________________________
>> 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 Sun Sep 23 12:30:42 2012

This archive was generated by hypermail 2.1.8 : Wed Sep 26 2012 - 13:56:04 MDT