[ncl-talk] Sub: Loop help

dale zuri dalezuri at gmail.com
Fri Nov 3 16:46:45 MDT 2017


Hi ,

begin
a    = addfile("mask.nc","r")
mas=a->mask
printMinMax(mas,0);;;;;;Print----(0,1,2,-21) each number associated with
different division ( ex., (0-1)- division 1, (1-2) division 2, oceanic
region are filled with missing number and land regions are filled with
number 1.
do i=1,1 or 2,2 or 3,3 ( I get the right selection of region and
printMinMax shows 1)
do i=1,4 ( I get the wrong selection of region and printMinMax shows
missing number)
j=i+1
mas=where(mas.ge.i .and. mas.lt.j,1,mas at _FillValue)
end do
printMinMax(mas,0) ...(1,1)
return

I hope this helps! Please let me know If you have any questions.

Thanks
DZ

On Fri, Nov 3, 2017 at 12:01 PM, Kevin Hallock <hallock at ucar.edu> wrote:

> Hi Dz,
>
> Could you please provide more detail about how the numbers are wrong?
>
> Also, do you have a complete script you could share? That might help us
> identify any possible issues.
>
> Thanks,
> Kevin
>
> > On Nov 3, 2017, at 1:37 PM, dale zuri <dalezuri at gmail.com> wrote:
> >
> > Hi NCL users,
> >
> > Could someone help me to fix this bug? This loop gives me wrong numbers.
> Please help me to handle this.
> > do i=1,11
> > j=i+1
> > mas=where(mas.ge.i .and. mas.lt.j,1,mas at _FillValue)
> > end do
> > Thanks
> > Dz
> > _______________________________________________
> > 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/20171103/189ae00c/attachment.html>


More information about the ncl-talk mailing list