netcdf subsetting in NCL

From: Naoki Mizukami <mizukami_at_nyahnyahspammersnyahnyah>
Date: Mon Jul 07 2014 - 15:48:28 MDT

Hi,

This should be simple, but cannot figure out why.... also this script
used to work before

I am reading netCDF file (with coordinate variables in the netCDF)
 and trying to subset it within lat/lon boundary I want. I keep getting
errors.

My script (only relevant part) is like the below
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
 begin
 dstyp =(/"BCCA","BCSD","BCSDdisag","BCSAR"/)
 ; get list of files to be processed
 dirc = "/d4/mizukami/forcing_data/VIC/netcdf/"

 do i = 4,4 ;loop for dstype i=1->BCCA, i=2->BCSD,
i=3->BCSDdisag i=4 -> BCSAR
     do yr=1979,1979 ;loop for year
       filpr = systemfunc("ls
"+dirc+dstyp(i-1)+"/ccsm/pr/"+dstyp(i-1)+"_pr_12km_"+tostring(yr)+".nc")
       fpr = addfile(filpr, "r")
       pr = fpr->pr(:,{25.1875:50.6875},{235.3125:292.9375}) ;
pr(time, lat, lon)
       t = fpr->time
       pr@long_name = "daily total precipitation"
       pr@units = "mm/day"
       printVarSummary(pr)
....

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
I am getting message like

Copyright (C) 1995-2013 - All Rights Reserved
 University Corporation for Atmospheric Research
 NCAR Command Language Version 6.1.2
 The use of this software is governed by a License Agreement.
 See http://www.ncl.ucar.edu/ for more details.
fatal:["NclAdvancedFile.c":2869]:Subscript out of range, error in subscript
#2
fatal:["Execute.c":8128]:Execute: Error occurred at or near line 28 in file
Process1_downscaled_forcing_nc.ncl

line 28 -> r = fpr->pr(:,{25.1875:50.6875},{235.3125:292.9375})

It should be inside boundary.

I would appreciate any clues.


thanks

National Center for Atmospheric Research
3450 Mitchell Lane
Boulder, CO 80301

Office FL2 3094H
Phone 303-497-2739

Received on Mon Jul 07 09:48:35 2014

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