Re: Help: Bugs in "gsn_panel" function with graphic array "plots" in NCAR Command Language Version 5.2.0 ?

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Thu Jun 03 2010 - 15:50:29 MDT

I started to look into this one again, and I think the problem has been fixed since I last tried your script.

If you need a new version of NCL (5.2.1 beta), send me a personal email with your machine information (uname -a, gcc --version).

--Mary

On May 14, 2010, at 5:19 PM, Mary Haley wrote:

> Hi,
>
> Just real quick: the problem seems to be with this resource:
>
> res@gsnContourNegLineDashPattern = 2
>
> If I comment this out, your script works. I had the same problem in V5.1.1, so it's not just a V5.2.0 issue.
>
> I'll look into this further.
>
> --Mary
>
> On May 14, 2010, at 4:19 PM, lxf wrote:
>
>> Hi,
>> I am not sure if there still have bug in Version 5.2.0 in gsn_panel if I use a "plots" array with multiple calls.
>> My problem is the attached t.ncl using t.nc can draw picture one by one, however, can not panel them up together using gsn_panel?
>>
>> The script can not be excuted like the following status after ">ncl -x t.ncl ":
>>
>> Copyright (C) 1995-2010 - All Rights Reserved
>> University Corporation for Atmospheric Research
>> NCAR Command Language Version 5.2.0
>> The use of this software is governed by a License Agreement.
>> See http://www.ncl.ucar.edu/ for more details.
>> Loading file "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
>> +
>> Loading file "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
>> +
>> Loading file "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
>> +
>> Loading file "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"
>> +
>> + undef("sub_draw_hor")
>> + function sub_draw_hor(wks,h,opt,ti)
>> + local wks,h,res,res1,plot,plot1,ploth,opt,ti
>> + begin
>> + ;
>> + ; draw Plots
>> + ;......
>> + print (""+ti)
>> + ;wks =gsn_open_wks("eps",outname)
>> + ;gsn_define_colormap(wks,"nrl_sirkes") ; choose color map
>> + res = True
>> + res@gsnDraw = False ; don't draw yet
>> + res@gsnFrame = False ; don't advance frame yet
>> + res@gsnMaximize = False
>> +
>> + res@cnFillOn = False ;True ; turn on color for contours
>> + res@cnLinesOn = True ;False ; turn off contour lines
>> + res@cnLineLabelsOn = False
>> +
>> + ;res@vpXF = 0.2
>> + ;res@vpYF = 0.8
>> + res@vpWidthF = 0.14
>> + res@vpHeightF = 0.08
>> + res@gsnPaperOrientation = "portrait"
>> +
>> + res@tiMainString = "" ; ti
>> + res@tiMainOn = False ; ti
>> + res@tiXAxisOn = False
>> + res@gsnLeftString = ti
>> + res@gsnCenterString = ""
>> + res@gsnRightString = ""
>> + res@tmXBOn = opt
>> + res@tmXTOn = False
>> + res@tmYROn = False
>> +
>> + res@cnLineLabelsOn = True ;False ; turn off line labels
>> + res@cnInfoLabelOn = False
>> +
>> + res@tmYLMode = "Explicit" ; label independently
>> + res@tmYLValues = h&time(::8)
>> + res@tmYLLabels = (/0,0.5,1,1.5,2/)
>> + ;res@tmYLLabelFontHeightF = 0.020
>> +
>> + res@gsnContourLineThicknessesScale = 1.5
>> + res@gsnContourZeroLineThicknessF = 1.5 ; doubles thickness of zero contour
>> + res@gsnContourNegLineDashPattern = 2 ; sets negative contours to dash pattern 1
>> +
>> +
>> + plot = gsn_csm_contour(wks, h(time
>> +
>> +
>> + return(plot)
>> + end
>> +
>> + ;====================================================================
>> + begin
>> +
>> +
>> + outname = "./t"
>> +
>> +
>> + f = addfile ("t.nc" , "r")
>> + a0 = f->a0
>> + a1 = f->a1
>> + a2 = f->a2
>> + a3 = f->a3
>> +
>> +
>> + ;
>> + ; draw Plots
>> + ;......
>> + wks =gsn_open_wks("eps",outname)
>> + gsn_define_colormap(wks,"nrl_sirkes") ; choose color map
>> + plots = new(4,graphic)
>> +
>> +
>> + opt = False
>> + ti = "a)"
>> + plots(0)=sub_draw_hor(wks,a0,opt,ti)
>> +
>> + opt = False
>> + ti = "c)"
>> + plots(1)=sub_draw_hor(wks,a1,opt,ti)
>> +
>> + opt = False
>> + ti = "b)"
>> + plots(2)=sub_draw_hor(wks,a2,opt,ti)
>> +
>> + opt = False
>> + ti = "d)"
>> + plots(3)=sub_draw_hor(wks,a3,opt,ti)
>> +
>> +
>> +
>> + resP = True ; modify the panel plot
>> + resP@gsnMaximize = True
>> +
>> + resP@gsnFrame = False
>> + resP@gsnPaperOrientation = "portrait"
>> + resP@gsnPanelBottom = 0.05
>> + resP@gsnPanelLabelBar = False
>> + resP@gsnPanelScalePlotIndex = 1
>> +
>> +
>> +
>> +
>> + gsn_panel(wks,plots,(/2,2/),resP)
>> + ;draw(plots(0))
>> + ;draw(plots(1))
>> + ;draw(plots(2))
>> + ;draw(plots(3))
>> + frame(wks)
>> +
>> +
>> + end
>> (0) a)
>> (0) c)
>> (0) b)
>> (0) d)
>>
>> It just stop here, with cpu 100% using and will not come on!
>>
>> And the result eps has the last figure "plots(3)" been igoned, which can surely be drawn out if not using gsn_panel and not calling the plots(0:2) array before this. It's just so strange!
>>
>> Any help or sugestion is appriciated.
>>
>> Sincerely,
>> Li<t.nc><t.ncl><t.eps>_______________________________________________
>> 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

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Jun 3 15:50:34 2010

This archive was generated by hypermail 2.1.8 : Mon Jun 07 2010 - 16:48:44 MDT