├── README.md ├── animation.ncl ├── animation.sh ├── book_cover.png ├── call-f90.sh ├── data-station.ncl ├── ex_cnmap.ncl ├── ex_color.ncl ├── ex_contour_tm.ncl ├── ex_panel.ncl ├── ex_poly.ncl ├── ex_title.ncl ├── ex_vector.ncl ├── ex_xy.ncl ├── ex_xy_legend.ncl ├── function_index.pdf ├── plot-bar-2stat.ncl ├── plot-bar-bj.ncl ├── plot-comp-enso.ncl ├── plot-corr-AO.ncl ├── plot-enso-wavelet.ncl ├── plot-hgt-Satellite.ncl ├── plot-hgt-lambert.ncl ├── plot-precip-jiangsu.ncl ├── plot-reg-AO.ncl ├── plot-scatter-AO.ncl ├── plot-xy-4stat.ncl ├── plot-xy-PC1.ncl ├── precip.f90 ├── wrf_ex1.ncl ├── wrf_ex2.ncl ├── wrf_ex3.ncl ├── wrf_ex4.ncl ├── wrf_ex5.ncl └── wrf_ex6.ncl /README.md: -------------------------------------------------------------------------------- 1 | ## 书本简介 2 | 3 | [《NCL数据处理与绘图实习教程》](http://www.qxcbs.com/news/newsdetail.jsp?id=164670&nodeid=383&siteid=2) 4 | 5 | 6 | >1._[测试数据下载链接](http://www.qxcbs.com/data/attachement/rar/site2/20170728/1501209300112.rar)_ 7 | 8 | >2._[Cygwin-Windows下安装Unix环境安装包下载链接](http://www.qxcbs.com/data/attachement/rar/site2/20170728/1501209277009.rar)_ 9 | 10 | 如果,链接失效可以发邮件到zhpfu.atm@gmail.com索要。 11 | 12 | ![](https://github.com/gavin971/NCL_meteorology_libs/blob/master/book_cover.png) 13 | 14 | 内容简介:本书首先介绍了NCL下载及安装方法,其后通过9个简单的绘图实例讲解了NCL的基本绘图方法,随后通过19个具体的应用实例进一步综合讲解了NCL对于各种常见格式数据的输入输出、复杂图形的绘制方法以及常见计算函数的使用方法 。此外,附录中还提供了124个常用计算函数及程序、53个常用绘图函数及程序、25个处理WRF输出数据的计算和绘图函数以及13类常用绘图参数的使用方法及说明,并提供了常用函数的索引,这些内容可方便读者日后参考查阅。 15 | 本书适合大气科学专业及地学专业本科及研究生实习,也可供相关专业研究生、科研业务人员参考使用。 16 | 17 | ISBN:978-7-5029-6567-9;定价:40.00元。 18 | 19 | [购书链接(友情帮转!)](http://www.qxcbs.com//books/booksdetail.jsp?id=164759&nodeid=267&siteid=2&pubcompanyid=49) 20 | 21 | 22 | ## 作者简介 23 | 24 | 施宁,南京信息工程大学副教授,博士。主讲课程: 数值天气预报,大气环流,Linux和NCL实践。主要研究领域: 近年来集中研究了北极涛动(AO)的形态及其大气内部动力学机制。(1)提出了在垂直方向上平流层—对流层非耦合型AO的形成机制,即东北亚地区及北美东部地区存在垂直波导区,它的存在有利于其附近的环流异常在平流层—对流层频散Rossby波能量,进而导致平流层—对流层中环流异常反位相的特征;(2)在多年代际尺度上发现阿留申—冰岛低压振荡有利于AO形成水平纬向对称的结构。 25 | 26 | >版权归作者所有,特殊用途请联系施宁老师,我只是大自然的搬运工。🙂 27 | 28 | -------------------------------------------------------------------------------- /animation.ncl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavin971/NCL_meteorology_libs/ebc77b4c8207faf485ba84398b0d7ba8fb148131/animation.ncl -------------------------------------------------------------------------------- /animation.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavin971/NCL_meteorology_libs/ebc77b4c8207faf485ba84398b0d7ba8fb148131/animation.sh -------------------------------------------------------------------------------- /book_cover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavin971/NCL_meteorology_libs/ebc77b4c8207faf485ba84398b0d7ba8fb148131/book_cover.png -------------------------------------------------------------------------------- /call-f90.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavin971/NCL_meteorology_libs/ebc77b4c8207faf485ba84398b0d7ba8fb148131/call-f90.sh -------------------------------------------------------------------------------- /data-station.ncl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavin971/NCL_meteorology_libs/ebc77b4c8207faf485ba84398b0d7ba8fb148131/data-station.ncl -------------------------------------------------------------------------------- /ex_cnmap.ncl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavin971/NCL_meteorology_libs/ebc77b4c8207faf485ba84398b0d7ba8fb148131/ex_cnmap.ncl -------------------------------------------------------------------------------- /ex_color.ncl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavin971/NCL_meteorology_libs/ebc77b4c8207faf485ba84398b0d7ba8fb148131/ex_color.ncl -------------------------------------------------------------------------------- /ex_contour_tm.ncl: -------------------------------------------------------------------------------- 1 | begin 2 | z = generate_2d_array(15,15,-100.,110.,0,(/40,40/)) 3 | 4 | wks = gsn_open_wks("eps","contour_tm_ex") 5 | gsn_define_colormap(wks,"GrayWhiteGray") 6 | 7 | res = True 8 | res@gsnDraw = False 9 | res@gsnFrame = False 10 | 11 | res@cnFillOn = True 12 | 13 | res@cnLinesOn = True 14 | res@cnLineThicknessF = 0.5 15 | 16 | 17 | res@tmXTOn = False 18 | 19 | plot = gsn_csm_contour(wks,z,res) 20 | 21 | draw(plot) 22 | frame(wks) 23 | 24 | end -------------------------------------------------------------------------------- /ex_panel.ncl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavin971/NCL_meteorology_libs/ebc77b4c8207faf485ba84398b0d7ba8fb148131/ex_panel.ncl -------------------------------------------------------------------------------- /ex_poly.ncl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavin971/NCL_meteorology_libs/ebc77b4c8207faf485ba84398b0d7ba8fb148131/ex_poly.ncl -------------------------------------------------------------------------------- /ex_title.ncl: -------------------------------------------------------------------------------- 1 | begin 2 | npts = 500 3 | y = 500.+.9* ispan(0,npts-1,1)*sin(0.031415926535898*ispan(0,npts-1,1)) 4 | 5 | wks = gsn_open_wks("eps","title_ex") 6 | 7 | res = True 8 | 9 | plot = gsn_csm_y(wks,y,res) 10 | end -------------------------------------------------------------------------------- /ex_vector.ncl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavin971/NCL_meteorology_libs/ebc77b4c8207faf485ba84398b0d7ba8fb148131/ex_vector.ncl -------------------------------------------------------------------------------- /ex_xy.ncl: -------------------------------------------------------------------------------- 1 | begin 2 | y = sin(0.0628*ispan(0,100,1)) 3 | 4 | wks = gsn_open_wks("eps","xy_ex") 5 | 6 | res = True 7 | 8 | plot = gsn_csm_y(wks,y,res) 9 | end -------------------------------------------------------------------------------- /ex_xy_legend.ncl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavin971/NCL_meteorology_libs/ebc77b4c8207faf485ba84398b0d7ba8fb148131/ex_xy_legend.ncl -------------------------------------------------------------------------------- /function_index.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavin971/NCL_meteorology_libs/ebc77b4c8207faf485ba84398b0d7ba8fb148131/function_index.pdf -------------------------------------------------------------------------------- /plot-bar-2stat.ncl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavin971/NCL_meteorology_libs/ebc77b4c8207faf485ba84398b0d7ba8fb148131/plot-bar-2stat.ncl -------------------------------------------------------------------------------- /plot-bar-bj.ncl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavin971/NCL_meteorology_libs/ebc77b4c8207faf485ba84398b0d7ba8fb148131/plot-bar-bj.ncl -------------------------------------------------------------------------------- /plot-comp-enso.ncl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavin971/NCL_meteorology_libs/ebc77b4c8207faf485ba84398b0d7ba8fb148131/plot-comp-enso.ncl -------------------------------------------------------------------------------- /plot-corr-AO.ncl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavin971/NCL_meteorology_libs/ebc77b4c8207faf485ba84398b0d7ba8fb148131/plot-corr-AO.ncl -------------------------------------------------------------------------------- /plot-enso-wavelet.ncl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavin971/NCL_meteorology_libs/ebc77b4c8207faf485ba84398b0d7ba8fb148131/plot-enso-wavelet.ncl -------------------------------------------------------------------------------- /plot-hgt-Satellite.ncl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavin971/NCL_meteorology_libs/ebc77b4c8207faf485ba84398b0d7ba8fb148131/plot-hgt-Satellite.ncl -------------------------------------------------------------------------------- /plot-hgt-lambert.ncl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavin971/NCL_meteorology_libs/ebc77b4c8207faf485ba84398b0d7ba8fb148131/plot-hgt-lambert.ncl -------------------------------------------------------------------------------- /plot-precip-jiangsu.ncl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavin971/NCL_meteorology_libs/ebc77b4c8207faf485ba84398b0d7ba8fb148131/plot-precip-jiangsu.ncl -------------------------------------------------------------------------------- /plot-reg-AO.ncl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavin971/NCL_meteorology_libs/ebc77b4c8207faf485ba84398b0d7ba8fb148131/plot-reg-AO.ncl -------------------------------------------------------------------------------- /plot-scatter-AO.ncl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavin971/NCL_meteorology_libs/ebc77b4c8207faf485ba84398b0d7ba8fb148131/plot-scatter-AO.ncl -------------------------------------------------------------------------------- /plot-xy-4stat.ncl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavin971/NCL_meteorology_libs/ebc77b4c8207faf485ba84398b0d7ba8fb148131/plot-xy-4stat.ncl -------------------------------------------------------------------------------- /plot-xy-PC1.ncl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavin971/NCL_meteorology_libs/ebc77b4c8207faf485ba84398b0d7ba8fb148131/plot-xy-PC1.ncl -------------------------------------------------------------------------------- /precip.f90: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavin971/NCL_meteorology_libs/ebc77b4c8207faf485ba84398b0d7ba8fb148131/precip.f90 -------------------------------------------------------------------------------- /wrf_ex1.ncl: -------------------------------------------------------------------------------- 1 | begin 2 | type = "png" 3 | wks = gsn_open_wks(type,"wrf_ex1") 4 | filename = "./data/wrf_ex_namelist.wps" 5 | 6 | mpres = True 7 | mpres@mpDataBaseVersion = "Ncarg4_1" 8 | mpres@mpGeophysicalLineColor = "Black" 9 | mpres@mpGridLineColor = "Black" 10 | 11 | mpres@tiMainString = "Domain Configuration" 12 | 13 | lnres = True 14 | lnres@gsLineThicknessF = 1. 15 | lnres@domLineColors = (/ "white", "Red", "Red", "Blue" /) 16 | 17 | txres = True 18 | txres@txFont = "helvetica-bold" 19 | txres@txJust = "TopLeft" 20 | txres@txPerimOn = False 21 | txres@txFontHeightF = 0.015 22 | maxdom = 21 23 | nvar = 19 24 | parent_idn = new (maxdom,integer) 25 | parent_grid_ration = new (maxdom,integer) 26 | i_parent_startn = new (maxdom,integer) 27 | j_parent_startn = new (maxdom,integer) 28 | e_wen = new (maxdom,integer) 29 | e_snn = new (maxdom,integer) 30 | plotvar = new((/maxdom,nvar/),float) 31 | plotvar@_FillValue = -999.0 32 | plotvar = wrf_wps_read_nml(filename) 33 | mpres@max_dom = floattointeger(plotvar(0,0)) 34 | mpres@dx = plotvar(0,1) 35 | mpres@dy = plotvar(0,2) 36 | if (.not.ismissing(plotvar(0,3))) then 37 | mpres@ref_lat = plotvar(0,3) 38 | else 39 | mpres@ref_lat = 0.0 40 | end if 41 | if (.not.ismissing(plotvar(0,4))) then 42 | mpres@ref_lon = plotvar(0,4) 43 | else 44 | mpres@ref_lon = 0.0 45 | end if 46 | if (.not.ismissing(plotvar(0,5))) then 47 | mpres@ref_x = plotvar(0,5) 48 | end if 49 | if (.not.ismissing(plotvar(0,6))) then 50 | mpres@ref_y = plotvar(0,6) 51 | end if 52 | mpres@truelat1 = plotvar(0,7) 53 | mpres@truelat2 = plotvar(0,8) 54 | mpres@stand_lon = plotvar(0,9) 55 | mproj_int = plotvar(0,10) 56 | mpres@pole_lat = plotvar(0,11) 57 | mpres@pole_lon = plotvar(0,12) 58 | 59 | do i = 0,maxdom-1 60 | parent_idn(i) = floattointeger(plotvar(i,13)) 61 | parent_grid_ration(i) = floattointeger(plotvar(i,14)) 62 | i_parent_startn(i) = floattointeger(plotvar(i,15)) 63 | j_parent_startn(i) = floattointeger(plotvar(i,16)) 64 | e_wen(i) = floattointeger(plotvar(i,17)) 65 | e_snn(i) = floattointeger(plotvar(i,18)) 66 | end do 67 | 68 | 69 | if(mpres@max_dom .gt. 1) then 70 | do i = 1,mpres@max_dom-1 71 | if(i_parent_startn(i) .lt. 5) then 72 | print("Warning: Western edge of grid must be at least 5 grid points from mother domain!") 73 | end if 74 | if(j_parent_startn(i) .lt. 5) then 75 | print("Warning: Southern edge of grid must be at least 5 grid points from mother domain!") 76 | end if 77 | pointwe = (e_wen(i)-1.)/parent_grid_ration(i) 78 | pointsn = (e_snn(i)-1.)/parent_grid_ration(i) 79 | gridwe = e_wen(parent_idn(i)-1)-(pointwe+i_parent_startn(i)) 80 | gridsn = e_snn(parent_idn(i)-1)-(pointsn+j_parent_startn(i)) 81 | if(gridwe .lt. 5) then 82 | print("Warning: Eastern edge of grid must be at least 5 grid points from mother domain!") 83 | end if 84 | if(gridsn .lt. 5) then 85 | print("Warning: Northern edge of grid must be at least 5 grid points from mother domain!") 86 | end if 87 | 88 | gridsizewe = (((e_wen(parent_idn(i)-1)-4)-i_parent_startn(i))*parent_grid_ration(i))-(parent_grid_ration(i)-1) 89 | gridsizesn = (((e_snn(parent_idn(i)-1)-4)-j_parent_startn(i))*parent_grid_ration(i))-(parent_grid_ration(i)-1) 90 | if(gridwe .lt. 5) then 91 | print("Warning: Inner nest (domain = " + (i+1) + ") is not fully contained in mother nest (domain = " + parent_idn(i) + ")!") 92 | print("For the current setup of mother domain = " + parent_idn(i) + ", you can only have a nest of size " + gridsizewe + "X" + gridsizesn + ". Stopping Program!") 93 | exit 94 | end if 95 | if(gridsn .lt. 5) then 96 | print("Warning: Inner nest (domain = " + (i+1) + ") is not fully contained in mother nest (domain = " + parent_idn(i) + ")!") 97 | print("For the current setup of mother domain = " + parent_idn(i) + ", you can only have a nest of size " + gridsizewe + "X" + gridsizesn + ". Stopping Program!") 98 | exit 99 | end if 100 | pointwetrunc = decimalPlaces(pointwe,0,False) 101 | pointsntrunc = decimalPlaces(pointsn,0,False) 102 | if((pointwe-pointwetrunc) .ne. 0.) then 103 | nest_we_up = (ceil(pointwe)*parent_grid_ration(i))+1 104 | nest_we_dn = (floor(pointwe)*parent_grid_ration(i))+1 105 | print("Nest does not end on mother grid domain point. Try " + nest_we_dn + " or " + nest_we_up + ".") 106 | end if 107 | if((pointsn-pointsntrunc) .ne. 0.) then 108 | nest_sn_up = (ceil(pointsn)*parent_grid_ration(i))+1 109 | nest_sn_dn = (floor(pointsn)*parent_grid_ration(i))+1 110 | print("Nest does not end on mother grid domain point. Try " + nest_sn_dn + " or " + nest_sn_up + ".") 111 | end if 112 | end do 113 | end if 114 | mpres@parent_id = parent_idn(0:mpres@max_dom-1) 115 | mpres@parent_grid_ratio = parent_grid_ration(0:mpres@max_dom-1) 116 | mpres@i_parent_start = i_parent_startn(0:mpres@max_dom-1) 117 | mpres@j_parent_start = j_parent_startn(0:mpres@max_dom-1) 118 | mpres@e_we = e_wen(0:mpres@max_dom-1) 119 | mpres@e_sn = e_snn(0:mpres@max_dom-1) 120 | if(mproj_int .eq. 1) then 121 | mpres@map_proj = "lambert" 122 | mpres@pole_lat = 0.0 123 | mpres@pole_lon = 0.0 124 | else if(mproj_int .eq. 2) then 125 | mpres@map_proj = "mercator" 126 | mpres@pole_lat = 0.0 127 | mpres@pole_lon = 0.0 128 | else if(mproj_int .eq. 3) then 129 | mpres@map_proj = "polar" 130 | mpres@pole_lat = 0.0 131 | mpres@pole_lon = 0.0 132 | else if(mproj_int .eq. 4) then 133 | mpres@map_proj = "lat-lon" 134 | end if 135 | end if 136 | end if 137 | end if 138 | if (mpres@dx.lt.1e-10 .and. mpres@dx.lt.1e-10) then 139 | mpres@dx = 360./(mpres@e_we(0) - 1) 140 | mpres@dy = 180./(mpres@e_sn(0) - 1) 141 | mpres@ref_lat = 0.0 142 | mpres@ref_lon = 180.0 143 | end if 144 | 145 | 146 | end 147 | -------------------------------------------------------------------------------- /wrf_ex2.ncl: -------------------------------------------------------------------------------- 1 | begin 2 | a = addfile("./data/geo_em.d01.nc","r") 3 | type = "png" 4 | wks = gsn_open_wks(type,"wrf_ex2") 5 | gsn_define_colormap(wks,"MPL_gist_yarg") 6 | 7 | opts = True 8 | opts@MainTitle = "" 9 | opts@InitTime = False 10 | opts@Footer = False 11 | opts@tiMainOn = False 12 | opts@lbTitleOn = False 13 | opts@FieldTitle ="" 14 | 15 | res = opts 16 | res@cnFillOn = True 17 | res@gsnSpreadColors = True 18 | 19 | contour = wrf_contour(a,wks,hgt,res) 20 | 21 | pltres = True 22 | pltres@NoTitles = True 23 | mpres = True 24 | mpres@mpGeophysicalLineColor = "Black" 25 | mpres@mpGridLineColor = "Black" 26 | 27 | end 28 | -------------------------------------------------------------------------------- /wrf_ex3.ncl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavin971/NCL_meteorology_libs/ebc77b4c8207faf485ba84398b0d7ba8fb148131/wrf_ex3.ncl -------------------------------------------------------------------------------- /wrf_ex4.ncl: -------------------------------------------------------------------------------- 1 | begin 2 | f = addfile("./data/wrfout_ex1_2014-12-31.nc","r") 3 | uvm10 = wrf_user_getvar(f,"uvmet10",-1) 4 | u10 = uvm10(0,:,:,:) 5 | v10 = uvm10(1,:,:,:) 6 | 7 | mx = loc(0) - 1 8 | ny = loc(1) - 1 9 | lat1 = f->XLAT(0,ny,mx) 10 | lon1 = f->XLONG(0,ny,mx) 11 | res = True 12 | ;res@tiMainString = "WRF: All Times: grid point ["+sprintf("%5.2f",lat1)+" , "+sprintf("%5.2f",lon1) +"]" 13 | 14 | wspd1= ndtooned(sqrt(u10(:,ny,mx)^2 + v10(:,ny,mx)^2)) 15 | wdir1= ndtooned(atan2(u10(:,ny,mx),v10(:,ny,mx))/0.01745329 +180.) 16 | numPetals = 16 17 | circFr = 8. 18 | spdBounds = (/ 1., 3.,5.,10./) 19 | colorBounds = (/ "blue", "green", "yellow", "red" /) 20 | wks = gsn_open_wks("png","wrf_ex4") 21 | end 22 | -------------------------------------------------------------------------------- /wrf_ex5.ncl: -------------------------------------------------------------------------------- 1 | begin 2 | a = addfile("./data/wrfout_ex1_2014-12-31.nc","r") 3 | type = "ps" 4 | wks = gsn_open_wks(type,"wrf_ex5") 5 | res = True 6 | res@NoHeaderFooter = True 7 | res@pmLabelBarOrthogonalPosF = -0.1 8 | res@lbTitleOn = False 9 | pltres = True 10 | pltres@PanelPlot = True 11 | mpres = True 12 | mpres3 = True 13 | times = wrf_user_getvar(a,"times",-1) 14 | ntimes = dimsizes(times) 15 | plots = new ( 4, graphic ) 16 | it = 1 17 | print("Working on time: " + times(it) ) 18 | res@TimeLabel = times(it) 19 | slp = wrf_user_getvar(a,"slp",it) 20 | wrf_smooth_2d( slp, 3 ) 21 | if ( it .eq. 0 ) then 22 | tc = wrf_user_getvar(a,"tc",it) 23 | td = wrf_user_getvar(a,"td",it) 24 | u = wrf_user_getvar(a,"ua",it) 25 | v = wrf_user_getvar(a,"va",it) 26 | tc2 = tc(0,:,:) 27 | td2 = td(0,:,:) 28 | u10 = u(0,:,:) 29 | v10 = v(0,:,:) 30 | else 31 | tc2 = wrf_user_getvar(a,"T2",it) 32 | tc2 = tc2-273.16 33 | td2 = wrf_user_getvar(a,"td2",it) 34 | u10 = wrf_user_getvar(a,"U10",it) 35 | v10 = wrf_user_getvar(a,"V10",it) 36 | end if 37 | tf2 = 1.8*tc2+32. 38 | ;tf2@description = "Surface Temperature" 39 | ;tf2@units = "F" 40 | td_f = 1.8*td2+32. 41 | ;td_f@description = "Surface Dew Point Temp" 42 | ;td_f@units = "F" 43 | u10 = u10*1.94386 44 | v10 = v10*1.94386 45 | ;u10@units = "kts" 46 | ;v10@units = "kts" 47 | opts = res 48 | opts@cnFillOn = True 49 | 50 | opts@ContourParameters = (/ -20., 90., 5./) 51 | opts@gsnSpreadColorEnd = -3 52 | contour_tc = wrf_contour(a,wks,tf2,opts) 53 | contour_tc2 = wrf_contour(a,wks,tf2,opts) 54 | delete(opts) 55 | opts = res 56 | opts@cnFillOn = True 57 | opts@cnLinesOn = True 58 | opts@cnLineLabelsOn = True 59 | opts@ContourParameters = (/ -30., 120., 15./) 60 | opts@cnLineLabelBackgroundColor = 0 61 | opts@gsnSpreadColorEnd = -3 62 | contour_td = wrf_contour(a,wks,td_f,opts) 63 | delete(opts) 64 | opts = res 65 | opts@cnFillOn = True 66 | contour_psl2 = wrf_contour(a,wks,slp,opts) 67 | opts@ContourParameters = (/ 986, 1042., 8. /) 68 | opts@cnFillOn = False 69 | opts@cnInfoLabelOrthogonalPosF = -0.115 70 | opts@cnLineColor = "NavyBlue" 71 | opts@cnHighLabelsOn = True 72 | opts@cnLowLabelsOn = True 73 | opts@cnLineLabelBackgroundColor = 0 74 | opts@gsnContourLineThicknessesScale = 2.0 75 | contour_psl = wrf_contour(a,wks,slp,opts) 76 | delete(opts) 77 | 78 | pltres@NoTitles = True 79 | 80 | opts = res 81 | ;opts@FieldTitle = "Wind" 82 | opts@NumVectors = 20 83 | vector = wrf_vector(a,wks,u10,v10,opts) 84 | delete(opts) 85 | 86 | pnlres = True 87 | ;pnlres@txString = "PLOTS for : " + times(it) 88 | pnlres@gsnPanelYWhiteSpacePercent = 1 89 | pnlres@gsnPanelScalePlotIndex = 1 90 | pnlres@gsnPanelFigureStrings= (/"a)","b)","c)","d)"/) 91 | pnlres@amJust = "topLeft 92 | 93 | 94 | end 95 | -------------------------------------------------------------------------------- /wrf_ex6.ncl: -------------------------------------------------------------------------------- 1 | begin 2 | a = addfile("./data/wrfout_ex1_2014-12-31.nc","r") 3 | Rain=(a->RAINC(5,:,:)+a->RAINNC(5,:,:))/1000. 4 | HGT= wrf_user_getvar(a,"HGT",0) 5 | wks = gsn_open_wks("eps" ,"wrf_ex6") 6 | res = True ; plot mods desired 7 | res@gsnFrame = False 8 | res@gsnDraw = False 9 | res@cnFillOn = True ; color plot desired 10 | res@cnFillPalette = "gsltod" ; Select grayscale colormap 11 | res@cnLinesOn = False ; turn off contour lines 12 | res@cnLineLabelsOn = False ; turn off contour labels 13 | res@cnFillMode = "RasterFill" 14 | res@cnFillOpacityF = 1. 15 | res@lbLabelBarOn = False 16 | res@pmLabelBarHeightF = 0.08 17 | res@lbLabelFontHeightF = 0.014 18 | res@gsnRightString = "" 19 | res@gsnLeftString = "" 20 | res@mpGeophysicalLineThicknessF = 0.5 ; thickness of map outlines 21 | res@mpGeophysicalLineColor = "black" 22 | 23 | res@tfDoNDCOverlay = True ; necessary for correct overlay on map 24 | 25 | res@pmTickMarkDisplayMode = "Always" ; turn on nicer tickmarks 26 | res@tmXBLabelFontHeightF = 0.018 27 | res@tmYLLabelFontHeightF = 0.018 28 | res@tmYLLabelStride = 2 ; label every other tickmark 29 | res@tmXBLabelStride = 2 30 | res@tmYRMajorOutwardLengthF = 0 31 | res@tmYLMajorOutwardLengthF = 0 32 | res@tmXBMajorOutwardLengthF = 0 33 | res@tmXBMinorOutwardLengthF = 0 34 | res@tmXTOn = True 35 | res@tmYROn = True 36 | res@tmYRLabelsOn = False 37 | res@tmXTLabelsOn = False 38 | 39 | res_rain = True 40 | res_rain@gsnFrame = False 41 | res_rain@gsnDraw = False 42 | 43 | cmap := read_colormap_file("rainbow") 44 | cmap(0,:) = (/0,0,0,0/) ; make first color fully transparent 45 | res_rain@cnFillOn = True 46 | res_rain@cnFillMode = "RasterFill" 47 | res_rain@cnFillPalette = cmap 48 | res_rain@cnLinesOn = False ; turn off contour lines 49 | res_rain@cnLineLabelsOn = False ; turn off contour labels 50 | res_rain@cnFillOpacityF = 1. ; .85 51 | res_rain@tfDoNDCOverlay = True ; necessary for correct overlay on map 52 | res_rain@cnLevelSelectionMode = "ManualLevels" 53 | res_rain@cnMaxLevelValF = 200. 54 | res_rain@cnMinLevelValF = 40. 55 | res_rain@cnLevelSpacingF = 15. 56 | res_rain@pmLabelBarHeightF = 0.08 ; Make labelbar less thick 57 | res_rain@lbLabelFontHeightF = 0.014 58 | res_rain@pmLabelBarOrthogonalPosF = -0.008 59 | res_rain@cnInfoLabelOn = False 60 | 61 | res_rain@tiMainFont = "Helvetica-bold" 62 | res_rain@tiMainFontHeightF = 0.018 63 | ;res_rain@gsnRightString = "RAIN, mm" 64 | res_rain@gsnLeftString = "" 65 | ;res_rain@tiMainString = "Total Rainfall" 66 | 67 | draw(plotrain) 68 | frame(wks) 69 | end 70 | --------------------------------------------------------------------------------