- 积分
 - 328
 
	- 贡献
 -  
 
	- 精华
 
	- 在线时间
 -  小时
 
	- 注册时间
 - 2019-4-7
 
	- 最后登录
 - 1970-1-1
 
 
 
 
 
 
 | 
	
 
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册 
 
 
 
x
 
在学习ncl画水汽通量散度图中,遇到画出图来正负波动过密,水汽通量散度计算错误的情况。于是我直接读取u,v数据先计算风散度,数据读取正确,使用的也是正确的uv2dv_cfd函数,但是画出的图还是错误的,请问有人遇到过这样的问题吗,这个问题已经卡了一周了,也不知道该怎么解决希望大家帮忙指点迷津=_= 
 
 
 
 
 
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" 
 
begin 
;---Open file and read in data 
f  =addfile("/public/FNL/0.25deg/2018winter/201901/gdas1.fnl0p25.2019012512.f00.grib2", "r") 
 
   U      = f->UGRD_P0_L100_GLL0 
   V      = f->VGRD_P0_L100_GLL0 
   lat    = f->lat_0 
   lon    = f->lon_0 
 
   U_850hPa  = U(25,:,:) 
   V_850hPa  = V(25,:,:) 
 
   vapord          = uv2dv_cfd(U_850hPa,V_850hPa,lat,lon,2)  
   vapord = vapord*100000              ; u,v ==> divergence 
   copy_VarCoords(U_850hPa,vapord) 
 
   wks_type       =  "png"                        ; the file type 
   name           =  "850hPaWind2019012520"                      ; the file name 
 
   wks            =  gsn_open_wks(wks_type, name) 
;----------------------------------------------------- 
  res                 = True 
  res@gsnDraw         = False 
  res@gsnFrame        = False 
  res@gsnMaximize     = False 
 
  ;res@tmXTOn = False 
  ;res@tmXBOn = False 
  ;res@tmYLOn = False 
  ;res@tmYROn = False 
 
  res@gsnLeftString     = "" 
  res@gsnRightString    = "" 
  res@tiMainString      = "2019012520  850hPa Wind divergence";Vapor flux  
  res@tiMainFontHeightF = 0.02 
 
  ;res@mpMaxLonF       = 145. 
  ;res@mpMinLonF       = 75. 
  ;res@mpMaxLatF       = 56. 
  ;res@mpMinLatF       = 15. 
 
  res@mpDataBaseVersion                 =  "MediumRes" 
  res@mpDataSetName                     =  "Earth..4" 
  ;res@pmTickMarkDisplayMode             = "Always" 
  res@mpFillOn                          = False           ; turn off map fill 
  res@mpOutlineBoundarySets             = "National"  ;"National"       ; "Geophysical" 
  res@mpOutlineMaskingOn                = True 
  res@mpOutlineSpecifiers               = (/"China","China:Zhejiang"/) 
  res@mpMaskAreaSpecifiers              = (/"China"/) 
  res@mpAreaMaskingOn                   = True 
  res@mpNationalLineThicknessF          = 3 
  res@mpGeophysicalLineThicknessF       = 2.8 
;------------------------------------------------------------- 
  res@cnFillOn                          =  True 
  res@cnLinesOn                         =  False            ; turn off the contour lines 
  res@cnFillPalette                     = "BlWhRe"    ; MPL_RdYlBuset color map ;WhiteBlueGreenYellowRed 
  res@cnLevelSelectionMode              = "ExplicitLevels" 
  ;res@cnMinLevelValF   = -3 ; set min contour level 
  ;res@cnMaxLevelValF   =  3. ; set max contour level    
  res@cnLevels                          = (/-4.0,-3.5,-3.0,-2.5,-2.0,-1.5,-1.0,-0.5,0,0.5,1.0,1.5,2.0,2.5,3.0,3.5,4.0/)  ;res@cnLineDashPattern                 = 0 
  ;res@cnLevelSpacingF                   = 3.0 
  ;res@cnLineThicknessF                  = 1 
 
 
  ;res@cnRasterSmoothingOn               =  True 
  ;res@cnSmoothingDistanceF              =  0.015 
  ;res@cnSmoothingTensionF               =  2.0 
 
  ;res@gsnSpreadColors                   =  True 
  ;res@gsnSpreadColorStart               =  5 
  ;res@gsnSpreadColorEnd                 =  17 
 
  res@lbLabelBarOn                      = True 
  res@pmLabelBarWidthF                  = 0.4 
  res@pmLabelBarHeightF                 = 0.05 
  res@pmLabelBarOrthogonalPosF          = 0.1 
  res@lbLabelFontHeightF                = 0.010 
  res@lbLabelAngleF                     = 45 
 
  ;res@tfDoNDCOverlay                    = True 
  ;res@gsnContourNegLineDashPattern      =  1 
 
  res@tmXBOn                            =  True 
  res@tmXBMode                          =  "Explicit"         ; "Manual""Automatic" 
  res@tmXBTickStartF                    =  75 
  res@tmXBTickEndF                      =  145 
  res@tmXBTickSpacingF                  =  10 
  res@tmXBValues                        =  (/75,85,95,105,115,125,135,145/) 
  res@tmXBLabels                        =  (/"75~S~o~N~E","85~S~o~N~E","95~S~o~N~E","105~S~o~N~E",\ 
                                            "115~S~o~N~E","125~S~o~N~E","135~S~o~N~E","145~S~o~N~E"/) 
  res@tmXBLabelsOn                      =  True               ; draw X-axis labels 
  res@tmXBLabelFontHeightF              =  0.012              ; adjust X-Lable font heights 
  res@tmXBLabelAngleF                   =  0.0 
  res@tmXBMinorPerMajor                 =  0                  ; set minor tickmark per major tickmark 
  res@tmXBMajorLengthF                  =  0.008 
  res@tmXBMajorThicknessF               =  1.5 
  res@tmXBMajorOutwardLengthF           =  0.005 
  res@tmXBMinorOn                       =  False               ; turn on the minor ticks 
  res@tmXBMinorLengthF                  =  0.005 
  res@tmXBMinorOutwardLengthF           =  0.005 
 
 
  res@tmXTOn                            =  False 
  res@tmYROn                            =  False 
  res@tmYLOn                            =  True 
  res@tmYLMode                          =  "Explicit"         ; "Manual""Automatic" 
  res@tmYLTickStartF                    =  15 
  res@tmYLTickEndF                      =  56 
  res@tmYLTickSpacingF                  =  10 
  res@tmYLValues                        =  (/15,25,35,45,56/) 
  res@tmYLLabels                        =  (/"15~S~o~N~N","25~S~o~N~N",\ 
                                            "35~S~o~N~N","45~S~o~N~N","56~S~o~N~N"/);"5~S~o~N~N", 
  res@tmYLLabelsOn                      =  True 
  res@tmYLLabelFontHeightF              =  0.012 
  res@tmYLLabelAngleF                   =  0.0 
  res@tmYLMinorPerMajor                 =  4 
  res@tmYLMajorLengthF                  =  0.008 
  res@tmYLMajorThicknessF               =  1.5 
  res@tmYLMajorOutwardLengthF           =  0.005 
  res@tmYLMinorOn                       =  False                ; turn on the minor ticks 
  res@tmYLMinorLengthF                  =  0.005 
  res@tmYLMinorOutwardLengthF           =  0.005 
 
     plot    = gsn_csm_contour_map(wks,vapord, res) 
 
 
     draw(plot) 
 
 
     frame(wks) 
 
 end 
 
 
 
 
 
 
 
 
 |   
- 
 
 
 
- 
 
 
 
 
 
 
 
 |