[ncl-talk] sub: Array mismatch
Dennis Shea
shea at ucar.edu
Wed May 6 09:52:44 MDT 2020
Well, NCL index values are 1-based. so a range of 0-to-11 represent 12
values.
Perhaps:
VRH(i:i+12,j:j+12)=k
Should be
VRH(i:i+11j:j+11)=k
====
You might get a lot of print put but you could debug yourself:
k=k+1
i12 = i+12
j12 = j+12
print("debug: k="+k+" i="+i+" i12="+i12+" j="+j+"
j12="+j12)
VRH(i:i+12,j:j+12)=k
On Tue, May 5, 2020 at 9:21 PM dale zuri via ncl-talk <ncl-talk at ucar.edu>
wrote:
> Hi NCL user,
> Could someone help me fix this issue?
>
> Thanks
>
> (i) 384
>
> (j) 320
>
> Mask = where(((u(0,:,:).ge.0.9).and.(lat2d(:,:) .ge. 55)), 1, 0);;;1
> corresponds to NH
>
> VRH=Mask
>
> k=0
>
> do i=300,(dimsizes(lat2d(:,0))-1),12
>
> do j=1,(dimsizes(lon2d(0,:))-1),12
>
> f =sum(VRH(i:i+12,j:j+12))
>
> if (.not. ismissing(f) .and. f .gt. 0)then ;;;;0 corresponds
> to SH
>
> k=k+1
>
> VRH(i:i+12,j:j+12)=k
>
> end if
>
>
>
> end do
>
> end do
>
>
> fatal:Subscript out of range, error in subscript #1
>
> fatal:An error occurred reading VRH
>
> fatal:["Execute.c":8637]:Execute: Error occurred
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> 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/20200506/e4b3efdf/attachment.html>
More information about the ncl-talk
mailing list