Dear Rolande. Encapsulated postscript can contain only one frame (no
multiple pages). So, either change your option to ³ps² [wks =
gsn_open_wks("ps" ,"wrfmp8mo")] . Perhaps you are advancing the frame when
you should not. Check out the examples in
http://ncl.ucar.edu/Applications/panel.shtml for guidance with panel plots.
Hope this helps,
Andrea
-- Andrea N. Hahmann Wind Energy Division Risų DTU Technical University of Denmark DTU Risų National Laboratory for Sustainable Energy Frederikborgvej 399, P.O. Box 49 Building 125 DK-4000 Roskilde, Denmark Direct +45 4677 5471 Fax +45 4677 5083 ahah@risoe.dk www.risoe.dtu.dk From: Rolande Tchouaken <tnrolande@yahoo.fr> Date: Fri, 30 Oct 2009 12:26:52 +0000 (GMT) To: <ncl-talk@ucar.edu> Subject: Re :How to do pannel with contain data of wrf modwl and data persiann? Good morning sir, I am a new user in ncl, I want to do pannel with contain data of wrf model and persiann data. My pannel should have 12 map. When i run my script i receive only one map and many error like: warning:GKS:GFA: --PostScript error: Encapsulated PostScript can have only one page ERROR **** IN GKS ERROR REPORTED FROM libhlu.a(Error.o) warning:WorkstationFill:libncarg Error:SFSGFA/SET - UNCLEARED PRIOR ERROR warning:GKS:GFA: --PostScript error: Encapsulated PostScript can have only one page ERROR **** IN GKS ERROR REPORTED FROM libhlu.a(Error.o) warning:WorkstationFill:libncarg Error:SFSGFA/SET - UNCLEARED PRIOR ERROR warning:GKS:GFA: --PostScript error: Encapsulated PostScript can have only one page 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("/home/romeowrf/simulation_rolande/wrfprd_CU3_MP8_BL1_SF1_RALW1_RASW 1_180709/wrfout_d01_2009-07-18_06:00:00.nc","r") a2 = addfile("/home/romeowrf/simulation_rolande/wrfprd_cu2_mp8_blp2_ssp1_ralw1_ra sw1_180709/wrfout_d01_2009-07-18_06:00:00.nc","r") a3 = addfile("/home/romeowrf/simulation_rolande/wrfprd_cu1_mp8_blp1_ssp1_ralw1_ra sw1_180709/wrfout_d01_2009-07-18_06:00:00.nc","r") ;;;;;;;;;;;;pr lire les fichiers de 12h ;;;;;;;;;;;;;;;;;;;;;;;;;;;; a4 = addfile("/home/romeowrf/simulation_rolande/wrfprd_CU3_MP8_BL1_SF1_RALW1_RASW 1_180709/wrfout_d01_2009-07-18_12:00:00.nc","r") a5 = addfile("/home/romeowrf/simulation_rolande/wrfprd_cu2_mp8_blp2_ssp1_ralw1_ra sw1_180709/wrfout_d01_2009-07-18_12:00:00.nc","r") a6 = addfile("/home/romeowrf/simulation_rolande/wrfprd_cu1_mp8_blp1_ssp1_ralw1_ra sw1_180709/wrfout_d01_2009-07-18_12:00:00.nc","r") ;;;;;;;;pr lire les fichiers de 18h;;;;;;;;;;;;;;;;;; a7 = addfile("/home/romeowrf/simulation_rolande/wrfprd_CU3_MP8_BL1_SF1_RALW1_RASW 1_180709/wrfout_d01_2009-07-18_18:00:00.nc","r") a8 = addfile("/home/romeowrf/simulation_rolande/wrfprd_cu2_mp8_blp2_ssp1_ralw1_ra sw1_180709/wrfout_d01_2009-07-18_18:00:00.nc","r") a9 = addfile("/home/romeowrf/simulation_rolande/wrfprd_cu1_mp8_blp1_ssp1_ralw1_ra sw1_180709/wrfout_d01_2009-07-18_18:00:00.nc","r") a10 = addfile("/home/romeowrf/simulation_rolande/persiannnc/raw6hr0919906.nc","r") ;;;;;;;;;;;pr extraire les donne de 6h a 12h le 18 ;;;;;;;;;;;;; a11 = addfile("/home/romeowrf/simulation_rolande/persiannnc/raw6hr0919912.nc","r") ;;;;;;;;;;;;pr extraire les donnees de 12h a 18h;;;;;;;;;;;;;; a12 = addfile("/home/romeowrf/simulation_rolande/persiannnc/raw6hr0919918.nc","r") prepper6 = a10->Prc prepper12 = a11->Prc prepper18 = a12->Prc prepwrfb6 = wrf_user_getvar(a2,"RAINNC",0) + wrf_user_getvar(a2,"RAINC",0) ;pr extraire les donnees du 18 de 0 a 6h prepwrfk6 =wrf_user_getvar(a3,"RAINNC",0)+ wrf_user_getvar(a3,"RAINC",0) ;pr extraire les donnees du 18 de 0 a 6h prepwrfg6 = wrf_user_getvar(a1,"RAINNC",0) + wrf_user_getvar(a1,"RAINC",0) ;pr extraire les donnees du 18 de 0 a 6h ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;, prepwrfg12 = wrf_user_getvar(a4,"RAINNC",0) +wrf_user_getvar(a4,"RAINC",0)- (wrf_user_getvar(a1,"RAINNC",0) + wrf_user_getvar(a1,"RAINC",0) ) ;pr extraire les donnees du 18 de 0 a 6h prepwrfb12 = (wrf_user_getvar(a5,"RAINNC",0) + wrf_user_getvar(a5,"RAINC",0)) - (wrf_user_getvar(a2,"RAINNC",0) + wrf_user_getvar(a2,"RAINC",0)) ;pr extraire les donnees du 18 de 0 a 6h prepwrfk12 = (wrf_user_getvar(a6,"RAINNC",0) + wrf_user_getvar(a6,"RAINC",0)) - (wrf_user_getvar(a3,"RAINNC",0) + wrf_user_getvar(a3,"RAINC",0)) ;pr extraire les donnees du 18 de 0 a 6h ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; prepwrfg18 = (wrf_user_getvar(a7,"RAINNC",0)+ wrf_user_getvar(a7,"RAINC",0) ) - (wrf_user_getvar(a4,"RAINNC",0) + wrf_user_getvar(a4,"RAINC",0)) ;pr extraire les donnees du 18 de 0 a 6h prepwrfb18 = (wrf_user_getvar(a8,"RAINNC",0)+ wrf_user_getvar(a8,"RAINC",0)) - (wrf_user_getvar(a5,"RAINNC",0) + wrf_user_getvar(a5,"RAINC",0)) ;pr extraire les donnees du 18 de 0 a 6h prepwrfk18 = (wrf_user_getvar(a9,"RAINNC",0) + wrf_user_getvar(a9,"RAINC",0) ) - (wrf_user_getvar(a6,"RAINNC",0)+ wrf_user_getvar(a6,"RAINC",0)) ;pr extraire les donnees du 18 de 0 a 6h ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;, wks = gsn_open_wks("eps" ,"wrfmp8mo") gsn_define_colormap(wks,"gui_default") pltres = True mpres = True res = True opts_r = True res@gsnSpreadColors = True ; use full range of colors res@gsnSpreadColorStart = 7 res@gsnSpreadColorEnd = 101 res@NoTitles = True ;res@mpLabelBarOrthogonalPost = -0.1 res@cnLevelSelectionMode = "ExplicitLevels" res@cnLevels = (/ .5, 1., 2.,5., 10.,15.,20. , \ 30., 50, 75, 100, 110./) ;opts_r@pmLabelBarOrthogonalPosF = -0.05 ;opts_r@lbTitleOn = True ; turn on title ; opts_r@lbTitleString = "" ;opts_r@cnLineLabelFontHeightF = 0.02 ; opts_r@cnInfoLabelOn = False ; opts_r@cnConstFLabelOn = False ; opts_r@cnFillOn = True ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;,,,, ;res@gsnAddCyclic = False res = True ; plot mods desired res@cnLineLabelsOn = True ; no line labels res@lbLabelBarOn = False ; turn off individual cb's res@cnFillOn = True res@cnLinesOn = False res@cnLineLabelsOn = False res@gsnSpreadColors = True res@cnLineLabelDensityF = 1.5 ;res@mpGridAndLimbOn = False ; lat/lon lines on ;res@mpGridSpacingF = 10.0 ; lat/lon lines every 10 deg ;res@mpGridLineDashPattern = 2 ; lat/lon lines as dashed ;res@pmTickMarkDisplayMode = "Always" ; turn on tickmarks ;res@mpPerimOn = True ;res@mpFillOn = False ; turn off map fill ;mpres@mpOutlineBoundarySets = "GeophysicalAndUSStates" res@mpOutlineBoundarySets = "National" ; turn on country boundaries ; res@mpGeophysicalLineColor = "Black" ; color of cont. outlines ; res@mpGeophysicalLineThicknessF = 1.8 ; thickness of outlines mpres@gsLineDashPattern = 1.8 ;res@lbOrientation = "Vertical" ; vertical label bar ;res@pmLabelBarOrthogonalPosF = -0.01 ; move label bar closer ;res@lbLabelStride = 2 ; res@cnLevelSelectionMode = "ManualLevels" ; manual levels res@cnLevelSelectionMode = "ExplicitLevels" ; manual levels ;res@cnLevels =(/ .5, 1., 2.,5., 10.,15.,20. , \ ; 30., 50, 75, 85, 100./) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;to add national boundary country;;;;;;;;;;;;;;;;;;;;;;;;;;;;;,,,,,, resm = True resm@mpOutlineBoundarySets = "National" ; turn on country boundaries resm@mpGeophysicalLineColor = "Black" ; color of cont. outlines resm@mpGeophysicalLineThicknessF = 1.8 ; 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 = 1 resm@mpLeftCornerLonF = 1 resm@mpRightCornerLatF = 14 resm@mpRightCornerLonF = 22 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; resource for my first plot;;;;;;;;;;;;;;;,,,, res1 = res res1@cnFillon = True prepwrfb6@description = "" cont_wrfb6 = wrf_contour(a1,wks, prepwrfb6, res1) ;;;;;;;;;;;;;;;;;;;;;;;res for my second plot;;;;;;;;;;;;;;;;;;;;;;;;;, res2 = res prepwrfk6@description = "" res2@cnFillon = True cont_wrfk6 = wrf_contour(a1,wks, prepwrfk6, res2) ;;;;;;;;;;;;;;;;;;;resource for my third plot;;;;;;;;;;;;;;;;;,,, res3 = res prepwrfg6@description = "" res3@cnFillon = True res3@gsnLeftString = " " cont_wrfg6 = wrf_contour(a1,wks, prepwrfg6, res3) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;resource for my four plot;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;, res4 = res prepwrfb12@description = "" res4@cnFillon = True cont_wrfb12 = wrf_contour(a1,wks, prepwrfb12, res4) res5 = res prepwrfk12@description = "" res5@cnFillon = True cont_wrfk12 = wrf_contour(a1,wks, prepwrfk12, res5) res6 = res prepwrfg12@description = "" res6@cnFillon = True cont_wrfg12 = wrf_contour(a1,wks, prepwrfg12, res6) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; res7 = res prepwrfb18@description = "" res7@cnFillon = True cont_wrfb18 = wrf_contour(a1,wks, prepwrfb18, res7) res8 = res prepwrfk18@description = "" res8@cnFillon = True cont_wrfk18= wrf_contour(a1,wks, prepwrfk18, res8) res9 = res prepwrfg18@description = "" res9@cnFillon = True cont_wrfg18 = wrf_contour(a1,wks, prepwrfg18, res9) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; , ; Generate maps. resm = True map = new(12,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) map4 = wrf_map(wks,a1,resm) map5 = wrf_map(wks,a1,resm) map6 = wrf_map(wks,a1,resm) map7 = wrf_map(wks,a1,resm) map8 = 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_wrfb6/),wrfres) wrf_map_overlay(wks,map1,(/cont_wrfk6/),wrfres) wrf_map_overlay(wks,map2,(/cont_wrfg6/),wrfres) wrf_map_overlay(wks,map3,(/cont_wrfb12/),wrfres) wrf_map_overlay(wks,map4,(/cont_wrfk12/),wrfres) wrf_map_overlay(wks,map5,(/cont_wrfg12/),wrfres) wrf_map_overlay(wks,map6,(/cont_wrfb18/),wrfres) wrf_map_overlay(wks,map7,(/cont_wrfk18/),wrfres) wrf_map_overlay(wks,map8,(/cont_wrfg18/),wrfres) ;;;;;;;;;;;;;;;;;to plot data persiann data cumul of 00-06h;;;;;;;;;;;;;;;;;;; res9 = res res9@cnFillon = True res9@mpLimitMode = "Corners" res9@mpLeftCornerLatF = 1 res9@mpLeftCornerLonF = 1 res9@mpRightCornerLatF = 14 res9@mpRightCornerLonF = 22 map9=gsn_csm_contour_map_ce(wks, prepper6(0,:,:), res9) ; create plot ;object ;******************************************* ;****************************** ; eleven plot ;****************************** ;;;;;;;;;;;;;;;;;;;;;;;to plot data persiann cumul of 06-12h;;;;;;;;;;;;;;;;;;;;;;;;;;;;;,,, res10 = res res10@cnFillon = True res10@mpLimitMode = "Corners" res10@mpLeftCornerLatF = 1 res10@mpLeftCornerLonF = 1 res10@mpRightCornerLatF = 14 res10@mpRightCornerLonF = 22 map10= gsn_csm_contour_map_ce(wks, prepper12(0,:,:), res10) ; create plot ;object ;******************************************* ;****************************** ; twelve plot ;****************************** ;;;;;;;;;;;;;;;;;;;to plot persiann data at 12-18h;;;;;;;;;;;;;;;;;;;;;;;;;; res11 = res res11@cnFillon = True res11@mpLimitMode = "Corners" res11@mpLeftCornerLatF = 1 res11@mpLeftCornerLonF = 1 res11@mpRightCornerLatF = 14 res11@mpRightCornerLonF = 22 map11= gsn_csm_contour_map_ce(wks, prepper18(0,:,:), res11) ; create plot ;object ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;,, pnlres = True 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 = "13-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@gsnPanelFigureStringsFontHeightF = 0.008 ; pnlres@gsnPanelFigureStrings= (/"BMJ 00h-06h","BMJ 06h-12h","BMJ 12h-18h","KF 00h-06h","KF 06h-12h","KF 12h-18","GD 00h-06h",\ ;"GD 06h-12h","GD 12h-18h"/) ; add strings to panel gsn_panel(wks,(/map0,map3,map6,map1,map4,map7,map2,map5,map8,map9,map10,map1 1/),(/4,3/),pnlres) end Thank for your help _______________________________________________ ncl-talk mailing list List instructions, subscriber options, unsubscribe: http://mailman.ucar.edu/mailman/listinfo/ncl-talk
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Oct 30 07:10:43 2009
This archive was generated by hypermail 2.1.8 : Mon Nov 02 2009 - 08:49:47 MST