If Statement - conditional expression yields a missing value

From: Mike Pirhalla <glacierbayncl_at_nyahnyahspammersnyahnyah>
Date: Mon Sep 16 2013 - 16:26:52 MDT

I'm making a series of Hovmueller plots by plotting height levels in 24 hour
time series by 124 days.

The plot simply plots height levels, and works perfectly for what I need it
to do. I also have temperature data for each corresponding height. I want
filter what I am plotting to only plot heights where the temperature is
greater than 5. When I attempt to set those temperature values and heights
to -999 that are less than 5, I get this error: "fatal:The result of the
conditional expression yields a missing value. NCL can not determine branch,
see ismissing function."

Perhaps I'm going about this in an incorrect manner. The code for this
portion is below, Thanks very much for any help.

 

; read in the data from the external file

do i=0,(nrow-1)

  n=i

  date(i) = a(n,0)

  day(i) = a(n,1)

  hour(i) = a(n,2)

  lev(i) = a(n,3)

  height(i) = a(n,4)

  temp(i) = a(n,5)

end do

 

height_new=new((/124,24/),float)

 

do i=0,123 ; loop over all of the days in season (124)

a0=i*24 ; each day has 24 hours

a23=a0+23 ; last hour of day

height_new(i,0:23)=height(a0:a23) ;new variable for heights for each hour
of the day

 

;height_new(:,:)= where(temp(i).lt.5,-999,temp(i)) ; this didn't work

 

if (temp(i) .lt. 5) then

temp(i)=-999

height_new(:,:)=-999

day(i)=-999

hour(i)=-999

date(i)=-999

lev(i)=-999

end if

 

.skipping to the end I plot:

plot= gsn_csm_contour(wks,height_new(:,:),res)

 

---
Michael Pirhalla
Graduate Research Assistant
University of Alaska Fairbanks
Dept. of Atmospheric Sciences

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Sep 16 16:27:00 2013

This archive was generated by hypermail 2.1.8 : Wed Sep 18 2013 - 17:07:30 MDT