DKRZ NCL ESMF regridding curvilinear to rectilinear example#
DKRZ NCL script:
;-----------------------------------------------------------------
; DKRZ NCL Example: NCL_rotated_grid.ncl
;
; 30.10.14 kmf
;-----------------------------------------------------------------
begin
;-- define file name
diri = "./"
fili = "diff_tas_rcp45_20060101.nc"
;-- open file and read variable
f = addfile(diri+fili, "r")
tas = f->tas
tas@lat2d = f->lat ;-- set 2D latitude data
tas@lon2d = f->lon ;-- set 2D longitude data
var = tas(0,:,:) ;-- only first time step
;-- define the workstation (plot type and name)
wks = gsn_open_wks("png","plot_rotated_grid")
;-- set resources
res = True
res@gsnMaximize = True ;-- maximize graphics output
res@gsnAddCyclic = True ;-- add cyclic point
res@mpMinLonF = -50.0 ;-- min lon
res@mpMaxLonF = 80.0 ;-- max lon
res@mpMinLatF = 10.0 ;-- min lat
res@mpMaxLatF = 90.0 ;-- max lat
res@cnFillOn = True ;-- turn on contour fill
res@cnFillMode = "CellFill" ;-- use CellFill method
res@cnLinesOn = False ;-- Turn lines off
res@cnLineLabelsOn = False ;-- Turn labels off
res@cnCellFillEdgeColor = -1 ;-- transparent edges
res@tiMainString = "Curvilinear grid regridded to rectilinear grid using ESMF" ;-- title string
res@tiMainFontHeightF = 0.02 ;-- title font size
;-- draw the contour map
plot = gsn_csm_contour_map(wks,var,res)
end
Result: