error: Dimensions and sizes: [ncl2 | 8] x [ncl3 | 73] x [ncl4 | 144]).

From: wei huang <whua27_at_nyahnyahspammersnyahnyah>
Date: Sun Jul 04 2010 - 04:17:49 MDT

Dear NCL Users,

I want to calculate the dTdx and dTdy using the “center_finite_diff”. I
perused this function and got the error (Dimensions and sizes: [ncl2 | 8]
x [ncl3 | 73] x [ncl4 | 144]). Could anyone to fix the error? Some parts of
the code and print are given below.

Thanks in advance

wei

 ----------------

 ntim=dimsizes(u&time)

 klev=dimsizes(u&level)

 nlat=dimsizes(u&lat)

 mlon=dimsizes(u&lon)

 lon=u&lon

 lat=u&lat

 dlon = (lon(2)-lon(1))*0.0174533 ; convert to radians

                                    ; pre-allocate space

 dTdx = new ( (/ntim,klev,nlat,mlon/), typeof(T), T@_FillValue)

 do nl=0,nlat-1 ; loop over each latitude

     dx = 6378388.*cos(0.0174533*lat(nl))*dlon ; constant at this latitude

     dTdx(:,:,nl,:) = center_finite_diff (T(:,:,nl,:), dx , True,0)

 end do

 dlat = (lat(2)-lat(1))*0.0174533 ; convert to radians

 dTdy = new ( (/ntim,klev,nlat,mlon/), typeof(T), T@_FillValue)

 do n1=0,mlon-1 ; loop over each latitude

     dy = 6378388.*dlat

    dTdy(:,:,:,n1) = center_finite_diff (T(:,:,:,n1), dy , True,0)

 end do

dTdx@long_name = "longitudinal gradient (derivative)"

dTdy@long_name = "latitudinal gradient (derivative)"

************************

print:

Variable: u

Type: float

Total Size: 336384 bytes

            84096 values

Number of Dimensions: 3

Dimensions and sizes: [ncl2 | 8] x [ncl3 | 73] x [ncl4 | 144]

Coordinates:

Number Of Attributes: 4

  units : k

long_name : vertical component

  _FillValue : -9.99e+33

  average_op_ncl : dim_avg_n over dimension(s): ncl1

Variable: u1

Type: float

Total Size: 336384 bytes

            84096 values

Number of Dimensions: 3

Dimensions and sizes: [level | 8] x [lat | 73] x [lon | 144]

Coordinates:

            level: [1000..300]

            lat: [90..-90]

            lon: [ 0..357.5]

Number Of Attributes: 16

long_name : horizontal component

valid_range : ( 150, 350 )

  actual_range : ( 177.73, 319.08 )

  units : k

  precision : 2

  least_significant_digit : 1

  GRIB_id : 11

  GRIB_name : TMP

  var_desc : Air temperature

A

  dataset : NCEP Reanalysis Daily Averages

AJ

  level_desc : Multiple levels

F

  statistic : Mean

M

  parent_stat : Individual Obs

I

  _FillValue : -9.99e+33

  missing_value : 32766

average_op_ncl : dim_avg_n over dimension(s): time

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Sun Jul 4 04:17:56 2010

This archive was generated by hypermail 2.1.8 : Fri Jul 09 2010 - 16:06:22 MDT