Re: Read multiple data files

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Tue Feb 05 2013 - 10:13:14 MST

Hi,

My guess is that you have a different number of lines in your ascii file, so "f" is a different size each time?

If so, try deleting "f" before the inside do loop is finished:

> do time=0,72
> f = readAsciiTable(file,----)
> …..
           delete(f)
> end do
>

If you upgrade to NCL V6.1.1, which was released yesterday, then you
can use the new ":=" operator instead:

> f := readAsciiTable(file,----)
> …..
> end do

This "reassignment" operator forces "f" to get overwritten no matter what it was previously.

--Mary

On Feb 5, 2013, at 12:38 AM, 魏士偉 wrote:

> Hello,
>
> I met some problem when I read many ascii data files.
> Now I have 73 station data files from 00 hrs to 72 hrs, every data file has 113 stations.
> and I want to draw the timeseries at different station.
> So I use the DO loop to get the station data in the 73 hrs, then plot the timeseries.
> Like below
> do n=0,112
> do time=0,72
> f = readAsciiTable(file,----)
> .....
> end do
>
> *process data and set plot resource
> obs_good=ind( .not.ismissing(obs) ) ; I use this to skip missing value
>
> end do
>
> But when n loop to 31, it will fail at the line obs_good.
> Then I try setting n equal 31, it succeed.
> then I try n loop from 20 to 40, if fail again.
> If loop from 30 to 40, it succeed.
>
> The fail message :
>
> fatal:Number of dimensions on right hand side do not match number of dimension in left hand side
> fatal:["Execute.c":7556]:Execute: Error occurred at or near line 96 in file test.ncl
>
>
> I don't know how to fix this problem, it's so strange.
> Did anyone have this kind problem before??
>
> Thanks,
> WeiWilliam
>
> _______________________________________________
> 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 Tue Feb 5 10:13:23 2013

This archive was generated by hypermail 2.1.8 : Wed Feb 06 2013 - 16:37:00 MST