Re: Error when generating more than one plot in one file?

From: Rick Grubin <grubin_at_nyahnyahspammersnyahnyah>
Date: Mon, 28 May 2007 07:45:29 -0600

Hello,

> I try to use a loop in one NCL file to generate many eps files but
> got some error message. Did anyone have try to do the same thing
> and have any experience generating a lot of eps files from one NCL
> file?

You can generate many EPS files (see below).

> warning:GKS:GOPWK: -- Only one PDF workstation can be open at a time
> fatal:Workstation with PID#49 is not open
> ERROR 3 IN NGSETI - value for WO must reference an open
> workstation.
> ERROR 1 IN NGSETI - Uncleared prior error
> ERROR 1 IN NGSETI - Uncleared prior error
> ERROR 1 IN NGSETI - Uncleared prior error
> ERROR 1 IN NGSETI - Uncleared prior error
> ERROR 1 IN NGSETI - Uncleared prior error
> fatal:Unable to open Workstation-Can't Create
> fatal:Unable to access object with id:-4
> fatal:NhlGetValues:PID #-4 is invalid

This error indicates that you are trying to have multiple PDF
workstations open at one time. In the documentation:

         http://www.ncl.ucar.edu/Document/Graphics/Interfaces/
gsn_open_wks.shtml

note this statement:

"You can have up to fifteen PostScript workstations open at one time,
but you can only have one NCGM or PDF workstation open at one time."

For your code:

> do i = 0, 81
> [...]
>
> wks = gsn_open_wks("pdf", "./test/"+f->stacode(i))
> [...]
> plot = gsn_csm_xy(wks, sdof_at_frq(0:500), splt(:, 0:500), res)
> end do

You must add the following statement:

delete(wks)

before the end of your "do" loop and this will solve the problem.
To open/write many PDF workstations, you could use your loop variable
to differentiate, as:

wks = gns_open_wks("pdf", "./test" + f->statcode(i) + i)

-Rick.
----
Rick Grubin NCAR/TDD/CISL/VETS
Visualization + Enabling Technologies
grubin_at_ucar.edu 303.497.1832

_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon May 28 2007 - 07:45:29 MDT

This archive was generated by hypermail 2.2.0 : Tue May 29 2007 - 07:20:15 MDT