- 积分
- 1365
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2017-3-1
- 最后登录
- 1970-1-1
|
发表于 2017-11-7 02:09:40
|
显示全部楼层
- ; These files are loaded by default in NCL V6.2.0 and newer
- 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/cnmap/cnmap.ncl"
- ;**************************************************************
- begin
- ;***************************************************************
- ; User Input
- ;***************************************************************
- ; diri = "" ; input directory
- ; fili = ""
- shpname = "$NCARG_ROOT/lib/ncarg/nclscripts/cnmap/cnmap.shp"
- cnres = True
- cnres[url=home.php?mod=space&uid=46658]@china[/url] = True ;draw china map or not
- cnres[url=home.php?mod=space&uid=15693]@river[/url] = True ;draw changjiang&huanghe or not
- cnres@province = True ;draw province boundary or not
- cnres@nanhai = True ;draw nanhai or not
- cnres@diqu = False ; draw diqujie or no
- ; End User Input
- ;***************************************************************
- ; Read
- ;***************************************************************
- f = addfile ("/run/media/hua/lsh/HM/results/CCTM_hm12_Linux2_x86_64.JJJ27_12.CGRID.2012183.ncf", "r")
- ; x = f->NH3(0, 0, :, :)
- a1 = f->AECI(:,0,:,:)
- a3 = f->AECJ(:,0,:,:)
- a4 = f->ASO4I(:,0,:,:)
- a5 = f->ASO4J(:,0,:,:)
- a6 = f->ANO3I(:,0,:,:)
- a7 = f->ANO3J(:,0,:,:)
- a8 = f->AORGPAI(:,0,:,:)
- a9 = f->AORGPAJ(:,0,:,:)
- a10 = f->A25J(:,0,:,:)
- a11 = f->AH2OJ(:,0,:,:)
- a12 = f->ANAJ(:,0,:,:)
- a13 = f->ACLJ(:,0,:,:)
- a14 = f->ANH4I(:,0,:,:)
- a15 = f->ANH4J(:,0,:,:)
- x1 = a1 + a3 + a4 +a5 +a6 +a7 + a8 + a9 + a10 + a11 + a12 + a13 + a14 + a15
- x = dim_avg_n(x1,0)
- ; x@_FillValue = -1
- ; x@missing_value = -1
- dimx = dimsizes(x)
- ;*****************************************************
- ; Create netCDF coordinate variables. The lat are N->S
- ;*****************************************************
- XCENT = f@XCENT
- XORIG = f@XORIG
- C1 = XCENT + XORIG/108000 ; limit bnd
- C2 = XCENT - XORIG/108000
- YCENT = f@YCENT
- YORIG = f@YORIG
- R1 = YCENT + YORIG/108000
- R2 = YCENT - YORIG/108000
- nlat = dimx(0)
- mlon = dimx(1)
- lat = fspan(R1, R2, nlat)
- lon = fspan(C1, C2, mlon)
- lat@long_name = "latitude"
- lat@units = "degrees_north"
- lat!0 = "lat"
- lat&lat = lat
- lon@long_name = "longitude"
- lon@units = "degrees_east"
- lon!0 = "lon"
- lon&lon = lon
- printMinMax(lat, True)
- printMinMax(lon, True)
- ;***************************************************************
- ; Associate the spatial coordinates with variables
- ;***************************************************************
- x!0 = "lat" ; 1st ... name the dimensions
- x!1 = "lon"
- x&lat = lat ; create coordinate variable
- x&lon = lon
- ;-- define the workstation (plot type and name)
- wks = gsn_open_wks("png","1PM2.5" )
- ;-- set resources
- res = True
- res@tiMainString = "1PM2.5"
- ; res@vpHeightF =
- ; res@mpDataBaseVersion = "MediumRes"
- res@mpProjection = "CylindricalEquidistant"
- res@gsnAddCyclic = False
- res@mpLimitMode = "LatLon"
- res@mpMinLatF = 0
- res@mpMaxLatF = 60
- res@mpMinLonF = 70
- res@mpMaxLonF = 140
- ;res@mpCenterLonF = f@P_GAM
- res@mpOutlineOn = False
- res@gsnDraw = False
- res@gsnFrame = False
- res@gsnMaximize = True
- res@cnFillOn = True
- res@cnFillPalette = "BlAqGrYeOrRe"
- res@cnLinesOn = False
- res@cnLineLabelsOn= False
- ; res@cnFillMode = "CellFill" ; Cell Mode
- res@cnFillMode = "RasterFill" ; Raster Mode
- ; res@cnFillMode = "AreaFill"
- res@cnSmoothingOn = True
- res@cnLevelSelectionMode = "ManualLevels" ; set manual contour levels
- res@cnMinLevelValF = 0 ; set min contour level
- res@cnMaxLevelValF = 200 ; set max contour level
- res@cnLevelSpacingF = 20 ; set contour spacing
- ;-- draw the contour map
- plot = gsn_csm_contour_map(wks, x, res)
- ;-- set resources for the polylines
- plres = True
- plres@gsLineColor = "black"
- plres@gsLineThicknessF = 2.5
- poly = gsn_add_shapefile_polylines(wks,plot,shpname,plres)
- ;-- draw the plot
- draw(plot)
- frame(wks)
- end
复制代码
博主,我没理解您的教程,我想直接用shapename调用您叠加好的中国底图该怎么操作啊,您看我脚本那一行shapename该怎么填啊 |
|