Re: script to maps

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Mon, 4 May 2009 06:42:46 -0600

This was mentioned offline, but I wanted to mention it here as well.

In order to properly close a PDF or PS file that is being opened inside
a do loop, you want to delete the workstation right before the
end of the loop:

   do n=0,nmap
     ...
      delete(wks)
   end do

Deleting the workstation causes the PS/PDF file to be closed properly.
(When you exit an ncl script, this also causes the current PDF/PS to
be closed.)

Deleting the workstation is also something you want to do before
converting
the PS/PDF file to another format using NCL's system call:

   wks = gsn_open_wks("test","ps")
   ...create some graphics...

   delete(wks)
   system("convert test.ps test.png")

--Mary

On May 2, 2009, at 9:06 AM, Dennis Shea wrote:

> The common way is to open the wks in a loop
>
> pltType = "pdf"
> pltName = "edson"
> do n=0,nmap
> wks = gsn_open_wks(pltType, pltName+"_"+n)
> gsn_define_colormap(wks,"....")
> ......
> end do
>
>
>
> Edson L. Nunes wrote:
>> Mrs,
>>
>>
>>
>> I am trying to do a script in NCL for plot a series of maps and he
>> presented a error informing that could not open more than a
>> workstation
>> pdf at the same time. How do I do to solve this problem? I would be
>> grateful if you could help me. I am working with the NCL Version
>> 4.2.0.a034 and the error is:
>>
>> warning:GKS:GOPWK: -- Only one PDF workstation can be open at a time
>> fatal:Workstation with PID#65 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
>> fatal:Execute:
>> Error occurred at or near line 2672 in file
>> $NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl fatal:Execute:
>> Error occurred at or near line 2797 in file
>> $NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl fatal:Execute:
>> Error occurred at or near line 190 in file rate.ncl
>> fatal:GCLWK:libncarg Error:NGSETI - Uncleared prior error
>>
>>
>>
>> Edson.
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> 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 Mon May 04 2009 - 06:42:46 MDT

This archive was generated by hypermail 2.2.0 : Wed May 06 2009 - 16:48:59 MDT