ESMF regrid fuction

From: Muhammad Amjad <callamjad_at_nyahnyahspammersnyahnyah>
Date: Fri Dec 07 2012 - 02:59:18 MST

Dear All,

I am using latest ncl. I am using this script but the regrided file
generated through this can't be displayed. The output variable has
values but can't be displayed and size on disk.
---------------------------------
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/esmf/ESMF_regridding.ncl"

begin

    des_latS = -90 ; rough box that encloses the Tibet Plateau
    des_latN = 90 ; this is larger than the 'final' Tibet region
    des_lonW = 0 ; common TIBET region: 28N-40N and 75-104E
    des_lonE = 357.5 ;

    src_latS = -88.542 ; rough box that encloses the Tibet Plateau
    src_latN = 88.542 ; this is larger than the 'final' Tibet region
    src_lonW = 0 ; common TIBET region: 28N-40N and 75-104E
    src_lonE = 358.125 ;

    sfile = addfile("air.2m.gauss.2010.nc","r")
    air2m_short = sfile->air(:,0,:,:)
    air2m = short2flt(air2m_short)
    air2m_slab = air2m(:,:,:)

    Opt = True
    Opt@CopyVarCoords = False
    Opt@SrcTitle = "TOPO Grid"

    Opt@DstGridType = "2.5deg" ; Destination grid description
    Opt@DstTitle = "Global 2.5 degree resolution"
    Opt@DstLLCorner = (/ des_latS, des_lonW /)
    Opt@DstURCorner = (/ des_latN, des_lonE /)

    Opt@SrcRegional = True ; These are necessary
    Opt@DstRegional = True
    Opt@Overwrite = True
    Opt@InterpMethod = "bilinear" ; Default is bilinear

    topo_regrid = ESMF_regrid(air2m_slab,Opt) ; Do the regridding

    lat = fspan(-90,90,73)
    lon = fspan(0,357.5,144)
    lat@long_name="latitude"
    lat@units="degree_north"
    lon@long_name="longitude"
    lon@units="degree_east"

    topo_regrid!0="time"
    topo_regrid!1="lat"
    topo_regrid!2="lon"
    topo_regrid@long_name="6-Hourly Forecast of Air temperature at 2 m"
    topo_regrid@units="degK"
    delete(topo_regrid@standard_name)

    system("/bin/rm -f regrid.nc")
    b = addfile("regrid.nc","c")
    b->topo_regrid = (/topo_regrid/)

end
---------------------------------

Best regards,

Amjad.
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Dec 7 02:59:38 2012

This archive was generated by hypermail 2.1.8 : Fri Dec 07 2012 - 13:30:06 MST