comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Improving a piece of code with arrays and for-loops
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Improving a piece of code with arrays and for-loops [message #52768 is a reply to message #52583] Thu, 01 March 2007 03:30 Go to previous messageGo to previous message
Halfdan is currently offline  Halfdan
Messages: 3
Registered: February 2007
Junior Member
I got the method to work correctly with slight modifications. It
might be a bit late but her goes.

I realized that my possible s-levels were not continous, i.e. there
could be "valid" s-levels away from the surface with "illegal" levels
in between. I therefore had to put a more stringent conditions on the
possible s-values as I only want the continous stretch of "valid"
levels near the surface.

I also choose some sensible values for wsp when the method would
otherwise give 0.




; What s-values are not possible?
idx = intarr(ni,nj,ns)
idx[where( tke LT rebin(tkelvl,ni,nj,ns) or tke_diff LT eps)] =
1
idx = reverse ( total( reverse(idx, 3), 3, /cumulative), 3)

; What s-values are not possible?
indsetmin=where( idx NE 0 )

; Zero value for the wind
wsptmp=wsp
wspmin=0.
wsptmp[indsetmin]=wspmin

; Max wsp
fgtmp[*,*,1]=max(wsptmp, DIMENSION=3) > wsp[*,*,ns-1]

; Max wsp where(int_diff lt 0.)
wsptmp[where(int_diff lt 0.)]=wspmin
fgtmp[*,*,0]=max(wsptmp, DIMENSION=3) > wsp[*,*,ns-1]

; max wsp where (int_diffver lt 0)
wsptmp[where(int_diffver lt 0.)]=wspmin
fgtmp[*,*,2]=max(wsptmp, DIMENSION=3) > wsp[*,*,ns-1]
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: fit through zero
Next Topic: Re: TRIANGULATE. Finding contiguous cells efficiently?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Thu Oct 09 21:24:04 PDT 2025

Total time taken to generate the page: 0.31938 seconds