Error when generating more than one plot in one file?

From: <xiexin163_at_nyahnyahspammersnyahnyah>
Date: Sun, 27 May 2007 15:59:39 +0800

Hi,

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?

Your help is appreciated.

Xie Xin

My code as follows:
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"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"

begin
res = True
res_at_tiXAxisString = "Frequency (cycles/40years)"
res_at_tiYAxisString = "Variance"
res_at_trYLog = True
res_at_trYMinF = 0.00001
res_at_vpHeightF = 0.6
res_at_vpWidthF = 1
res_at_gsnMaximize = True

f = addfile("data.nc", "r")

do i = 0, 81
temp = f->temperature(i,:)

iopt = 0
jave = 3
pct = 0.1
sdof = specx_anal(temp, iopt, jave, pct)
splt = specx_ci(sdof, 0.05, 0.95)

wks = gsn_open_wks("pdf", "./test/"+f->stacode(i))

res_at_tiMainString = "Periodogram Of Station "+f->stacode(i)

plot = gsn_csm_xy(wks, sdof_at_frq(0:500), splt(:, 0:500), res)
end do

end
;-------------------End of Code------------------------

And I got this error:

Copyright (C) 1995-2006 - All Rights Reserved
 University Corporation for Atmospheric Research
 NCAR Command Language Version 4.2.0.a033
 The use of this software is governed by a License Agreement.
 See http://www.ncl.ucar.edu/ for more details.
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
fatal:Execute: Error occurred at or near line 2580 in file
$NCARG_ROOT/lib/ncarg/ncl scripts/csm/gsn_code.ncl

fatal:Execute: Error occurred at or near line 2705 in file
$NCARG_ROOT/lib/ncarg/ncl scripts/csm/gsn_code.ncl

fatal:Execute: Error occurred at or near line 35 in file spec.ncl

fatal:GCLWK:libncarg Error:NGSETI - Uncleared prior error

_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Sun May 27 2007 - 01:59:39 MDT

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