if then statements

From: jbuzan <jbuzan_at_nyahnyahspammersnyahnyah>
Date: Fri Jun 07 2013 - 14:27:12 MDT

Hello NCL-talk,

I am having trouble with my if-then statements.
I am not sure why my statement is failing.

-Jonathan

        Teq = (/200.,\
              205.,210.,215.,220.,225.,\
              230.,235.,240.,245.,250.,\
              255.,260.,265.,270.,275.,\
              280.,285.,290.,295.,300.,\
              305.,310.,315.,320.,325.,\
              330.,335.,340.,345.,350.,\
              355.,360.,365.,370.,375./)

Incorrect:
; hot = where((Teq.gt.355.15),1.,0.)
             if (any(Teq.gt.355.15 )) then
              hot = 1.0
              else
              hot = 0.0
           end if

Variable: hot
...
(0) 1

(35) 1

Correct:
           hot = where((Teq.gt.355.15),1.,0.)
; if (any(Teq.gt.355.15 )) then
; hot = 1.0
; else
; hot = 0.0
; end if

Variable: hot
...
(0) 0

(31) 0
(32) 1
(33) 1
(34) 1
(35) 1

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Jun 7 14:27:24 2013

This archive was generated by hypermail 2.1.8 : Tue Jun 11 2013 - 12:03:58 MDT