[ncl-talk] sub: Regridding NARR data
dale zuri
dalezuri at gmail.com
Sat Feb 29 14:55:48 MST 2020
Hi NCL user,
I have been trying to regrid NARR 0.3 resolution to 190x384 using the ESMF
regrid function. The regrid was successful, however the output values seem
unrealistic and not correct.
I would appreciate any suggestion to fix the problem.
Thanks
Here the code:
diri1 = "/NARR/daily/prate/"
fill1 = systemfunc("for((i="+yrstrt+";i<="+yrend+";i+=1)); do ls "+
diri1 +"*$i*;
done")
print(fill1)
f1 = addfiles (fill1, "r") ; note the "s" of addfile
ListSetType (f1, "cat")
uT1 = f1[:]->prate ; read T from all files
lon2d = f1[:]->x ; read T from all files
lat2d = f1[:]->y ; read T from all files
printVarSummary (uT1)
uT1 at _FillValue = uT1 at missing_value ; fix missing value
printMinMax(uT1,0)
uT = short2flt( uT1 ) ; apply scale and offset attributes
xMon = calculate_monthly_values (uT, "avg", 0,True)
printVarSummary(xMon)
printMinMax(xMon,0)
T1 = month_to_season (xMon, "JJA")
printVarSummary(T1)
T1=T1*86400*92
printMinMax(T1,0)
;-- define the T255 grid (lat x lon - 256x512)
nlat = 190 ;-- number of latitudes
nlon = 384 ;-- number of longitudes
grint = 0.9375 ;-- grid spacing
dst_lat = fspan((-90.0+grint),(90.-grint),nlat)*1d ;-- type double
dst_lat!0 = "lat" ;-- dimension name
dst_lat at units = "degrees_north" ;-- dimension units
dst_lon = fspan(0.0,(360.-grint),nlon)*1d ;-- type double
dst_lon!0 = "lon" ;-- dimension name
dst_lon at units = "degrees_east" ;-- dimension units
;-- set ESMF resources
Opt = True
Opt at InterpMethod = "patch" ;-- interpolation method
Opt at SrcFileName = "ECHAM5_SCRIP_bilinear.nc" ;-- new source file name
Opt at WgtFileName = "ECHAM5toWorldCurvilinear_bilinear.nc";-- weights file
Opt at ForceOverwrite = True ;-- force overwrite
Opt at DstFileName = "WorldRectilinear_SCRIP_bilinear.nc";-- destination file
Opt at DstGridType = "rectilinear" ;-- Destination grid
Opt at DstGridLon = dst_lon
Opt at DstGridLat = dst_lat
newgrid = ESMF_regrid(T1,Opt)
;newgrid = f2fsh_Wrap(T1,(/190,384/))
printVarSummary (newgrid)
printMinMax(newgrid,0)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20200229/71fd5b3e/attachment.html>
More information about the ncl-talk
mailing list