<div dir="ltr"><div>Hi David,</div><div>I guess no one answered this question, if so, I would suggest to upgrade to NCL to 6.6.2. I think this type of issue may have been fixed in the latest NCL, just a guess though!</div><div><br></div><div> Below is some quick search on web but I do not know if these issues are same or relevant: <a href="https://github.com/uturuncoglu/RegESM/issues/15">https://github.com/uturuncoglu/RegESM/issues/15</a></div><div><br></div><div>Cheers,</div><div>Rashed<br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Oct 4, 2020 at 6:47 PM Vollaro, David via ncl-talk <<a href="mailto:ncl-talk@mailman.ucar.edu">ncl-talk@mailman.ucar.edu</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 style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Hi,</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
I am trying to read in a grib2 datafile and convert it to a KML file. I am following the rastertimeseries2kml<br>
script from the NCL_GETools API page (<a href="https://www.ncl.ucar.edu/Document/Manuals/GETools/NCL_GETools.html" id="gmail-m_6741670454403047612LPlnk" target="_blank">https://www.ncl.ucar.edu/Document/Manuals/GETools/NCL_GETools.html</a>)<br>
<div></div>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Here is the Logfile PET0.RegridWeightGen.Log contents:<br>
<div>20201004 163128.461 INFO PET0 Running with ESMF Version 7.0.2</div>
<div>20201004 163128.505 INFO PET0 Running with ESMF Version 7.0.2</div>
<div>20201004 163128.559 INFO PET0 Running with ESMF Version 7.0.2</div>
<div>20201004 163130.167 ERROR PET0 /d1/haley/src/esmf-7.0.2/src/Infrastructure/IO/interface/ESMC</div>
<div>_IOScrip2ESMF.C:48 handle_error Internal error: Bad condition - line 240: NetCDF error: No such file o</div>
<div>r directory</div>
<div>20201004 163130.167 ERROR PET0 ESMF_IOScrip.F90:764 ESMF_OutputScripWeightFile Invalid objec</div>
<div>t - Internal subroutine call returned Error</div>
<div>20201004 163130.167 ERROR PET0 ESMF_RegridWeightGen.F90:1580 ESMF_RegridWeightGenFile Invali</div>
<div>d object - Internal subroutine call returned Error</div>
<div><br>
</div>
<div>It generates tmpDstGrid.nc, and tmpSrcGrid.nc. I believe the errors arise when trying to generate a weight file.</div>
<div> Here is a snippet of my code. The data is on a 3500x7000 grid at 0.1deg.<br>
<div> La1 : 54.995</div>
<div> Lo1 : 230.005</div>
<div> La2 : 20.005</div>
<div> Lo2 : 299.995</div>
<div> Di : 0.009999999</div>
<div> Dj : 0.01</div>
Lat is in degrees_north Lon in degrees_east. I am running NCL 6.5.0<br>
</div>
<div><br>
</div>
<div>Below is a snippet of my code. Thanks</div>
<div><br>
</div>
<div>Dave<br>
</div>
<div>============================<br>
</div>
<br>
load "$NCARG_ROOT/lib/ncarg/nclscripts/contrib/NCL_GETools.ncl"
<div><br>
</div>
<div>begin</div>
<div>;***********************************************</div>
<div>; get variable names from grib file</div>
<div>;***********************************************</div>
<div> ifile = "/jm13/djv/howie/MRMS_MESH_Max_1440min_00.50_20200811-060832"</div>
<div> ifile_subs = str_split(ifile,"_")</div>
<div> nch=strlen(ifile)</div>
<div> hhmmss = str_get_cols(ifile,nch-6,nch)</div>
<div> time = str_get_cols(hhmmss,0,1)+":"+str_get_cols(hhmmss,2,3)+":"+str_get_cols(hhmmss,4,5)</div>
<div> date = str_get_cols(ifile,nch-15,nch-12)+"-"+str_get_cols(ifile,nch-11,nch-10)+"-"+str_get_cols(ifile,nch-9,nch-8)</div>
<div> TimeTag=date+"T"+time</div>
<div> kml_out = "/jm13/djv/Hailmax_MRMS_"+date+"_"+hhmmss</div>
<div> grib_in = addfile(ifile+".grib2","r") </div>
<div> names = getfilevarnames(grib_in); extract all variable names </div>
print(names+" "+TimeTag)</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
;***********************************************
<div>; loop through variables <br>
</div>
<div>;***********************************************</div>
<div> do i = 0,dimsizes(names)-1 <br>
</div>
<div> print(i+" vv "+names(i))</div>
<div> if (names(i).eq."lat_0") then</div>
<div> Lat = grib_in->$names(i)$</div>
<div> print(names(i)+" "+dimsizes(Lat))</div>
<div> else if (names(i).eq."lon_0") then </div>
<div> Lon = grib_in->$names(i)$</div>
<div> print(names(i)+" "+dimsizes(Lon))</div>
<div> else</div>
<div> tmp = grib_in->$names(i)$</div>
<div> print(names(i)+" "+dimsizes(tmp))</div>
<div> dims=dimsizes(tmp)</div>
<div> print("LL "+dims(0)+" "+dims(1))</div>
<div> end if</div>
<div> end if</div>
<div> end do <br>
</div>
<div>; Create 3D grid transposing from LAT/LON to Lon/Lat<br>
</div>
<div> HailSize=new((/1,dims(1),dims(0)/),"float")</div>
<div> HailSize=0.</div>
HailSize(0,:,:) = transpose(tmp)
<div> ; Create 5 patches of datavalues <br>
</div>
<div> iloc=new((/5/),"integer")</div>
<div> jloc=new((/5/),"integer")</div>
<div> ii=0</div>
<div> do i = 45,25,5</div>
<div> iloc(ii)=ind_nearest_coord(i,Lat,0)</div>
<div> print(i+" "+iloc(ii)+" "+Lat(iloc(ii)))</div>
<div> ii=ii+1</div>
<div> end do</div>
<div> ii=0</div>
<div> do i = 240,280,10</div>
<div> jloc(ii)=ind_nearest_coord(i,Lon,0)</div>
<div> print(i+" "+jloc(ii)+" "+Lon(jloc(ii)))</div>
<div> ii=ii+1</div>
<div> end do</div>
<div> do i=0,2</div>
<div> print(iloc(i)+" "+jloc(i))</div>
<div> HailSize(0,jloc(i)-5:jloc(i)+5,iloc(i)-5:iloc(i)+5)=3.5</div>
<div> HailSize(0,jloc(i)-15:jloc(i)+15,iloc(i)-15:iloc(i)+15)=2.5</div>
<div> HailSize(0,jloc(i)-25:jloc(i)+25,iloc(i)-25:iloc(i)+25)=1.0</div>
<div> end do</div>
<div> do i=3,4</div>
<div> HailSize(0,jloc(i)-15:jloc(i)+15,iloc(i)-15:iloc(i)+15)=1.5</div>
<div> HailSize(0,jloc(i)-25:jloc(i)+25,iloc(i)-25:iloc(i)+25)=0.5</div>
<div> end do</div>
<div> print(Lat(iloc))</div>
<div> print(Lon(jloc))</div>
<div><br>
</div>
<div>; Generate 2D latlon grids from 1D<br>
</div>
<div> Lat2D = new((/dims(1),dims(0)/),"float")</div>
<div> Lon2D = new((/dims(1),dims(0)/),"float")</div>
<div> do i=0,dims(0)-1</div>
<div> Lat2D(:,i)=Lat(i)</div>
<div> end do</div>
<div> do j=0,dims(1)-1</div>
<div> Lon2D(j,:)=Lon(j)</div>
<div> end do</div>
<div>;Generate contour increments<br>
</div>
<div> cint=fspan(0,5,11)</div>
<div> print(cint) <br>
</div>
<div><br>
</div>
<div>; rastertimeseries2kml template<br>
</div>
<div>parm=True</div>
<div>parm@Verbose=True</div>
<div>parm@ColorMap="WhiteBlueGreenYellowRed"</div>
<div>parm@DataSetTitle="MMRS Hail Product"</div>
<div>parm@MinData=0.0</div>
<div>parm@MaxData=5.0</div>
<div>parm@MinDataOpacity=0</div>
<div>parm@MaxDataOpacity=60</div>
<div>parm@IncludeGrid=True</div>
<div>parm@LineWidth=3</div>
<div>parm@Name="MMRS HailSize Algorithm for "+TimeTag</div>
<div>; The following command will create a KML file, called olr12.kml,</div>
<div>; in the current directory, since the first argument, i.e.</div>
<div>; the PATH, is set to "."</div>
<div><br>
</div>
<div>; File is very large extract out subset for debugging<br>
</div>
<div>i1=1400</div>
<div>i2=1600</div>
<div>j1=2900</div>
<div>j2=3100</div>
<div> HailSize1=new((/1,j2-j1+1,i2-i1+1/),"float")</div>
<div> Lat2D1 = new((/j2-j1+1,i2-i1+1/),"float")</div>
<div> Lon2D1 = new((/j2-j1+1,i2-i1+1/),"float")</div>
<div> HailSize1=0.</div>
<div> HailSize1(0,:,:)=HailSize(0,j1:j2,i1:i2)</div>
<div> Lat2D1 = Lat2D(j1:j2,i1:i2)</div>
<div> Lon2D1 = Lon2D(j1:j2,i1:i2)</div>
<div>;HailSize1@lat2d = Lat2D1</div>
<div>RasterTimeSeries2KML(kml_out,HailSize1,Lon2D1,Lat2D1,TimeTag,parm)</div>
<div><br>
</div>
<div>end </div>
=================================================================<br>
<br>
</div>
</div>
_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@mailman.ucar.edu" target="_blank">ncl-talk@mailman.ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="https://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">https://mailman.ucar.edu/mailman/listinfo/ncl-talk</a></blockquote></div>