Re: can't undestand warning

From: Jim Means <jmeans_at_nyahnyahspammersnyahnyah>
Date: Thu Jun 27 2013 - 11:17:58 MDT

Hi Katja,

Just a guess, but could it be because label_ndc expects an integer, but
dimsizes is an integer array that you are using as if it were an
integer, so it needs to be coerced (changed) into integer type?

Jim

On 6/27/2013 16:58, Katja Lohmüller wrote:
> Hi NCL-talk,
>
> I'm working on my plot and I always get a warning in the terminal I
> can't understand or figure out of which function is meant. Is anyone
> able to help me?
>
> Thank you,
> Katja
>
> My script is as follows:
>
> ;*************************************************
> ; traj_2.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/contributed.ncl"
> ;**************************************************
> begin
> ;*************************************
> ; read in data
> ;************************************
> path = "/home/lohmueller/Desktop/BA/Amdardaten/Flutra01JanDLH_1.asc"
> data = asciiread(path,(/72,4/),"float")
> ; print(data)
> ntime=72
>
> ;********************************************
> wks = gsn_open_wks("pdf","trajectory") ; open workstation
> ;*********************************************
> ; color preps
> ;*****************************
>
>
> cnLevels=fspan(-65.0,0.0,14)
>
> ;colors =
> (/"RoyalBlue","IndianRed","PaleGreen","MidnightBlue","DeepSkyBlue1","DarkTurquoise","DarkGreen","LimeGreen","yellow","OrangeRed","VioletRed","VioletRed3","MediumOrchid4","MediumPurple3"/)
> ; rgb = span_named_colors(colors,False)
> ;gsn_define_colormap(wks,rgb)
>
> ;color="/home/lohmueller/Desktop/BA/NCL/Tempe.rgb"
> ;gsn_define_colormap(wks,"BlWhRe")
>
> cmap = gsn_retrieve_colormap (wks)
>
> gsn_define_colormap (wks,"BlWhRe")
>
> ;cmap= RGBtoCmap("/home/lohmueller/Desktop/BA/NCL/Temp.rgb")
> ;gsn_define_colormap (wks,cmap)
>
>
>
>
>
>
> res = True ; map resources
>
>
> res@gsnDraw = False ; don't draw
> res@gsnFrame = False ; don't advance frame
> res@vpWidthF = 0.70 ; make map bigger
> res@vpHeightF = 0.70
> res@mpMaxLatF = 55 ; select subregion
> res@mpMinLatF = 20
> res@mpMaxLonF = 65
> res@mpMinLonF = 5
>
> res@gsnMaximize = True
> res@gsnPaperOrientation = "landscape"
> res@gsnSpreadColors = True ; use full
> range of colors
> res@mpFillOn = True ; turn map fill on
> res@mpOutlineOn = True ; turn the map outline on
> color1 = NhlNewColor(wks,0.75,0.75,0.75) ; add a
> lighter gray to the color map
> res@mpFillColors = (/ -1,-1,102,-1/) ; color of the
> continents: gray
>
>
> ; label bar resources
> res_lb = True
> res_lb@vpWidthF = 0.60
> res_lb@vpHeightF = 0.10
> res_lb@lbPerimOn = False ; Turn off perimeter.
> res_lb@lbOrientation = "Horizontal" ; Default is vertical.
> res_lb@lbLabelStride = 2 ; an welchen Strich was stehen soll
> res_lb@lbLabelAlignment = "InteriorEdges" ; Default is "BoxCenters".
> res_lb@lbMonoFillPattern = True ; Fill them all solid.
> res_lb@lbLabelFontHeightF = 0.015
> res_lb@lbFillColors = cmap(:,:) ; Colors for boxes.
>
> res@tiMainString = "Flug 601 01.Januar DLH" ; title
> res@gsnCenterString = "Tempereatur [°C]"
>
> map = gsn_csm_map_ce(wks,res) ; create map
> delete(res)
> ;*********************************************
> ;trajectory parameters
> ;*********************************************
>
>
> xpt= new(ntime,float)
> ypt= new(ntime,float)
> t= new(ntime,float)
>
>
> ;*********************************************
> ;plot parameters
> ;*********************************************
>
> pres = True
> pres@gsLineThicknessF = 2.0
>
> mres = True
> first= True
> last= True
>
> ;*********************************************
>
> do i=0,ntime-1
> ypt(i) = data(i,0) ;extract latitude(Breite(N))
> xpt(i)= data(i,1) ;extract longitude(Länge(E))
> t(i) = data(i,3)
> end do
>
>
> print(t)
>
> draw(map)
>
>
> do j= 0,ntime-2
> pres@gsLineColor=GetFillColor(cnLevels,cmap,t(j))
> ;pres@gsLineColor=GetFillColor(cnLevels,cmap,avg((/t(j),t(j+1)/)))
> gsn_polyline(wks,map,(/xpt(j),xpt(j+1)/),(/ypt(j),ypt(j+1)/),pres)
> ;gsn_polyline(wks,map,xpt(j),ypt(j),pres)
> end do
>
>
> ;; create a unique marker to indicate the start of the trajectory
>
> first@gsMarkerSizeF = 5.0 ; marker size
> first@gsMarkerColor = "red" ; marker color
> last@gsMarkerSizeF = 9.0 ; marker size
> last@gsMarkerColor = "blue" ; marker color
>
> gsn_polymarker(wks,map,xpt(0),ypt(0),first) ;draw start of trajectory
> gsn_polymarker(wks,map,xpt(71),ypt(71),last) ;draw end of trajectory
> ;delete(first@gsMarkerColor)
> ;delete(first@gsMarkerSizeF)
>
>
>
> gsn_labelbar_ndc(wks,dimsizes(cnLevels)+1,cnLevels,0.20,0.20,res_lb)
> frame(wks)
>
>
>
> print(dimsizes(cnLevels))
>
> end
>
>
> warning:Argument 2 of the current function or procedure was coerced to
> the appropriate type and thus will not change if the function or
> procedure modifies its value
>
>

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Jun 27 11:18:28 2013

This archive was generated by hypermail 2.1.8 : Mon Jul 01 2013 - 12:35:42 MDT