Problem in MASK/WHERE function

From: Liang Guo <liang.guo.81_at_nyahnyahspammersnyahnyah>
Date: Mon Apr 26 2010 - 09:23:19 MDT

Hi,

I am using NCL v5.2.0. I try to using MASK function to set all values
outside a specified region to a missing value. And I follow example 5
shown in MASK function webpage, and it looks like:
=============================
begin
;
   f = addfile ("raw/50_ht_1983.nc", "r")

   x = f->ht(0,0,:,:)
   x@lat2d = f->latitude
   x@lon2d = f->longitude
   printVarSummary (x)

    latMin = -20
    latMax = 60
    lonMin = 110
    lonMax = 270

    x = mask(x,(x@lat2d.ge.latMin .and. x@lat2d.le.latMax .and.
x@lon2d.ge.lonMin .and. x@lon2d.le.lonMax), True)
; x = where((x@lat2d.ge.latMin .and. x@lat2d.le.latMax .and.
x@lon2d.ge.lonMin .and. x@lon2d.le.lonMax), x, x@_FillValue)
;
end
======================

However, I got error:
===================================
Variable: x
Type: float
Total Size: 248832 bytes
            62208 values
Number of Dimensions: 2
Dimensions and sizes: [latitude | 216] x [longitude | 288]
Coordinates:
            latitude: [-89.58334..89.58334]
            longitude: [0.625..359.375]
Number Of Attributes: 15
  lon2d : <ARRAY of 288 elements>
  lat2d : <ARRAY of 216 elements>
  p : 1000
  t : 45
  source : Unified Model Output (Vn 6.1):
  name : ht
  title : Height
  date : 01/03/83
  time : 00:00
  long_name : Height
  units : m
  missing_value : 2e+20
  _FillValue : 2e+20
  valid_min : -43.29757
  valid_max : 27644.69
fatal:And: Dimension size, for dimension number 0, of operands does
not match, can't continue

fatal:Execute: Error occurred at or near line 15 in file try.ncl
========================================

I cannot find what is wrong, also if I try WHERE function
alternatively, I got same error.

Thank you

Liang
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Apr 26 09:23:28 2010

This archive was generated by hypermail 2.1.8 : Thu Apr 29 2010 - 08:05:27 MDT