Good morning sir,
I have done my pannel who plot in contour sea level presssion of wrf model and sea level pression of NCEP. In each map I have contours of sea level pression plus color (green) in the map. I don't know how can I do to move this color (I want to have a white background). yhank for your comprehension
this is my script:
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"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
;load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
load "gsn_code_new.ncl"
load "WRFUserARW_new.ncl"
begin
; read in netCDF file
;************************************************
;;;;;;;;;;;;;;;;;pr lire les fichiers de 6h ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
a1 = addfile("/media/disk/simulation_rolande/wrfprd_cu1_mp6_blp1_ssp1_ralw1_rasw1_180709/wrfout_d01_2009-07-18_00:00:00.nc","r")
a2 = addfile("/media/disk/simulation_rolande/wrfprd_cu1_mp6_blp1_ssp1_ralw1_rasw1_180709/wrfout_d01_2009-07-18_06:00:00.nc","r")
a3 = addfile("/media/disk/simulation_rolande/wrfprd_cu1_mp6_blp1_ssp1_ralw1_rasw1_180709/wrfout_d01_2009-07-18_12:00:00.nc","r")
;;;;;;;;;;;;pr lire les fichiers de 12h ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
a4 = addfile("/media/disk/simulation_rolande/wrfprd_cu1_mp6_blp1_ssp1_ralw1_rasw1_180709/wrfout_d01_2009-07-18_18:00:00.nc","r")
a6 = addfile("/media/disk/simulation_rolande/slp_day.nc","r")
slpwrf0= wrf_user_getvar(a1,"slp",0)
slpwrf6= wrf_user_getvar(a2,"slp",0)
slpwrf12= wrf_user_getvar(a3,"slp",0)
slpwrf18= wrf_user_getvar(a4,"slp",0)
slpncep1 =short2flt(a6->slp)
slpncep = slpncep1 /100
copy_VarCoords(slpncep1,slpncep)
wks = gsn_open_wks("ps" ,"slp18")
pltres = True
mpres = True
res = True
opts_r = True
res@cnFillOn = True
res@NoTitles = True
res@lbLabelBarOn = False ; turn off individual c
res@UnitLabel = ""
res@mpMinLonF = 0.2 ; select a subregion
res@mpMaxLonF = 22
res@mpMinLatF = 0.1
res@mpMaxLatF = 14
res@gsnDraw = False ; don't draw
res@gsnFrame = False ; don't advance frame
;;;;;;;;;;;;;;;;;;;;;;;;draw national boundery map;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Map stuff ;
res@mpDataBaseVersion = "Ncarg4_0" ; use finer database ;
res@mpOutlineOn = True ;
res@mpFillOn = False ; turn off gray fill ;
res@mpOutlineBoundarySets = "National" ; turn on country boundaries ;
res@mpNationalLineColor = "Black" ;"Red"
res@mpNationalLineDashPattern = 0 ;1 ;for dashpattern
res@mpNationalLineThicknessF = 1.5
res@mpGeophysicalLineColor = "Black" ; color of cont. outlines ;
res@mpGeophysicalLineThicknessF = 1.5 ; thickness of outlines;; ;
res@cnFillOn = True
res@cnFillDrawOrder = "Predraw"
;;;;;;;;;;;;;;;to add national boundary country;;;;;;;;;;;;;;;;;;;;;;;;;;;;;,,,,,,
resm = True
resm@mpOutlineBoundarySets = "National" ; turn on country boundaries
resm@mpGeophysicalLineColor = "Black" ; color of cont. outlines
resm@mpGeophysicalLineThicknessF = 1.5 ; thickness of outlines
resm@gsLineDashPattern = 1.8
resm@mpDataBaseVersion = "Ncarg4_1" ; use finer database ;
resm@mpOutlineOn = True ;
resm@mpFillOn = False ; turn off gray fill ;
resm@mpOutlineBoundarySets = "National" ; turn on country boundaries ;
resm@mpNationalLineColor = "Black" ;"Red"
resm@mpNationalLineDashPattern = 0 ;1 ;for dashpattern
resm@mpNationalLineThicknessF = 1.5
;;;;;;;;;;;;;;;;;;;;to select my region;;;;;;;;;;;;;;;;;;;;;;;;;;;,
resm@mpLeftCornerLatF = 0.1
resm@mpLeftCornerLonF = 0.2
resm@mpRightCornerLatF = 14
resm@mpRightCornerLonF = 22
res@vpWidthF = .870 ;7*.118 ;0.2
res@vpHeightF =13.6 ;8*.09 ;0.8
res = True
res@cnLevelSelectionMode = "ManualLevels" ; set manual contour levels
res@cnMinLevelValF = 900. ; set min contour level
res@cnMaxLevelValF = 1100. ; set max contour level
res@cnLevelSpacingF = 1. ; set contour spacing
res@cnLineColor = "Red"
res@cnLinesOn = True
res@cnLineLabelsOn = True
res@cnFillColors = (/"White","White"/)
res@gsnContourZeroLineThicknessF = 2. ; doubles thickness of zero contour
res@gsnContourNegLineDashPattern = 1 ; sets negative contours to dash pattern 1
; opts_psl@UnitLabel = ""
res@cnInfoLabelOn = False
res@cnLineLabelFontHeightF = 0.01
res@cnLineLabelPerimOn = False
res5 = res
slpwrf0@description = ""
slpwrf0@UnitLabel = ""
res5@cnFillon = True
cont_slpwrf0 = wrf_contour(a1,wks, slpwrf0,res5)
res6 =res
slpwrf6@description = ""
res6@cnFillon = True
cont_slpwrf6 = wrf_contour(a1,wks, slpwrf6, res6)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
res7 = res
slpwrf12@description = ""
res7@cnFillon = True
cont_slpwrf12 = wrf_contour(a1,wks, slpwrf12, res7)
res8 =res
slpwrf18@description = ""
res8@cnFillon = True
cont_slpwrf18= wrf_contour(a1,wks, slpwrf18, res8)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;,
res@mpOutlineBoundarySets = "National" ; turn on country boundaries
res@mpGeophysicalLineColor = "Black" ; color of cont. outlines
res@mpGeophysicalLineThicknessF = 1.5 ; thickness of outlines
res@gsLineDashPattern = 1.8
res@mpDataBaseVersion = "Ncarg4_1" ; use finer database ;
res@mpOutlineOn = True ;
res@mpFillOn = False ; turn off gray fill ;
res@mpOutlineBoundarySets = "National" ; turn on country boundaries ;
res@mpNationalLineColor = "Black" ;"Red"
res@mpNationalLineDashPattern = 0 ;1 ;for dashpattern
res@mpNationalLineThicknessF = 1.5
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;,,
res9 =res
map4=gsn_csm_contour_map_ce(wks,slpncep(0,:,:),res9)
res0 =res
map5=gsn_csm_contour_map(wks,slpncep(1, :, :),res0) ; create plot ;object
res1 =res
map6=gsn_csm_contour_map(wks,slpncep(2, :, :),res1)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
res2 =res
map7=gsn_csm_contour_map(wks,slpncep(3, :, :),res2)
; Generate maps.
resm = True
map = new(8,graphic)
map0 = wrf_map(wks,a1,resm)
map1 = wrf_map(wks,a1,resm)
map2 = wrf_map(wks,a1,resm)
map3 = wrf_map(wks,a1,resm)
res@tmXBLabelsOn =True
res@tmXBTickSpacingF = 2.
res@tmYLLabelsOn =True
res@tmYLTickSpacingF = 2.
res@mpGridAndLimbOn = True ; turn on lat/lon lines
res@mpPerimOn = False ; turn off box around plot
; pltres@mpGridLatSpacingF = 2. ; spacing for lat lines
;pltres@mpGridLonSpacingF = 2. ; spacing for lon lines
wrfres = True
wrfres@PanelPlot = True ; Indicate these plots are to be paneled.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;,,
wrf_map_overlay(wks,map0,(/cont_slpwrf0/),wrfres)
wrf_map_overlay(wks,map1,((/cont_slpwrf6/)),wrfres)
wrf_map_overlay(wks,map2,((/cont_slpwrf12/)),wrfres)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
wrf_map_overlay(wks,map3,((/cont_slpwrf18/)),wrfres)
pnlres = True
;pnlres@pmLabelBarOrthogonalPosF = -0.01
pnlres@gsnMaximize = True
pnlres@txString = ""
pnlres@gsnPanelXWhiteSpacePercent = 10.
pnlres@gsnPanelYF = (/0.95,0.95,5.5,5.5/)
; pnlres@gsnPanelLabelBar = True ; add common colorbar
; pnlres@txString = "pression au niveau de la mer du 18 juillet 2009" ; add common title
pnlres@gsnPanelBottom = 0.10 ; add space at bottom
;pnlres@pmLabelBarWidthF = .6
pnlres@tmYRLabelsOn = False ; no right labels
pnlres@tmYROn = False ; no right tickmarks
pnlres@amJust = "BottomLeft"
;pnlres@lbTitleOn = True ; turn on title
; ;pnlres@lbTitlePosition = "Bottom"
; pnlres@lbTitleString = "(degC)"
pnlres@lbTitleFontHeightF= .015 ; make title smaller
pnlres@gsnPanelFigureStringsFontHeightF = 0.008
pnlres@gsnPanelFigureStrings= (/"WRF 00h","NCEP 00h","WRF 06h","NCEP 06h","WRF 12h",\
"NCEP 12h","WRF 18h","NCEP 18h"/)
gsn_panel(wks,(/map0,map4,map1,map5,map2,map6,map3,map7/),(/4,2/),pnlres)
end
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Nov 17 07:55:37 2009
This archive was generated by hypermail 2.1.8 : Tue Nov 17 2009 - 17:27:42 MST