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/contributed.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl" ;******************************************** begin ; dir = "./CFSv2_icegrb" dir = "./" e1 = addfile(dir+"ocnf2015040900.grb2","r") icecvr7 = e1->ICEC_P0_L1_GLL0(::-1,:) ; reverse the latitudes icecvr8 = e1->ICETK_P0_L1_GLL0 ; CFSv2 thickness printVarSummary(icecvr7) ; printVarSummary(icecvr8) printMinMax(icecvr7,0) ; printMinMax(icecvr8,0) newlat = fspan(-89.75,89.75,360) newlon = fspan(0.25, 359.75, 720) newlat@units = "degrees_north" newlon@units = "degrees_east" ;; newlat2 = fspan(90.0,-90.0,181) ;; newlon2 = fspan(0, 359, 360) ;; newlat2@units = "degrees_north" ;; newlon2@units = "degrees_east" ;; icecvr7!0="latt1" ;; icecvr7&latt1=newlat2 ;; icecvr7!1="lonn1" ;; icecvr7&lonn1=newlon2 new_icecvr7 = linint2(icecvr7&lon_0,icecvr7&lat_0,icecvr7,True,newlon,newlat,0) new_icecvr7!0="latt2" new_icecvr7&latt2=newlat new_icecvr7!1="lonn2" new_icecvr7&lonn2=newlon printVarSummary(new_icecvr7) printMinMax(icecvr7,0) printMinMax(new_icecvr7,0) labes = (/"Org Grid", "Regrid"/) wks_type = "png" wks_type@wkWidth = 2500 wks_type@wkHeight = 2500 wname = "IceCfs_Test" wks = gsn_open_wks(wks_type,wname) gsn_define_colormap(wks,"precip3_16lev") ;************************************************ ; create panel plots ;************************************************* plot_A = new (2, graphic) ; create graphical array res = True ; plot options desired ; res@gsnAddCyclic = True res@gsnDraw = False res@gsnFrame = False res@gsnPolar = "NH" ; specify the hemisphere res@mpMinLatF = 60 res@mpFillOn = False res@cnLinesOn = False res@cnFillOn = True ; turn on color fill res@cnInfoLabelOn = False ; turn off contour info label res@cnLineLabelsOn = False ; turn off line labels res@cnLevelSelectionMode = "ExplicitLevels" ; set explicit contour levels res@cnLevels = (/0.05,0.1,0.15,0.2,0.25,0.3,0.35,0.4,0.5,0.6,0.7,0.8,0.9,0.98/) ; res@cnLabelBarEndStyle = "ExcludeOuterBoxes" res@cnFillDrawOrder = "Predraw" res@vpWidthF = 0.9 res@vpHeightF = 0.4 res@cnFillMode = "rasterfill" res@gsnSpreadColors = True ; use full color table res@mpOutlineBoundarySets = "National" ; res@lbLabelBarOn = False ; turn off individual color bars res@gsnStringFontHeightF = 0.021 res@tmYRMode = "Automatic" ; turn off special labels on right axis res@lbAutoManage = False ; we control label bar res@tmXBLabelFontHeightF = 0.018 ; resize tick labels res@tmYLLabelFontHeightF = 0.018 res@gsnDraw = False res@gsnFrame = False res@gsnLeftString = "" res@gsnRightString = "" pres1 = True ; panel options pres1@gsnFrame = False pres1@gsnDraw = True pres1@gsnMaximize = True ; maximize image pres1@gsnPanelLabelBar = True ; Add common label bar pres1@txString = "20150409 at 00z" ; add common title ; pres1@txFontHeightF = 0.013 ; pres1@gsnPanelBottom = 0.05 pres1@lbTitlePosition = "Bottom" ; put it below the plot pres1@lbTitleOffsetF = 0.1 pres1@lbTitleFontHeightF = 0.01 pres1@lbLabelFontHeightF = 0.007 ; pres1@gsnPanelTop = 0.98 ; pres1@gsnPanelBottom = 0.45 pres1@gsnPanelYWhiteSpacePercent = 3 pres1@gsnPanelXWhiteSpacePercent = 3 pres1@pmLabelBarWidthF = 0.5 ; default is shorter res@gsnCenterString = labes(0) plot_A(0) = gsn_csm_contour_map_polar (wks, icecvr7(:,:), res) res@gsnCenterString = labes(1) plot_A(1) = gsn_csm_contour_map_polar (wks,new_icecvr7 (:,:), res) gsn_panel(wks,plot_A,(/1,2/),pres1) ;draw(plot) frame(wks) delete(wks) system("convert -trim " + wname + ".png " + wname + "_2015.png") ;******************************************** end