<div dir="ltr"><div>ij := <b>region_ind</b> (lat,lon,latS,latN, lonW,lonE )</div><div><b>if</b> (<b>any</b>(<b>ismissing</b>(ij)) then</div><div> <b>print</b>("Current file has no values in the region")</div><div> <span style="color:rgb(0,0,255)"><b>continue</b></span> ; proceed to
the next loop iteration [file]</div><div><b>end if</b><br>
</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, May 22, 2019 at 1:05 AM Barry Lynn <<a href="mailto:barry.h.lynn@gmail.com">barry.h.lynn@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hello:<div><br></div><div>Have you looked for missing values.</div><div><br></div><div>You can do a check this way:</div><div><br></div><div>check = ismiissing (variable)</div><div><br></div><div>If it returns "True," then you'll get that error.</div><div><br></div><div>Barry</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, May 22, 2019 at 9:08 AM Ajay Bankar <<a href="mailto:ajaybankar123@gmail.com" target="_blank">ajaybankar123@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><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-m_-1703696624832203930gmail-m_-53521603889796838gmail_signature"><div dir="ltr"><div><div><b>Thanks & Regards,<br></b></div><b>Ajay <br></b></div><b><br></b></div></div></div>
_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail-m_-1703696624832203930gmail_signature"><div dir="ltr"><div><div dir="ltr">Barry H. Lynn, Ph.D<div><div>Senior Associate Scientist, Lecturer,</div><div><div><span style="color:rgb(136,136,136)">The Institute of the Earth Science, </span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">The Hebrew University of Jerusalem, </span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">Givat Ram, Jerusalem 91904, Israel </span><br style="color:rgb(136,136,136)"></div><span style="color:rgb(136,136,136)">Tel: 972 547 231 170</span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">Fax: (972)-25662581</span></div></div><div><span style="color:rgb(136,136,136)"><br></span></div><div>C.E.O, Weather It Is, LTD<br>Weather and Climate Focus<br><a href="http://weather-it-is.com" target="_blank">http://weather-it-is.com</a><br>Jerusalem, Israel<br>Local: 02 930 9525<br>Cell: 054 7 231 170<br>Int-IS: x972 2 930 9525<br><br></div></div></div></div></div>
_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
</blockquote></div>