NCL學習筆記
2016-03-30 12:35
375 查看
fo=addfile("test1.nc","c") 創建文件 | Variable: fo Type: file filename: test1 path: test1.nc file global attributes: dimensions: variables: |
filedimdef(fo,(/"lon","lat"/),(/360,180/),(/False,False/)) 定義維 | Variable: fo Type: file filename: test1 path: test1.nc file global attributes: dimensions: lon = 360 lat = 180 variables: |
lat1=fspan(-90,90,181) lat1@name="lat:-90to90" filevardef(fo,"lat1",typeof(lat1),"lat") 創建變量 | Variable: fo Type: file filename: test1 path: test1.nc file global attributes: dimensions: lon = 360 lat = 180 variables: float lat1 ( lat ) |
filevarattdef(fo,"lat1",lat1) 賦屬性 | Variable: fo Type: file filename: test1 path: test1.nc file global attributes: dimensions: lon = 360 lat = 180 variables: float lat1 ( lat ) name : lat:-90to90 |
因為dimensions: lat = 180所以不能fo->lat1=(/lat1/) lon=fspan(0,359,360) lon@name="lon:0to360" filevardef(fo,"lon",typeof(lon),"lon") 創建變量 | Variable: fo Type: file filename: test1 path: test1.nc file global attributes: dimensions: lon = 360 lat = 180 ncl2 = 181 variables: float lat1 ( lat ) name : lat:-90to90 float lat ( ncl2 ) float lon ( lon ) |
filevarattdef(fo,"lon",lon) 賦屬性 | Variable: fo Type: file filename: test1 path: test1.nc file global attributes: dimensions: lon = 360 lat = 180 ncl2 = 181 variables: float lat1 ( lat ) name : lat:-90to90 float lat ( ncl2 ) float lon ( lon ) name : lon:0to360 |
fo->lon=(/lon/) 賦值 | Variable: fo Type: file filename: test1 path: test1.nc file global attributes: dimensions: lon = 360 lat = 180 ncl2 = 181 variables: float lat1 ( lat ) name : lat:-90to90 float lat ( ncl2 ) float lon ( lon ) name : lon:0to360 |
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
;;--open file--;;
a=addfile("wrfout_d02_2015-10-21_06_00_00","r")
;;--output file--;;
wks=gsn_open_wks("pdf","test0405f")
;;--color map--;;
gsn_define_colormap(wks,"WhViBlGrYeOrReWh")
res = True
res@MainTitle = "REAL-TIME WRF"
pltres = True
;;--geo map--;;
mpres = True
mpres@mpGeophysicalLineColor = "Black"
mpres@mpGridLineColor = "Black"
mpres@mpLimbLineColor = "Black"
mpres@mpNationalLineColor = "Black"
mpres@mpPerimLineColor = "Black"
mpres@mpUSStateLineColor = "Black"
mpres@mpDataSetName="Earth..4"
mpres@mpOutlineSpecifiers=(/"China:states","Taiwan"/)
;;--time, because there are many time in the file--;;
times = wrf_user_getvar(a,"times",-1)
ntimes = dimsizes(times)
it=1
print("Working on time: " + times(it) )
res@TimeLabel = times(it)
;;--get var: mdbz--;;
mdbz = wrf_user_getvar(a,(/"mdbz","1","1"/),it)
opts = res
opts@cnFillOn = True
opts@cnLevelSelectionMode="ExplicitLevels"
opts@cnLevels=(/10,15,20,25,30,35,40,45,50,55,60,65,70/)
opts@cnFillColors=(/(/255,255,255/),(/1,160,246/),(/0,236,236/),(/0,216,0/),(/1,144,0/),(/255,255,0/),(/231,192,0/),(/255,144,0/),(/255,0,0/),(/214,0,0/),(/192,0,0/),(/255,0,240/),(/150,0,180/),(/173,144,240/)/) /255.0
;;--draw contour--;;
contour = wrf_contour(a,wks,mdbz,opts)
;;--show the plots--;;
plot = wrf_map_overlays(a,wks,(/contour/),pltres,mpres)
;;--some wonderful things--;;
;print(getfiledimsizes(a)+getvardims(a))
;print(getfilevarnames(a))
相关文章推荐
- spring-security 4.x简单实现(持续更新)
- Android比DES加密更安全的算法——3DES加密算法
- 人艰不拆~找实习之路(二)。
- Appserv 2.5.10 升级PHP from version 5.2 to 5.3
- 查找某人在某微博裏留下的所有留言
- 版本控制器git学习
- js插件实现步骤
- DES 加密算法
- Go语言学习五:数组与传递到函数的数组
- Unity5.x的GUIText被UI Text所取代--增加头文件UnityEngine.UI
- 身体各个部位的日语单词
- Unity3d游戏中自定义贝塞尔曲线编辑器[转]
- POJ 2484 A Funny Game【博弈】
- POJ 2484 A Funny Game【博弈】
- Linux的SOCKET编程详解
- tomcat 部署web步骤
- 蓝桥杯省赛结果
- ExtJS 常用组件属性 及使用方法
- Linux 重点补充
- 解决Mysql报错:PHP Warning: mysql_connect(): mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication.