Error from using "where" function

From: Jingmin Li <jingmin.li_at_nyahnyahspammersnyahnyah>
Date: Wed Apr 11 2012 - 01:26:00 MDT

Hello,

I have a 3-dimensional array coordinate arrays time*lon*lat. I want to
set all values outside a domain region to 0.

I copied one example of "where" function from NCL home. But I got
always error message like:
--------------------
fatal:And: Dimension size, for dimension number 0, of operands does
not match, can't continue)
fatal:where: condition variable (parameter 1) dimension mismatch with
parameter 2.
-----------------------

Does anyone know what is the problem? Thanks!
Jingmin

Here is my code:
---------------------
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"

begin

   data_dir = "/home/jingmin/echam_plot"
   cdf_file = addfile(data_dir + "/T21_amip2sst_2000_copy.nc","r")

   sst = cdf_file->sst ; files to local variables.
   sst@time = cdf_file->time
   sst@lat = cdf_file->lat ; Create coordinate variables
   sst@lon = cdf_file->lon ; for sst and store the sizes

   latS = 30.00
   latN = 40.00
   lonW = 70.00
   lonE = 140.00

   sst= where( (sst@lat.ge.latS .and. sst@lat.le.latN .and. \
               sst@lon.ge.lonW .and. sst@lonE),0,sst)
   end
----------------------------------
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Apr 11 01:26:15 2012

This archive was generated by hypermail 2.1.8 : Fri Apr 13 2012 - 13:37:52 MDT