<div dir="ltr"><div><div><div><div><div>Hi NCLers,<br></div>I am regridding 2d lat/lon curvilinear grid (GOES IR data)  to a 1d lat/lon grid.  The program worked fine, I have good results; however, now I am getting an error when calling the ESMF_regridding.ncl routine.  I don´t know if I accidentally removed something from the code or corrupted it somehow.  But here is the error message<br></div><br><br> Copyright (C) 1995-2015 - All Rights Reserved<br> University Corporation for Atmospheric Research<br> NCAR Command Language Version 6.3.1-03Jul2015_0233<br> The use of this software is governed by a License Agreement.<br> See <a href="http://www.ncl.ucar.edu/">http://www.ncl.ucar.edu/</a> for more details.<br>(0)    get_src_grid_info: source lat dims = (41,73)<br>(0)    get_src_grid_info: source lon dims = (41,73)<br>(0)    get_src_grid_info: source grid type is &#39;curvilinear&#39;<br>fatal:Could not create (<a href="http://source_grid_file.nc">source_grid_file.nc</a>)<br>warning:FileSetFileOption: invalid file or format<br>fatal:[&quot;Execute.c&quot;:8575]:Execute: Error occurred at or near line 1637 in file $NCARG_ROOT/lib/ncarg/nclscripts/esmf/ESMF_regridding.ncl<br><br>fatal:[&quot;Execute.c&quot;:8575]:Execute: Error occurred at or near line 3853 in file $NCARG_ROOT/lib/ncarg/nclscripts/esmf/ESMF_regridding.ncl<br><br>fatal:[&quot;Execute.c&quot;:8575]:Execute: Error occurred at or near line 3983 in file $NCARG_ROOT/lib/ncarg/nclscripts/esmf/ESMF_regridding.ncl<br><br>fatal:[&quot;Execute.c&quot;:8575]:Execute: Error occurred at or near line 48 in file test.ncl<br><br>-----------------------------------------------------------------------------------------------------<br></div>Here is the original code<br><br>;   May 31, 2016<br>load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl&quot;<br>load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl&quot;<br>load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/esmf/ESMF_regridding.ncl&quot;<br><br>begin<br>;---Data file containing source grid<br>    src_file = &quot;goes12_4_2012_121_2345_DenseN.nc&quot;        ;;2d lat/lon netcdf file<br>;---Data file containing destination grid<br>    dst_file = &quot;2011_09_18_2115_ch4subset_Karen.nc&quot;   ;; 1d lat/lon netcdf file<br><br>    sfile    = addfile(src_file,&quot;r&quot;)<br>    dfile    = addfile(dst_file,&quot;r&quot;)<br><br>;---Get variable to regrid<br>    var     = sfile-&gt;temperature<br>    src_lat = sfile-&gt;latitude      ;;--- source 2d lat<br>    src_lon = sfile-&gt;longitude     ;;---source 2d lon<br><br> ;---Get new grid variables<br><br>    dst_lat= dfile-&gt;lat<br>    dst_lon= dfile-&gt;lon<br><br>;---Set up regridding options<br>    Opt                   = True<br><br>;---&quot;bilinear&quot; is the default. &quot;patch&quot; and &quot;conserve&quot; are other options.<br>    Opt@InterpMethod      = &quot;bilinear&quot;        ;;---Change (maybe)<br><br>    Opt@SrcGridLat        = src_lat           ; source grid<br>    Opt@SrcGridLon        = src_lon<br><br>    Opt@DstGridLat        = dst_lat           ; source grid<br>    Opt@DstGridLon        = dst_lon<br><br>    Opt@SrcRegional       = False             ;;--Change (maybe)<br>    Opt@SrcInputFileName  = src_file          ; optional, but good idea<br>    Opt@SrcMask2D         = where(.not.ismissing(var),1,0) ; Necessary if has<br>                                                           ; missing values.<br>    Opt@DstGridType       = &quot;rectilinear&quot;            ; Destination grid<br>   Opt@DstRegional       = False                   ;;--Change (maybe)<br><br>    Opt@ForceOverwrite    = True<br>    Opt@PrintTimings      = True<br>    Opt@Debug             = True<br><br>     temp = ESMF_regrid(var,Opt)     ; new regridded variable<br><br>;----------------------------------------------------------<br>;   write out new netcdf 1d lat/lon files<br>; -------------------------------------------------------------<br>    fout  = addfile (&quot;<a href="http://goes12_4_2012_121_2345_subset_1d.nc">goes12_4_2012_121_2345_subset_1d.nc</a>&quot;, &quot;c&quot;)<br>;    setfileoption(fout,&quot;DefineMode&quot;,True)<br><br> ;===================================================================<br>    ; create global attributes of the file<br>    ;===================================================================<br>        fAtt               = True            ; assign file attribute<br>        fAtt@source_file   =  &quot;goes12_4_2012_121_2345_DenseN.nc&quot;<br>        fAtt@Conventions   = &quot;None&quot;<br>        fAtt@creation_date = systemfunc (&quot;date&quot;)<br>        fileattdef(fout,fAtt )<br>       temp@_FillValue = -999.99<br>       fout-&gt;lat  = dst_lat           ;  new 1d lat<br>       fout-&gt;lon =  dst_lon           ;  new 1d lon<br>       fout-&gt;temp =  temp             ; regridded variable<br><br><br></div>thanks in advance,<br></div>Dave<br><div><div><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><div><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br></div></div></div></div>