Issue with subscripts in array

From: Tabish Ansari <tabishumaransari_at_nyahnyahspammersnyahnyah>
Date: Wed Jun 25 2014 - 14:57:06 MDT

Hi

I am using the following script:

load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"

begin
a=addfile("geo_em_flatasia.d01.nc","w")
topo = a->HGT_M
printMinMax(topo,True)
print (dimsizes(topo))

do i=0,89,1
 do j=0,99,1
  if (topo(0,i,j).gt.200) then
   topo(0,i,j) = (200 + (0.01*(topo(0,i,j)-200)))
  end if
 end do
end do
printMinMax(topo,True)
printMinMax(a->HGT_M,True)

end

​I am getting the following output:

 Copyright (C) 1995-2012 - All Rights Reserved
 University Corporation for Atmospheric Research
 NCAR Command Language Version 6.1.0
 The use of this software is governed by a License Agreement.
 See http://www.ncl.ucar.edu/ for more details.
(0)
(0) Topography height: min=-122.312 max=5411.67
(0) 1
(1) 89
(2) 99
fatal:Subscript out of range, error in subscript #2
fatal:An error occurred reading topo
fatal:["Execute.c":7743]:Execute: Error occurred at or near line 12 in file
flattentopo.ncl


--
Thanks & Regards
Tabish Umar Ansari
MS Research Scholar
Environmental & Water Resources Engineering Division
Department of Civil Engineering
IIT Madras

Received on Wed Jun 25 08:57:14 2014

This archive was generated by hypermail 2.1.8 : Wed Jul 23 2014 - 15:33:46 MDT