[Thread Prev][Thread Next][Index]

Re: How to handle the mean of multiple files



Hi,

the problem is (probably) that you can only append data to some file along
one axis, which is here the time or l axis. The solution to your problem
is to write an even easier script:

 use output.00.nc
 use output.06.nc
 use output.12.nc
 use output.18.nc
 set region/x=1:357.5/y=-90:90

 let umean=(u[d=1]+u[d=2]+u[d=3]+u[d=4])/4
 let vmean=(v[d=1]+v[d=2]+v[d=3]+v[d=4])/4
 save/file=outputmean.nc umean,vmean

Hope that helps.

With regards,

John

 On Thu, 8 Apr 2004, du hui wrote:

> Dear ferret users:
>   I have sent a email about the question to how to do the mean of the 4
> files. But I think I made a mistake.  I have re-edited my script as
> following, but it doesn't work
>
> use output.00.nc
> use output.06.nc
> use output.12.nc
> use output.18.nc
> set region/x=1:357.5/y=-90:90
>
> let umean=(u[d=1,k=1]+u[d=2,k=1]+u[d=3,k=1]+u[d=4,k=1])/4
> let vmean=(v[d=1,k=1]+v[d=2,k=1]+v[d=3,k=1]+v[d=4,k=1])/4
> repeat/l=1:731 save/file=outputmean.nc/append umean,vmean
>
> let umean=(u[d=1,k=2]+u[d=2,k=2]+u[d=3,k=2]+u[d=4,k=2])/4
> let vmean=(v[d=1,k=2]+v[d=2,k=2]+v[d=3,k=2]+v[d=4,k=2])/4
> repeat/l=1:731 save/file=outputmean.nc/append umean,vmean
>
>
> When I excuted the above script, after finishing the level 1, then the
> following messages appeared,
>
> let umean=(u[d=1,k=2]+u[d=2,k=2]+u[d=3,k=2]+u[d=4,k=2])/4
> let vmean=(v[d=1,k=2]+v[d=2,k=2]+v[d=3,k=2]+v[d=4,k=2])/4
> repeat/l=1:731 save/file=outputmean.nc/append umean,vmean
> !-> REPEAT: L=1
>  LISTing to file outputmean.nc
>  **TMAP ERR: Requested data range is outside of data set limits
>              Expected: UMEAN[K= 2 : 2 ] Found: UMEAN[K= 1 : 1 ]
> LIST/FORMAT=CDF/file=outputmean.nc/append umean,vmean
> Command file, command group, or REPEAT execution aborted
>
> What is the mistake in my script?
> Could anyone give me some hints for this problem
> Thanks a lot
>
> _________________________________________________________________
> Ãâ·ÑÏÂÔØ MSN Explorer:   http://explorer.msn.com/lccn/
>
>

------------------------------------------
John Donners
Royal Netherlands Meteorological Institute
Dept. Oceanographic Research
http://www.knmi.nl/~donners

P.O. Box 201
Wilheminalaan 10
3730 AE  De Bilt
tel. nr. : ++31 30 2206701
fax. nr. : ++31 30 2202570
-------------------------------------------------------------- 

Zie ook/see also: http://www.knmi.nl/maildisclaimer.html 
 



[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement