<div dir="ltr"><div>Hi all,</div><div>      I'm running following ncl script to read and write some parameters from AIRS datasets in csv file. I'm trying to read data for particular region from all (27) files. Every file having different number of lat and lon. If I run the following script I'm getting an error : </div><div><b>fatal:ind_resolve: One of the input indices is invalid; will return a missing value<br>fatal:Subscript out of range, error in subscript #0<br>fatal:An error occurred reading lat<br>fatal:["Execute.c":8637]:Execute: Error occurred at or near line 41 in file airs2.ncl</b><br></div><div><b><br></b></div><div>This is the line where it's giving an error :LAT := lat(ilat1:ilat2,ilon1:ilon2)<b> </b></div><div>It's printing number of lats, lons, min and max for first 6 files and after that I'm getting this error.</div><div><br></div><div>The ncl script I used is as below :</div><div><br></div><div>begin<br>  <br> files = systemfunc ("ls /scratch/DATASETS/AIRS/*.hdf")<br> filein = addfiles (files+".he2","r")<br>  <br> do nf = 0, ListCount(filein)-1<br> ;print(filein)<br> lat = filein[nf]->Latitude_L2_Support_atmospheric_surface_product<br> lon = filein[nf] ->Longitude_L2_Support_atmospheric_surface_product<br> TAir = filein[nf] ->TAirSup_L2_Support_atmospheric_surface_product<br> TAir_QC = filein[nf] ->TAirSup_QC_L2_Support_atmospheric_surface_product<br> H2OMMRLEV = filein[nf] ->H2OMMRLevSup_L2_Support_atmospheric_surface_product<br> H2OMMRLEV_QC = filein[nf] ->H2OMMRLevSup_QC_L2_Support_atmospheric_surface_product<br>   <br>printMinMax(lat, 0)<br>printMinMax(lon, 0)</div><div>latS := 5.0<br>latN := 40.0<br>lonW := 62.0<br>lonE := 100.0<br><br><br>ij := region_ind (lat,lon,latS,latN, lonW,lonE )<br><br>ilat1 := ij(0)<br>ilat2 := ij(1)<br>ilon1 := ij(2)<br>ilon2 := ij(3)<br><br>;print(ij)<br>LAT := lat(ilat1:ilat2,ilon1:ilon2)<br>LON := lon(ilat1:ilat2,ilon1:ilon2)<br><br>print("# of valid latitude values       =" +num(.not.ismissing(LAT)))<br>print("# of missing latitude values     =" +num(ismissing(LAT)))<br>print("# of valid longitude values      =" +num(.not.ismissing(LON)))<br>print("# of missing longitude values    =" +num(ismissing(LON)))<br>printMinMax(LAT,0)<br>printMinMax(LON, 0)<br> </div><div>end</div><div><br></div>Thanks in advance for any help !<br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div><b>Thanks & Regards,<br></b></div><b>Ajay <br></b></div><b><br></b></div></div></div>