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

Dennis Shea shea at ucar.edu
Fri Mar 20 09:39:59 MDT 2015


[1]
If you have 6.1.1 or newer use the reassignment operatore:  :=

  uk := f1->

[2] else

do k = 0, 2

   f1  = addfile("CDL_2010_"+county(k)+".nc","r")

   u1  = f1->Band1(:,:)

   :

   :

   delete(u1)
end do


On Fri, Mar 20, 2015 at 9:21 AM, Wang, Jiali <jialiwang at anl.gov> wrote:

>  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
>
>
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150320/4dcb571c/attachment.html 


More information about the ncl-talk mailing list