<div dir="ltr"><div><div><div>Hi <br></div>I get the error now this lat/lon. After flipping the lon coordinated still unable to match the region selection between two files. <br></div>I would appreciate any help. <br></div>Thanks <br><div><div><br> diri = "./"<br> fili1 = "MERRA2_300.tavg1_2d_int_Nx.20040926.nc4"<br> fili = "<a href="http://tmp2m.2012050218.time.nc">tmp2m.2012050218.time.nc</a>"<br> in = addfile(diri+fili,"r")<br> in1 = addfile(diri+fili1,"r")<br>print(in1)<br>;;;;Region1;;;;<br>lat_min =-60<br>lat_max =-35<br> lon_min = 180<br> lon_max = 255<br> tmp1 = in1->SWNETTOA<br> neb=lonFlip(tmp1)<br>printVarSummary(tmp1)<br>printVarSummary(neb)<br> tmpp = neb(:,lat_min:lat_max,lon_min:lon_max)<br>; tmpp = neb(:,:,:) <br>; tmp = in->TMP_P0_L103_GGA0(:,lat_min:lat_max,lon_min:lon_max) <br>;printVarSummary(tmp1)<br>printVarSummary(tmpp)<br>; ts = tmp(time|0:0,lat|:,lon|:) ; reorder variable<br>;printVarSummary(ts)<br> ts = dim_avg_n_Wrap(tmpp, 0 )<br><br><br>;;;;;<br>Variable: neb<br>Type: float<br>Total Size: 19961856 bytes<br> 4990464 values<br>Number of Dimensions: 3<br>Dimensions and sizes: [time | 24] x [lat | 361] x [lon | 576]<br>Coordinates: <br> time: [0..1380]<br> lat: [ -90.. 90]<br> lon: [-5.920304394294029e-13..359.375]<br>Number Of Attributes: 12<br> long_name : toa_net_downward_shortwave_flux<br> units : W m-2<br> _FillValue : 1e+15<br> missing_value : 1e+15<br> fmissing_value : 1e+15<br> scale_factor : 1<br> add_offset : 0<br> standard_name : toa_net_downward_shortwave_flux<br> vmax : 1e+15<br> vmin : -1e+15<br> valid_range : ( -1e+15, 1e+15 )<br> lonFlip : longitude coordinate variable has been reordered via lonFlip<br>fatal:Subscript out of range, error in subscript #1<br>fatal:An error occurred reading neb<br>fatal:["Execute.c":8575]:Execute: Error occurred at or near line 33 in file TESTSinglevartime.ncl<br><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Nov 21, 2017 at 1:17 AM, dale zuri <span dir="ltr"><<a href="mailto:dalezuri@gmail.com" target="_blank">dalezuri@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div>Hi, <br></div>Please help me to select the same region from the two different files. <br></div>I want to have the region1 selection for both the files. I am not able to set the same region1 for Merra data. <br></div>Thanks<br><div><div><div><div><br>begin<br>;*****************************<wbr>*******************<br>; create pointer to file and read in temperature<br>;*****************************<wbr>*******************<br> diri = "./"<br> fili1 = "MERRA2_300.tavg1_2d_int_Nx.<wbr>20040926.nc4"<br> fili = "<a href="http://tmp2m.2012050218.time.nc" target="_blank">tmp2m.2012050218.time.nc</a>"<br> in = addfile(diri+fili,"r")<br> in1 = addfile(diri+fili1,"r")<br>print(in1)<br>lat_min =-180;;wrong region selection<br> lat_max =180<br> lon_min = 0<br> lon_max = 138<br>;;;;Region1;;;;;;;;;;;;<br>lat_min =15<br>lat_max =40<br> lon_min = 180 <br> lon_max = 255<br> tmp1 = in1->SWNETTOA(:,lat_min:lat_<wbr>max,lon_min:lon_max)<br> tmp = in->TMP_P0_L103_GGA0(:,lat_<wbr>min:lat_max,lon_min:lon_max)<br>printVarSummary(tmp1)<br>; ts = tmp(time|0:0,lat|:,lon|:) <wbr> ; reorder variable<br>;printVarSummary(ts)<br> ts = dim_avg_n_Wrap(tmp, 0 )<br> ts1 = dim_avg_n_Wrap(tmp1, 0 )</div><div><br></div><div>Variable: tmp1<br>Type: float<br>Total Size: 19961856 bytes<br> 4990464 values<br>Number of Dimensions: 3<br>Dimensions and sizes: [time | 24] x [lat | 361] x [lon | 576]<br>Coordinates: <br> time: [0..1380]<br> lat: [ -90.. 90]<br> lon: [-180..179.375]<br>Number Of Attributes: 11<br> long_name : toa_net_downward_shortwave_<wbr>flux<br> units : W m-2<br> _FillValue : 1e+15<br> missing_value : 1e+15<br> fmissing_value : 1e+15<br> scale_factor : 1<br> add_offset : 0<br> standard_name : toa_net_downward_shortwave_<wbr>flux<br> vmax : 1e+15<br> vmin : -1e+15<br> valid_range : ( -1e+15, 1e+15 )<br></div></div></div></div></div>
</blockquote></div><br></div>