[ncl-talk] sub: array assignment

Buzan, Jonathan jbuzan at purdue.edu
Wed Apr 29 01:05:17 MDT 2020


Hi Dale Zuri,

Looking at your loop construction, you go through every i,j pair and make it 0. Then you go through every i,j pair, and make it 1… your end answer should be for every i,j pair should be 8242.

-Jonathan



On Apr 29, 2020, at 5:15 AM, dale zuri via ncl-talk <ncl-talk at ucar.edu<mailto:ncl-talk at ucar.edu>> wrote:

Hi NCL user,
 I have been trying to assign number 1,2, 3 etc, for the specific locations. But this piece of code seems to break and not producing any results. I would appreciate any help to fix this problem.

Thanks in advance!
do k=0, 8242
   do i=0,(dimsizes(lat2d(:,0))-1)
     do j=0,(dimsizes(lon2d(0,:))-1)
        if (.not.ismissing(M(i,j)) .eq. 1)then
           M(i,j)= k
        end if
     end do
   end do
end do


_______________________________________________
ncl-talk mailing list
ncl-talk at ucar.edu<mailto: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/20200429/e1c3adee/attachment.html>


More information about the ncl-talk mailing list