Re: replacing the do loops

From: James McPhee <jmcphee_at_nyahnyahspammersnyahnyah>
Date: Wed, 6 Jun 2007 16:47:01 -0400

On the same line, maybe a combination of the "where" and "conform"
functions would save you the loops, but I don't know if that's faster...

James McPhee
Profesor Asistente, Departamento de Ingenieria Civil
Facultad de Ciencias Fisicas y Matematicas, Universidad de Chile
Av. Blanco Encalada 2002 piso 3
Santiago, Chile
tel: +56-2-9784397
jmcphee_at_ing.uchile.cl
http://www.cec.uchile.cl/~jmcphee

On Jun 6, 2007, at 4:30 PM, Debasish Pai Mazumder wrote:

> Hi,
>
>
>
> Does anyone have a suggestion how to do this without using a do
> loop and if statement, so it's faster?
>
>
>
> T1=new ((/24, 848, 70,150/), double)
>
> T1 (:,:,:,:) =-9999.
>
> T1@_FillValue = -9999. ; sets _FillValue to -9999
>
> m= -1
>
> do i=0,15
>
> do j=0,52
>
> m=m+1
>
> do k=0,69
>
> do l=0,149
>
> if(lat(k).ge.lat1(i).and.lat(k).le.lat1(i+1)) then
>
> if(lon(l).ge.lon1(j).and.lon(l).le.lon1(j+1)) then
>
> T1(:,m,k,l)= TLand(:,k,l)
>
> end if
>
> end if
>
> end do
>
> end do
>
> print(m)
>
> end do
>
> end do
>
> printVarSummary(T1)
>
>
>
> Thanks
>
>
>
> Debasish
>
>
>
> ----------------------------------------------------------------------
> -----------
>
>
>
> Debasish Pai Mazumder
>
> Graduate Research Assistant
> Geophysical Institute,University of Alaska Fairbanks,
>
> 903 Koyukuk Drive
>
> Fairbanks, AK 99775
>
> USA
>
>
>
> Phone : +1 907 474 7618
>
> Email : debasish_at_gi.alaska.edu
>
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk_at_ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Jun 06 2007 - 14:47:01 MDT

This archive was generated by hypermail 2.2.0 : Fri Jun 15 2007 - 12:34:56 MDT