Hello,
This is offline.
Today is a national holiday ... Independence (from the Brits) Day! :-)
Someone who knows the work station 'stuff' will likely answer tomorrow.
-----------------------------------------------------------------------
I am not clear on the objective. So, some rambling
gsn_open_wks is argument prototyped as
function gsn_open_wks (
type [1] : string,
name [1] : string <=====
)
http://www.ncl.ucar.edu/Document/Graphics/Interfaces/gsn_open_wks.shtml
The variable 'savefile' would have to be type string
or you would be violating the prototype (error message?)
So 'savefile' must be
savefile = new(nspc*2, "string", "No_FillValue")
Yet, gsn_open_wks creates a graphical object, so ...
wks_array = new (nspc*2, "graphic", "No_FillValue")
do ispc = 0,nspc-1
wks_temp1 = gsn_open_wks(type, "FOO_1")
wks_temp2 = gsn_open_wks(type, "FOO_2")
:
wks_array(2*ispc) = wks_temp1
wks_array(2*ispc+1) = wks_temp2
end do
; v6.0.0
delete( [/"FOO_1", "FOO_2"/] ) ; delete temp graphical obj
; not necessary
In my view, each entry of wks_array is a pointer to each graphical obj.
==================================================
Again... not sure what you want, maybe?
pltName = "SPC_"
do ispc = 0,nspc-1
; unique names for each plot
wks_temp1 = gsn_open_wks(type, pltName+sprinti("%0.3i", 2*ispc ))
wks_temp2 = gsn_open_wks(type, pltName+sprinti("%0.3i",(2*ispc+1))
On 7/4/12 3:50 AM, Douglas Lowe wrote:
> Hi all,
>
> Is it possible to open graphics devices within an array, rather than as individual objects?
>
> We've attempted to use the code below to do this, but all that happens is that as one graphics object is added to the array the rest are closed.
>
> ------------------------------------------------------------------------------------------------------
>
> type = "ps"
> wks_array = new(nspc*2, "graphic") ; create workstation array
>
>
> do ispc = 0,nspc-1
> print("opening workstations "+2*ispc+" and "+(2*ispc+1))
> wks_temp1 = gsn_open_wks(type,savefile(2*ispc))
> wks_temp2 = gsn_open_wks(type,savefile(2*ispc+1))
>
> wks_array(2*ispc) = wks_temp1
> wks_array(2*ispc+1) = wks_temp2
> delete(wks_temp1)
> delete(wks_temp2)
> end do
>
> ------------------------------------------------------------------------------------------------------
>
> We're attempting to open the graphics objects in this way so that we can loop through our processing code
> (rather than have to duplicate everything 12 times). Does ncl support pointers? If so would it be possible for
> us to use those to do this instead?
>
> Thanks,
> Doug
> _______________________________________________
> 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 Wed Jul 4 09:15:45 2012
This archive was generated by hypermail 2.1.8 : Mon Jul 09 2012 - 10:45:32 MDT