[ncl-talk] How to read files having different dimension sizes

Wang, Jiali jialiwang at anl.gov
Fri Mar 20 09:21:40 MDT 2015


Dear NCL users,

I am trying to read in files which have different dimension sizes, and get fatal error: Dimension sizes of left hand side and right hand side of assignment do not match.

Here is my ncl script:
==============
county = (/"Delaware","Sioux","Lincoln"/)

do k = 0, 2
   f1  = addfile("CDL_2010_"+county(k)+".nc","r")
   u1  = f1->Band1(:,:)
end do
===============

Since the dimension sizes of the three data sets are totally different, the script works only for k=0,0 or k=1,1 or k=2,2. Is there a way to address this problem? Something like, make it forgets the dimension of last loop (say, k=0) and starts the next loop (say, k=1)? I have much more than three data sets needed to be read in.

Thanks!

Jiali


Jiali Wang, Ph. D
Environmental Science Division
Argonne National Laboratory
Tel: 630-252-2848
http://www.evs.anl.gov/about-evs/staff/detail/index.cfm?/Wang/Jiali


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150320/ef66d459/attachment.html 


More information about the ncl-talk mailing list