Dimension size error

From: Chris MacIntosh <cwmac_at_nyahnyahspammersnyahnyah>
Date: Tue Aug 09 2011 - 12:57:47 MDT

Hey all,

Trying to run a script that cuts a certain lat/lon domain out of a file
(including a land/sea mask) and then outputs. Here's the error I keep
getting:

*fatal:And: Dimension size, for dimension number 0, of operands does not
match, can't continue

fatal:Execute: Error occurred at or near line 182 in file CMIP5_script.ncl
*
And the dimension sizes:

*Variable: can_mean
Type: float
Total Size: 1949532160 bytes
            487383040 values
Number of Dimensions: 3
Dimensions and sizes: [time | 59495] x [lat | 64] x [lon | 128]
Coordinates:
            time: [ 0.5..59494.5]
            lat: [-87.8638013437108..87.8638013437108]
            lon: [ 0..357.1875]
Number Of Attributes: 11
  standard_name : precipitation_flux
  long_name : Precipitation
  comment : at surface; includes both liquid and solid phases from all
types of clouds (both large-scale and convective)
  units : kg m-2 s-1
  original_name : PCP
  cell_methods : time: mean (interval: 15 minutes)
  cell_measures : area: areacella
  history : 2011-04-11T14:39:25Z altered by CMOR: replaced missing value
flag (1e+38) with standard missing value (1e+20).
  missing_value : 1e+20
  _FillValue : 1e+20
  associated_files : baseURL:
http://cmip-pcmdi.llnl.gov/CMIP5/dataLocation gridspecFile:
gridspec_atmos_fx_CanESM2_historicalMisc_r0i0p0.nc areacella:
areacella_fx_CanESM2_historicalMisc_r0i0p0.nc

Variable: lat2d
Type: double
Total Size: 512 bytes
            64 values
Number of Dimensions: 1
Dimensions and sizes: [lat | 64]
Coordinates:
            lat: [-87.8638013437108..87.8638013437108]
Number Of Attributes: 5
  standard_name : latitude
  long_name : latitude
  axis : Y
  units : degrees_north
  bounds : lat_bnds

Variable: lon2d
Type: double
Total Size: 1024 bytes
            128 values
Number of Dimensions: 1
Dimensions and sizes: [lon | 128]
Coordinates:
            lon: [ 0..357.1875]
Number Of Attributes: 5
  standard_name : longitude
  long_name : longitude
  axis : X
  units : degrees_east
  bounds : lon_bnd*s

As for the script, here's where the variables are assigned, followed by the
line of the error:
*
  t = 59494

  TimeChara = a->time(0:t)
  DimTimeChara = dimsizes(TimeChara)
  nTime = TimeChara
  nTimes = dimsizes(nTime) - 1

  lat = a->lat
  lon = a->lon
  lat2d = lat
  lon2d = lon

  res = True

  can_mean = a->pr(0:t,:,:)
  can_mean!0 = "time"
  can_mean!1 = "lat"
  can_mean!2 = "lon"

  can_mean@lat2d = lat ; 2D coordinate arrays
  can_mean@lon2d = lon

  latMin = 70
  latMax = 85

  lonMin = -126
  lonMax = -119

  can_mean = mask(can_mean,(can_mean@lat2d.ge.latMin .and.
can_mean@lat2d.le.latMax .and. \
                can_mean@lon2d.ge.lonMin .and. can_mean@lon2d.le.lonMax),
True)
*
Can't figure out what the problem is for the life of me. The grad student
that wrote the script can't figure out what the problem is either. Any help
would be greatly appreciated. If anything else is needed from the script,
just let me know; I'm extremely new to NCL, so I'm not sure what is needed
and what isn't.

Chris

-- 
Christopher MacIntosh
Iowa State University
Senior in Meteorology, Honors
ISU AMS Webmaster
EW&F Learning Community Peer Mentor
cwmac@iastate.edu | 636-368-1116

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Aug 9 12:57:58 2011

This archive was generated by hypermail 2.1.8 : Fri Aug 12 2011 - 11:48:30 MDT