Hi all,
I have been trying to regrid some model data, but when I use the bilinear
interpolation (linint2) it keeps plotting the data 180 degrees off the
orginal grid (ex. temp data for australia is now plotted over south
america). I have put my script below. Any help is greatly appreciated.
Mike
p.s. if I am not describing the problem fully, I have posted a plot of the
orginal grid and of the new grid that is off at dust.ess.uci.edu/brownmc
it is called regrid_problem.pdf
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"
begin
in =
addfile("/data/brownmc/sresa1b/working/sresa1b_ncar_ccsm3_0_run1_209001_209912_200001_200912_diff.nc","r")
sst = in->tas(0,:,:)
lon = in->lon({0.:360})
newlat = fspan(-90.,90.,90)
newlon = fspan(0.,360.,180)
newsst = linint2(lon,sst&lat,sst,True,newlon,newlat,0)
newsst!0 ="lat"
newsst!1 = "lon"
newsst&lat = newlat
newsst&lon = newlon
wks = gsn_open_wks("X11","regrid") ; open a ps file
gsn_define_colormap(wks,"gui_default") ; choose colormap
res = True ; plot mods desired
res@cnFillOn = True ; turn on color
res@gsnSpreadColors = True ; use full color map
res@cnLinesOn = False ; no contour lines
res@cnLineLabelsOn = False ; no line labels
;res@mpMaxLatF = 60 ; choose map range
;res@mpMinLatF = -60
res@gsnDraw = False ; don't draw yet
res@gsnFrame = False ; don't advance frame yet
;res@cnLevelSelectionMode = "ManualLevels" ; manual levels
;res@cnMinLevelValF = 4 ; min level
;res@cnMaxLevelValF = 32 ; max level
;res@cnLevelSpacingF = 2 ; interval
;res@tmXBLabelFontHeightF = 0.014 ; adjust some font heights
;res@tmYLLabelFontHeightF = 0.014
;res@tiMainFontHeightF = 0.022
;res@txFontHeightF = 0.017
res@lbLabelBarOn = False ; turn off label bar
;************************************************
; create plots
;************************************************
plot = new(2,graphic)
res@tiMainString = "Original Grid"
plot(0) = gsn_csm_contour_map_ce(wks,sst,res) ; create the plot
res@tiMainString = "Grid after linint2"
plot(1) = gsn_csm_contour_map_ce(wks,newsst,res) ; create the plot
;************************************************
; create panel
;************************************************
pres = True
pres@gsnPanelLabelBar = True ; common label bar
gsn_panel(wks,plot,(/2,1/),pres)
end
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Feb 24 2006 - 14:58:46 MST
This archive was generated by hypermail 2.2.0 : Mon Feb 27 2006 - 09:24:31 MST