<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Hi all,<div><br></div><div>I am trying to regrid precipitation data from TRMM3B42 using ESMF bilinear regridding, however, when I try to generate the weights I get the following error:</div><div><br></div><div><b>curvilinear_to_SCRIP: Opt@Mask2D is not the correct dimensionality</b><br></div><div><br></div><div><div>I successfully did the regridding in the past for the same data, but now some attributes of the data have changed for the period of time I interested in and I am getting the last error.</div><br class="gmail-Apple-interchange-newline"></div><div>These are the attributes of my data:</div><div><i>netcdf \3B42.20090101.00.7A.HDF {</i></div><div><i>dimensions:</i></div><div><i>        nlon = 1440 ;</i></div><div><i>        nlat = 400 ;</i></div><div><i>variables:</i></div><div><i>        float precipitation(nlon, nlat) ;</i></div><div><i>                precipitation:units = "mm/hr" ;</i></div><div><i>                precipitation:coordinates = "nlon nlat" ;</i></div><div><i>                precipitation:_FillValue = -9999.9f ;</i></div><div><i>        float nlon(nlon) ;</i></div><div><i>                nlon:long_name = "longitude" ;</i></div><div><i>                nlon:standard_name = "longitude" ;</i></div><div><i>                nlon:units = "degrees_east" ;</i></div><div><i>        float nlat(nlat) ;</i></div><div><i>                nlat:long_name = "latitude" ;</i></div><div><i>                nlat:standard_name = "latitude" ;</i></div><div><i>                nlat:units = "degrees_north" ;</i></div><div><i><br></i></div><div>And this is my script:</div><div><div>load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"</div><div>load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"</div><div>load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"</div><div>load "$NCARG_ROOT/lib/ncarg/nclscripts/esmf/ESMF_regridding.ncl"</div><div><br></div><div>begin</div><div><br></div><div>;----------------------------------------------------------------------</div><div>; User settings</div><div>;----------------------------------------------------------------------</div><div><br></div><div>  ;---------------------------------------------------------------;</div><div>  ; Set source and destination grid filenames.                    ;</div><div>  ; Define weight filename.                                       ;</div><div>  ;---------------------------------------------------------------;</div><div>    interp_opt = "bilinear"</div><div>    wgtFileName = "./TRMM2WRFHydro_weight_"+interp_opt+".nc"</div><div><br></div><div>    srcGridName = "./3B42.20090101.00.7A.HDF.nc4"</div><div>  if ( .not.isfilepresent( srcGridName ) ) then</div><div>     print( " ... source grid file not found : "+ srcGridName )</div><div>     exit</div><div>  end if</div><div><br></div><div>    dstGridName = "/glade/work/mirce/DOMAINS/DOMAIN_Files_250m_200/<a href="http://geo_em.d04.nc">geo_em.d04.nc</a>"</div><div>  if ( .not.isfilepresent( dstGridName ) ) then</div><div>     print( " ... destination grid file not found : "+ dstGridName )</div><div>     exit</div><div>  end if</div><div><br></div><div>  ;---------------------------------------------------------------;</div><div>  ; Field names for lat and lon coordinates in the source file.   ;</div><div>  ;---------------------------------------------------------------;</div><div>  LatName = "nlat"</div><div>  LonName = "nlon"</div><div><br></div><div>;----------------------------------------------------------------------</div><div>; Convert source grid to a SCRIP convention file.</div><div>;----------------------------------------------------------------------</div><div>    src_file = addfile(srcGridName,"r")</div><div>    vNames   = getfilevarnames( src_file )</div></div><div><div><br></div><div>    if ( isfilevar( src_file, LatName ) .and. isfilevar( src_file, LonName ) ) then</div><div>       src_lat = src_file->$LatName$</div><div>       src_lon = src_file->$LonName$</div><div>    else</div><div>       print( " ... no such lat/lon fieldnames" )</div><div>       exit</div><div>    end if</div><div><br></div><div>    if ( isfilevar( src_file, "precipitation" ) ) then</div><div>       test_mask = src_file->precipitation(:,:)</div><div>    else</div><div>       print( " ... no such data field " )</div><div>       exit</div><div>    end if</div><div><br></div><div>    Opt                = True</div><div>    Opt@Mask2D         = where(.not.ismissing(test_mask),1,0)</div><div>    Opt@SrcRegional    = False</div><div>    Opt@ForceOverwrite = True</div><div>    Opt@PrintTimings   = True</div><div>    Opt@Title          = "TRMM"</div><div><br></div><div>    src_SCRIP_filename     = "SCRIP_TRMM_"+interp_opt+".nc"</div><div>    rectilinear_to_SCRIP( src_SCRIP_filename, src_lat, src_lon, Opt)</div><div><br></div><div>    delete(Opt)</div><div><br></div><div>;----------------------------------------------------------------------</div><div>; Convert destination grid to a SCRIP convention file.</div><div>;----------------------------------------------------------------------</div><div>    dst_file = addfile(dstGridName,"r")</div><div><br></div><div>    if ( isfilevar( dst_file, "XLAT" ) .and. .not. isfilevar( dst_file, "XLAT_M") ) then</div><div>       dst_lat = dst_file->XLAT(0,:,:)</div><div>       dst_lon = dst_file->XLONG(0,:,:)</div></div><div><div>    end if</div><div><br></div><div>    Opt                = True</div><div>    Opt@DstRegional    = True</div><div>    Opt@ForceOverwrite = True</div><div>    Opt@PrintTimings   = True</div><div>    Opt@Title          = dstGridName</div><div><br></div><div>    dst_SCRIP_filename     = "SCRIP_WRFHydro_"+interp_opt+".nc"</div><div>    curvilinear_to_SCRIP( dst_SCRIP_filename, dst_lat, dst_lon,Opt)</div><div><br></div><div>    delete(Opt)</div><div><br></div><div>;----------------------------------------------------------------------</div><div>; Generate the weights that take you from the source grid to</div><div>; destination degree grid.</div><div>;----------------------------------------------------------------------</div><div>    Opt                      = True</div><div>    Opt@InterpMethod         = interp_opt</div><div>    Opt@DstRegional          = True</div><div>    Opt@ForceOverwrite       = True</div><div>    Opt@PrintTimings         = True</div><div>    Opt@Debug                = True</div><div><br></div><div>    ESMF_regrid_gen_weights( src_SCRIP_filename, dst_SCRIP_filename, wgtFileName, Opt)</div><div><br></div><div>    delete(Opt)</div><div><br></div><div>;----------------------------------------------------------------------</div><div>;----------------------------------------------------------------------</div><div>end</div></div><div><br></div><div>If it's helpful, my data is in the following path in Cheyenne:</div><div><i>/glade/scratch/mirce/LaSierra/FullDomainForcing/TRMM_3B24/Test<br></i></div><div><br></div><div>I will appreciate any help about how to fix this error.</div><div><br></div><div>Thanks!,</div><div>Mirce.</div><div><br></div><div> <br></div></div></div></div></div></div></div></div>