while loop

From: jam hong <cumarporn_at_nyahnyahspammersnyahnyah>
Date: Mon May 03 2010 - 09:18:01 MDT

Dear NCL users

I try to sum up the moisture flux when the pressure is higher than 850 mb.

But I got the error that I could not compare each other because of

Assignment type mismatch, right hand side can't be coerced to type of left hand side.

I try to put floor over p to make it as integer but it still did not work.

and for the while loop it is required scalar number to compare with 850.

How can I change the type of data around??

Thanks

Jam

 p = wrf_user_getvar(f,"pressure",4)
Q = f ->QVAPOR(0,:,99,71)
v = f ->V(0,:,99,71)
m = Q * v * 1000
print(m)
i = 1
msum = new((/1,1/),integer)
print(msum)
p1 = new((/1,1/),integer)
p1 = floor(p(0,99,71))
print(p1)
do while (p1.gt.850)
print(m(i))
print(msum)
msum = msum + m(i)
print(msum)
 i = i+1
p1 = p(i,99,71)
p1 = floor(p1)
print(p1)
end do
> Date: Mon, 3 May 2010 08:49:17 -0600
> From: shea@ucar.edu
> To: prabshr@gmail.com
> CC: ncl-talk@ucar.edu
> Subject: Re: analogous of CASE statement in IDL for NCL usage
>
> Sorry there is no CASE statement in NCL at this time.
>
> Extracting flags:
>
> http://www.ncl.ucar.edu/Applications/HDF.shtml
>
> See Example 5
>
> Good luck
>
> On 5/2/10 10:25 PM, p s wrote:
> > Hi,
> > I am trying to convert this IDL
> > code(http://eosweb.larc.nasa.gov/PRODOCS/calipso/Tools/vfm_feature_flags.pro)
> > provided for reading the VFM data in CALIPSO.
> > Is their any statements in NCL i.e. similar to CASE statement of IDL?
> >
> > Regards,
> > Prabhakar
> >
> >
> >
> > _______________________________________________
> > ncl-talk mailing list
> > List instructions, subscriber options, unsubscribe:
> > http://mailman.ucar.edu/mailman/listinfo/ncl-talk
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
                                               
_________________________________________________________________
Hotmail: Free, trusted and rich email service.
https://signup.live.com/signup.aspx?id=60969

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon May 3 09:18:45 2010

This archive was generated by hypermail 2.1.8 : Mon May 03 2010 - 14:51:25 MDT