fatal:Subscript out of range

From: wei huang <whua27_at_nyahnyahspammersnyahnyah>
Date: Sat Feb 12 2011 - 08:11:22 MST

Hi,

Does anyone give me help to fix the problem? Some part of code is attached.

Thanks , wei

 = = = = = = =

if ( FirstTime ) then ; get height info for labels

      zmin = 0.

      zmax = 12. ; We are only interested in the
first 6km

      nz = floattoint(zmax + 1)

    end if

; Find the index where 12km is - only need to do this once

        if ( FirstTime ) then

          zz = wrf_user_intrp3d(z,z,"v",plane,angle,opts)

          printVarSummary(zz)

          b = ind(zz(:,0,0) .gt. zmax*1000. )

          zmax_pos = b(0) - 1

          printVarSummary(zmax_pos)

        ; if ( abs(zz(zmax_pos,0)-zmax*1000.) .lt.
abs(zz(zmax_pos+1,0)-zmax*1000.) )

          if ( abs(zz(zmax_pos,0,0)-zmax*1000.) .lt.
abs(zz(zmax_pos+1,0,0)-zmax*1000.) ) then

            zspan = b(0) - 1

          else

            zspan = b(0)

          end if

          delete(zz)

          delete(b)

          FirstTime = False

        end if

= = = = = = = = =

  res@tmYLMode = "Explicit"

  res@tmYLValues = fspan(0,zspan,nz) ;
Create tick marks

res@tmYLLabels = sprintf("%.1f",fspan(zmin,zmax,nz)) ; Create
labels

;= = = = = = = = =

Variable: zz

Type: float

Total Size: 1270000 bytes

            317500 values

Number of Dimensions: 3

Dimensions and sizes: [Time | 15] x [Vertical | 100] x [Horizontal | 120]

Coordinates:

Number Of Attributes: 4

  _FillValue : -999

  units : m

  description : Height

Orientation : Cross-Sesion: (87,5) to (82,131)

Variable: zmax_pos

Type: integer

Total Size: 4 bytes

            1 values

Number of Dimensions: 1

Dimensions and sizes: [1]

Coordinates:

Number Of Attributes: 1

  _FillValue : -999

fatal:Subscript out of range, error in subscript #0

fatal:An error occurred reading zz

fatal:Execute: Error occurred at or near line 105 in file

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Sat Feb 12 08:11:28 2011

This archive was generated by hypermail 2.1.8 : Tue Feb 15 2011 - 09:43:19 MST